@xiaozhu2007/koishi-plugin-litematic-renderer 0.5.5 → 0.7.19
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.
- package/README.md +61 -12
- package/assets/standalone-renderer/{litematic-standalone-renderer-0.2.7-patch.1.jar → litematic-standalone-renderer-0.2.8-patch.1.jar} +0 -0
- package/assets/threeviews/assets/deepslate.min.js +12 -15
- package/dist/index.css +1 -0
- package/dist/index.js +13 -0
- package/lib/cache.d.ts +94 -0
- package/lib/cache.js +1 -0
- package/lib/concurrency.d.ts +13 -0
- package/lib/concurrency.js +1 -0
- package/lib/config.d.ts +205 -0
- package/lib/config.js +1 -0
- package/lib/diagnostics.d.ts +86 -0
- package/lib/diagnostics.js +1 -0
- package/lib/gpuAgentProtocol.d.ts +196 -0
- package/lib/gpuAgentProtocol.js +1 -0
- package/lib/index.d.ts +79 -362
- package/lib/index.js +1 -1
- package/lib/jsonFile.d.ts +8 -0
- package/lib/jsonFile.js +1 -0
- package/lib/litematic.d.ts +103 -0
- package/lib/litematic.js +1 -0
- package/lib/messageDelivery.d.ts +82 -0
- package/lib/messageDelivery.js +1 -0
- package/lib/messageFiles.d.ts +93 -0
- package/lib/messageFiles.js +1 -0
- package/lib/officialProxy.d.ts +12 -0
- package/lib/officialProxy.js +1 -0
- package/lib/onebotCompat.d.ts +29 -0
- package/lib/onebotCompat.js +1 -0
- package/lib/projectionCache.d.ts +83 -0
- package/lib/projectionCache.js +1 -0
- package/lib/projectionSearch.d.ts +3 -0
- package/lib/projectionSearch.js +1 -0
- package/lib/rateLimit.d.ts +18 -0
- package/lib/rateLimit.js +1 -0
- package/lib/render/cpu.d.ts +23 -0
- package/lib/render/cpu.js +1 -0
- package/lib/render/externalGpu.d.ts +12 -0
- package/lib/render/externalGpu.js +1 -0
- package/lib/render/gpuAgent.d.ts +7 -0
- package/lib/render/gpuAgent.js +1 -0
- package/lib/render/imageValidation.d.ts +18 -0
- package/lib/render/imageValidation.js +1 -0
- package/lib/render/javaBridge.d.ts +11 -0
- package/lib/render/javaBridge.js +1 -0
- package/lib/render/standalone.d.ts +76 -0
- package/lib/render/standalone.js +1 -0
- package/lib/render/types.d.ts +5 -0
- package/lib/render/types.js +1 -0
- package/lib/render/webgl.d.ts +21 -0
- package/lib/render/webgl.js +1 -0
- package/lib/resourcePacks.d.ts +15 -0
- package/lib/resourcePacks.js +1 -0
- package/lib/runtimePaths.d.ts +8 -0
- package/lib/runtimePaths.js +1 -0
- package/lib/schematicFormats.d.ts +8 -0
- package/lib/schematicFormats.js +1 -0
- package/package.json +28 -16
package/README.md
CHANGED
|
@@ -1,18 +1,67 @@
|
|
|
1
1
|
# @xiaozhu2007/koishi-plugin-litematic-renderer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
将 QQ 群或私聊中的 Minecraft 建筑投影渲染为图片,支持自定义材质包、多视角图片和缓存投影搜索
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 安装与启用
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
在 Koishi 插件市场安装并启用本插件,也可以执行:
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```bash
|
|
10
|
+
npm install @xiaozhu2007/koishi-plugin-litematic-renderer
|
|
11
|
+
```
|
|
10
12
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
|
|
13
|
+
默认渲染方式需要 Java 21 或更高版本。请先配置 QQ 适配器,再按需要设置允许使用的群、文件大小和方块数量限制。私聊渲染默认关闭,可在配置中开启
|
|
14
|
+
|
|
15
|
+
## 支持的文件
|
|
16
|
+
|
|
17
|
+
- `.litematic`:Litematica 投影
|
|
18
|
+
- `.schem`:Sponge Schematic v2/v3
|
|
19
|
+
- `.nbt`:Minecraft 原版结构模板
|
|
20
|
+
|
|
21
|
+
将文件发送到允许使用的群,或引用含有投影附件的消息执行渲染命令
|
|
22
|
+
|
|
23
|
+
## 渲染命令
|
|
24
|
+
|
|
25
|
+
`litematic.render [url]` 渲染指定链接,省略链接时使用引用消息中的投影附件
|
|
26
|
+
|
|
27
|
+
```text
|
|
28
|
+
litematic.render https://example.com/castle.schem
|
|
29
|
+
litematic.render --size 1600 --rotation 45 --slant 30 --background #203040
|
|
30
|
+
litematic.render --transparent --no-six-face
|
|
31
|
+
litematic.render --profile redstone
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
| 选项 | 作用 |
|
|
35
|
+
| ------------------------------ | ------------------------------ |
|
|
36
|
+
| `--size <pixels>` | 输出边长,范围 128–4096 |
|
|
37
|
+
| `-r, --rotation <degrees>` | 水平旋转角 |
|
|
38
|
+
| `--slant <degrees>` | 俯仰角,范围 -90 到 90 |
|
|
39
|
+
| `-b, --background <color>` | PNG 背景颜色 |
|
|
40
|
+
| `-t, --transparent` | 透明背景 |
|
|
41
|
+
| `--six-face` / `--no-six-face` | 开启或关闭六面正投影 |
|
|
42
|
+
| `-n, --name <filename>` | 覆盖展示名称 |
|
|
43
|
+
| `-p, --profile <name>` | 临时选择材质包配置档 |
|
|
44
|
+
| `-e, --engine <name>` | 管理员临时选择已配置的渲染引擎 |
|
|
45
|
+
|
|
46
|
+
## 搜索已渲染投影
|
|
47
|
+
|
|
48
|
+
发送 `搜索投影 关键词` 查看可用的缓存投影,再使用 `发送投影1` 获取对应图片和投影文件,也可以直接使用 `发送投影1 关键词`
|
|
49
|
+
|
|
50
|
+
编号对应当前会话的搜索结果,十分钟内有效。搜索只显示当前配置可用的图片;图片已清理或配置发生变化时,请重新渲染
|
|
51
|
+
|
|
52
|
+
## 图片和材质设置
|
|
53
|
+
|
|
54
|
+
- 在配置中调整分辨率、视角、背景和需要展示的投影信息
|
|
55
|
+
- 官方 QQ 支持横向拼接、竖向拼接和逐张发送,拼接图超过 10 MiB 时自动逐张发送
|
|
56
|
+
- 自建 QQ 支持合并转发或联合消息,可按群设置发送方式
|
|
57
|
+
- 在控制台上传 ZIP 材质包,并通过配置档为不同群选择材质
|
|
58
|
+
- 使用 `--profile` 可为单次渲染临时选择材质包配置档
|
|
59
|
+
- 直链渲染默认只接受公网 HTTP(S) 地址,可在配置中关闭
|
|
60
|
+
|
|
61
|
+
## 管理
|
|
62
|
+
|
|
63
|
+
控制台提供渲染状态、历史记录、缓存和诊断管理
|
|
64
|
+
|
|
65
|
+
`litematic.agent.status` 查看已配置的渲染节点状态,`litematic.cache.clear` 清空缓存,`litematic.errors.export` 查看诊断文件位置,`litematic.errors.disable` 归档诊断
|
|
66
|
+
|
|
67
|
+
自动清理会保留投影源文件,主动清空缓存会同时删除保存的投影资料
|
|
Binary file
|
|
@@ -3016,21 +3016,18 @@
|
|
|
3016
3016
|
static fromNbt(t) {
|
|
3017
3017
|
const e = Mi.parse(Si(t.value, "Name", "string")),
|
|
3018
3018
|
i = Ii(() => Si(t.value, "Properties", "compound"), {}),
|
|
3019
|
-
n = Object.keys(i).reduce(
|
|
3020
|
-
(
|
|
3021
|
-
|
|
3022
|
-
(
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
},
|
|
3032
|
-
{},
|
|
3033
|
-
);
|
|
3019
|
+
n = Object.keys(i).reduce((t, e) => {
|
|
3020
|
+
return (
|
|
3021
|
+
(n = ((t, e) => {
|
|
3022
|
+
for (var i in e || (e = {})) Fi.call(e, i) && Di(t, i, e[i]);
|
|
3023
|
+
if (Pi) for (var i of Pi(e)) Li.call(e, i) && Di(t, i, e[i]);
|
|
3024
|
+
return t;
|
|
3025
|
+
})({}, t)),
|
|
3026
|
+
(s = { [e]: Si(i, e, "string") }),
|
|
3027
|
+
Ci(n, Oi(s))
|
|
3028
|
+
);
|
|
3029
|
+
var n, s;
|
|
3030
|
+
}, {});
|
|
3034
3031
|
return new zi(e, n);
|
|
3035
3032
|
}
|
|
3036
3033
|
static fromJson(t) {
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.litematic-operations[data-v-07ecf83e]{color:var(--fg1)}.operations-header[data-v-07ecf83e],.section-heading[data-v-07ecf83e]{display:flex;align-items:center;justify-content:space-between;gap:16px}.operations-header[data-v-07ecf83e]{margin-bottom:24px}.operations-header h1[data-v-07ecf83e]{margin:0;font-size:24px;line-height:1.3;letter-spacing:0}.operations-header p[data-v-07ecf83e],.section-heading span[data-v-07ecf83e]{margin:4px 0 0;color:var(--fg3);font-size:13px}.operations-actions[data-v-07ecf83e]{display:flex;flex:none;gap:8px}.metric-grid[data-v-07ecf83e]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:20px 0 30px}.metric[data-v-07ecf83e]{min-width:0;padding:16px;border:1px solid var(--k-card-border);border-radius:6px;background:var(--k-card-bg)}.metric span[data-v-07ecf83e],.metric small[data-v-07ecf83e]{display:block;color:var(--fg3)}.metric strong[data-v-07ecf83e]{display:block;margin:8px 0 4px;color:var(--fg1);font-size:22px;letter-spacing:0}.operations-section[data-v-07ecf83e]{margin-top:32px;padding-top:24px;border-top:1px solid var(--k-card-border)}.section-heading[data-v-07ecf83e]{margin-bottom:14px}.section-heading h2[data-v-07ecf83e]{margin:0;font-size:17px;letter-spacing:0}@media(max-width:800px){.metric-grid[data-v-07ecf83e]{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.operations-header[data-v-07ecf83e]{align-items:flex-start;flex-direction:column}.metric-grid[data-v-07ecf83e]{grid-template-columns:1fr}}.litematic-resource-pack-toolbar{display:inline-flex;flex-wrap:wrap;gap:8px;margin-right:8px}.litematic-resource-pack-toolbar .el-button{margin-left:0}.k-schema-table tr.litematic-selected td{background:var(--k-button-hover-bg)}.k-schema-table tr.litematic-selected td:first-child{box-shadow:inset 3px 0 var(--k-color-active)}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{send as Fn,message as le}from"@koishijs/client";import{defineComponent as P,openBlock as m,createElementBlock as x,createElementVNode as y,warn as Ho,computed as g,getCurrentInstance as ue,watch as ee,unref as u,onMounted as we,watchEffect as Vo,onBeforeUnmount as Ae,inject as q,ref as O,isRef as zn,onScopeDispose as Do,shallowRef as et,provide as Nt,mergeProps as ze,renderSlot as Q,toRef as rt,onUnmounted as Ko,useAttrs as Uo,useSlots as Hn,nextTick as J,createCommentVNode as L,Fragment as tt,normalizeClass as M,createBlock as A,withCtx as E,resolveDynamicComponent as re,withModifiers as Fe,createVNode as C,toDisplayString as k,normalizeStyle as It,Text as jo,reactive as Vn,h as Go,toRefs as Yo,resolveComponent as V,Transition as qo,withDirectives as wt,withKeys as Ye,createTextVNode as j,vShow as _t,isVNode as Dn,render as Kn}from"vue";import{isClient as ce,useEventListener as Wo,useResizeObserver as Xo}from"@vueuse/core";/*! Element Plus Icons Vue v2.3.2 */var Zo=P({name:"CircleCheck",__name:"circle-check",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),y("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}}),Jo=Zo,Qo=P({name:"CircleCloseFilled",__name:"circle-close-filled",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),Un=Qo,er=P({name:"CircleClose",__name:"circle-close",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),y("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),jn=er,tr=P({name:"Close",__name:"close",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),nr=tr,or=P({name:"Delete",__name:"delete",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}}),rr=or,ar=P({name:"Download",__name:"download",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"})]))}}),sr=ar,ir=P({name:"FolderRemove",__name:"folder-remove",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m256 416h320v64H352z"})]))}}),lr=ir,ur=P({name:"Hide",__name:"hide",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),y("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}}),cr=ur,dr=P({name:"InfoFilled",__name:"info-filled",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),Gn=dr,fr=P({name:"Loading",__name:"loading",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}}),at=fr,pr=P({name:"Refresh",__name:"refresh",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"})]))}}),vr=pr,hr=P({name:"SuccessFilled",__name:"success-filled",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.27 38.27 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),Yn=hr,mr=P({name:"View",__name:"view",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),gr=mr,br=P({name:"WarningFilled",__name:"warning-filled",setup(e){return(t,n)=>(m(),x("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[y("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.43 58.43 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.43 58.43 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),qn=br;const yr='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',wr=e=>getComputedStyle(e).position==="fixed"?false:e.offsetParent!==null,an=e=>Array.from(e.querySelectorAll(yr)).filter(t=>_r(t)&&wr(t)),_r=e=>{if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return true;if(e.disabled)return false;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return!(e.type==="hidden"||e.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return true;default:return false}},Er=()=>ce&&/firefox/i.test(window.navigator.userAgent);/**
|
|
2
|
+
* @vue/shared v3.5.42
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/const He=()=>{},Sr=Object.prototype.hasOwnProperty,st=(e,t)=>Sr.call(e,t),it=e=>typeof e=="function",ge=e=>typeof e=="string",Ve=e=>e!==null&&typeof e=="object",Cr=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},xr=/-\w/g,Tr=Cr(e=>e.replace(xr,t=>t.slice(1).toUpperCase()));var kr=typeof global=="object"&&global&&global.Object===Object&&global,Mr=typeof self=="object"&&self&&self.Object===Object&&self,Rt=kr||Mr||Function("return this")(),ye=Rt.Symbol,Wn=Object.prototype,Ir=Wn.hasOwnProperty,Ar=Wn.toString,Re=ye?ye.toStringTag:void 0;function Br(e){var t=Ir.call(e,Re),n=e[Re];try{e[Re]=void 0;var o=true}catch{}var r=Ar.call(e);return o&&(t?e[Re]=n:delete e[Re]),r}var Lr=Object.prototype,Or=Lr.toString;function $r(e){return Or.call(e)}var Pr="[object Null]",Nr="[object Undefined]",sn=ye?ye.toStringTag:void 0;function Ft(e){return e==null?e===void 0?Nr:Pr:sn&&sn in Object(e)?Br(e):$r(e)}function zt(e){return e!=null&&typeof e=="object"}var Rr="[object Symbol]";function Ht(e){return typeof e=="symbol"||zt(e)&&Ft(e)==Rr}function Fr(e,t){for(var n=-1,o=e==null?0:e.length,r=Array(o);++n<o;)r[n]=t(e[n],n,e);return r}var Ue=Array.isArray,ln=ye?ye.prototype:void 0,un=ln?ln.toString:void 0;function Xn(e){if(typeof e=="string")return e;if(Ue(e))return Fr(e,Xn)+"";if(Ht(e))return un?un.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function lt(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function zr(e){return e}var Hr="[object AsyncFunction]",Vr="[object Function]",Dr="[object GeneratorFunction]",Kr="[object Proxy]";function Ur(e){if(!lt(e))return false;var t=Ft(e);return t==Vr||t==Dr||t==Hr||t==Kr}var Et=Rt["__core-js_shared__"],cn=(function(){var e=/[^.]+$/.exec(Et&&Et.keys&&Et.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""})();function jr(e){return!!cn&&cn in e}var Gr=Function.prototype,Yr=Gr.toString;function qr(e){if(e!=null){try{return Yr.call(e)}catch{}try{return e+""}catch{}}return""}var Wr=/[\\^$.*+?()[\]{}|]/g,Xr=/^\[object .+?Constructor\]$/,Zr=Function.prototype,Jr=Object.prototype,Qr=Zr.toString,ea=Jr.hasOwnProperty,ta=RegExp("^"+Qr.call(ea).replace(Wr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function na(e){if(!lt(e)||jr(e))return false;var t=Ur(e)?ta:Xr;return t.test(qr(e))}function oa(e,t){return e==null?void 0:e[t]}function Vt(e,t){var n=oa(e,t);return na(n)?n:void 0}function ra(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var aa=800,sa=16,ia=Date.now;function la(e){var t=0,n=0;return function(){var o=ia(),r=sa-(o-n);if(n=o,r>0){if(++t>=aa)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ua(e){return function(){return e}}var ut=(function(){try{var e=Vt(Object,"defineProperty");return e({},"",{}),e}catch{}})(),ca=ut?function(e,t){return ut(e,"toString",{configurable:true,enumerable:false,value:ua(t),writable:true})}:zr,da=la(ca),fa=9007199254740991,pa=/^(?:0|[1-9]\d*)$/;function Zn(e,t){var n=typeof e;return t=t??fa,!!t&&(n=="number"||n!="symbol"&&pa.test(e))&&e>-1&&e%1==0&&e<t}function Jn(e,t,n){t=="__proto__"&&ut?ut(e,t,{configurable:true,enumerable:true,value:n,writable:true}):e[t]=n}function Qn(e,t){return e===t||e!==e&&t!==t}var va=Object.prototype,ha=va.hasOwnProperty;function ma(e,t,n){var o=e[t];(!(ha.call(e,t)&&Qn(o,n))||n===void 0&&!(t in e))&&Jn(e,t,n)}var dn=Math.max;function ga(e,t,n){return t=dn(t===void 0?e.length-1:t,0),function(){for(var o=arguments,r=-1,a=dn(o.length-t,0),s=Array(a);++r<a;)s[r]=o[t+r];r=-1;for(var l=Array(t+1);++r<t;)l[r]=o[r];return l[t]=n(s),ra(e,this,l)}}var ba=9007199254740991;function ya(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=ba}var wa="[object Arguments]";function fn(e){return zt(e)&&Ft(e)==wa}var eo=Object.prototype,_a=eo.hasOwnProperty,Ea=eo.propertyIsEnumerable,to=fn((function(){return arguments})())?fn:function(e){return zt(e)&&_a.call(e,"callee")&&!Ea.call(e,"callee")},Sa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ca=/^\w*$/;function xa(e,t){if(Ue(e))return false;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||Ht(e)?true:Ca.test(e)||!Sa.test(e)||t!=null&&e in Object(t)}var De=Vt(Object,"create");function Ta(){this.__data__=De?De(null):{},this.size=0}function ka(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var Ma="__lodash_hash_undefined__",Ia=Object.prototype,Aa=Ia.hasOwnProperty;function Ba(e){var t=this.__data__;if(De){var n=t[e];return n===Ma?void 0:n}return Aa.call(t,e)?t[e]:void 0}var La=Object.prototype,Oa=La.hasOwnProperty;function $a(e){var t=this.__data__;return De?t[e]!==void 0:Oa.call(t,e)}var Pa="__lodash_hash_undefined__";function Na(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=De&&t===void 0?Pa:t,this}function Te(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Te.prototype.clear=Ta;Te.prototype.delete=ka;Te.prototype.get=Ba;Te.prototype.has=$a;Te.prototype.set=Na;function Ra(){this.__data__=[],this.size=0}function pt(e,t){for(var n=e.length;n--;)if(Qn(e[n][0],t))return n;return-1}var Fa=Array.prototype,za=Fa.splice;function Ha(e){var t=this.__data__,n=pt(t,e);if(n<0)return false;var o=t.length-1;return n==o?t.pop():za.call(t,n,1),--this.size,true}function Va(e){var t=this.__data__,n=pt(t,e);return n<0?void 0:t[n][1]}function Da(e){return pt(this.__data__,e)>-1}function Ka(e,t){var n=this.__data__,o=pt(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}function Be(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}Be.prototype.clear=Ra;Be.prototype.delete=Ha;Be.prototype.get=Va;Be.prototype.has=Da;Be.prototype.set=Ka;var Ua=Vt(Rt,"Map");function ja(){this.size=0,this.__data__={hash:new Te,map:new(Ua||Be),string:new Te}}function Ga(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function vt(e,t){var n=e.__data__;return Ga(t)?n[typeof t=="string"?"string":"hash"]:n.map}function Ya(e){var t=vt(this,e).delete(e);return this.size-=t?1:0,t}function qa(e){return vt(this,e).get(e)}function Wa(e){return vt(this,e).has(e)}function Xa(e,t){var n=vt(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}function ke(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var o=e[t];this.set(o[0],o[1])}}ke.prototype.clear=ja;ke.prototype.delete=Ya;ke.prototype.get=qa;ke.prototype.has=Wa;ke.prototype.set=Xa;var Za="Expected a function";function Dt(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(Za);var n=function(){var o=arguments,r=t?t.apply(this,o):o[0],a=n.cache;if(a.has(r))return a.get(r);var s=e.apply(this,o);return n.cache=a.set(r,s)||a,s};return n.cache=new(Dt.Cache||ke),n}Dt.Cache=ke;var Ja=500;function Qa(e){var t=Dt(e,function(o){return n.size===Ja&&n.clear(),o}),n=t.cache;return t}var es=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ts=/\\(\\)?/g,ns=Qa(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(es,function(n,o,r,a){t.push(r?a.replace(ts,"$1"):o||n)}),t});function os(e){return e==null?"":Xn(e)}function ht(e,t){return Ue(e)?e:xa(e,t)?[e]:ns(os(e))}function Kt(e){if(typeof e=="string"||Ht(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function no(e,t){t=ht(t,e);for(var n=0,o=t.length;e!=null&&n<o;)e=e[Kt(t[n++])];return n&&n==o?e:void 0}function rs(e,t,n){var o=e==null?void 0:no(e,t);return o===void 0?n:o}function as(e,t){for(var n=-1,o=t.length,r=e.length;++n<o;)e[r+n]=t[n];return e}var pn=ye?ye.isConcatSpreadable:void 0;function ss(e){return Ue(e)||to(e)||!!(pn&&e&&e[pn])}function is(e,t,n,o,r){var a=-1,s=e.length;for(n||(n=ss),r||(r=[]);++a<s;){var l=e[a];n(l)?as(r,l):r[r.length]=l}return r}function ls(e){var t=e==null?0:e.length;return t?is(e):[]}function us(e){return da(ga(e,void 0,ls),e+"")}function cs(e,t){return e!=null&&t in Object(e)}function ds(e,t,n){t=ht(t,e);for(var o=-1,r=t.length,a=false;++o<r;){var s=Kt(t[o]);if(!(a=e!=null&&n(e,s)))break;e=e[s]}return a||++o!=r?a:(r=e==null?0:e.length,!!r&&ya(r)&&Zn(s,r)&&(Ue(e)||to(e)))}function fs(e,t){return e!=null&&ds(e,t,cs)}function oo(e){for(var t=-1,n=e==null?0:e.length,o={};++t<n;){var r=e[t];Jn(o,r[0],r[1])}return o}function ro(e){return e==null}function ps(e,t,n,o){if(!lt(e))return e;t=ht(t,e);for(var r=-1,a=t.length,s=a-1,l=e;l!=null&&++r<a;){var v=Kt(t[r]),f=n;if(v==="__proto__"||v==="constructor"||v==="prototype")return e;if(r!=s){var _=l[v];f=void 0,f===void 0&&(f=lt(_)?_:Zn(t[r+1])?[]:{})}ma(l,v,f),l=l[v]}return e}function vs(e,t,n){for(var o=-1,r=t.length,a={};++o<r;){var s=t[o],l=no(e,s);n(l,s)&&ps(a,ht(s,e),l)}return a}function hs(e,t){return vs(e,t,function(n,o){return fs(e,o)})}var ms=us(function(e,t){return e==null?{}:hs(e,t)});const ao=e=>e===void 0,ct=e=>typeof e=="number",vn=e=>typeof Element>"u"?false:e instanceof Element,gs=e=>ge(e)?!Number.isNaN(Number(e)):false,hn=e=>Object.keys(e);class bs extends Error{constructor(t){super(t),this.name="ElementPlusError"}}function ys(e,t){throw new bs(`[${e}] ${t}`)}const so=(e="")=>e.split(" ").filter(t=>!!t.trim()),mn=(e,t)=>{if(!e||!t)return false;if(t.includes(" "))throw new Error("className should not contain space.");return e.classList.contains(t)},ws=(e,t)=>{!e||!t.trim()||e.classList.add(...so(t))},_s=(e,t)=>{!e||!t.trim()||e.classList.remove(...so(t))},Es=(e,t)=>{var n;if(!ce||!e||!t)return"";let o=Tr(t);o==="float"&&(o="cssFloat");try{const r=e.style[o];if(r)return r;const a=(n=document.defaultView)==null?void 0:n.getComputedStyle(e,"");return a?a[o]:""}catch{return e.style[o]}};function At(e,t="px"){if(!e)return"";if(ct(e)||gs(e))return`${e}${t}`;if(ge(e))return e}let qe;const Ss=e=>{var t;if(!ce)return 0;if(qe!==void 0)return qe;const n=document.createElement("div");n.className=`${e}-scrollbar__wrap`,n.style.visibility="hidden",n.style.width="100px",n.style.position="absolute",n.style.top="-9999px",document.body.appendChild(n);const o=n.offsetWidth;n.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",n.appendChild(r);const a=r.offsetWidth;return(t=n.parentNode)==null||t.removeChild(n),qe=o-a,qe},io="__epPropKey",be=e=>e,Cs=e=>Ve(e)&&!!e[io],lo=(e,t)=>{if(!Ve(e)||Cs(e))return e;const{values:n,required:o,default:r,type:a,validator:s}=e,v={type:a,required:!!o,validator:n||s?f=>{let _=false,h=[];if(n&&(h=Array.from(n),st(e,"default")&&h.push(r),_||(_=h.includes(f))),s&&(_||(_=s(f))),!_&&h.length>0){const w=[...new Set(h)].map($=>JSON.stringify($)).join(", ");Ho(`Invalid prop: validation failed${t?` for prop "${t}"`:""}. Expected one of [${w}], got value ${JSON.stringify(f)}.`)}return _}:void 0,[io]:true};return st(e,"default")&&(v.default=r),v},Le=e=>oo(Object.entries(e).map(([t,n])=>[t,lo(n,t)])),dt=be([String,Object,Function]),xs={Close:nr,SuccessFilled:Yn,InfoFilled:Gn,WarningFilled:qn,CircleCloseFilled:Un},gn={success:Yn,warning:qn,error:Un,info:Gn},Ts={validating:at,success:Jo,error:jn},Ut=(e,t)=>{if(e.install=n=>{for(const o of[e,...Object.values(t??{})])n.component(o.name,o)},t)for(const[n,o]of Object.entries(t))e[n]=o;return e},ks=e=>(e.install=He,e),jt={tab:"Tab",esc:"Escape"},Bt="update:modelValue",uo=["","default","small","large"],Ms=e=>["",...uo].includes(e);var nt=(e=>(e[e.TEXT=1]="TEXT",e[e.CLASS=2]="CLASS",e[e.STYLE=4]="STYLE",e[e.PROPS=8]="PROPS",e[e.FULL_PROPS=16]="FULL_PROPS",e[e.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",e[e.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",e[e.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",e[e.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",e[e.NEED_PATCH=512]="NEED_PATCH",e[e.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",e[e.HOISTED=-1]="HOISTED",e[e.BAIL=-2]="BAIL",e))(nt||{});const Is=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),As=e=>e,Bs=["class","style"],Ls=/^on[A-Z]/,Os=(e={})=>{const{excludeListeners:t=false,excludeKeys:n}=e,o=g(()=>((n==null?void 0:n.value)||[]).concat(Bs)),r=ue();return r?g(()=>{var a;return oo(Object.entries((a=r.proxy)==null?void 0:a.$attrs).filter(([s])=>!o.value.includes(s)&&!(t&&Ls.test(s))))}):g(()=>({}))},co=({from:e,replacement:t,scope:n,version:o,ref:r,type:a="API"},s)=>{ee(()=>u(s),l=>{},{immediate:true})},$s=(e,t,n,o)=>{let r={offsetX:0,offsetY:0};const a=v=>{const f=v.clientX,_=v.clientY,{offsetX:h,offsetY:w}=r,$=e.value.getBoundingClientRect(),d=$.left,i=$.top,p=$.width,b=$.height,S=document.documentElement.clientWidth,z=document.documentElement.clientHeight,B=-d+h,Y=-i+w,W=S-d-p+h,R=z-i-b+w,H=G=>{let D=h+G.clientX-f,N=w+G.clientY-_;o!=null&&o.value||(D=Math.min(Math.max(D,B),W),N=Math.min(Math.max(N,Y),R)),r={offsetX:D,offsetY:N},e.value&&(e.value.style.transform=`translate(${At(D)}, ${At(N)})`)},X=()=>{document.removeEventListener("mousemove",H),document.removeEventListener("mouseup",X)};document.addEventListener("mousemove",H),document.addEventListener("mouseup",X)},s=()=>{t.value&&e.value&&t.value.addEventListener("mousedown",a)},l=()=>{t.value&&e.value&&t.value.removeEventListener("mousedown",a)};we(()=>{Vo(()=>{n.value?s():l()})}),Ae(()=>{l()})};var Ps={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color."},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const Ns=e=>(t,n)=>Rs(t,n,u(e)),Rs=(e,t,n)=>rs(n,e,e).replace(/\{(\w+)\}/g,(o,r)=>{var a;return`${(a=t==null?void 0:t[r])!=null?a:`{${r}}`}`}),Fs=e=>{const t=g(()=>u(e).name),n=zn(e)?e:O(e);return{lang:t,locale:n,t:Ns(e)}},fo=Symbol("localeContextKey"),zs=e=>{const t=e||q(fo,O());return Fs(g(()=>t.value||Ps))},ot="el",Hs="is-",Se=(e,t,n,o,r)=>{let a=`${e}-${t}`;return n&&(a+=`-${n}`),o&&(a+=`__${o}`),r&&(a+=`--${r}`),a},po=Symbol("namespaceContextKey"),vo=e=>{const t=e||(ue()?q(po,O(ot)):O(ot));return g(()=>u(t)||ot)},de=(e,t)=>{const n=vo(t);return{namespace:n,b:(i="")=>Se(n.value,e,i,"",""),e:i=>i?Se(n.value,e,"",i,""):"",m:i=>i?Se(n.value,e,"","",i):"",be:(i,p)=>i&&p?Se(n.value,e,i,p,""):"",em:(i,p)=>i&&p?Se(n.value,e,"",i,p):"",bm:(i,p)=>i&&p?Se(n.value,e,i,"",p):"",bem:(i,p,b)=>i&&p&&b?Se(n.value,e,i,p,b):"",is:(i,...p)=>{const b=p.length>=1?p[0]:true;return i&&b?`${Hs}${i}`:""},cssVar:i=>{const p={};for(const b in i)i[b]&&(p[`--${n.value}-${b}`]=i[b]);return p},cssVarName:i=>`--${n.value}-${i}`,cssVarBlock:i=>{const p={};for(const b in i)i[b]&&(p[`--${n.value}-${e}-${b}`]=i[b]);return p},cssVarBlockName:i=>`--${n.value}-${e}-${i}`}},Vs=(e,t={})=>{zn(e)||ys("[useLockscreen]","You need to pass a ref param to this function");const n=t.ns||de("popup"),o=g(()=>n.bm("parent","hidden"));if(!ce||mn(document.body,o.value))return;let r=0,a=false,s="0";const l=()=>{setTimeout(()=>{_s(document==null?void 0:document.body,o.value),a&&document&&(document.body.style.width=s)},200)};ee(e,v=>{if(!v){l();return}a=!mn(document.body,o.value),a&&(s=document.body.style.width),r=Ss(n.namespace.value);const f=document.documentElement.clientHeight<document.body.scrollHeight,_=Es(document.body,"overflowY");r>0&&(f||_==="scroll")&&a&&(document.body.style.width=`calc(100% - ${r}px)`),ws(document.body,o.value)}),Do(()=>l())},ho=e=>{const t=ue();return g(()=>{var n,o;return(o=(n=t==null?void 0:t.proxy)==null?void 0:n.$props)==null?void 0:o[e]})},mo=e=>{if(!e)return{onClick:He,onMousedown:He,onMouseup:He};let t=false,n=false;return{onClick:s=>{t&&n&&e(s),t=n=false},onMousedown:s=>{t=s.target===s.currentTarget},onMouseup:s=>{n=s.target===s.currentTarget}}},bn={prefix:Math.floor(Math.random()*1e4),current:0},Ds=Symbol("elIdInjection"),Ks=()=>ue()?q(Ds,bn):bn,Lt=e=>{const t=Ks(),n=vo();return g(()=>u(e)||`${n.value}-id-${t.prefix}-${t.current++}`)};let Ie=[];const yn=e=>{const t=e;t.key===jt.esc&&Ie.forEach(n=>n(t))},Us=e=>{we(()=>{Ie.length===0&&document.addEventListener("keydown",yn),ce&&Ie.push(e)}),Ae(()=>{Ie=Ie.filter(t=>t!==e),Ie.length===0&&ce&&document.removeEventListener("keydown",yn)})},wn={current:0},_n=O(0),go=2e3,En=Symbol("elZIndexContextKey"),bo=Symbol("zIndexContextKey"),js=e=>{const t=ue()?q(En,wn):wn,n=e||(ue()?q(bo,void 0):void 0),o=g(()=>{const s=u(n);return ct(s)?s:go}),r=g(()=>o.value+_n.value),a=()=>(t.current++,_n.value=t.current,r.value);return!ce&&q(En),{initialZIndex:o,currentZIndex:r,nextZIndex:a}};function Gs(e){const t=O();function n(){if(e.value==null)return;const{selectionStart:r,selectionEnd:a,value:s}=e.value;if(r==null||a==null)return;const l=s.slice(0,Math.max(0,r)),v=s.slice(Math.max(0,a));t.value={selectionStart:r,selectionEnd:a,value:s,beforeTxt:l,afterTxt:v}}function o(){if(e.value==null||t.value==null)return;const{value:r}=e.value,{beforeTxt:a,afterTxt:s,selectionStart:l}=t.value;if(a==null||s==null||l==null)return;let v=r.length;if(r.endsWith(s))v=r.length-s.length;else if(r.startsWith(a))v=a.length;else{const f=a[l-1],_=r.indexOf(f,l-1);_!==-1&&(v=_+1)}e.value.setSelectionRange(v,v)}return[n,o]}const yo=lo({type:String,values:uo,required:false}),wo=Symbol("size"),Ys=()=>{const e=q(wo,{});return g(()=>u(e.size)||"")};function qs(e,{afterFocus:t,beforeBlur:n,afterBlur:o}={}){const r=ue(),{emit:a}=r,s=et(),l=O(false),v=h=>{l.value||(l.value=true,a("focus",h),t==null||t())},f=h=>{var w;it(n)&&n(h)||h.relatedTarget&&((w=s.value)!=null&&w.contains(h.relatedTarget))||(l.value=false,a("blur",h),o==null||o())},_=()=>{var h;(h=e.value)==null||h.focus()};return ee(s,h=>{h&&h.setAttribute("tabindex","-1")}),Wo(s,"click",_),{wrapperRef:s,isFocused:l,handleFocus:v,handleBlur:f}}const Ws=Symbol("emptyValuesContextKey");Le({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:e=>it(e)?!e():!e}});const Xs=Le({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),Zs=e=>ms(Xs,e),_o=Symbol(),ft=O();function Gt(e,t=void 0){const n=ue()?q(_o,ft):ft;return e?g(()=>{var o,r;return(r=(o=n.value)==null?void 0:o[e])!=null?r:t}):n}function Js(e,t){const n=Gt(),o=de(e,g(()=>{var l;return((l=n.value)==null?void 0:l.namespace)||ot})),r=zs(g(()=>{var l;return(l=n.value)==null?void 0:l.locale})),a=js(g(()=>{var l;return((l=n.value)==null?void 0:l.zIndex)||go})),s=g(()=>{var l;return u(t)||((l=n.value)==null?void 0:l.size)||""});return Qs(g(()=>u(n)||{})),{ns:o,locale:r,zIndex:a,size:s}}const Qs=(e,t,n=false)=>{var o;const r=!!ue(),a=r?Gt():void 0,s=(o=void 0)!=null?o:r?Nt:void 0;if(!s)return;const l=g(()=>{const v=u(e);return a!=null&&a.value?ei(a.value,v):v});return s(_o,l),s(fo,g(()=>l.value.locale)),s(po,g(()=>l.value.namespace)),s(bo,g(()=>l.value.zIndex)),s(wo,{size:g(()=>l.value.size||"")}),s(Ws,g(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(n||!ft.value)&&(ft.value=l.value),l},ei=(e,t)=>{const n=[...new Set([...hn(e),...hn(t)])],o={};for(const r of n)o[r]=t[r]!==void 0?t[r]:e[r];return o};var Oe=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n};const ti=Le({size:{type:be([Number,String])},color:{type:String}}),ni=P({name:"ElIcon",inheritAttrs:false}),oi=P({...ni,props:ti,setup(e){const t=e,n=de("icon"),o=g(()=>{const{size:r,color:a}=t;return!r&&!a?{}:{fontSize:ao(r)?void 0:At(r),"--color":a}});return(r,a)=>(m(),x("i",ze({class:u(n).b(),style:u(o)},r.$attrs),[Q(r.$slots,"default")],16))}});var ri=Oe(oi,[["__file","icon.vue"]]);const he=Ut(ri),Yt=Symbol("formContextKey"),Eo=Symbol("formItemContextKey"),So=(e,t={})=>{const n=O(void 0),o=t.prop?n:ho("size"),r=t.global?n:Ys(),a=t.form?{size:void 0}:q(Yt,void 0),s=t.formItem?{size:void 0}:q(Eo,void 0);return g(()=>o.value||u(e)||(s==null?void 0:s.size)||(a==null?void 0:a.size)||r.value||"")},qt=e=>{const t=ho("disabled"),n=q(Yt,void 0);return g(()=>t.value||u(e)||(n==null?void 0:n.disabled)||false)},Co=()=>{const e=q(Yt,void 0),t=q(Eo,void 0);return{form:e,formItem:t}},ai=(e,{formItemContext:t,disableIdGeneration:n,disableIdManagement:o})=>{n||(n=O(false)),o||(o=O(false));const r=O();let a;const s=g(()=>{var l;return!!(!(e.label||e.ariaLabel)&&t&&t.inputIds&&((l=t.inputIds)==null?void 0:l.length)<=1)});return we(()=>{a=ee([rt(e,"id"),n],([l,v])=>{const f=l??(v?void 0:Lt().value);f!==r.value&&(t!=null&&t.removeInputId&&(r.value&&t.removeInputId(r.value),!(o!=null&&o.value)&&!v&&f&&t.addInputId(f)),r.value=f)},{immediate:true})}),Ko(()=>{a&&a(),t!=null&&t.removeInputId&&r.value&&t.removeInputId(r.value)}),{isLabeledByFormItem:s,inputId:r}};let ne;const si=`
|
|
6
|
+
height:0 !important;
|
|
7
|
+
visibility:hidden !important;
|
|
8
|
+
${Er()?"":"overflow:hidden !important;"}
|
|
9
|
+
position:absolute !important;
|
|
10
|
+
z-index:-1000 !important;
|
|
11
|
+
top:0 !important;
|
|
12
|
+
right:0 !important;
|
|
13
|
+
`,ii=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function li(e){const t=window.getComputedStyle(e),n=t.getPropertyValue("box-sizing"),o=Number.parseFloat(t.getPropertyValue("padding-bottom"))+Number.parseFloat(t.getPropertyValue("padding-top")),r=Number.parseFloat(t.getPropertyValue("border-bottom-width"))+Number.parseFloat(t.getPropertyValue("border-top-width"));return{contextStyle:ii.map(s=>`${s}:${t.getPropertyValue(s)}`).join(";"),paddingSize:o,borderSize:r,boxSizing:n}}function Sn(e,t=1,n){var o;ne||(ne=document.createElement("textarea"),document.body.appendChild(ne));const{paddingSize:r,borderSize:a,boxSizing:s,contextStyle:l}=li(e);ne.setAttribute("style",`${l};${si}`),ne.value=e.value||e.placeholder||"";let v=ne.scrollHeight;const f={};s==="border-box"?v=v+a:s==="content-box"&&(v=v-r),ne.value="";const _=ne.scrollHeight-r;if(ct(t)){let h=_*t;s==="border-box"&&(h=h+r+a),v=Math.max(h,v),f.minHeight=`${h}px`}if(ct(n)){let h=_*n;s==="border-box"&&(h=h+r+a),v=Math.min(h,v)}return f.height=`${v}px`,(o=ne.parentNode)==null||o.removeChild(ne),ne=void 0,f}const ui=Le({id:{type:String,default:void 0},size:yo,disabled:Boolean,modelValue:{type:be([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:be([Boolean,Object]),default:false},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:{type:Boolean,default:false},clearable:{type:Boolean,default:false},showPassword:{type:Boolean,default:false},showWordLimit:{type:Boolean,default:false},suffixIcon:{type:dt},prefixIcon:{type:dt},containerRole:{type:String,default:void 0},label:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:true},inputStyle:{type:be([Object,Array,String]),default:()=>As({})},autofocus:{type:Boolean,default:false},...Zs(["ariaLabel"])}),ci={[Bt]:e=>ge(e),input:e=>ge(e),change:e=>ge(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>true,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},di=["role"],fi=["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus"],pi=["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus"],vi=P({name:"ElInput",inheritAttrs:false}),hi=P({...vi,props:ui,emits:ci,setup(e,{expose:t,emit:n}){const o=e,r=Uo(),a=Hn(),s=g(()=>{const c={};return o.containerRole==="combobox"&&(c["aria-haspopup"]=r["aria-haspopup"],c["aria-owns"]=r["aria-owns"],c["aria-expanded"]=r["aria-expanded"]),c}),l=g(()=>[o.type==="textarea"?p.b():i.b(),i.m($.value),i.is("disabled",d.value),i.is("exceed",Ao.value),{[i.b("group")]:a.prepend||a.append,[i.m("prefix")]:a.prefix||o.prefixIcon,[i.m("suffix")]:a.suffix||o.suffixIcon||o.clearable||o.showPassword,[i.bm("suffix","password-clear")]:je.value&>.value,[i.b("hidden")]:o.type==="hidden"},r.class]),v=g(()=>[i.e("wrapper"),i.is("focus",G.value)]),f=Os({excludeKeys:g(()=>Object.keys(s.value))}),{form:_,formItem:h}=Co(),{inputId:w}=ai(o,{formItemContext:h}),$=So(),d=qt(),i=de("input"),p=de("textarea"),b=et(),S=et(),z=O(false),B=O(false),Y=O(false),W=O(),R=et(o.inputStyle),H=g(()=>b.value||S.value),{wrapperRef:X,isFocused:G,handleFocus:D,handleBlur:N}=qs(H,{afterBlur(){var c;o.validateEvent&&((c=h==null?void 0:h.validate)==null||c.call(h,"blur").catch(I=>void 0))}}),_e=g(()=>{var c;return(c=_==null?void 0:_.statusIcon)!=null?c:false}),T=g(()=>(h==null?void 0:h.validateState)||""),Ee=g(()=>T.value&&Ts[T.value]),F=g(()=>Y.value?gr:cr),ae=g(()=>[r.style]),se=g(()=>[o.inputStyle,R.value,{resize:o.resize}]),te=g(()=>ro(o.modelValue)?"":String(o.modelValue)),je=g(()=>o.clearable&&!d.value&&!o.readonly&&!!te.value&&(G.value||z.value)),gt=g(()=>o.showPassword&&!d.value&&!o.readonly&&!!te.value&&(!!te.value||G.value)),Me=g(()=>o.showWordLimit&&!!o.maxlength&&(o.type==="text"||o.type==="textarea")&&!d.value&&!o.readonly&&!o.showPassword),bt=g(()=>te.value.length),Ao=g(()=>!!Me.value&&bt.value>Number(o.maxlength)),Bo=g(()=>!!a.suffix||!!o.suffixIcon||je.value||o.showPassword||Me.value||!!T.value&&_e.value),[Lo,Oo]=Gs(b);Xo(S,c=>{if($o(),!Me.value||o.resize!=="both")return;const I=c[0],{width:K}=I.contentRect;W.value={right:`calc(100% - ${K+15+6}px)`}});const Pe=()=>{const{type:c,autosize:I}=o;if(!(!ce||c!=="textarea"||!S.value))if(I){const K=Ve(I)?I.minRows:void 0,Ge=Ve(I)?I.maxRows:void 0,rn=Sn(S.value,K,Ge);R.value={overflowY:"hidden",...rn},J(()=>{S.value.offsetHeight,R.value=rn})}else R.value={minHeight:Sn(S.value).minHeight}},$o=(c=>{let I=false;return()=>{var K;if(I||!o.autosize)return;((K=S.value)==null?void 0:K.offsetParent)===null||(c(),I=true)}})(Pe),Ne=()=>{const c=H.value,I=o.formatter?o.formatter(te.value):te.value;!c||c.value===I||(c.value=I)},yt=async c=>{Lo();let{value:I}=c.target;if(o.formatter&&(I=o.parser?o.parser(I):I),!B.value){if(I===te.value){Ne();return}n(Bt,I),n("input",I),await J(),Ne(),Oo()}},Zt=c=>{n("change",c.target.value)},Jt=c=>{n("compositionstart",c),B.value=true},Qt=c=>{var I;n("compositionupdate",c);const K=(I=c.target)==null?void 0:I.value,Ge=K[K.length-1]||"";B.value=!Is(Ge)},en=c=>{n("compositionend",c),B.value&&(B.value=false,yt(c))},Po=()=>{Y.value=!Y.value,tn()},tn=async()=>{var c;await J(),(c=H.value)==null||c.focus()},No=()=>{var c;return(c=H.value)==null?void 0:c.blur()},Ro=c=>{z.value=false,n("mouseleave",c)},Fo=c=>{z.value=true,n("mouseenter",c)},nn=c=>{n("keydown",c)},zo=()=>{var c;(c=H.value)==null||c.select()},on=()=>{n(Bt,""),n("change",""),n("clear"),n("input","")};return ee(()=>o.modelValue,()=>{var c;J(()=>Pe()),o.validateEvent&&((c=h==null?void 0:h.validate)==null||c.call(h,"change").catch(I=>void 0))}),ee(te,()=>Ne()),ee(()=>o.type,async()=>{await J(),Ne(),Pe()}),we(()=>{!o.formatter&&o.parser,Ne(),J(Pe)}),co({from:"label",replacement:"aria-label",version:"2.8.0",scope:"el-input",ref:"https://element-plus.org/en-US/component/input.html"},g(()=>!!o.label)),t({input:b,textarea:S,ref:H,textareaStyle:se,autosize:rt(o,"autosize"),focus:tn,blur:No,select:zo,clear:on,resizeTextarea:Pe}),(c,I)=>(m(),x("div",ze(u(s),{class:[u(l),{[u(i).bm("group","append")]:c.$slots.append,[u(i).bm("group","prepend")]:c.$slots.prepend}],style:u(ae),role:c.containerRole,onMouseenter:Fo,onMouseleave:Ro}),[L(" input "),c.type!=="textarea"?(m(),x(tt,{key:0},[L(" prepend slot "),c.$slots.prepend?(m(),x("div",{key:0,class:M(u(i).be("group","prepend"))},[Q(c.$slots,"prepend")],2)):L("v-if",true),y("div",{ref_key:"wrapperRef",ref:X,class:M(u(v))},[L(" prefix slot "),c.$slots.prefix||c.prefixIcon?(m(),x("span",{key:0,class:M(u(i).e("prefix"))},[y("span",{class:M(u(i).e("prefix-inner"))},[Q(c.$slots,"prefix"),c.prefixIcon?(m(),A(u(he),{key:0,class:M(u(i).e("icon"))},{default:E(()=>[(m(),A(re(c.prefixIcon)))]),_:1},8,["class"])):L("v-if",true)],2)],2)):L("v-if",true),y("input",ze({id:u(w),ref_key:"input",ref:b,class:u(i).e("inner")},u(f),{minlength:c.minlength,maxlength:c.maxlength,type:c.showPassword?Y.value?"text":"password":c.type,disabled:u(d),readonly:c.readonly,autocomplete:c.autocomplete,tabindex:c.tabindex,"aria-label":c.label||c.ariaLabel,placeholder:c.placeholder,style:c.inputStyle,form:c.form,autofocus:c.autofocus,onCompositionstart:Jt,onCompositionupdate:Qt,onCompositionend:en,onInput:yt,onFocus:I[0]||(I[0]=(...K)=>u(D)&&u(D)(...K)),onBlur:I[1]||(I[1]=(...K)=>u(N)&&u(N)(...K)),onChange:Zt,onKeydown:nn}),null,16,fi),L(" suffix slot "),u(Bo)?(m(),x("span",{key:1,class:M(u(i).e("suffix"))},[y("span",{class:M(u(i).e("suffix-inner"))},[!u(je)||!u(gt)||!u(Me)?(m(),x(tt,{key:0},[Q(c.$slots,"suffix"),c.suffixIcon?(m(),A(u(he),{key:0,class:M(u(i).e("icon"))},{default:E(()=>[(m(),A(re(c.suffixIcon)))]),_:1},8,["class"])):L("v-if",true)],64)):L("v-if",true),u(je)?(m(),A(u(he),{key:1,class:M([u(i).e("icon"),u(i).e("clear")]),onMousedown:Fe(u(He),["prevent"]),onClick:on},{default:E(()=>[C(u(jn))]),_:1},8,["class","onMousedown"])):L("v-if",true),u(gt)?(m(),A(u(he),{key:2,class:M([u(i).e("icon"),u(i).e("password")]),onClick:Po},{default:E(()=>[(m(),A(re(u(F))))]),_:1},8,["class"])):L("v-if",true),u(Me)?(m(),x("span",{key:3,class:M(u(i).e("count"))},[y("span",{class:M(u(i).e("count-inner"))},k(u(bt))+" / "+k(c.maxlength),3)],2)):L("v-if",true),u(T)&&u(Ee)&&u(_e)?(m(),A(u(he),{key:4,class:M([u(i).e("icon"),u(i).e("validateIcon"),u(i).is("loading",u(T)==="validating")])},{default:E(()=>[(m(),A(re(u(Ee))))]),_:1},8,["class"])):L("v-if",true)],2)],2)):L("v-if",true)],2),L(" append slot "),c.$slots.append?(m(),x("div",{key:1,class:M(u(i).be("group","append"))},[Q(c.$slots,"append")],2)):L("v-if",true)],64)):(m(),x(tt,{key:1},[L(" textarea "),y("textarea",ze({id:u(w),ref_key:"textarea",ref:S,class:[u(p).e("inner"),u(i).is("focus",u(G))]},u(f),{minlength:c.minlength,maxlength:c.maxlength,tabindex:c.tabindex,disabled:u(d),readonly:c.readonly,autocomplete:c.autocomplete,style:u(se),"aria-label":c.label||c.ariaLabel,placeholder:c.placeholder,form:c.form,autofocus:c.autofocus,onCompositionstart:Jt,onCompositionupdate:Qt,onCompositionend:en,onInput:yt,onFocus:I[2]||(I[2]=(...K)=>u(D)&&u(D)(...K)),onBlur:I[3]||(I[3]=(...K)=>u(N)&&u(N)(...K)),onChange:Zt,onKeydown:nn}),null,16,pi),u(Me)?(m(),x("span",{key:0,style:It(W.value),class:M(u(i).e("count"))},k(u(bt))+" / "+k(c.maxlength),7)):L("v-if",true)],64))],16,di))}});var mi=Oe(hi,[["__file","input.vue"]]);const gi=Ut(mi),St="focus-trap.focus-after-trapped",Ct="focus-trap.focus-after-released",bi="focus-trap.focusout-prevented",Cn={cancelable:true,bubbles:false},yi={cancelable:true,bubbles:false},xn="focusAfterTrapped",Tn="focusAfterReleased",wi=Symbol("elFocusTrap"),Wt=O(),mt=O(0),Xt=O(0);let We=0;const xo=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0||o===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},kn=(e,t)=>{for(const n of e)if(!_i(n,t))return n},_i=(e,t)=>{if(getComputedStyle(e).visibility==="hidden")return true;for(;e;){if(t&&e===t)return false;if(getComputedStyle(e).display==="none")return true;e=e.parentElement}return false},Ei=e=>{const t=xo(e),n=kn(t,e),o=kn(t.reverse(),e);return[n,o]},Si=e=>e instanceof HTMLInputElement&&"select"in e,pe=(e,t)=>{if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:true}),Xt.value=window.performance.now(),e!==n&&Si(e)&&t&&e.select()}};function Mn(e,t){const n=[...e],o=e.indexOf(t);return o!==-1&&n.splice(o,1),n}const Ci=()=>{let e=[];return{push:o=>{const r=e[0];r&&o!==r&&r.pause(),e=Mn(e,o),e.unshift(o)},remove:o=>{var r,a;e=Mn(e,o),(a=(r=e[0])==null?void 0:r.resume)==null||a.call(r)}}},xi=(e,t=false)=>{const n=document.activeElement;for(const o of e)if(pe(o,t),document.activeElement!==n)return},In=Ci(),Ti=()=>mt.value>Xt.value,Xe=()=>{Wt.value="pointer",mt.value=window.performance.now()},An=()=>{Wt.value="keyboard",mt.value=window.performance.now()},ki=()=>(we(()=>{We===0&&(document.addEventListener("mousedown",Xe),document.addEventListener("touchstart",Xe),document.addEventListener("keydown",An)),We++}),Ae(()=>{We--,We<=0&&(document.removeEventListener("mousedown",Xe),document.removeEventListener("touchstart",Xe),document.removeEventListener("keydown",An))}),{focusReason:Wt,lastUserFocusTimestamp:mt,lastAutomatedFocusTimestamp:Xt}),Ze=e=>new CustomEvent(bi,{...yi,detail:e}),Mi=P({name:"ElFocusTrap",inheritAttrs:false,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[xn,Tn,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const n=O();let o,r;const{focusReason:a}=ki();Us(d=>{e.trapped&&!s.paused&&t("release-requested",d)});const s={paused:false,pause(){this.paused=true},resume(){this.paused=false}},l=d=>{if(!e.loop&&!e.trapped||s.paused)return;const{key:i,altKey:p,ctrlKey:b,metaKey:S,currentTarget:z,shiftKey:B}=d,{loop:Y}=e,W=i===jt.tab&&!p&&!b&&!S,R=document.activeElement;if(W&&R){const H=z,[X,G]=Ei(H);if(X&&G){if(!B&&R===G){const N=Ze({focusReason:a.value});t("focusout-prevented",N),N.defaultPrevented||(d.preventDefault(),Y&&pe(X,true))}else if(B&&[X,H].includes(R)){const N=Ze({focusReason:a.value});t("focusout-prevented",N),N.defaultPrevented||(d.preventDefault(),Y&&pe(G,true))}}else if(R===H){const N=Ze({focusReason:a.value});t("focusout-prevented",N),N.defaultPrevented||d.preventDefault()}}};Nt(wi,{focusTrapRef:n,onKeydown:l}),ee(()=>e.focusTrapEl,d=>{d&&(n.value=d)},{immediate:true}),ee([n],([d],[i])=>{d&&(d.addEventListener("keydown",l),d.addEventListener("focusin",_),d.addEventListener("focusout",h)),i&&(i.removeEventListener("keydown",l),i.removeEventListener("focusin",_),i.removeEventListener("focusout",h))});const v=d=>{t(xn,d)},f=d=>t(Tn,d),_=d=>{const i=u(n);if(!i)return;const p=d.target,b=d.relatedTarget,S=p&&i.contains(p);e.trapped||b&&i.contains(b)||(o=b),S&&t("focusin",d),!s.paused&&e.trapped&&(S?r=p:pe(r,true))},h=d=>{const i=u(n);if(!(s.paused||!i))if(e.trapped){const p=d.relatedTarget;!ro(p)&&!i.contains(p)&&setTimeout(()=>{if(!s.paused&&e.trapped){const b=Ze({focusReason:a.value});t("focusout-prevented",b),b.defaultPrevented||pe(r,true)}},0)}else{const p=d.target;p&&i.contains(p)||t("focusout",d)}};async function w(){await J();const d=u(n);if(d){In.push(s);const i=d.contains(document.activeElement)?o:document.activeElement;if(o=i,!d.contains(i)){const b=new Event(St,Cn);d.addEventListener(St,v),d.dispatchEvent(b),b.defaultPrevented||J(()=>{let S=e.focusStartEl;ge(S)||(pe(S),document.activeElement!==S&&(S="first")),S==="first"&&xi(xo(d),true),(document.activeElement===i||S==="container")&&pe(d)})}}}function $(){const d=u(n);if(d){d.removeEventListener(St,v);const i=new CustomEvent(Ct,{...Cn,detail:{focusReason:a.value}});d.addEventListener(Ct,f),d.dispatchEvent(i),!i.defaultPrevented&&(a.value=="keyboard"||!Ti()||d.contains(document.activeElement))&&pe(o??document.body),d.removeEventListener(Ct,f),In.remove(s)}}return we(()=>{e.trapped&&w(),ee(()=>e.trapped,d=>{d?w():$()})}),Ae(()=>{e.trapped&&$()}),{onKeydown:l}}});function Ii(e,t,n,o,r,a){return Q(e.$slots,"default",{handleKeydown:e.onKeydown})}var Ai=Oe(Mi,[["render",Ii],["__file","focus-trap.vue"]]);const To=Symbol("buttonGroupContextKey"),Bi=(e,t)=>{co({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},g(()=>e.type==="text"));const n=q(To,void 0),o=Gt("button"),{form:r}=Co(),a=So(g(()=>n==null?void 0:n.size)),s=qt(),l=O(),v=Hn(),f=g(()=>e.type||(n==null?void 0:n.type)||""),_=g(()=>{var d,i,p;return(p=(i=e.autoInsertSpace)!=null?i:(d=o.value)==null?void 0:d.autoInsertSpace)!=null?p:false}),h=g(()=>e.tag==="button"?{ariaDisabled:s.value||e.loading,disabled:s.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),w=g(()=>{var d;const i=(d=v.default)==null?void 0:d.call(v);if(_.value&&(i==null?void 0:i.length)===1){const p=i[0];if((p==null?void 0:p.type)===jo){const b=p.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(b.trim())}}return false});return{_disabled:s,_size:a,_type:f,_ref:l,_props:h,shouldAddSpace:w,handleClick:d=>{e.nativeType==="reset"&&(r==null||r.resetFields()),t("click",d)}}},Li=["default","primary","success","warning","info","danger","text",""],Oi=["button","submit","reset"],Ot=Le({size:yo,disabled:Boolean,type:{type:String,values:Li,default:""},icon:{type:dt},nativeType:{type:String,values:Oi,default:"button"},loading:Boolean,loadingIcon:{type:dt,default:()=>at},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:be([String,Object]),default:"button"}}),$i={click:e=>e instanceof MouseEvent};function U(e,t){Pi(e)&&(e="100%");var n=Ni(e);return e=t===360?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:(t===360?e=(e<0?e%t+t:e%t)/parseFloat(String(t)):e=e%t/parseFloat(String(t)),e)}function Je(e){return Math.min(1,Math.max(0,e))}function Pi(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function Ni(e){return typeof e=="string"&&e.indexOf("%")!==-1}function ko(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Qe(e){return e<=1?"".concat(Number(e)*100,"%"):e}function Ce(e){return e.length===1?"0"+e:String(e)}function Ri(e,t,n){return{r:U(e,255)*255,g:U(t,255)*255,b:U(n,255)*255}}function Bn(e,t,n){e=U(e,255),t=U(t,255),n=U(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),a=0,s=0,l=(o+r)/2;if(o===r)s=0,a=0;else{var v=o-r;switch(s=l>.5?v/(2-o-r):v/(o+r),o){case e:a=(t-n)/v+(t<n?6:0);break;case t:a=(n-e)/v+2;break;case n:a=(e-t)/v+4;break}a/=6}return{h:a,s,l}}function xt(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*(6*n):n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Fi(e,t,n){var o,r,a;if(e=U(e,360),t=U(t,100),n=U(n,100),t===0)r=n,a=n,o=n;else{var s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;o=xt(l,s,e+1/3),r=xt(l,s,e),a=xt(l,s,e-1/3)}return{r:o*255,g:r*255,b:a*255}}function Ln(e,t,n){e=U(e,255),t=U(t,255),n=U(n,255);var o=Math.max(e,t,n),r=Math.min(e,t,n),a=0,s=o,l=o-r,v=o===0?0:l/o;if(o===r)a=0;else{switch(o){case e:a=(t-n)/l+(t<n?6:0);break;case t:a=(n-e)/l+2;break;case n:a=(e-t)/l+4;break}a/=6}return{h:a,s:v,v:s}}function zi(e,t,n){e=U(e,360)*6,t=U(t,100),n=U(n,100);var o=Math.floor(e),r=e-o,a=n*(1-t),s=n*(1-r*t),l=n*(1-(1-r)*t),v=o%6,f=[n,s,a,a,l,n][v],_=[l,n,n,s,a,a][v],h=[a,a,l,n,n,s][v];return{r:f*255,g:_*255,b:h*255}}function On(e,t,n,o){var r=[Ce(Math.round(e).toString(16)),Ce(Math.round(t).toString(16)),Ce(Math.round(n).toString(16))];return o&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function Hi(e,t,n,o,r){var a=[Ce(Math.round(e).toString(16)),Ce(Math.round(t).toString(16)),Ce(Math.round(n).toString(16)),Ce(Vi(o))];return r&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}function Vi(e){return Math.round(parseFloat(e)*255).toString(16)}function $n(e){return Z(e)/255}function Z(e){return parseInt(e,16)}function Di(e){return{r:e>>16,g:(e&65280)>>8,b:e&255}}var $t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Ki(e){var t={r:0,g:0,b:0},n=1,o=null,r=null,a=null,s=false,l=false;return typeof e=="string"&&(e=Gi(e)),typeof e=="object"&&(ie(e.r)&&ie(e.g)&&ie(e.b)?(t=Ri(e.r,e.g,e.b),s=true,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):ie(e.h)&&ie(e.s)&&ie(e.v)?(o=Qe(e.s),r=Qe(e.v),t=zi(e.h,o,r),s=true,l="hsv"):ie(e.h)&&ie(e.s)&&ie(e.l)&&(o=Qe(e.s),a=Qe(e.l),t=Fi(e.h,o,a),s=true,l="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=ko(n),{ok:s,format:e.format||l,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var Ui="[-\\+]?\\d+%?",ji="[-\\+]?\\d*\\.\\d+%?",me="(?:".concat(ji,")|(?:").concat(Ui,")"),Tt="[\\s|\\(]+(".concat(me,")[,|\\s]+(").concat(me,")[,|\\s]+(").concat(me,")\\s*\\)?"),kt="[\\s|\\(]+(".concat(me,")[,|\\s]+(").concat(me,")[,|\\s]+(").concat(me,")[,|\\s]+(").concat(me,")\\s*\\)?"),oe={CSS_UNIT:new RegExp(me),rgb:new RegExp("rgb"+Tt),rgba:new RegExp("rgba"+kt),hsl:new RegExp("hsl"+Tt),hsla:new RegExp("hsla"+kt),hsv:new RegExp("hsv"+Tt),hsva:new RegExp("hsva"+kt),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Gi(e){if(e=e.trim().toLowerCase(),e.length===0)return false;var t=false;if($t[e])e=$t[e],t=true;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var n=oe.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=oe.rgba.exec(e),n?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=oe.hsl.exec(e),n?{h:n[1],s:n[2],l:n[3]}:(n=oe.hsla.exec(e),n?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=oe.hsv.exec(e),n?{h:n[1],s:n[2],v:n[3]}:(n=oe.hsva.exec(e),n?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=oe.hex8.exec(e),n?{r:Z(n[1]),g:Z(n[2]),b:Z(n[3]),a:$n(n[4]),format:t?"name":"hex8"}:(n=oe.hex6.exec(e),n?{r:Z(n[1]),g:Z(n[2]),b:Z(n[3]),format:t?"name":"hex"}:(n=oe.hex4.exec(e),n?{r:Z(n[1]+n[1]),g:Z(n[2]+n[2]),b:Z(n[3]+n[3]),a:$n(n[4]+n[4]),format:t?"name":"hex8"}:(n=oe.hex3.exec(e),n?{r:Z(n[1]+n[1]),g:Z(n[2]+n[2]),b:Z(n[3]+n[3]),format:t?"name":"hex"}:false)))))))))}function ie(e){return!!oe.CSS_UNIT.exec(String(e))}var Yi=(function(){function e(t,n){t===void 0&&(t=""),n===void 0&&(n={});var o;if(t instanceof e)return t;typeof t=="number"&&(t=Di(t)),this.originalInput=t;var r=Ki(t);this.originalInput=t,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(o=n.format)!==null&&o!==void 0?o:r.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},e.prototype.getLuminance=function(){var t=this.toRgb(),n,o,r,a=t.r/255,s=t.g/255,l=t.b/255;return a<=.03928?n=a/12.92:n=Math.pow((a+.055)/1.055,2.4),s<=.03928?o=s/12.92:o=Math.pow((s+.055)/1.055,2.4),l<=.03928?r=l/12.92:r=Math.pow((l+.055)/1.055,2.4),.2126*n+.7152*o+.0722*r},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(t){return this.a=ko(t),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var t=this.toHsl().s;return t===0},e.prototype.toHsv=function(){var t=Ln(this.r,this.g,this.b);return{h:t.h*360,s:t.s,v:t.v,a:this.a}},e.prototype.toHsvString=function(){var t=Ln(this.r,this.g,this.b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.v*100);return this.a===1?"hsv(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsva(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var t=Bn(this.r,this.g,this.b);return{h:t.h*360,s:t.s,l:t.l,a:this.a}},e.prototype.toHslString=function(){var t=Bn(this.r,this.g,this.b),n=Math.round(t.h*360),o=Math.round(t.s*100),r=Math.round(t.l*100);return this.a===1?"hsl(".concat(n,", ").concat(o,"%, ").concat(r,"%)"):"hsla(".concat(n,", ").concat(o,"%, ").concat(r,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(t){return t===void 0&&(t=false),On(this.r,this.g,this.b,t)},e.prototype.toHexString=function(t){return t===void 0&&(t=false),"#"+this.toHex(t)},e.prototype.toHex8=function(t){return t===void 0&&(t=false),Hi(this.r,this.g,this.b,this.a,t)},e.prototype.toHex8String=function(t){return t===void 0&&(t=false),"#"+this.toHex8(t)},e.prototype.toHexShortString=function(t){return t===void 0&&(t=false),this.a===1?this.toHexString(t):this.toHex8String(t)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var t=Math.round(this.r),n=Math.round(this.g),o=Math.round(this.b);return this.a===1?"rgb(".concat(t,", ").concat(n,", ").concat(o,")"):"rgba(".concat(t,", ").concat(n,", ").concat(o,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var t=function(n){return"".concat(Math.round(U(n,255)*100),"%")};return{r:t(this.r),g:t(this.g),b:t(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var t=function(n){return Math.round(U(n,255)*100)};return this.a===1?"rgb(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%)"):"rgba(".concat(t(this.r),"%, ").concat(t(this.g),"%, ").concat(t(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return false;for(var t="#"+On(this.r,this.g,this.b,false),n=0,o=Object.entries($t);n<o.length;n++){var r=o[n],a=r[0],s=r[1];if(t===s)return a}return false},e.prototype.toString=function(t){var n=!!t;t=t??this.format;var o=false,r=this.a<1&&this.a>=0,a=!n&&r&&(t.startsWith("hex")||t==="name");return a?t==="name"&&this.a===0?this.toName():this.toRgbString():(t==="rgb"&&(o=this.toRgbString()),t==="prgb"&&(o=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(o=this.toHexString()),t==="hex3"&&(o=this.toHexString(true)),t==="hex4"&&(o=this.toHex8String(true)),t==="hex8"&&(o=this.toHex8String()),t==="name"&&(o=this.toName()),t==="hsl"&&(o=this.toHslString()),t==="hsv"&&(o=this.toHsvString()),o||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=Je(n.l),new e(n)},e.prototype.brighten=function(t){t===void 0&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(255*-(t/100)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(255*-(t/100)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(255*-(t/100)))),new e(n)},e.prototype.darken=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=Je(n.l),new e(n)},e.prototype.tint=function(t){return t===void 0&&(t=10),this.mix("white",t)},e.prototype.shade=function(t){return t===void 0&&(t=10),this.mix("black",t)},e.prototype.desaturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=Je(n.s),new e(n)},e.prototype.saturate=function(t){t===void 0&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=Je(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),o=(n.h+t)%360;return n.h=o<0?360+o:o,new e(n)},e.prototype.mix=function(t,n){n===void 0&&(n=50);var o=this.toRgb(),r=new e(t).toRgb(),a=n/100,s={r:(r.r-o.r)*a+o.r,g:(r.g-o.g)*a+o.g,b:(r.b-o.b)*a+o.b,a:(r.a-o.a)*a+o.a};return new e(s)},e.prototype.analogous=function(t,n){t===void 0&&(t=6),n===void 0&&(n=30);var o=this.toHsl(),r=360/n,a=[this];for(o.h=(o.h-(r*t>>1)+720)%360;--t;)o.h=(o.h+r)%360,a.push(new e(o));return a},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){t===void 0&&(t=6);for(var n=this.toHsv(),o=n.h,r=n.s,a=n.v,s=[],l=1/t;t--;)s.push(new e({h:o,s:r,v:a})),a=(a+l)%1;return s},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),o=new e(t).toRgb(),r=n.a+o.a*(1-n.a);return new e({r:(n.r*n.a+o.r*o.a*(1-n.a))/r,g:(n.g*n.a+o.g*o.a*(1-n.a))/r,b:(n.b*n.a+o.b*o.a*(1-n.a))/r,a:r})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),o=n.h,r=[this],a=360/t,s=1;s<t;s++)r.push(new e({h:(o+s*a)%360,s:n.s,l:n.l}));return r},e.prototype.equals=function(t){return this.toRgbString()===new e(t).toRgbString()},e})();function fe(e,t=20){return e.mix("#141414",t).toString()}function qi(e){const t=qt(),n=de("button");return g(()=>{let o={},r=e.color;if(r){const a=r.match(/var\((.*?)\)/);a&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(a[1]));const s=new Yi(r),l=e.dark?s.tint(20).toString():fe(s,20);if(e.plain)o=n.cssVarBlock({"bg-color":e.dark?fe(s,90):s.tint(90).toString(),"text-color":r,"border-color":e.dark?fe(s,50):s.tint(50).toString(),"hover-text-color":`var(${n.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":l,"active-text-color":`var(${n.cssVarName("color-white")})`,"active-border-color":l}),t.value&&(o[n.cssVarBlockName("disabled-bg-color")]=e.dark?fe(s,90):s.tint(90).toString(),o[n.cssVarBlockName("disabled-text-color")]=e.dark?fe(s,50):s.tint(50).toString(),o[n.cssVarBlockName("disabled-border-color")]=e.dark?fe(s,80):s.tint(80).toString());else{const v=e.dark?fe(s,30):s.tint(30).toString(),f=s.isDark()?`var(${n.cssVarName("color-white")})`:`var(${n.cssVarName("color-black")})`;if(o=n.cssVarBlock({"bg-color":r,"text-color":f,"border-color":r,"hover-bg-color":v,"hover-text-color":f,"hover-border-color":v,"active-bg-color":l,"active-border-color":l}),t.value){const _=e.dark?fe(s,50):s.tint(50).toString();o[n.cssVarBlockName("disabled-bg-color")]=_,o[n.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${n.cssVarName("color-white")})`,o[n.cssVarBlockName("disabled-border-color")]=_}}}return o})}const Wi=P({name:"ElButton"}),Xi=P({...Wi,props:Ot,emits:$i,setup(e,{expose:t,emit:n}){const o=e,r=qi(o),a=de("button"),{_ref:s,_size:l,_type:v,_disabled:f,_props:_,shouldAddSpace:h,handleClick:w}=Bi(o,n),$=g(()=>[a.b(),a.m(v.value),a.m(l.value),a.is("disabled",f.value),a.is("loading",o.loading),a.is("plain",o.plain),a.is("round",o.round),a.is("circle",o.circle),a.is("text",o.text),a.is("link",o.link),a.is("has-bg",o.bg)]);return t({ref:s,size:l,type:v,disabled:f,shouldAddSpace:h}),(d,i)=>(m(),A(re(d.tag),ze({ref_key:"_ref",ref:s},u(_),{class:u($),style:u(r),onClick:u(w)}),{default:E(()=>[d.loading?(m(),x(tt,{key:0},[d.$slots.loading?Q(d.$slots,"loading",{key:0}):(m(),A(u(he),{key:1,class:M(u(a).is("loading"))},{default:E(()=>[(m(),A(re(d.loadingIcon)))]),_:1},8,["class"]))],64)):d.icon||d.$slots.icon?(m(),A(u(he),{key:1},{default:E(()=>[d.icon?(m(),A(re(d.icon),{key:0})):Q(d.$slots,"icon",{key:1})]),_:3})):L("v-if",true),d.$slots.default?(m(),x("span",{key:2,class:M({[u(a).em("text","expand")]:u(h)})},[Q(d.$slots,"default")],2)):L("v-if",true)]),_:3},16,["class","style","onClick"]))}});var Zi=Oe(Xi,[["__file","button.vue"]]);const Ji={size:Ot.size,type:Ot.type},Qi=P({name:"ElButtonGroup"}),el=P({...Qi,props:Ji,setup(e){const t=e;Nt(To,Vn({size:rt(t,"size"),type:rt(t,"type")}));const n=de("button");return(o,r)=>(m(),x("div",{class:M(`${u(n).b("group")}`)},[Q(o.$slots,"default")],2))}});var Mo=Oe(el,[["__file","button-group.vue"]]);const tl=Ut(Zi,{ButtonGroup:Mo});ks(Mo);const Pt="_trap-focus-children",xe=[],Pn=e=>{if(xe.length===0)return;const t=xe[xe.length-1][Pt];if(t.length>0&&e.code===jt.tab){if(t.length===1){e.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const n=e.shiftKey,o=e.target===t[0],r=e.target===t[t.length-1];o&&n&&(e.preventDefault(),t[t.length-1].focus()),r&&!n&&(e.preventDefault(),t[0].focus())}},nl={beforeMount(e){e[Pt]=an(e),xe.push(e),xe.length<=1&&document.addEventListener("keydown",Pn)},updated(e){J(()=>{e[Pt]=an(e)})},unmounted(){xe.shift(),xe.length===0&&document.removeEventListener("keydown",Pn)}},ol=Le({mask:{type:Boolean,default:true},customMaskEvent:{type:Boolean,default:false},overlayClass:{type:be([String,Array,Object])},zIndex:{type:be([String,Number])}}),rl={click:e=>e instanceof MouseEvent},al="overlay";var sl=P({name:"ElOverlay",props:ol,emits:rl,setup(e,{slots:t,emit:n}){const o=de(al),r=v=>{n("click",v)},{onClick:a,onMousedown:s,onMouseup:l}=mo(e.customMaskEvent?void 0:r);return()=>e.mask?C("div",{class:[o.b(),e.overlayClass],style:{zIndex:e.zIndex},onClick:a,onMousedown:s,onMouseup:l},[Q(t,"default")],nt.STYLE|nt.CLASS|nt.PROPS,["onClick","onMouseup","onMousedown"]):Go("div",{class:e.overlayClass,style:{zIndex:e.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[Q(t,"default")])}});const il=sl,ll=P({name:"ElMessageBox",directives:{TrapFocus:nl},components:{ElButton:tl,ElFocusTrap:Ai,ElInput:gi,ElOverlay:il,ElIcon:he,...xs},inheritAttrs:false,props:{buttonSize:{type:String,validator:Ms},modal:{type:Boolean,default:true},lockScroll:{type:Boolean,default:true},showClose:{type:Boolean,default:true},closeOnClickModal:{type:Boolean,default:true},closeOnPressEscape:{type:Boolean,default:true},closeOnHashChange:{type:Boolean,default:true},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:false,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(e,{emit:t}){const{locale:n,zIndex:o,ns:r,size:a}=Js("message-box",g(()=>e.buttonSize)),{t:s}=n,{nextZIndex:l}=o,v=O(false),f=Vn({autofocus:true,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:false,distinguishCancelAndClose:false,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:true,modalClass:"",showCancelButton:false,showConfirmButton:true,type:"",title:void 0,showInput:false,action:"",confirmButtonLoading:false,cancelButtonLoading:false,confirmButtonLoadingIcon:at,cancelButtonLoadingIcon:at,confirmButtonDisabled:false,editorErrorMessage:"",validateError:false,zIndex:l()}),_=g(()=>{const F=f.type;return{[r.bm("icon",F)]:F&&gn[F]}}),h=Lt(),w=Lt(),$=g(()=>f.icon||gn[f.type]||""),d=g(()=>!!f.message),i=O(),p=O(),b=O(),S=O(),z=O(),B=g(()=>f.confirmButtonClass);ee(()=>f.inputValue,async F=>{await J(),e.boxType==="prompt"&&F!==null&&N()},{immediate:true}),ee(()=>v.value,F=>{var ae,se;F&&(e.boxType!=="prompt"&&(f.autofocus?b.value=(se=(ae=z.value)==null?void 0:ae.$el)!=null?se:i.value:b.value=i.value),f.zIndex=l()),e.boxType==="prompt"&&(F?J().then(()=>{var te;S.value&&S.value.$el&&(f.autofocus?b.value=(te=_e())!=null?te:i.value:b.value=i.value)}):(f.editorErrorMessage="",f.validateError=false))});const Y=g(()=>e.draggable),W=g(()=>e.overflow);$s(i,p,Y,W),we(async()=>{await J(),e.closeOnHashChange&&window.addEventListener("hashchange",R)}),Ae(()=>{e.closeOnHashChange&&window.removeEventListener("hashchange",R)});function R(){v.value&&(v.value=false,J(()=>{f.action&&t("action",f.action)}))}const H=()=>{e.closeOnClickModal&&D(f.distinguishCancelAndClose?"close":"cancel")},X=mo(H),G=F=>{if(f.inputType!=="textarea")return F.preventDefault(),D("confirm")},D=F=>{var ae;e.boxType==="prompt"&&F==="confirm"&&!N()||(f.action=F,f.beforeClose?(ae=f.beforeClose)==null||ae.call(f,F,f,R):R())},N=()=>{if(e.boxType==="prompt"){const F=f.inputPattern;if(F&&!F.test(f.inputValue||""))return f.editorErrorMessage=f.inputErrorMessage||s("el.messagebox.error"),f.validateError=true,false;const ae=f.inputValidator;if(typeof ae=="function"){const se=ae(f.inputValue);if(se===false)return f.editorErrorMessage=f.inputErrorMessage||s("el.messagebox.error"),f.validateError=true,false;if(typeof se=="string")return f.editorErrorMessage=se,f.validateError=true,false}}return f.editorErrorMessage="",f.validateError=false,true},_e=()=>{const F=S.value.$refs;return F.input||F.textarea},T=()=>{D("close")},Ee=()=>{e.closeOnPressEscape&&T()};return e.lockScroll&&Vs(v),{...Yo(f),ns:r,overlayEvent:X,visible:v,hasMessage:d,typeClass:_,contentId:h,inputId:w,btnSize:a,iconComponent:$,confirmButtonClasses:B,rootRef:i,focusStartRef:b,headerRef:p,inputRef:S,confirmRef:z,doClose:R,handleClose:T,onCloseRequested:Ee,handleWrapperClick:H,handleInputEnter:G,handleAction:D,t:s}}}),ul=["aria-label","aria-describedby"],cl=["aria-label"],dl=["id"];function fl(e,t,n,o,r,a){const s=V("el-icon"),l=V("close"),v=V("el-input"),f=V("el-button"),_=V("el-focus-trap"),h=V("el-overlay");return m(),A(qo,{name:"fade-in-linear",onAfterLeave:t[11]||(t[11]=w=>e.$emit("vanish")),persisted:""},{default:E(()=>[wt(C(h,{"z-index":e.zIndex,"overlay-class":[e.ns.is("message-box"),e.modalClass],mask:e.modal},{default:E(()=>[y("div",{role:"dialog","aria-label":e.title,"aria-modal":"true","aria-describedby":e.showInput?void 0:e.contentId,class:M(`${e.ns.namespace.value}-overlay-message-box`),onClick:t[8]||(t[8]=(...w)=>e.overlayEvent.onClick&&e.overlayEvent.onClick(...w)),onMousedown:t[9]||(t[9]=(...w)=>e.overlayEvent.onMousedown&&e.overlayEvent.onMousedown(...w)),onMouseup:t[10]||(t[10]=(...w)=>e.overlayEvent.onMouseup&&e.overlayEvent.onMouseup(...w))},[C(_,{loop:"",trapped:e.visible,"focus-trap-el":e.rootRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:E(()=>[y("div",{ref:"rootRef",class:M([e.ns.b(),e.customClass,e.ns.is("draggable",e.draggable),{[e.ns.m("center")]:e.center}]),style:It(e.customStyle),tabindex:"-1",onClick:t[7]||(t[7]=Fe(()=>{},["stop"]))},[e.title!==null&&e.title!==void 0?(m(),x("div",{key:0,ref:"headerRef",class:M([e.ns.e("header"),{"show-close":e.showClose}])},[y("div",{class:M(e.ns.e("title"))},[e.iconComponent&&e.center?(m(),A(s,{key:0,class:M([e.ns.e("status"),e.typeClass])},{default:E(()=>[(m(),A(re(e.iconComponent)))]),_:1},8,["class"])):L("v-if",true),y("span",null,k(e.title),1)],2),e.showClose?(m(),x("button",{key:0,type:"button",class:M(e.ns.e("headerbtn")),"aria-label":e.t("el.messagebox.close"),onClick:t[0]||(t[0]=w=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel")),onKeydown:t[1]||(t[1]=Ye(Fe(w=>e.handleAction(e.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"]))},[C(s,{class:M(e.ns.e("close"))},{default:E(()=>[C(l)]),_:1},8,["class"])],42,cl)):L("v-if",true)],2)):L("v-if",true),y("div",{id:e.contentId,class:M(e.ns.e("content"))},[y("div",{class:M(e.ns.e("container"))},[e.iconComponent&&!e.center&&e.hasMessage?(m(),A(s,{key:0,class:M([e.ns.e("status"),e.typeClass])},{default:E(()=>[(m(),A(re(e.iconComponent)))]),_:1},8,["class"])):L("v-if",true),e.hasMessage?(m(),x("div",{key:1,class:M(e.ns.e("message"))},[Q(e.$slots,"default",{},()=>[e.dangerouslyUseHTMLString?(m(),A(re(e.showInput?"label":"p"),{key:1,for:e.showInput?e.inputId:void 0,innerHTML:e.message},null,8,["for","innerHTML"])):(m(),A(re(e.showInput?"label":"p"),{key:0,for:e.showInput?e.inputId:void 0},{default:E(()=>[j(k(e.dangerouslyUseHTMLString?"":e.message),1)]),_:1},8,["for"]))])],2)):L("v-if",true)],2),wt(y("div",{class:M(e.ns.e("input"))},[C(v,{id:e.inputId,ref:"inputRef",modelValue:e.inputValue,"onUpdate:modelValue":t[2]||(t[2]=w=>e.inputValue=w),type:e.inputType,placeholder:e.inputPlaceholder,"aria-invalid":e.validateError,class:M({invalid:e.validateError}),onKeydown:Ye(e.handleInputEnter,["enter"])},null,8,["id","modelValue","type","placeholder","aria-invalid","class","onKeydown"]),y("div",{class:M(e.ns.e("errormsg")),style:It({visibility:e.editorErrorMessage?"visible":"hidden"})},k(e.editorErrorMessage),7)],2),[[_t,e.showInput]])],10,dl),y("div",{class:M(e.ns.e("btns"))},[e.showCancelButton?(m(),A(f,{key:0,loading:e.cancelButtonLoading,"loading-icon":e.cancelButtonLoadingIcon,class:M([e.cancelButtonClass]),round:e.roundButton,size:e.btnSize,onClick:t[3]||(t[3]=w=>e.handleAction("cancel")),onKeydown:t[4]||(t[4]=Ye(Fe(w=>e.handleAction("cancel"),["prevent"]),["enter"]))},{default:E(()=>[j(k(e.cancelButtonText||e.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size"])):L("v-if",true),wt(C(f,{ref:"confirmRef",type:"primary",loading:e.confirmButtonLoading,"loading-icon":e.confirmButtonLoadingIcon,class:M([e.confirmButtonClasses]),round:e.roundButton,disabled:e.confirmButtonDisabled,size:e.btnSize,onClick:t[5]||(t[5]=w=>e.handleAction("confirm")),onKeydown:t[6]||(t[6]=Ye(Fe(w=>e.handleAction("confirm"),["prevent"]),["enter"]))},{default:E(()=>[j(k(e.confirmButtonText||e.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size"]),[[_t,e.showConfirmButton]])],2)],6)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,ul)]),_:3},8,["z-index","overlay-class","mask"]),[[_t,e.visible]])]),_:3})}var pl=Oe(ll,[["render",fl],["__file","index.vue"]]);const Ke=new Map,vl=e=>{let t=document.body;return e.appendTo&&(ge(e.appendTo)&&(t=document.querySelector(e.appendTo)),vn(e.appendTo)&&(t=e.appendTo),vn(t)||(t=document.body)),t},hl=(e,t,n=null)=>{const o=C(pl,e,it(e.message)||Dn(e.message)?{default:it(e.message)?e.message:()=>e.message}:null);return o.appContext=n,Kn(o,t),vl(e).appendChild(t.firstElementChild),o.component},ml=()=>document.createElement("div"),gl=(e,t)=>{const n=ml();e.onVanish=()=>{Kn(null,n),Ke.delete(r)},e.onAction=a=>{const s=Ke.get(r);let l;e.showInput?l={value:r.inputValue,action:a}:l=a,e.callback?e.callback(l,o.proxy):a==="cancel"||a==="close"?e.distinguishCancelAndClose&&a!=="cancel"?s.reject("close"):s.reject("cancel"):s.resolve(l)};const o=hl(e,n,t),r=o.proxy;for(const a in e)st(e,a)&&!st(r.$props,a)&&(r[a]=e[a]);return r.visible=true,r};function $e(e,t=null){if(!ce)return Promise.reject();let n;return ge(e)||Dn(e)?e={message:e}:n=e.callback,new Promise((o,r)=>{const a=gl(e,t??$e._context);Ke.set(a,{options:e,callback:n,resolve:o,reject:r})})}const bl=["alert","confirm","prompt"],yl={alert:{closeOnPressEscape:false,closeOnClickModal:false},confirm:{showCancelButton:true},prompt:{showCancelButton:true,showInput:true}};bl.forEach(e=>{$e[e]=wl(e)});function wl(e){return(t,n,o,r)=>{let a="";return Ve(n)?(o=n,a=""):ao(n)?a="":a=n,$e(Object.assign({title:a,message:t,type:"",...yl[e]},o,{boxType:e}),r)}}$e.close=()=>{Ke.forEach((e,t)=>{t.doClose()}),Ke.clear()};$e._context=null;const ve=$e;ve.install=e=>{ve._context=e._context,e.config.globalProperties.$msgbox=ve,e.config.globalProperties.$messageBox=ve,e.config.globalProperties.$alert=ve.alert,e.config.globalProperties.$confirm=ve.confirm,e.config.globalProperties.$prompt=ve.prompt};const Nn=ve,_l={class:"operations-header"},El={class:"operations-actions"},Sl={key:1,class:"metric-grid"},Cl={class:"metric"},xl={class:"metric"},Tl={class:"metric"},kl={class:"metric"},Ml={key:2,class:"operations-section"},Il={class:"section-heading"},Al={key:3,class:"operations-section"},Bl={class:"section-heading"},Ll={key:0},Ol={key:1},$l={key:1},Pl={key:0},Nl={key:4,class:"operations-section"},Rl={class:"section-heading"},Fl=P({__name:"dashboard",setup(e){const t=O(),n=O(false),o=O("");let r;const a=Fn,s=g(()=>{var i,p;return((p=(i=t.value)==null?void 0:i.gpu)==null?void 0:p.nodes.filter(b=>b.online).length)??0}),l=g(()=>{var p,b;const i=((p=t.value)==null?void 0:p.metrics.completed)??0;return i?`${Math.round((((b=t.value)==null?void 0:b.metrics.cacheHits)??0)/i*100)}%`:"0%"});async function v(){if(!n.value){n.value=true;try{t.value=await a("litematic/operations/status"),o.value=""}catch(i){o.value=i instanceof Error?i.message:String(i)}finally{n.value=false}}}async function f(){try{await Nn.confirm("确认清理全部投影渲染缓存?","清理缓存",{type:"warning"})}catch{return}try{t.value=await a("litematic/operations/cache-clear"),le.success("渲染缓存已清理")}catch(i){le.error(i instanceof Error?i.message:String(i))}}async function _(){try{await Nn.confirm("确认归档当前诊断并创建空白快照?","归档诊断",{type:"warning"})}catch{return}try{t.value=await a("litematic/operations/diagnostics-disable"),le.success("诊断快照已归档")}catch(i){le.error(i instanceof Error?i.message:String(i))}}async function h(){try{const i=await a("litematic/operations/diagnostics-export"),p=Uint8Array.from(atob(i.base64),z=>z.charCodeAt(0)),b=URL.createObjectURL(new Blob([p],{type:"application/json"})),S=document.createElement("a");S.href=b,S.download=i.filename,S.click(),window.setTimeout(()=>URL.revokeObjectURL(b),0)}catch(i){le.error(i instanceof Error?i.message:String(i))}}function w(i){if(i<1024)return`${i} B`;const p=["KiB","MiB","GiB","TiB"];let b=i/1024,S=p[0];for(let z=1;z<p.length&&b>=1024;z++)b/=1024,S=p[z];return`${b.toFixed(b>=10?1:2)} ${S}`}function $(i=0){return i>=1e3?`${(i/1e3).toFixed(1)} s`:`${i} ms`}function d(i){return i?new Date(i).toLocaleString("zh-CN",{hour12:false}):"-"}return we(()=>{v(),r=window.setInterval(()=>void v(),5e3)}),Ae(()=>window.clearInterval(r)),(i,p)=>{const b=V("el-button"),S=V("el-tooltip"),z=V("el-alert"),B=V("el-table-column"),Y=V("el-tag"),W=V("el-table"),R=V("k-empty"),H=V("el-progress"),X=V("el-tab-pane"),G=V("el-tabs"),D=V("k-content"),N=V("k-layout");return m(),A(N,{main:"litematic-operations"},{default:E(()=>[C(D,null,{default:E(()=>{var _e;return[y("header",_l,[y("div",null,[p[0]||(p[0]=y("h1",null,"Litematic Renderer",-1)),y("p",null,k(t.value?`渲染引擎:${t.value.engine}`:"正在读取状态"),1)]),y("div",El,[C(S,{content:"刷新",placement:"bottom"},{default:E(()=>[C(b,{circle:"",icon:u(vr),loading:n.value,onClick:v},null,8,["icon","loading"])]),_:1}),C(S,{content:"导出诊断",placement:"bottom"},{default:E(()=>[C(b,{circle:"",icon:u(sr),onClick:h},null,8,["icon"])]),_:1}),C(S,{content:"归档当前诊断",placement:"bottom"},{default:E(()=>[C(b,{circle:"",icon:u(lr),onClick:_},null,8,["icon"])]),_:1}),C(S,{content:"清理渲染缓存",placement:"bottom"},{default:E(()=>[C(b,{circle:"",type:"danger",plain:"",icon:u(rr),onClick:f},null,8,["icon"])]),_:1})])]),o.value?(m(),A(z,{key:0,title:o.value,type:"error","show-icon":"",closable:false},null,8,["title"])):L("v-if",true),t.value?(m(),x("div",Sl,[y("div",Cl,[p[1]||(p[1]=y("span",null,"完成任务",-1)),y("strong",null,k(t.value.metrics.completed),1),y("small",null,"失败 "+k(t.value.metrics.failed),1)]),y("div",xl,[p[2]||(p[2]=y("span",null,"缓存命中",-1)),y("strong",null,k(l.value),1),y("small",null,k(t.value.metrics.cacheHits)+" / "+k(t.value.metrics.completed),1)]),y("div",Tl,[p[3]||(p[3]=y("span",null,"平均耗时",-1)),y("strong",null,k($(t.value.metrics.averageDurationMs)),1),y("small",null,"最近 "+k($(t.value.metrics.lastDurationMs)),1)]),y("div",kl,[p[4]||(p[4]=y("span",null,"缓存占用",-1)),y("strong",null,k(w(t.value.cache.totalBytes)),1),y("small",null,k(t.value.cache.entryCount)+" 个条目",1)])])):L("v-if",true),t.value?(m(),x("section",Ml,[y("div",Il,[p[5]||(p[5]=y("h2",null,"最近渲染",-1)),y("span",null,k(t.value.history.length)+" / 20",1)]),t.value.history.length?(m(),A(W,{key:0,data:t.value.history,stripe:""},{default:E(()=>[C(B,{prop:"projectionName",label:"投影","min-width":"210"}),C(B,{prop:"engine",label:"引擎",width:"110"}),C(B,{label:"结果",width:"100"},{default:E(({row:T})=>[C(Y,{type:T.status==="completed"?"success":"danger",size:"small"},{default:E(()=>[j(k(T.status==="completed"?"完成":"失败"),1)]),_:2},1032,["type"])]),_:1}),C(B,{label:"耗时",width:"110"},{default:E(({row:T})=>[j(k($(T.durationMs)),1)]),_:1}),C(B,{label:"缓存",width:"100"},{default:E(({row:T})=>[j(k(T.cacheHit?"命中":"新生成"),1)]),_:1}),C(B,{label:"时间","min-width":"170"},{default:E(({row:T})=>[j(k(d(T.completedAt)),1)]),_:1})]),_:1},8,["data"])):(m(),A(R,{key:1},{default:E(()=>[...p[6]||(p[6]=[j("暂无渲染记录",-1)])]),_:1}))])):L("v-if",true),t.value?(m(),x("section",Al,[y("div",Bl,[p[7]||(p[7]=y("h2",null,"GPU Agent",-1)),t.value.gpu?(m(),x("span",Ll,k(s.value)+"/"+k(t.value.gpu.nodes.length)+" 在线 · "+k(t.value.gpu.queued)+" 排队 ",1)):(m(),x("span",Ol,"服务未启用"))]),(_e=t.value.gpu)!=null&&_e.nodes.length?(m(),A(W,{key:0,data:t.value.gpu.nodes,stripe:""},{default:E(()=>[C(B,{prop:"agentId",label:"节点","min-width":"150"}),C(B,{label:"状态",width:"105"},{default:E(({row:T})=>[C(Y,{type:T.online?T.busy?"warning":"success":"info",size:"small"},{default:E(()=>[j(k(T.online?T.busy?"忙碌":"空闲":"离线"),1)]),_:2},1032,["type"])]),_:1}),C(B,{label:"进度","min-width":"170"},{default:E(({row:T})=>[T.busy&&T.progress!=null?(m(),A(H,{key:0,percentage:Math.round(T.progress*100),"stroke-width":8},null,8,["percentage"])):(m(),x("span",$l,k(T.stage||"-"),1))]),_:1}),C(B,{label:"GPU / 版本","min-width":"230"},{default:E(({row:T})=>[j(k(T.capabilities.gpu||"-")+" ",1),T.capabilities.minecraftVersion?(m(),x("small",Pl," · MC "+k(T.capabilities.minecraftVersion),1)):L("v-if",true)]),_:1}),C(B,{label:"材质配置档","min-width":"150"},{default:E(({row:T})=>{var Ee;return[j(k(((Ee=T.capabilities.resourcePackProfiles)==null?void 0:Ee.join(", "))||"default"),1)]}),_:1}),C(B,{label:"最近心跳","min-width":"170"},{default:E(({row:T})=>[j(k(d(T.lastSeen)),1)]),_:1})]),_:1},8,["data"])):(m(),A(R,{key:1},{default:E(()=>[...p[8]||(p[8]=[j("没有已配置的 GPU 节点",-1)])]),_:1}))])):L("v-if",true),t.value?(m(),x("section",Nl,[y("div",Rl,[p[9]||(p[9]=y("h2",null,"渲染诊断",-1)),y("span",null,k(t.value.diagnostics.blockKinds)+" 类方块 · "+k(t.value.diagnostics.errorKinds)+" 类错误 ",1)]),C(G,null,{default:E(()=>[C(X,{label:"不支持的方块"},{default:E(()=>[t.value.diagnostics.topBlocks.length?(m(),A(W,{key:0,data:t.value.diagnostics.topBlocks},{default:E(()=>[C(B,{prop:"state",label:"方块状态","min-width":"260"}),C(B,{prop:"reason",label:"原因","min-width":"220"}),C(B,{prop:"count",label:"次数",width:"100"})]),_:1},8,["data"])):(m(),A(R,{key:1},{default:E(()=>[...p[10]||(p[10]=[j("暂无方块诊断",-1)])]),_:1}))]),_:1}),C(X,{label:"错误"},{default:E(()=>[t.value.diagnostics.recentErrors.length?(m(),A(W,{key:0,data:t.value.diagnostics.recentErrors},{default:E(()=>[C(B,{prop:"engine",label:"阶段",width:"130"}),C(B,{prop:"message",label:"错误","min-width":"340"}),C(B,{prop:"count",label:"次数",width:"100"}),C(B,{label:"时间","min-width":"170"},{default:E(({row:T})=>[j(k(d(T.generatedAt)),1)]),_:1})]),_:1},8,["data"])):(m(),A(R,{key:1},{default:E(()=>[...p[11]||(p[11]=[j("暂无渲染错误",-1)])]),_:1}))]),_:1})]),_:1})])):L("v-if",true)]}),_:1})]),_:1})}}}),zl=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Hl=zl(Fl,[["__scopeId","data-v-07ecf83e"]]);function Rn(){return new Promise(e=>requestAnimationFrame(()=>requestAnimationFrame(()=>e())))}function Vl(){return[...document.querySelectorAll(".k-schema-item")].filter(e=>{var t,n;return((n=(t=e.querySelector("h3"))==null?void 0:t.textContent)==null?void 0:n.trim())==="resourcePackPaths"})}function Dl(e){if(e.dataset.litematicResourcePacks==="ready")return;const t=e.querySelector(".k-schema-right");if(!t)return;e.dataset.litematicResourcePacks="ready";const n=document.createElement("div");n.className="litematic-resource-pack-toolbar";const o=Mt("上传材质包",true),r=Mt("上移"),a=Mt("下移"),s=document.createElement("input");s.type="file",s.accept=".zip,application/zip",s.hidden=true,n.append(o,r,a,s),t.prepend(n);let l=-1;const v=()=>[...e.querySelectorAll(".k-schema-table tr")].filter(h=>!!h.querySelector("td")),f=()=>{const h=v();l>=h.length&&(l=h.length-1),h.forEach((w,$)=>w.classList.toggle("litematic-selected",$===l)),r.disabled=l<=0,a.disabled=l<0||l>=h.length-1};e.addEventListener("click",h=>{const w=h.target.closest(".k-schema-table tr");!w||!w.querySelector("td")||(l=v().indexOf(w),f())});const _=async h=>{var d;const w=v();if(l<0||l+h<0||l+h>=w.length)return;(d=w[l].querySelectorAll("td.k-schema-table-button")[h<0?0:1])==null||d.click(),l+=h,await Rn(),f()};r.addEventListener("click",()=>void _(-1)),a.addEventListener("click",()=>void _(1)),o.addEventListener("click",()=>s.click()),s.addEventListener("change",async()=>{var w,$;const h=(w=s.files)==null?void 0:w[0];if(s.value="",!!h){if(!/\.zip$/i.test(h.name))return le.error("只允许上传 ZIP 材质包");if(h.size>256*1024*1024)return le.error("材质包超过 256 MB 上传上限");o.disabled=true,o.textContent="上传中...";try{const d=await Fn("litematic/resource-pack-upload",h.name,await Kl(h)),i=[...t.querySelectorAll("button")].find(z=>/添加(行|项目)/.test(z.textContent??""));if(!i)throw new Error("无法找到资源包列表的添加按钮");i.click(),await Rn();const p=e.querySelectorAll(".k-schema-table input"),b=p[p.length-1];if(!b)throw new Error("无法写入资源包路径");const S=($=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value"))==null?void 0:$.set;S==null||S.call(b,d),b.dispatchEvent(new Event("input",{bubbles:true})),b.dispatchEvent(new Event("change",{bubbles:true})),l=v().length-1,f(),le.success("材质包已上传并设为最高优先级,请保存配置")}catch(d){le.error(d instanceof Error?d.message:String(d))}finally{o.disabled=false,o.textContent="上传材质包"}}}),new MutationObserver(f).observe(e,{childList:true,subtree:true}),f()}function Mt(e,t=false){const n=document.createElement("button");return n.type="button",n.className=`el-button${t?" el-button--primary":""}`,n.textContent=e,n}function Kl(e){return new Promise((t,n)=>{const o=new FileReader;o.onerror=()=>n(o.error??new Error("读取文件失败")),o.onload=()=>t(String(o.result).split(",",2)[1]??""),o.readAsDataURL(e)})}function Io(){Vl().forEach(Dl)}new MutationObserver(Io).observe(document.body,{childList:true,subtree:true});Io();const ql=e=>{e.page({id:"litematic-renderer",path:"/litematic-renderer",name:"投影渲染",icon:"tools",authority:3,component:Hl})};export{ql as default};
|
package/lib/cache.d.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** 描述磁盘渲染缓存来源及失效依据的元数据 */
|
|
2
|
+
interface CacheMetadata {
|
|
3
|
+
/** 创建该条目的插件版本 */
|
|
4
|
+
pluginVersion: string;
|
|
5
|
+
/** 缓存格式修订号;结构或渲染算法变化时递增 */
|
|
6
|
+
cacheFormatVersion: number;
|
|
7
|
+
/** 原始上传文件的 SHA-256;多格式转换不会改变此身份 */
|
|
8
|
+
contentSha256: string;
|
|
9
|
+
/** 转换后实际发送给渲染器的 Litematic 摘要,旧缓存可省略 */
|
|
10
|
+
normalizedContentSha256?: string;
|
|
11
|
+
/** 有效渲染参数摘要,用于隔离同投影的不同配置 */
|
|
12
|
+
renderConfigSha256: string;
|
|
13
|
+
/** 原始上传文件名,用于展示和索引重建 */
|
|
14
|
+
sourceFilename: string;
|
|
15
|
+
/** 首次创建时间,格式为 ISO 8601 */
|
|
16
|
+
createdAt: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CacheStats {
|
|
19
|
+
/** 渲染目录与持久投影资料的总磁盘占用,单位字节 */
|
|
20
|
+
totalBytes: number;
|
|
21
|
+
/** 持久源投影占用,不参与渲染缓存容量及过期淘汰 */
|
|
22
|
+
sourceBytes?: number;
|
|
23
|
+
entryCount: number;
|
|
24
|
+
versionCount: number;
|
|
25
|
+
latestUsedAt?: string;
|
|
26
|
+
}
|
|
27
|
+
/** 将缓存统计转换为稳定、便于命令行和日志阅读的文本。 */
|
|
28
|
+
export declare function formatCacheStats(stats: CacheStats): string;
|
|
29
|
+
/**
|
|
30
|
+
* 为影响渲染结果的配置生成稳定的短哈希
|
|
31
|
+
*
|
|
32
|
+
* @param configuration - 可被 JSON 序列化的渲染配置
|
|
33
|
+
* @returns SHA-256 摘要的前 16 个十六进制字符
|
|
34
|
+
*/
|
|
35
|
+
export declare function hashRenderConfiguration(configuration: unknown): string;
|
|
36
|
+
/**
|
|
37
|
+
* 将任意文本转换为可安全用作缓存目录名的片段
|
|
38
|
+
*
|
|
39
|
+
* @param value - 原始目录名片段
|
|
40
|
+
* @returns 仅包含安全字符的目录名片段
|
|
41
|
+
*/
|
|
42
|
+
export declare function cachePathSegment(value: string): string;
|
|
43
|
+
/**
|
|
44
|
+
* 从投影文件名生成跨平台安全的缓存名称片段
|
|
45
|
+
*
|
|
46
|
+
* @param filename - 原始投影文件名或路径
|
|
47
|
+
* @returns 移除扩展名和非法字符后、最长 80 个字符的名称
|
|
48
|
+
*/
|
|
49
|
+
export declare function cacheNameSegment(filename: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* 从文件名提取用于消息展示的投影名称
|
|
52
|
+
*
|
|
53
|
+
* @param filename - 原始投影文件名或路径
|
|
54
|
+
* @returns 去除受支持投影扩展名后的投影名称
|
|
55
|
+
*/
|
|
56
|
+
export declare function projectionNameFromFilename(filename: string): string;
|
|
57
|
+
/**
|
|
58
|
+
* 在缓存条目尚无元数据时写入 `cache.json`
|
|
59
|
+
*
|
|
60
|
+
* @param directory - 缓存条目目录
|
|
61
|
+
* @param metadata - 要持久化的缓存元数据
|
|
62
|
+
* @returns 写入完成后解决的 Promise
|
|
63
|
+
* @throws 无法访问或写入元数据文件时抛出文件系统错误
|
|
64
|
+
*/
|
|
65
|
+
export declare function ensureCacheMetadata(directory: string, metadata: CacheMetadata): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* 更新缓存目录的访问时间,供最近最少使用清理策略排序
|
|
68
|
+
*
|
|
69
|
+
* @param directory - 要更新的缓存目录
|
|
70
|
+
* @returns 文件时间更新尝试完成后解决的 Promise
|
|
71
|
+
*/
|
|
72
|
+
export declare function touchCacheEntry(directory: string): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* 按最近最少使用顺序删除缓存条目,直至容量不超过限制
|
|
75
|
+
*
|
|
76
|
+
* @param cacheDirectory - 包含版本子目录的缓存根目录
|
|
77
|
+
* @param maxBytes - 允许保留的最大总字节数
|
|
78
|
+
* @param protectedDirectory - 本轮清理中不得删除的缓存条目
|
|
79
|
+
* @returns 清理后的总字节数、删除字节数和删除条目数
|
|
80
|
+
* @throws 无法读取或删除缓存内容时抛出文件系统错误
|
|
81
|
+
*/
|
|
82
|
+
export declare function enforceCacheLimit(cacheDirectory: string, maxBytes: number, protectedDirectory?: string): Promise<{
|
|
83
|
+
totalBytes: number;
|
|
84
|
+
removedBytes: number;
|
|
85
|
+
removedEntries: number;
|
|
86
|
+
}>;
|
|
87
|
+
/** 删除超过保留时长的缓存条目,同时保留当前正在使用的条目。 */
|
|
88
|
+
export declare function enforceCacheAge(cacheDirectory: string, maxAgeMs: number, protectedDirectory?: string, now?: number): Promise<{
|
|
89
|
+
removedBytes: number;
|
|
90
|
+
removedEntries: number;
|
|
91
|
+
}>;
|
|
92
|
+
/** 汇总所有版本缓存的条目数、磁盘占用和最近使用时间。 */
|
|
93
|
+
export declare function getCacheStats(cacheDirectory: string): Promise<CacheStats>;
|
|
94
|
+
export {};
|
package/lib/cache.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.formatCacheStats=formatCacheStats,exports.hashRenderConfiguration=hashRenderConfiguration,exports.cachePathSegment=cachePathSegment,exports.cacheNameSegment=cacheNameSegment,exports.projectionNameFromFilename=projectionNameFromFilename,exports.ensureCacheMetadata=ensureCacheMetadata,exports.touchCacheEntry=touchCacheEntry,exports.enforceCacheLimit=enforceCacheLimit,exports.enforceCacheAge=enforceCacheAge,exports.getCacheStats=getCacheStats;const node_crypto_1=require("node:crypto"),node_fs_1=require("node:fs"),node_path_1=require("node:path");function formatCacheStats(e){const t=(e.totalBytes/1048576).toFixed(2);return`缓存:${e.entryCount} 个条目,${e.versionCount} 个版本,占用 ${t} MiB${e.latestUsedAt?`,最近使用 ${e.latestUsedAt}`:""}`}function hashRenderConfiguration(e){return(0,node_crypto_1.createHash)("sha256").update(JSON.stringify(e)).digest("hex").slice(0,16)}function cachePathSegment(e){return e.replace(/[^a-zA-Z0-9._-]/g,"_")||"unknown"}function cacheNameSegment(e){return((0,node_path_1.basename)(e||"schematic.litematic",(0,node_path_1.extname)(e||"")).replace(/[<>:"/\\|?*\u0000-\u001f]/g,"_").replace(/[. ]+$/g,"").trim()||"schematic").slice(0,80)}function projectionNameFromFilename(e){return(0,node_path_1.basename)(e||"schematic.litematic").replace(/\.(?:litematic|schem|nbt)$/i,"").trim()||"schematic"}async function ensureCacheMetadata(e,t){const o=(0,node_path_1.join)(e,"cache.json");await exists(o)||await node_fs_1.promises.writeFile(o,JSON.stringify(t,null,2)+"\n")}async function touchCacheEntry(e){const t=new Date;await node_fs_1.promises.utimes(e,t,t).catch(()=>{})}async function directorySize(e){let t=0;const o=await node_fs_1.promises.readdir(e,{withFileTypes:!0}).catch(e=>{if("ENOENT"===e?.code)return[];throw e});for(const n of o){const o=(0,node_path_1.join)(e,n.name);n.isDirectory()?t+=await directorySize(o):n.isFile()&&(t+=(await node_fs_1.promises.stat(o)).size)}return t}async function enforceCacheLimit(e,t,o){const n=[],i=await node_fs_1.promises.readdir(e,{withFileTypes:!0}).catch(e=>{if("ENOENT"===e?.code)return[];throw e});for(const t of i){if(!t.isDirectory()||".projection-library"===t.name)continue;const o=(0,node_path_1.join)(e,t.name),i=await node_fs_1.promises.readdir(o,{withFileTypes:!0});for(const e of i){if(!e.isDirectory())continue;const t=(0,node_path_1.join)(o,e.name),[i,r]=await Promise.all([directorySize(t),node_fs_1.promises.stat(t)]);n.push({path:t,size:i,lastUsed:r.mtimeMs})}}let r=n.reduce((e,t)=>e+t.size,0),a=0,s=0;const c=o&&(0,node_path_1.resolve)(o);n.sort((e,t)=>e.lastUsed-t.lastUsed);for(const e of n){if(r<=t)break;c&&(0,node_path_1.resolve)(e.path)===c||(await node_fs_1.promises.rm(e.path,{recursive:!0,force:!0}),r-=e.size,a+=e.size,s++)}return{totalBytes:r,removedBytes:a,removedEntries:s}}async function enforceCacheAge(e,t,o,n=Date.now()){if(!Number.isFinite(t)||t<=0)return{removedBytes:0,removedEntries:0};const i=o&&(0,node_path_1.resolve)(o);let r=0,a=0;const s=await node_fs_1.promises.readdir(e,{withFileTypes:!0}).catch(e=>{if("ENOENT"===e?.code)return[];throw e});for(const o of s){if(!o.isDirectory()||".projection-library"===o.name)continue;const s=(0,node_path_1.join)(e,o.name),c=await node_fs_1.promises.readdir(s,{withFileTypes:!0});for(const e of c){if(!e.isDirectory())continue;const o=(0,node_path_1.join)(s,e.name);if(i&&(0,node_path_1.resolve)(o)===i)continue;if(n-(await node_fs_1.promises.stat(o)).mtimeMs<=t)continue;const c=await directorySize(o);await node_fs_1.promises.rm(o,{recursive:!0,force:!0}),r+=c,a++}}return{removedBytes:r,removedEntries:a}}async function getCacheStats(e){let t=0,o=0,n=0,i=0;const r=await node_fs_1.promises.readdir(e,{withFileTypes:!0}).catch(e=>{if("ENOENT"===e?.code)return[];throw e});for(const a of r){if(!a.isDirectory()||".projection-library"===a.name)continue;n++;const r=(0,node_path_1.join)(e,a.name),s=await node_fs_1.promises.readdir(r,{withFileTypes:!0});for(const e of s){if(!e.isDirectory())continue;o++;const n=(0,node_path_1.join)(r,e.name),[a,s]=await Promise.all([directorySize(n),node_fs_1.promises.stat(n)]);t+=a,i=Math.max(i,s.mtimeMs)}}const a=await directorySize((0,node_path_1.join)(e,".projection-library"));return{totalBytes:t+a,...a?{sourceBytes:a}:{},entryCount:o,versionCount:n,latestUsedAt:i?new Date(i).toISOString():void 0}}async function exists(e){return node_fs_1.promises.access(e).then(()=>!0).catch(()=>!1)}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type Release = () => void;
|
|
2
|
+
/** 限制本地渲染并发数,超出的请求按 FIFO 顺序等待。 */
|
|
3
|
+
export declare class RenderConcurrencyLimiter {
|
|
4
|
+
private readonly limit;
|
|
5
|
+
private active;
|
|
6
|
+
private readonly queue;
|
|
7
|
+
constructor(limit: number);
|
|
8
|
+
get activeCount(): number;
|
|
9
|
+
get queuedCount(): number;
|
|
10
|
+
acquire(): Promise<Release>;
|
|
11
|
+
private release;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RenderConcurrencyLimiter=void 0;class RenderConcurrencyLimiter{limit;active=0;queue=[];constructor(e){this.limit=e}get activeCount(){return this.active}get queuedCount(){return this.queue.length}acquire(){return!this.limit||this.limit<1||this.active<this.limit?(this.active++,Promise.resolve(()=>this.release())):new Promise(e=>this.queue.push(e))}release(){const e=this.queue.shift();e?e(()=>this.release()):this.active=Math.max(0,this.active-1)}}exports.RenderConcurrencyLimiter=RenderConcurrencyLimiter;
|