@wangmingfa/model-gate 0.0.1-beta.1
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/LICENSE +21 -0
- package/README.md +376 -0
- package/config.example.json +36 -0
- package/model-gate.js +2585 -0
- package/package.json +56 -0
package/model-gate.js
ADDED
|
@@ -0,0 +1,2585 @@
|
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
|
+
// @bun
|
|
3
|
+
|
|
4
|
+
// src/index.ts
|
|
5
|
+
import { statSync } from "fs";
|
|
6
|
+
import { networkInterfaces } from "os";
|
|
7
|
+
|
|
8
|
+
// src/config.ts
|
|
9
|
+
import { readFileSync } from "fs";
|
|
10
|
+
|
|
11
|
+
class ConfigError extends Error {
|
|
12
|
+
}
|
|
13
|
+
var ENV_PATTERN = /^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$/;
|
|
14
|
+
function interpolateEnv(value) {
|
|
15
|
+
if (typeof value !== "string" || value.length === 0) {
|
|
16
|
+
throw new ConfigError("api_key \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32");
|
|
17
|
+
}
|
|
18
|
+
const m = ENV_PATTERN.exec(value);
|
|
19
|
+
if (!m)
|
|
20
|
+
return value;
|
|
21
|
+
const env = process.env[m[1]];
|
|
22
|
+
if (env === undefined || env.length === 0) {
|
|
23
|
+
throw new ConfigError(`\u73AF\u5883\u53D8\u91CF ${m[1]} \u672A\u8BBE\u7F6E\uFF08api_key \u5F15\u7528\u4E86\u5B83\uFF09`);
|
|
24
|
+
}
|
|
25
|
+
return env;
|
|
26
|
+
}
|
|
27
|
+
function isPlainObject(v) {
|
|
28
|
+
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
29
|
+
}
|
|
30
|
+
function loadConfig(path, mode = "boot") {
|
|
31
|
+
let text;
|
|
32
|
+
try {
|
|
33
|
+
text = readFileSync(path, "utf-8");
|
|
34
|
+
} catch (e) {
|
|
35
|
+
throw new ConfigError(`\u65E0\u6CD5\u8BFB\u53D6\u914D\u7F6E\u6587\u4EF6 ${path}: ${e.message}`);
|
|
36
|
+
}
|
|
37
|
+
let raw;
|
|
38
|
+
try {
|
|
39
|
+
raw = JSON.parse(text);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
throw new ConfigError(`\u914D\u7F6E\u6587\u4EF6 ${path} \u4E0D\u662F\u5408\u6CD5 JSON: ${e.message}`);
|
|
42
|
+
}
|
|
43
|
+
return validateConfig(raw, path, mode);
|
|
44
|
+
}
|
|
45
|
+
function validateConfig(raw, path = "<config>", mode = "strict") {
|
|
46
|
+
const fail = (msg) => {
|
|
47
|
+
throw new ConfigError(`\u914D\u7F6E\u9519\u8BEF ${path}: ${msg}`);
|
|
48
|
+
};
|
|
49
|
+
if (!isPlainObject(raw))
|
|
50
|
+
fail("\u5FC5\u987B\u662F JSON \u5BF9\u8C61");
|
|
51
|
+
const r = raw;
|
|
52
|
+
const port = typeof r.port === "number" ? r.port : 8787;
|
|
53
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535)
|
|
54
|
+
fail("port \u5FC5\u987B\u662F 1-65535 \u7684\u6574\u6570");
|
|
55
|
+
const host = typeof r.host === "string" ? r.host : "127.0.0.1";
|
|
56
|
+
if (host.length === 0)
|
|
57
|
+
fail("host \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32");
|
|
58
|
+
const timeout_seconds = typeof r.timeout_seconds === "number" ? r.timeout_seconds : 60;
|
|
59
|
+
if (!Number.isFinite(timeout_seconds) || timeout_seconds <= 0) {
|
|
60
|
+
fail("timeout_seconds \u5FC5\u987B\u662F\u5927\u4E8E 0 \u7684\u6570\u5B57");
|
|
61
|
+
}
|
|
62
|
+
const access_log = r.access_log !== false;
|
|
63
|
+
const keysRaw = Array.isArray(r.keys) ? r.keys : [];
|
|
64
|
+
const keys = [];
|
|
65
|
+
for (const item of keysRaw) {
|
|
66
|
+
if (typeof item !== "object" || item === null)
|
|
67
|
+
fail("keys \u7684\u6BCF\u4E00\u9879\u5FC5\u987B\u662F\u5BF9\u8C61 { name, key, created_at }");
|
|
68
|
+
const k = item;
|
|
69
|
+
if (typeof k.name !== "string" || k.name.length === 0)
|
|
70
|
+
fail("keys \u6BCF\u4E00\u9879\u7684 name \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32");
|
|
71
|
+
if (typeof k.key !== "string" || k.key.length === 0)
|
|
72
|
+
fail(`keys \u6BCF\u4E00\u9879\u7684 key \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\uFF08${k.name}\uFF09`);
|
|
73
|
+
if (typeof k.created_at !== "string" || !Number.isFinite(Date.parse(k.created_at))) {
|
|
74
|
+
fail(`keys \u6BCF\u4E00\u9879\u7684 created_at \u5FC5\u987B\u662F\u5408\u6CD5 ISO \u65F6\u95F4\uFF08${k.name}\uFF09`);
|
|
75
|
+
}
|
|
76
|
+
const name = k.name;
|
|
77
|
+
const key = k.key;
|
|
78
|
+
const created_at = k.created_at;
|
|
79
|
+
keys.push({ name, key, created_at });
|
|
80
|
+
}
|
|
81
|
+
const names = new Set(keys.map((k) => k.name));
|
|
82
|
+
if (names.size !== keys.length)
|
|
83
|
+
fail("keys \u7684\u540D\u79F0\u4E0D\u5141\u8BB8\u91CD\u590D");
|
|
84
|
+
const values = new Set(keys.map((k) => k.key));
|
|
85
|
+
if (values.size !== keys.length)
|
|
86
|
+
fail("keys \u7684\u5BC6\u94A5\u503C\u4E0D\u5141\u8BB8\u91CD\u590D");
|
|
87
|
+
const providersRaw = r.providers;
|
|
88
|
+
if (!isPlainObject(providersRaw))
|
|
89
|
+
fail("providers \u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
90
|
+
const providers = {};
|
|
91
|
+
for (const [name, pRaw] of Object.entries(providersRaw)) {
|
|
92
|
+
if (!isPlainObject(pRaw))
|
|
93
|
+
fail(`providers.${name} \u5FC5\u987B\u662F\u5BF9\u8C61`);
|
|
94
|
+
const p = pRaw;
|
|
95
|
+
const base_urlRaw = p.base_url;
|
|
96
|
+
if (typeof base_urlRaw !== "string" || !/^https?:\/\/[^/\s]+/.test(base_urlRaw)) {
|
|
97
|
+
fail(`providers.${name}.base_url \u5FC5\u987B\u662F http(s) URL`);
|
|
98
|
+
}
|
|
99
|
+
const base_url = base_urlRaw;
|
|
100
|
+
const apiKeyRaw = typeof p.api_key === "string" ? p.api_key : "";
|
|
101
|
+
const api_key = (() => {
|
|
102
|
+
try {
|
|
103
|
+
return interpolateEnv(apiKeyRaw);
|
|
104
|
+
} catch (e) {
|
|
105
|
+
return fail(`providers.${name}.api_key: ${e.message}`);
|
|
106
|
+
}
|
|
107
|
+
})();
|
|
108
|
+
const modelsRaw = p.models;
|
|
109
|
+
if (!Array.isArray(modelsRaw) || modelsRaw.length === 0 || !modelsRaw.every((m) => typeof m === "string" && m.length > 0)) {
|
|
110
|
+
fail(`providers.${name}.models \u5FC5\u987B\u662F\u975E\u7A7A\u5B57\u7B26\u4E32\u6570\u7EC4`);
|
|
111
|
+
}
|
|
112
|
+
providers[name] = {
|
|
113
|
+
base_url: base_url.replace(/\/+$/, ""),
|
|
114
|
+
api_key,
|
|
115
|
+
api_key_raw: apiKeyRaw,
|
|
116
|
+
models: modelsRaw
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
const aliasesRaw = r.aliases;
|
|
120
|
+
if (!isPlainObject(aliasesRaw))
|
|
121
|
+
fail("aliases \u5FC5\u987B\u662F\u5BF9\u8C61");
|
|
122
|
+
const aliases = {};
|
|
123
|
+
for (const [name, targetsRaw] of Object.entries(aliasesRaw)) {
|
|
124
|
+
if (!Array.isArray(targetsRaw) || targetsRaw.length === 0 || !targetsRaw.every((t) => typeof t === "string")) {
|
|
125
|
+
fail(`aliases.${name} \u5FC5\u987B\u662F\u975E\u7A7A "provider:model" \u5B57\u7B26\u4E32\u6570\u7EC4`);
|
|
126
|
+
}
|
|
127
|
+
const targets = targetsRaw;
|
|
128
|
+
for (const t of targets) {
|
|
129
|
+
const sep = t.indexOf(":");
|
|
130
|
+
if (sep <= 0 || sep === t.length - 1) {
|
|
131
|
+
fail(`aliases.${name} \u4E2D "${t}" \u5FC5\u987B\u662F "provider:model" \u5F62\u5F0F`);
|
|
132
|
+
}
|
|
133
|
+
const provName = t.slice(0, sep);
|
|
134
|
+
const modelName = t.slice(sep + 1);
|
|
135
|
+
}
|
|
136
|
+
aliases[name] = targets;
|
|
137
|
+
}
|
|
138
|
+
const default_model = typeof r.default_model === "string" ? r.default_model : Object.keys(aliases)[0] ?? "";
|
|
139
|
+
let admin_password = "";
|
|
140
|
+
const adminPasswordRaw = r.admin_password;
|
|
141
|
+
if (adminPasswordRaw !== undefined) {
|
|
142
|
+
if (typeof adminPasswordRaw !== "string")
|
|
143
|
+
fail("admin_password \u5FC5\u987B\u662F\u5B57\u7B26\u4E32");
|
|
144
|
+
const pwd = adminPasswordRaw;
|
|
145
|
+
if (pwd.length > 0) {
|
|
146
|
+
try {
|
|
147
|
+
admin_password = interpolateEnv(pwd);
|
|
148
|
+
} catch (e) {
|
|
149
|
+
fail(`admin_password: ${e.message}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return { port, host, default_model, timeout_seconds, access_log, keys, admin_password, providers, aliases };
|
|
154
|
+
}
|
|
155
|
+
function checkConfig(cfg) {
|
|
156
|
+
const issues = [];
|
|
157
|
+
for (const [aliasName, targets] of Object.entries(cfg.aliases)) {
|
|
158
|
+
for (const t of targets) {
|
|
159
|
+
const sep = t.indexOf(":");
|
|
160
|
+
const provName = t.slice(0, sep);
|
|
161
|
+
const modelName = t.slice(sep + 1);
|
|
162
|
+
const prov = cfg.providers[provName];
|
|
163
|
+
if (!prov) {
|
|
164
|
+
issues.push({
|
|
165
|
+
level: "error",
|
|
166
|
+
message: `\u522B\u540D\u300C${aliasName}\u300D\u5F15\u7528\u4E86\u4E0D\u5B58\u5728\u7684 provider\u300C${provName}\u300D\uFF08${t}\uFF09`,
|
|
167
|
+
target: `alias:${aliasName}`
|
|
168
|
+
});
|
|
169
|
+
} else if (!prov.models.includes(modelName)) {
|
|
170
|
+
issues.push({
|
|
171
|
+
level: "error",
|
|
172
|
+
message: `\u522B\u540D\u300C${aliasName}\u300D\u5F15\u7528\u7684\u6A21\u578B\u300C${modelName}\u300D\u4E0D\u5728 provider\u300C${provName}\u300D\u7684 models \u5217\u8868\u4E2D\uFF08${t}\uFF09`,
|
|
173
|
+
target: `alias:${aliasName}`
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (cfg.default_model && !cfg.aliases[cfg.default_model]) {
|
|
179
|
+
issues.push({
|
|
180
|
+
level: "error",
|
|
181
|
+
message: `default_model\u300C${cfg.default_model}\u300D\u4E0D\u662F\u5DF2\u5B9A\u4E49\u7684\u522B\u540D`,
|
|
182
|
+
target: "default_model"
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
if (cfg.keys.length === 0) {
|
|
186
|
+
issues.push({
|
|
187
|
+
level: "warning",
|
|
188
|
+
message: "\u5C1A\u672A\u914D\u7F6E\u4EFB\u4F55\u4E0B\u6E38\u5BC6\u94A5\uFF08keys \u4E3A\u7A7A\uFF09\uFF0C/v1/* \u63A5\u53E3\u5C06\u8FD4\u56DE 503 \u5F15\u5BFC\u53BB /admin \u914D\u7F6E",
|
|
189
|
+
target: "keys"
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
if (Object.keys(cfg.providers).length === 0) {
|
|
193
|
+
issues.push({ level: "warning", message: "\u5C1A\u672A\u914D\u7F6E\u4EFB\u4F55\u4E0A\u6E38 provider", target: "providers" });
|
|
194
|
+
}
|
|
195
|
+
if (Object.keys(cfg.aliases).length === 0) {
|
|
196
|
+
issues.push({ level: "warning", message: "\u5C1A\u672A\u5B9A\u4E49\u4EFB\u4F55\u522B\u540D\uFF08aliases \u4E3A\u7A7A\uFF09\uFF0Cagent \u65E0\u6CD5\u901A\u8FC7 /v1/models \u83B7\u53D6\u53EF\u7528\u6A21\u578B", target: "aliases" });
|
|
197
|
+
}
|
|
198
|
+
return issues;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// node_modules/hono/dist/compose.js
|
|
202
|
+
var compose = (middleware, onError, onNotFound) => {
|
|
203
|
+
return (context, next) => {
|
|
204
|
+
let index = -1;
|
|
205
|
+
return dispatch(0);
|
|
206
|
+
async function dispatch(i) {
|
|
207
|
+
if (i <= index) {
|
|
208
|
+
throw new Error("next() called multiple times");
|
|
209
|
+
}
|
|
210
|
+
index = i;
|
|
211
|
+
let res;
|
|
212
|
+
let isError = false;
|
|
213
|
+
let handler;
|
|
214
|
+
if (middleware[i]) {
|
|
215
|
+
handler = middleware[i][0][0];
|
|
216
|
+
context.req.routeIndex = i;
|
|
217
|
+
} else {
|
|
218
|
+
handler = i === middleware.length && next || undefined;
|
|
219
|
+
}
|
|
220
|
+
if (handler) {
|
|
221
|
+
try {
|
|
222
|
+
res = await handler(context, () => dispatch(i + 1));
|
|
223
|
+
} catch (err) {
|
|
224
|
+
if (err instanceof Error && onError) {
|
|
225
|
+
context.error = err;
|
|
226
|
+
res = await onError(err, context);
|
|
227
|
+
isError = true;
|
|
228
|
+
} else {
|
|
229
|
+
throw err;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
} else {
|
|
233
|
+
if (context.finalized === false && onNotFound) {
|
|
234
|
+
res = await onNotFound(context);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (res && (context.finalized === false || isError)) {
|
|
238
|
+
context.res = res;
|
|
239
|
+
}
|
|
240
|
+
return context;
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// node_modules/hono/dist/request/constants.js
|
|
246
|
+
var GET_MATCH_RESULT = /* @__PURE__ */ Symbol();
|
|
247
|
+
|
|
248
|
+
// node_modules/hono/dist/utils/buffer.js
|
|
249
|
+
var bufferToFormData = (arrayBuffer, contentType) => {
|
|
250
|
+
const response = new Response(arrayBuffer, {
|
|
251
|
+
headers: {
|
|
252
|
+
"Content-Type": contentType.replace(/^[^;]+/, (mediaType) => mediaType.toLowerCase())
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
return response.formData();
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
// node_modules/hono/dist/utils/body.js
|
|
259
|
+
var isRawRequest = (request) => ("headers" in request);
|
|
260
|
+
var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
|
|
261
|
+
const { all = false, dot = false } = options;
|
|
262
|
+
const headers = isRawRequest(request) ? request.headers : request.raw.headers;
|
|
263
|
+
const contentType = headers.get("Content-Type");
|
|
264
|
+
const mediaType = contentType?.split(";")[0].trim().toLowerCase();
|
|
265
|
+
if (mediaType === "multipart/form-data" || mediaType === "application/x-www-form-urlencoded") {
|
|
266
|
+
return parseFormData(request, { all, dot });
|
|
267
|
+
}
|
|
268
|
+
return {};
|
|
269
|
+
};
|
|
270
|
+
async function parseFormData(request, options) {
|
|
271
|
+
if (!isRawRequest(request) && request.bodyCache.formData) {
|
|
272
|
+
return convertFormDataToBodyData(await request.bodyCache.formData, options);
|
|
273
|
+
}
|
|
274
|
+
const headers = isRawRequest(request) ? request.headers : request.raw.headers;
|
|
275
|
+
const arrayBuffer = await request.arrayBuffer();
|
|
276
|
+
const formDataPromise = bufferToFormData(arrayBuffer, headers.get("Content-Type") || "");
|
|
277
|
+
if (!isRawRequest(request)) {
|
|
278
|
+
request.bodyCache.formData = formDataPromise;
|
|
279
|
+
}
|
|
280
|
+
const formData = await formDataPromise;
|
|
281
|
+
if (formData) {
|
|
282
|
+
return convertFormDataToBodyData(formData, options);
|
|
283
|
+
}
|
|
284
|
+
return {};
|
|
285
|
+
}
|
|
286
|
+
function convertFormDataToBodyData(formData, options) {
|
|
287
|
+
const form = /* @__PURE__ */ Object.create(null);
|
|
288
|
+
formData.forEach((value, key) => {
|
|
289
|
+
const shouldParseAllValues = options.all || key.endsWith("[]");
|
|
290
|
+
if (!shouldParseAllValues) {
|
|
291
|
+
form[key] = value;
|
|
292
|
+
} else {
|
|
293
|
+
handleParsingAllValues(form, key, value);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
if (options.dot) {
|
|
297
|
+
Object.entries(form).forEach(([key, value]) => {
|
|
298
|
+
const shouldParseDotValues = key.includes(".");
|
|
299
|
+
if (shouldParseDotValues) {
|
|
300
|
+
handleParsingNestedValues(form, key, value);
|
|
301
|
+
delete form[key];
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
return form;
|
|
306
|
+
}
|
|
307
|
+
var handleParsingAllValues = (form, key, value) => {
|
|
308
|
+
if (form[key] !== undefined) {
|
|
309
|
+
if (Array.isArray(form[key])) {
|
|
310
|
+
form[key].push(value);
|
|
311
|
+
} else {
|
|
312
|
+
form[key] = [form[key], value];
|
|
313
|
+
}
|
|
314
|
+
} else {
|
|
315
|
+
if (!key.endsWith("[]")) {
|
|
316
|
+
form[key] = value;
|
|
317
|
+
} else {
|
|
318
|
+
form[key] = [value];
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
var handleParsingNestedValues = (form, key, value) => {
|
|
323
|
+
if (/(?:^|\.)__proto__\./.test(key)) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
let nestedForm = form;
|
|
327
|
+
const keys = key.split(".");
|
|
328
|
+
keys.forEach((key2, index) => {
|
|
329
|
+
if (index === keys.length - 1) {
|
|
330
|
+
nestedForm[key2] = value;
|
|
331
|
+
} else {
|
|
332
|
+
if (!nestedForm[key2] || typeof nestedForm[key2] !== "object" || Array.isArray(nestedForm[key2]) || nestedForm[key2] instanceof File) {
|
|
333
|
+
nestedForm[key2] = /* @__PURE__ */ Object.create(null);
|
|
334
|
+
}
|
|
335
|
+
nestedForm = nestedForm[key2];
|
|
336
|
+
}
|
|
337
|
+
});
|
|
338
|
+
};
|
|
339
|
+
|
|
340
|
+
// node_modules/hono/dist/utils/url.js
|
|
341
|
+
var splitPath = (path) => {
|
|
342
|
+
const paths = path.split("/");
|
|
343
|
+
if (paths[0] === "") {
|
|
344
|
+
paths.shift();
|
|
345
|
+
}
|
|
346
|
+
return paths;
|
|
347
|
+
};
|
|
348
|
+
var splitRoutingPath = (routePath) => {
|
|
349
|
+
const { groups, path } = extractGroupsFromPath(routePath);
|
|
350
|
+
const paths = splitPath(path);
|
|
351
|
+
return replaceGroupMarks(paths, groups);
|
|
352
|
+
};
|
|
353
|
+
var extractGroupsFromPath = (path) => {
|
|
354
|
+
const groups = [];
|
|
355
|
+
path = path.replace(/\{[^}]+\}/g, (match, index) => {
|
|
356
|
+
const mark = `@${index}`;
|
|
357
|
+
groups.push([mark, match]);
|
|
358
|
+
return mark;
|
|
359
|
+
});
|
|
360
|
+
return { groups, path };
|
|
361
|
+
};
|
|
362
|
+
var replaceGroupMarks = (paths, groups) => {
|
|
363
|
+
for (let i = groups.length - 1;i >= 0; i--) {
|
|
364
|
+
const [mark] = groups[i];
|
|
365
|
+
for (let j = paths.length - 1;j >= 0; j--) {
|
|
366
|
+
if (paths[j].includes(mark)) {
|
|
367
|
+
paths[j] = paths[j].replace(mark, groups[i][1]);
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return paths;
|
|
373
|
+
};
|
|
374
|
+
var patternCache = {};
|
|
375
|
+
var getPattern = (label, next) => {
|
|
376
|
+
if (label === "*") {
|
|
377
|
+
return "*";
|
|
378
|
+
}
|
|
379
|
+
const match = label.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
|
|
380
|
+
if (match) {
|
|
381
|
+
const cacheKey = `${label}#${next}`;
|
|
382
|
+
if (!patternCache[cacheKey]) {
|
|
383
|
+
if (match[2]) {
|
|
384
|
+
patternCache[cacheKey] = next && next[0] !== ":" && next[0] !== "*" ? [cacheKey, match[1], new RegExp(`^${match[2]}(?=/${next})`)] : [label, match[1], new RegExp(`^${match[2]}$`)];
|
|
385
|
+
} else {
|
|
386
|
+
patternCache[cacheKey] = [label, match[1], true];
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
return patternCache[cacheKey];
|
|
390
|
+
}
|
|
391
|
+
return null;
|
|
392
|
+
};
|
|
393
|
+
var tryDecode = (str, decoder) => {
|
|
394
|
+
try {
|
|
395
|
+
return decoder(str);
|
|
396
|
+
} catch {
|
|
397
|
+
return str.replace(/(?:%[0-9A-Fa-f]{2})+/g, (match) => {
|
|
398
|
+
try {
|
|
399
|
+
return decoder(match);
|
|
400
|
+
} catch {
|
|
401
|
+
return match;
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
var tryDecodeURI = (str) => tryDecode(str, decodeURI);
|
|
407
|
+
var getPath = (request) => {
|
|
408
|
+
const url = request.url;
|
|
409
|
+
const start = url.indexOf("/", url.indexOf(":") + 4);
|
|
410
|
+
let i = start;
|
|
411
|
+
for (;i < url.length; i++) {
|
|
412
|
+
const charCode = url.charCodeAt(i);
|
|
413
|
+
if (charCode === 37) {
|
|
414
|
+
const queryIndex = url.indexOf("?", i);
|
|
415
|
+
const hashIndex = url.indexOf("#", i);
|
|
416
|
+
const end = queryIndex === -1 ? hashIndex === -1 ? undefined : hashIndex : hashIndex === -1 ? queryIndex : Math.min(queryIndex, hashIndex);
|
|
417
|
+
const path = url.slice(start, end);
|
|
418
|
+
return tryDecodeURI(path.includes("%25") ? path.replace(/%25/g, "%2525") : path);
|
|
419
|
+
} else if (charCode === 63 || charCode === 35) {
|
|
420
|
+
break;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
return url.slice(start, i);
|
|
424
|
+
};
|
|
425
|
+
var getPathNoStrict = (request) => {
|
|
426
|
+
const result = getPath(request);
|
|
427
|
+
return result.length > 1 && result.at(-1) === "/" ? result.slice(0, -1) : result;
|
|
428
|
+
};
|
|
429
|
+
var mergePath = (base, sub, ...rest) => {
|
|
430
|
+
if (rest.length) {
|
|
431
|
+
sub = mergePath(sub, ...rest);
|
|
432
|
+
}
|
|
433
|
+
return `${base?.[0] === "/" ? "" : "/"}${base}${sub === "/" ? "" : `${base?.at(-1) === "/" ? "" : "/"}${sub?.[0] === "/" ? sub.slice(1) : sub}`}`;
|
|
434
|
+
};
|
|
435
|
+
var checkOptionalParameter = (path) => {
|
|
436
|
+
if (path.charCodeAt(path.length - 1) !== 63 || !path.includes(":")) {
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
const segments = path.split("/");
|
|
440
|
+
const results = [];
|
|
441
|
+
let basePath = "";
|
|
442
|
+
segments.forEach((segment) => {
|
|
443
|
+
if (segment !== "" && !/\:/.test(segment)) {
|
|
444
|
+
basePath += "/" + segment;
|
|
445
|
+
} else if (/\:/.test(segment)) {
|
|
446
|
+
if (segment.charCodeAt(segment.length - 1) === 63) {
|
|
447
|
+
if (results.length === 0 && basePath === "") {
|
|
448
|
+
results.push("/");
|
|
449
|
+
} else {
|
|
450
|
+
results.push(basePath);
|
|
451
|
+
}
|
|
452
|
+
const optionalSegment = segment.slice(0, -1);
|
|
453
|
+
basePath += "/" + optionalSegment;
|
|
454
|
+
results.push(basePath);
|
|
455
|
+
} else {
|
|
456
|
+
basePath += "/" + segment;
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
return results.filter((v, i, a) => a.indexOf(v) === i);
|
|
461
|
+
};
|
|
462
|
+
var tryDecodeURIComponent = (str) => str.indexOf("%") !== -1 ? tryDecode(str, decodeURIComponent_) : str;
|
|
463
|
+
var _decodeURI = (value) => {
|
|
464
|
+
if (value.indexOf("+") !== -1) {
|
|
465
|
+
value = value.replace(/\+/g, " ");
|
|
466
|
+
}
|
|
467
|
+
return tryDecodeURIComponent(value);
|
|
468
|
+
};
|
|
469
|
+
var _getQueryParam = (url, key, multiple) => {
|
|
470
|
+
let encoded;
|
|
471
|
+
if (!multiple && key && key.indexOf("%") === -1 && key.indexOf("+") === -1) {
|
|
472
|
+
let keyIndex2 = url.indexOf("?", 8);
|
|
473
|
+
if (keyIndex2 === -1) {
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
if (!url.startsWith(key, keyIndex2 + 1)) {
|
|
477
|
+
keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1);
|
|
478
|
+
}
|
|
479
|
+
while (keyIndex2 !== -1) {
|
|
480
|
+
const trailingKeyCode = url.charCodeAt(keyIndex2 + key.length + 1);
|
|
481
|
+
if (trailingKeyCode === 61) {
|
|
482
|
+
const valueIndex = keyIndex2 + key.length + 2;
|
|
483
|
+
const endIndex = url.indexOf("&", valueIndex);
|
|
484
|
+
return _decodeURI(url.slice(valueIndex, endIndex === -1 ? undefined : endIndex));
|
|
485
|
+
} else if (trailingKeyCode == 38 || isNaN(trailingKeyCode)) {
|
|
486
|
+
return "";
|
|
487
|
+
}
|
|
488
|
+
keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1);
|
|
489
|
+
}
|
|
490
|
+
encoded = /[%+]/.test(url);
|
|
491
|
+
if (!encoded) {
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
const results = /* @__PURE__ */ Object.create(null);
|
|
496
|
+
encoded ??= /[%+]/.test(url);
|
|
497
|
+
let keyIndex = url.indexOf("?", 8);
|
|
498
|
+
while (keyIndex !== -1) {
|
|
499
|
+
const nextKeyIndex = url.indexOf("&", keyIndex + 1);
|
|
500
|
+
let valueIndex = url.indexOf("=", keyIndex);
|
|
501
|
+
if (valueIndex > nextKeyIndex && nextKeyIndex !== -1) {
|
|
502
|
+
valueIndex = -1;
|
|
503
|
+
}
|
|
504
|
+
let name = url.slice(keyIndex + 1, valueIndex === -1 ? nextKeyIndex === -1 ? undefined : nextKeyIndex : valueIndex);
|
|
505
|
+
if (encoded) {
|
|
506
|
+
name = _decodeURI(name);
|
|
507
|
+
}
|
|
508
|
+
keyIndex = nextKeyIndex;
|
|
509
|
+
if (name === "") {
|
|
510
|
+
continue;
|
|
511
|
+
}
|
|
512
|
+
let value;
|
|
513
|
+
if (valueIndex === -1) {
|
|
514
|
+
value = "";
|
|
515
|
+
} else {
|
|
516
|
+
value = url.slice(valueIndex + 1, nextKeyIndex === -1 ? undefined : nextKeyIndex);
|
|
517
|
+
if (encoded) {
|
|
518
|
+
value = _decodeURI(value);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
if (multiple) {
|
|
522
|
+
if (!(results[name] && Array.isArray(results[name]))) {
|
|
523
|
+
results[name] = [];
|
|
524
|
+
}
|
|
525
|
+
results[name].push(value);
|
|
526
|
+
} else {
|
|
527
|
+
results[name] ??= value;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return key ? results[key] : results;
|
|
531
|
+
};
|
|
532
|
+
var getQueryParam = _getQueryParam;
|
|
533
|
+
var getQueryParams = (url, key) => {
|
|
534
|
+
return _getQueryParam(url, key, true);
|
|
535
|
+
};
|
|
536
|
+
var decodeURIComponent_ = decodeURIComponent;
|
|
537
|
+
|
|
538
|
+
// node_modules/hono/dist/request.js
|
|
539
|
+
var HonoRequest = class {
|
|
540
|
+
raw;
|
|
541
|
+
#validatedData;
|
|
542
|
+
#matchResult;
|
|
543
|
+
routeIndex = 0;
|
|
544
|
+
path;
|
|
545
|
+
bodyCache = {};
|
|
546
|
+
constructor(request, path = "/", matchResult = [[]]) {
|
|
547
|
+
this.raw = request;
|
|
548
|
+
this.path = path;
|
|
549
|
+
this.#matchResult = matchResult;
|
|
550
|
+
}
|
|
551
|
+
param(key) {
|
|
552
|
+
return key ? this.#getDecodedParam(key) : this.#getAllDecodedParams();
|
|
553
|
+
}
|
|
554
|
+
#getDecodedParam(key) {
|
|
555
|
+
const paramKey = this.#matchResult[0][this.routeIndex][1][key];
|
|
556
|
+
const param = this.#getParamValue(paramKey);
|
|
557
|
+
return param && tryDecodeURIComponent(param);
|
|
558
|
+
}
|
|
559
|
+
#getAllDecodedParams() {
|
|
560
|
+
const decoded = {};
|
|
561
|
+
const keys = Object.keys(this.#matchResult[0][this.routeIndex][1]);
|
|
562
|
+
for (const key of keys) {
|
|
563
|
+
const value = this.#getParamValue(this.#matchResult[0][this.routeIndex][1][key]);
|
|
564
|
+
if (value !== undefined) {
|
|
565
|
+
decoded[key] = tryDecodeURIComponent(value);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return decoded;
|
|
569
|
+
}
|
|
570
|
+
#getParamValue(paramKey) {
|
|
571
|
+
return this.#matchResult[1] ? this.#matchResult[1][paramKey] : paramKey;
|
|
572
|
+
}
|
|
573
|
+
query(key) {
|
|
574
|
+
return getQueryParam(this.url, key);
|
|
575
|
+
}
|
|
576
|
+
queries(key) {
|
|
577
|
+
return getQueryParams(this.url, key);
|
|
578
|
+
}
|
|
579
|
+
header(name) {
|
|
580
|
+
if (name) {
|
|
581
|
+
return this.raw.headers.get(name) ?? undefined;
|
|
582
|
+
}
|
|
583
|
+
const headerData = /* @__PURE__ */ Object.create(null);
|
|
584
|
+
this.raw.headers.forEach((value, key) => {
|
|
585
|
+
headerData[key] = value;
|
|
586
|
+
});
|
|
587
|
+
return headerData;
|
|
588
|
+
}
|
|
589
|
+
async parseBody(options) {
|
|
590
|
+
return parseBody(this, options);
|
|
591
|
+
}
|
|
592
|
+
#cachedBody = (key) => {
|
|
593
|
+
const { bodyCache, raw } = this;
|
|
594
|
+
const cachedBody = bodyCache[key];
|
|
595
|
+
if (cachedBody) {
|
|
596
|
+
return cachedBody;
|
|
597
|
+
}
|
|
598
|
+
for (const anyCachedKey in bodyCache) {
|
|
599
|
+
return bodyCache[anyCachedKey].then((body) => {
|
|
600
|
+
if (anyCachedKey === "json") {
|
|
601
|
+
body = JSON.stringify(body);
|
|
602
|
+
}
|
|
603
|
+
return new Response(body)[key]();
|
|
604
|
+
});
|
|
605
|
+
}
|
|
606
|
+
return bodyCache[key] = raw[key]();
|
|
607
|
+
};
|
|
608
|
+
json() {
|
|
609
|
+
return this.#cachedBody("text").then((text) => JSON.parse(text));
|
|
610
|
+
}
|
|
611
|
+
text() {
|
|
612
|
+
return this.#cachedBody("text");
|
|
613
|
+
}
|
|
614
|
+
arrayBuffer() {
|
|
615
|
+
return this.#cachedBody("arrayBuffer");
|
|
616
|
+
}
|
|
617
|
+
bytes() {
|
|
618
|
+
return this.#cachedBody("arrayBuffer").then((buffer) => new Uint8Array(buffer));
|
|
619
|
+
}
|
|
620
|
+
blob() {
|
|
621
|
+
return this.#cachedBody("blob");
|
|
622
|
+
}
|
|
623
|
+
formData() {
|
|
624
|
+
return this.#cachedBody("formData");
|
|
625
|
+
}
|
|
626
|
+
addValidatedData(target, data) {
|
|
627
|
+
(this.#validatedData ??= {})[target] = data;
|
|
628
|
+
}
|
|
629
|
+
valid(target) {
|
|
630
|
+
return this.#validatedData?.[target];
|
|
631
|
+
}
|
|
632
|
+
get url() {
|
|
633
|
+
return this.raw.url;
|
|
634
|
+
}
|
|
635
|
+
get method() {
|
|
636
|
+
return this.raw.method;
|
|
637
|
+
}
|
|
638
|
+
get [GET_MATCH_RESULT]() {
|
|
639
|
+
return this.#matchResult;
|
|
640
|
+
}
|
|
641
|
+
get matchedRoutes() {
|
|
642
|
+
return this.#matchResult[0].map(([[, route]]) => route);
|
|
643
|
+
}
|
|
644
|
+
get routePath() {
|
|
645
|
+
return this.#matchResult[0].map(([[, route]]) => route)[this.routeIndex].path;
|
|
646
|
+
}
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
// node_modules/hono/dist/utils/html.js
|
|
650
|
+
var HtmlEscapedCallbackPhase = {
|
|
651
|
+
Stringify: 1,
|
|
652
|
+
BeforeStream: 2,
|
|
653
|
+
Stream: 3
|
|
654
|
+
};
|
|
655
|
+
var raw = (value, callbacks) => {
|
|
656
|
+
const escapedString = new String(value);
|
|
657
|
+
escapedString.isEscaped = true;
|
|
658
|
+
escapedString.callbacks = callbacks;
|
|
659
|
+
return escapedString;
|
|
660
|
+
};
|
|
661
|
+
var resolveCallback = async (str, phase, preserveCallbacks, context, buffer) => {
|
|
662
|
+
if (typeof str === "object" && !(str instanceof String)) {
|
|
663
|
+
if (!(str instanceof Promise)) {
|
|
664
|
+
str = str.toString();
|
|
665
|
+
}
|
|
666
|
+
if (str instanceof Promise) {
|
|
667
|
+
str = await str;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
const callbacks = str.callbacks;
|
|
671
|
+
if (!callbacks?.length) {
|
|
672
|
+
return Promise.resolve(str);
|
|
673
|
+
}
|
|
674
|
+
if (buffer) {
|
|
675
|
+
buffer[0] += str;
|
|
676
|
+
} else {
|
|
677
|
+
buffer = [str];
|
|
678
|
+
}
|
|
679
|
+
const resStr = Promise.all(callbacks.map((c) => c({ phase, buffer, context }))).then((res) => Promise.all(res.filter(Boolean).map((str2) => resolveCallback(str2, phase, false, context, buffer))).then(() => buffer[0]));
|
|
680
|
+
if (preserveCallbacks) {
|
|
681
|
+
return raw(await resStr, callbacks);
|
|
682
|
+
} else {
|
|
683
|
+
return resStr;
|
|
684
|
+
}
|
|
685
|
+
};
|
|
686
|
+
|
|
687
|
+
// node_modules/hono/dist/context.js
|
|
688
|
+
var TEXT_PLAIN = "text/plain; charset=UTF-8";
|
|
689
|
+
var setDefaultContentType = (contentType, headers) => {
|
|
690
|
+
return {
|
|
691
|
+
"Content-Type": contentType,
|
|
692
|
+
...headers
|
|
693
|
+
};
|
|
694
|
+
};
|
|
695
|
+
var createResponseInstance = (body, init) => new Response(body, init);
|
|
696
|
+
var Context = class {
|
|
697
|
+
#rawRequest;
|
|
698
|
+
#req;
|
|
699
|
+
env = {};
|
|
700
|
+
#var;
|
|
701
|
+
finalized = false;
|
|
702
|
+
error;
|
|
703
|
+
#status;
|
|
704
|
+
#executionCtx;
|
|
705
|
+
#res;
|
|
706
|
+
#layout;
|
|
707
|
+
#renderer;
|
|
708
|
+
#notFoundHandler;
|
|
709
|
+
#preparedHeaders;
|
|
710
|
+
#matchResult;
|
|
711
|
+
#path;
|
|
712
|
+
constructor(req, options) {
|
|
713
|
+
this.#rawRequest = req;
|
|
714
|
+
if (options) {
|
|
715
|
+
this.#executionCtx = options.executionCtx;
|
|
716
|
+
this.env = options.env;
|
|
717
|
+
this.#notFoundHandler = options.notFoundHandler;
|
|
718
|
+
this.#path = options.path;
|
|
719
|
+
this.#matchResult = options.matchResult;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
get req() {
|
|
723
|
+
this.#req ??= new HonoRequest(this.#rawRequest, this.#path, this.#matchResult);
|
|
724
|
+
return this.#req;
|
|
725
|
+
}
|
|
726
|
+
get event() {
|
|
727
|
+
if (this.#executionCtx && "respondWith" in this.#executionCtx) {
|
|
728
|
+
return this.#executionCtx;
|
|
729
|
+
} else {
|
|
730
|
+
throw Error("This context has no FetchEvent");
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
get executionCtx() {
|
|
734
|
+
if (this.#executionCtx) {
|
|
735
|
+
return this.#executionCtx;
|
|
736
|
+
} else {
|
|
737
|
+
throw Error("This context has no ExecutionContext");
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
get res() {
|
|
741
|
+
return this.#res ||= createResponseInstance(null, {
|
|
742
|
+
headers: this.#preparedHeaders ??= new Headers
|
|
743
|
+
});
|
|
744
|
+
}
|
|
745
|
+
set res(_res) {
|
|
746
|
+
if (this.#res && _res) {
|
|
747
|
+
_res = createResponseInstance(_res.body, _res);
|
|
748
|
+
for (const [k, v] of this.#res.headers.entries()) {
|
|
749
|
+
if (k === "content-type") {
|
|
750
|
+
continue;
|
|
751
|
+
}
|
|
752
|
+
if (k === "set-cookie") {
|
|
753
|
+
const cookies = this.#res.headers.getSetCookie();
|
|
754
|
+
_res.headers.delete("set-cookie");
|
|
755
|
+
for (const cookie of cookies) {
|
|
756
|
+
_res.headers.append("set-cookie", cookie);
|
|
757
|
+
}
|
|
758
|
+
} else {
|
|
759
|
+
_res.headers.set(k, v);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
this.#res = _res;
|
|
764
|
+
this.finalized = true;
|
|
765
|
+
}
|
|
766
|
+
render = (...args) => {
|
|
767
|
+
this.#renderer ??= (content) => this.html(content);
|
|
768
|
+
return this.#renderer(...args);
|
|
769
|
+
};
|
|
770
|
+
setLayout = (layout) => this.#layout = layout;
|
|
771
|
+
getLayout = () => this.#layout;
|
|
772
|
+
setRenderer = (renderer) => {
|
|
773
|
+
this.#renderer = renderer;
|
|
774
|
+
};
|
|
775
|
+
header = (name, value, options) => {
|
|
776
|
+
if (this.finalized) {
|
|
777
|
+
this.#res = createResponseInstance(this.#res.body, this.#res);
|
|
778
|
+
}
|
|
779
|
+
const headers = this.#res ? this.#res.headers : this.#preparedHeaders ??= new Headers;
|
|
780
|
+
if (value === undefined) {
|
|
781
|
+
headers.delete(name);
|
|
782
|
+
} else if (options?.append) {
|
|
783
|
+
headers.append(name, value);
|
|
784
|
+
} else {
|
|
785
|
+
headers.set(name, value);
|
|
786
|
+
}
|
|
787
|
+
};
|
|
788
|
+
status = (status) => {
|
|
789
|
+
this.#status = status;
|
|
790
|
+
};
|
|
791
|
+
set = (key, value) => {
|
|
792
|
+
this.#var ??= /* @__PURE__ */ new Map;
|
|
793
|
+
this.#var.set(key, value);
|
|
794
|
+
};
|
|
795
|
+
get = (key) => {
|
|
796
|
+
return this.#var ? this.#var.get(key) : undefined;
|
|
797
|
+
};
|
|
798
|
+
get var() {
|
|
799
|
+
if (!this.#var) {
|
|
800
|
+
return {};
|
|
801
|
+
}
|
|
802
|
+
return Object.fromEntries(this.#var);
|
|
803
|
+
}
|
|
804
|
+
#newResponse(data, arg, headers) {
|
|
805
|
+
let responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders;
|
|
806
|
+
if (typeof arg === "object" && arg.headers) {
|
|
807
|
+
responseHeaders ??= new Headers;
|
|
808
|
+
for (const [key, value] of new Headers(arg.headers)) {
|
|
809
|
+
if (key === "set-cookie") {
|
|
810
|
+
responseHeaders.append(key, value);
|
|
811
|
+
} else {
|
|
812
|
+
responseHeaders.set(key, value);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
if (headers) {
|
|
817
|
+
if (!responseHeaders) {
|
|
818
|
+
let count = 0;
|
|
819
|
+
for (const k in headers) {
|
|
820
|
+
if (++count > 1 || typeof headers[k] !== "string") {
|
|
821
|
+
responseHeaders = new Headers;
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
if (responseHeaders) {
|
|
827
|
+
for (const k in headers) {
|
|
828
|
+
const v = headers[k];
|
|
829
|
+
if (typeof v === "string") {
|
|
830
|
+
responseHeaders.set(k, v);
|
|
831
|
+
} else {
|
|
832
|
+
responseHeaders.delete(k);
|
|
833
|
+
for (const v2 of v) {
|
|
834
|
+
responseHeaders.append(k, v2);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
const status = typeof arg === "number" ? arg : arg?.status ?? this.#status;
|
|
841
|
+
return createResponseInstance(data, {
|
|
842
|
+
status,
|
|
843
|
+
headers: responseHeaders ?? headers
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
newResponse = (...args) => this.#newResponse(...args);
|
|
847
|
+
body = (data, arg, headers) => this.#newResponse(data, arg, headers);
|
|
848
|
+
text = (text, arg, headers) => {
|
|
849
|
+
return !this.#preparedHeaders && !this.#status && !arg && !headers && !this.finalized ? new Response(text) : this.#newResponse(text, arg, setDefaultContentType(TEXT_PLAIN, headers));
|
|
850
|
+
};
|
|
851
|
+
json = (object, arg, headers) => {
|
|
852
|
+
return this.#newResponse(JSON.stringify(object), arg, setDefaultContentType("application/json", headers));
|
|
853
|
+
};
|
|
854
|
+
html = (html, arg, headers) => {
|
|
855
|
+
const res = (html2) => this.#newResponse(html2, arg, setDefaultContentType("text/html; charset=UTF-8", headers));
|
|
856
|
+
return typeof html === "object" ? resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html);
|
|
857
|
+
};
|
|
858
|
+
redirect = (location, status) => {
|
|
859
|
+
const locationString = String(location);
|
|
860
|
+
this.header("Location", !/[^\x00-\xFF]/.test(locationString) ? locationString : encodeURI(locationString));
|
|
861
|
+
return this.newResponse(null, status ?? 302);
|
|
862
|
+
};
|
|
863
|
+
notFound = () => {
|
|
864
|
+
this.#notFoundHandler ??= () => createResponseInstance();
|
|
865
|
+
return this.#notFoundHandler(this);
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
// node_modules/hono/dist/router.js
|
|
870
|
+
var METHOD_NAME_ALL = "ALL";
|
|
871
|
+
var METHOD_NAME_ALL_LOWERCASE = "all";
|
|
872
|
+
var METHODS = ["get", "post", "put", "delete", "options", "patch", "query"];
|
|
873
|
+
var MESSAGE_MATCHER_IS_ALREADY_BUILT = "Can not add a route since the matcher is already built.";
|
|
874
|
+
var UnsupportedPathError = class extends Error {
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
// node_modules/hono/dist/utils/constants.js
|
|
878
|
+
var COMPOSED_HANDLER = "__COMPOSED_HANDLER";
|
|
879
|
+
|
|
880
|
+
// node_modules/hono/dist/hono-base.js
|
|
881
|
+
var notFoundHandler = (c) => {
|
|
882
|
+
return c.text("404 Not Found", 404);
|
|
883
|
+
};
|
|
884
|
+
var errorHandler = (err, c) => {
|
|
885
|
+
if ("getResponse" in err) {
|
|
886
|
+
const res = err.getResponse();
|
|
887
|
+
return c.newResponse(res.body, res);
|
|
888
|
+
}
|
|
889
|
+
console.error(err);
|
|
890
|
+
return c.text("Internal Server Error", 500);
|
|
891
|
+
};
|
|
892
|
+
var Hono = class _Hono {
|
|
893
|
+
get;
|
|
894
|
+
post;
|
|
895
|
+
put;
|
|
896
|
+
delete;
|
|
897
|
+
options;
|
|
898
|
+
patch;
|
|
899
|
+
query;
|
|
900
|
+
all;
|
|
901
|
+
on;
|
|
902
|
+
use;
|
|
903
|
+
router;
|
|
904
|
+
getPath;
|
|
905
|
+
_basePath = "/";
|
|
906
|
+
#path = "/";
|
|
907
|
+
routes = [];
|
|
908
|
+
constructor(options = {}) {
|
|
909
|
+
const allMethods = [...METHODS, METHOD_NAME_ALL_LOWERCASE];
|
|
910
|
+
allMethods.forEach((method) => {
|
|
911
|
+
this[method] = (args1, ...args) => {
|
|
912
|
+
if (typeof args1 === "string") {
|
|
913
|
+
this.#path = args1;
|
|
914
|
+
} else {
|
|
915
|
+
this.#addRoute(method, this.#path, args1);
|
|
916
|
+
}
|
|
917
|
+
args.forEach((handler) => {
|
|
918
|
+
this.#addRoute(method, this.#path, handler);
|
|
919
|
+
});
|
|
920
|
+
return this;
|
|
921
|
+
};
|
|
922
|
+
});
|
|
923
|
+
this.on = (method, path, ...handlers) => {
|
|
924
|
+
for (const p of [path].flat()) {
|
|
925
|
+
this.#path = p;
|
|
926
|
+
for (const m of [method].flat()) {
|
|
927
|
+
handlers.map((handler) => {
|
|
928
|
+
this.#addRoute(m.toUpperCase(), this.#path, handler);
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
return this;
|
|
933
|
+
};
|
|
934
|
+
this.use = (arg1, ...handlers) => {
|
|
935
|
+
if (typeof arg1 === "string") {
|
|
936
|
+
this.#path = arg1;
|
|
937
|
+
} else {
|
|
938
|
+
this.#path = "*";
|
|
939
|
+
handlers.unshift(arg1);
|
|
940
|
+
}
|
|
941
|
+
handlers.forEach((handler) => {
|
|
942
|
+
this.#addRoute(METHOD_NAME_ALL, this.#path, handler);
|
|
943
|
+
});
|
|
944
|
+
return this;
|
|
945
|
+
};
|
|
946
|
+
const { strict, ...optionsWithoutStrict } = options;
|
|
947
|
+
Object.assign(this, optionsWithoutStrict);
|
|
948
|
+
this.getPath = strict ?? true ? options.getPath ?? getPath : getPathNoStrict;
|
|
949
|
+
}
|
|
950
|
+
#clone() {
|
|
951
|
+
const clone = new _Hono({
|
|
952
|
+
router: this.router,
|
|
953
|
+
getPath: this.getPath
|
|
954
|
+
});
|
|
955
|
+
clone.errorHandler = this.errorHandler;
|
|
956
|
+
clone.#notFoundHandler = this.#notFoundHandler;
|
|
957
|
+
clone.routes = this.routes;
|
|
958
|
+
return clone;
|
|
959
|
+
}
|
|
960
|
+
#notFoundHandler = notFoundHandler;
|
|
961
|
+
errorHandler = errorHandler;
|
|
962
|
+
route(path, app) {
|
|
963
|
+
const subApp = this.basePath(path);
|
|
964
|
+
app.routes.map((r) => {
|
|
965
|
+
let handler;
|
|
966
|
+
if (app.errorHandler === errorHandler) {
|
|
967
|
+
handler = r.handler;
|
|
968
|
+
} else {
|
|
969
|
+
handler = async (c, next) => (await compose([], app.errorHandler)(c, () => r.handler(c, next))).res;
|
|
970
|
+
handler[COMPOSED_HANDLER] = r.handler;
|
|
971
|
+
}
|
|
972
|
+
subApp.#addRoute(r.method, r.path, handler, r.basePath);
|
|
973
|
+
});
|
|
974
|
+
return this;
|
|
975
|
+
}
|
|
976
|
+
basePath(path) {
|
|
977
|
+
const subApp = this.#clone();
|
|
978
|
+
subApp._basePath = mergePath(this._basePath, path);
|
|
979
|
+
return subApp;
|
|
980
|
+
}
|
|
981
|
+
onError = (handler) => {
|
|
982
|
+
this.errorHandler = handler;
|
|
983
|
+
return this;
|
|
984
|
+
};
|
|
985
|
+
notFound = (handler) => {
|
|
986
|
+
this.#notFoundHandler = handler;
|
|
987
|
+
return this;
|
|
988
|
+
};
|
|
989
|
+
mount(path, applicationHandler, options) {
|
|
990
|
+
let replaceRequest;
|
|
991
|
+
let optionHandler;
|
|
992
|
+
if (options) {
|
|
993
|
+
if (typeof options === "function") {
|
|
994
|
+
optionHandler = options;
|
|
995
|
+
} else {
|
|
996
|
+
optionHandler = options.optionHandler;
|
|
997
|
+
if (options.replaceRequest === false) {
|
|
998
|
+
replaceRequest = (request) => request;
|
|
999
|
+
} else {
|
|
1000
|
+
replaceRequest = options.replaceRequest;
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
const getOptions = optionHandler ? (c) => {
|
|
1005
|
+
const options2 = optionHandler(c);
|
|
1006
|
+
return Array.isArray(options2) ? options2 : [options2];
|
|
1007
|
+
} : (c) => {
|
|
1008
|
+
let executionContext = undefined;
|
|
1009
|
+
try {
|
|
1010
|
+
executionContext = c.executionCtx;
|
|
1011
|
+
} catch {}
|
|
1012
|
+
return [c.env, executionContext];
|
|
1013
|
+
};
|
|
1014
|
+
replaceRequest ||= (() => {
|
|
1015
|
+
const mergedPath = mergePath(this._basePath, path);
|
|
1016
|
+
const pathPrefixLength = mergedPath === "/" ? 0 : mergedPath.length;
|
|
1017
|
+
return (request) => {
|
|
1018
|
+
const url = new URL(request.url);
|
|
1019
|
+
url.pathname = this.getPath(request).slice(pathPrefixLength) || "/";
|
|
1020
|
+
return new Request(url, request);
|
|
1021
|
+
};
|
|
1022
|
+
})();
|
|
1023
|
+
const handler = async (c, next) => {
|
|
1024
|
+
const res = await applicationHandler(replaceRequest(c.req.raw), ...getOptions(c));
|
|
1025
|
+
if (res) {
|
|
1026
|
+
return res;
|
|
1027
|
+
}
|
|
1028
|
+
await next();
|
|
1029
|
+
};
|
|
1030
|
+
this.#addRoute(METHOD_NAME_ALL, mergePath(path, "*"), handler);
|
|
1031
|
+
return this;
|
|
1032
|
+
}
|
|
1033
|
+
#addRoute(method, path, handler, baseRoutePath) {
|
|
1034
|
+
method = method.toUpperCase();
|
|
1035
|
+
path = mergePath(this._basePath, path);
|
|
1036
|
+
const r = {
|
|
1037
|
+
basePath: baseRoutePath !== undefined ? mergePath(this._basePath, baseRoutePath) : this._basePath,
|
|
1038
|
+
path,
|
|
1039
|
+
method,
|
|
1040
|
+
handler
|
|
1041
|
+
};
|
|
1042
|
+
this.router.add(method, path, [handler, r]);
|
|
1043
|
+
this.routes.push(r);
|
|
1044
|
+
}
|
|
1045
|
+
#handleError(err, c) {
|
|
1046
|
+
if (err instanceof Error) {
|
|
1047
|
+
return this.errorHandler(err, c);
|
|
1048
|
+
}
|
|
1049
|
+
throw err;
|
|
1050
|
+
}
|
|
1051
|
+
#dispatch(request, executionCtx, env, method) {
|
|
1052
|
+
if (method === "HEAD") {
|
|
1053
|
+
return (async () => new Response(null, await this.#dispatch(request, executionCtx, env, "GET")))();
|
|
1054
|
+
}
|
|
1055
|
+
const path = this.getPath(request, { env });
|
|
1056
|
+
const matchResult = this.router.match(method, path);
|
|
1057
|
+
const c = new Context(request, {
|
|
1058
|
+
path,
|
|
1059
|
+
matchResult,
|
|
1060
|
+
env,
|
|
1061
|
+
executionCtx,
|
|
1062
|
+
notFoundHandler: this.#notFoundHandler
|
|
1063
|
+
});
|
|
1064
|
+
if (matchResult[0].length === 1) {
|
|
1065
|
+
let res;
|
|
1066
|
+
try {
|
|
1067
|
+
res = matchResult[0][0][0][0](c, async () => {
|
|
1068
|
+
c.res = await this.#notFoundHandler(c);
|
|
1069
|
+
});
|
|
1070
|
+
} catch (err) {
|
|
1071
|
+
return this.#handleError(err, c);
|
|
1072
|
+
}
|
|
1073
|
+
return res instanceof Promise ? res.then((resolved) => resolved || (c.finalized ? c.res : this.#notFoundHandler(c))).catch((err) => this.#handleError(err, c)) : res ?? this.#notFoundHandler(c);
|
|
1074
|
+
}
|
|
1075
|
+
const composed = compose(matchResult[0], this.errorHandler, this.#notFoundHandler);
|
|
1076
|
+
return (async () => {
|
|
1077
|
+
try {
|
|
1078
|
+
const context = await composed(c);
|
|
1079
|
+
if (!context.finalized) {
|
|
1080
|
+
throw new Error("Context is not finalized. Did you forget to return a Response object or `await next()`?");
|
|
1081
|
+
}
|
|
1082
|
+
return context.res;
|
|
1083
|
+
} catch (err) {
|
|
1084
|
+
return this.#handleError(err, c);
|
|
1085
|
+
}
|
|
1086
|
+
})();
|
|
1087
|
+
}
|
|
1088
|
+
fetch = (request, ...rest) => {
|
|
1089
|
+
return this.#dispatch(request, rest[1], rest[0], request.method);
|
|
1090
|
+
};
|
|
1091
|
+
request = (input, requestInit, Env, executionCtx) => {
|
|
1092
|
+
if (input instanceof Request) {
|
|
1093
|
+
return this.fetch(requestInit ? new Request(input, requestInit) : input, Env, executionCtx);
|
|
1094
|
+
}
|
|
1095
|
+
input = input.toString();
|
|
1096
|
+
return this.fetch(new Request(/^https?:\/\//.test(input) ? input : `http://localhost${mergePath("/", input)}`, requestInit), Env, executionCtx);
|
|
1097
|
+
};
|
|
1098
|
+
fire = () => {
|
|
1099
|
+
addEventListener("fetch", (event) => {
|
|
1100
|
+
event.respondWith(this.#dispatch(event.request, event, undefined, event.request.method));
|
|
1101
|
+
});
|
|
1102
|
+
};
|
|
1103
|
+
};
|
|
1104
|
+
|
|
1105
|
+
// node_modules/hono/dist/router/reg-exp-router/matcher.js
|
|
1106
|
+
var emptyParam = [];
|
|
1107
|
+
function match(method, path) {
|
|
1108
|
+
const matchers = this.buildAllMatchers();
|
|
1109
|
+
const match2 = (method2, path2) => {
|
|
1110
|
+
const matcher = matchers[method2] || matchers[METHOD_NAME_ALL];
|
|
1111
|
+
const staticMatch = matcher[2][path2];
|
|
1112
|
+
if (staticMatch) {
|
|
1113
|
+
return staticMatch;
|
|
1114
|
+
}
|
|
1115
|
+
const match3 = path2.match(matcher[0]);
|
|
1116
|
+
if (!match3) {
|
|
1117
|
+
return [[], emptyParam];
|
|
1118
|
+
}
|
|
1119
|
+
const index = match3.indexOf("", 1);
|
|
1120
|
+
return [matcher[1][index], match3];
|
|
1121
|
+
};
|
|
1122
|
+
this.match = match2;
|
|
1123
|
+
return match2(method, path);
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
// node_modules/hono/dist/router/reg-exp-router/node.js
|
|
1127
|
+
var LABEL_REG_EXP_STR = "[^/]+";
|
|
1128
|
+
var ONLY_WILDCARD_REG_EXP_STR = ".*";
|
|
1129
|
+
var TAIL_WILDCARD_REG_EXP_STR = "(?:|/.*)";
|
|
1130
|
+
var PATH_ERROR = /* @__PURE__ */ Symbol();
|
|
1131
|
+
var regExpMetaChars = new Set(".\\+*[^]$()");
|
|
1132
|
+
function compareKey(a, b) {
|
|
1133
|
+
if (a.length === 1) {
|
|
1134
|
+
return b.length === 1 ? a < b ? -1 : 1 : -1;
|
|
1135
|
+
}
|
|
1136
|
+
if (b.length === 1) {
|
|
1137
|
+
return 1;
|
|
1138
|
+
}
|
|
1139
|
+
if (a === ONLY_WILDCARD_REG_EXP_STR || a === TAIL_WILDCARD_REG_EXP_STR) {
|
|
1140
|
+
return b === TAIL_WILDCARD_REG_EXP_STR ? -1 : 1;
|
|
1141
|
+
} else if (b === ONLY_WILDCARD_REG_EXP_STR || b === TAIL_WILDCARD_REG_EXP_STR) {
|
|
1142
|
+
return -1;
|
|
1143
|
+
}
|
|
1144
|
+
if (a === LABEL_REG_EXP_STR) {
|
|
1145
|
+
return 1;
|
|
1146
|
+
} else if (b === LABEL_REG_EXP_STR) {
|
|
1147
|
+
return -1;
|
|
1148
|
+
}
|
|
1149
|
+
return a.length === b.length ? a < b ? -1 : 1 : b.length - a.length;
|
|
1150
|
+
}
|
|
1151
|
+
var Node = class _Node {
|
|
1152
|
+
#index;
|
|
1153
|
+
#varIndex;
|
|
1154
|
+
#children = /* @__PURE__ */ Object.create(null);
|
|
1155
|
+
insert(tokens, index, paramMap, context, isStatic) {
|
|
1156
|
+
let node = this;
|
|
1157
|
+
for (let i = 0, len = tokens.length;i < len; i++) {
|
|
1158
|
+
const token = tokens[i];
|
|
1159
|
+
const pattern = token.length === 1 ? token === "*" ? i === len - 1 ? ["", "", ONLY_WILDCARD_REG_EXP_STR] : ["", "", LABEL_REG_EXP_STR] : null : token === "/*" ? ["", "", TAIL_WILDCARD_REG_EXP_STR] : token.match(/^\:([^\{\}]+)(?:\{(.+)\})?$/);
|
|
1160
|
+
let nextNode;
|
|
1161
|
+
if (pattern) {
|
|
1162
|
+
const name = pattern[1];
|
|
1163
|
+
let regexpStr = pattern[2] || LABEL_REG_EXP_STR;
|
|
1164
|
+
if (name && pattern[2]) {
|
|
1165
|
+
if (regexpStr === ".*") {
|
|
1166
|
+
throw PATH_ERROR;
|
|
1167
|
+
}
|
|
1168
|
+
regexpStr = regexpStr.replace(/^\((?!\?:)(?=[^)]+\)$)/, "(?:");
|
|
1169
|
+
if (/\((?!\?:)/.test(regexpStr)) {
|
|
1170
|
+
throw PATH_ERROR;
|
|
1171
|
+
}
|
|
1172
|
+
if (regexpStr.length === 1 && regExpMetaChars.has(regexpStr)) {
|
|
1173
|
+
throw PATH_ERROR;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
nextNode = node.#children[regexpStr];
|
|
1177
|
+
if (!nextNode) {
|
|
1178
|
+
if (regexpStr !== ONLY_WILDCARD_REG_EXP_STR && regexpStr !== TAIL_WILDCARD_REG_EXP_STR) {
|
|
1179
|
+
for (const k in node.#children) {
|
|
1180
|
+
if ((regexpStr.length > 1 || k.length > 1) && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR) {
|
|
1181
|
+
throw PATH_ERROR;
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
nextNode = node.#children[regexpStr] = new _Node;
|
|
1186
|
+
}
|
|
1187
|
+
if (name !== "") {
|
|
1188
|
+
nextNode.#varIndex ??= context.varIndex++;
|
|
1189
|
+
paramMap.push([name, nextNode.#varIndex]);
|
|
1190
|
+
}
|
|
1191
|
+
} else {
|
|
1192
|
+
nextNode = node.#children[token];
|
|
1193
|
+
if (!nextNode) {
|
|
1194
|
+
for (const k in node.#children) {
|
|
1195
|
+
if (k.length > 1 && k !== ONLY_WILDCARD_REG_EXP_STR && k !== TAIL_WILDCARD_REG_EXP_STR) {
|
|
1196
|
+
throw PATH_ERROR;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
nextNode = node.#children[token] = new _Node;
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
node = nextNode;
|
|
1203
|
+
}
|
|
1204
|
+
if (node.#index !== undefined) {
|
|
1205
|
+
throw PATH_ERROR;
|
|
1206
|
+
}
|
|
1207
|
+
node.#index = isStatic ? -1 : index;
|
|
1208
|
+
}
|
|
1209
|
+
buildRegExpStr() {
|
|
1210
|
+
const childKeys = Object.keys(this.#children).sort(compareKey);
|
|
1211
|
+
const strList = childKeys.map((k) => {
|
|
1212
|
+
const c = this.#children[k];
|
|
1213
|
+
const childStr = c.buildRegExpStr();
|
|
1214
|
+
return childStr === "" ? "" : (typeof c.#varIndex === "number" ? `(${k})@${c.#varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + childStr;
|
|
1215
|
+
}).filter(Boolean);
|
|
1216
|
+
if (typeof this.#index === "number" && this.#index !== -1) {
|
|
1217
|
+
strList.unshift(`#${this.#index}`);
|
|
1218
|
+
}
|
|
1219
|
+
if (strList.length === 0) {
|
|
1220
|
+
return "";
|
|
1221
|
+
}
|
|
1222
|
+
if (strList.length === 1) {
|
|
1223
|
+
return strList[0];
|
|
1224
|
+
}
|
|
1225
|
+
return "(?:" + strList.join("|") + ")";
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
1228
|
+
|
|
1229
|
+
// node_modules/hono/dist/router/reg-exp-router/trie.js
|
|
1230
|
+
var Trie = class {
|
|
1231
|
+
#context = { varIndex: 0 };
|
|
1232
|
+
#root = new Node;
|
|
1233
|
+
#index = 0;
|
|
1234
|
+
paths = /* @__PURE__ */ Object.create(null);
|
|
1235
|
+
insert(path, isStatic) {
|
|
1236
|
+
if (isStatic) {
|
|
1237
|
+
this.#root.insert(path.split(""), 0, [], this.#context, true);
|
|
1238
|
+
return;
|
|
1239
|
+
}
|
|
1240
|
+
const paramAssoc = [];
|
|
1241
|
+
const groups = [];
|
|
1242
|
+
let markedPath = path;
|
|
1243
|
+
for (let i = 0;; ) {
|
|
1244
|
+
let replaced = false;
|
|
1245
|
+
markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => {
|
|
1246
|
+
const mark = `@\\${i}`;
|
|
1247
|
+
groups[i] = [mark, m];
|
|
1248
|
+
i++;
|
|
1249
|
+
replaced = true;
|
|
1250
|
+
return mark;
|
|
1251
|
+
});
|
|
1252
|
+
if (!replaced) {
|
|
1253
|
+
break;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
|
|
1257
|
+
for (let i = groups.length - 1;i >= 0; i--) {
|
|
1258
|
+
const [mark] = groups[i];
|
|
1259
|
+
for (let j = tokens.length - 1;j >= 0; j--) {
|
|
1260
|
+
if (tokens[j].indexOf(mark) !== -1) {
|
|
1261
|
+
tokens[j] = tokens[j].replace(mark, groups[i][1]);
|
|
1262
|
+
break;
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
this.#root.insert(tokens, this.#index, paramAssoc, this.#context, false);
|
|
1267
|
+
this.paths[path] = [this.#index++, paramAssoc];
|
|
1268
|
+
}
|
|
1269
|
+
buildRegExp() {
|
|
1270
|
+
let regexp = this.#root.buildRegExpStr();
|
|
1271
|
+
if (regexp === "") {
|
|
1272
|
+
return [/^$/, [], []];
|
|
1273
|
+
}
|
|
1274
|
+
let captureIndex = 0;
|
|
1275
|
+
const indexReplacementMap = [];
|
|
1276
|
+
const paramReplacementMap = [];
|
|
1277
|
+
regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => {
|
|
1278
|
+
if (handlerIndex !== undefined) {
|
|
1279
|
+
indexReplacementMap[++captureIndex] = Number(handlerIndex);
|
|
1280
|
+
return "$()";
|
|
1281
|
+
}
|
|
1282
|
+
if (paramIndex !== undefined) {
|
|
1283
|
+
paramReplacementMap[Number(paramIndex)] = ++captureIndex;
|
|
1284
|
+
return "";
|
|
1285
|
+
}
|
|
1286
|
+
return "";
|
|
1287
|
+
});
|
|
1288
|
+
return [new RegExp(`^${regexp}`), indexReplacementMap, paramReplacementMap];
|
|
1289
|
+
}
|
|
1290
|
+
};
|
|
1291
|
+
|
|
1292
|
+
// node_modules/hono/dist/router/reg-exp-router/router.js
|
|
1293
|
+
var wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
1294
|
+
function buildWildcardRegExp(path) {
|
|
1295
|
+
return wildcardRegExpCache[path] ??= new RegExp(path === "*" ? "" : `^${path.replace(/\/\*$|([.\\+*[^\]$()])/g, (_, metaChar) => metaChar ? `\\${metaChar}` : "(?:|/.*)")}$`);
|
|
1296
|
+
}
|
|
1297
|
+
function clearWildcardRegExpCache() {
|
|
1298
|
+
wildcardRegExpCache = /* @__PURE__ */ Object.create(null);
|
|
1299
|
+
}
|
|
1300
|
+
function findMiddleware(middleware, path) {
|
|
1301
|
+
if (!middleware) {
|
|
1302
|
+
return;
|
|
1303
|
+
}
|
|
1304
|
+
for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) {
|
|
1305
|
+
if (buildWildcardRegExp(k).test(path)) {
|
|
1306
|
+
return [...middleware[k]];
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
return;
|
|
1310
|
+
}
|
|
1311
|
+
var RegExpRouter = class {
|
|
1312
|
+
name = "RegExpRouter";
|
|
1313
|
+
#middleware;
|
|
1314
|
+
#routes;
|
|
1315
|
+
#tries;
|
|
1316
|
+
constructor() {
|
|
1317
|
+
this.#middleware = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
|
|
1318
|
+
this.#routes = { [METHOD_NAME_ALL]: /* @__PURE__ */ Object.create(null) };
|
|
1319
|
+
this.#tries = { [METHOD_NAME_ALL]: new Trie };
|
|
1320
|
+
}
|
|
1321
|
+
#insertPath(method, path) {
|
|
1322
|
+
try {
|
|
1323
|
+
this.#tries[method].insert(path, !/\*|\/:/.test(path));
|
|
1324
|
+
} catch (e) {
|
|
1325
|
+
throw e === PATH_ERROR ? new UnsupportedPathError(path) : e;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
add(method, path, handler) {
|
|
1329
|
+
const middleware = this.#middleware;
|
|
1330
|
+
const routes = this.#routes;
|
|
1331
|
+
if (!middleware || !routes) {
|
|
1332
|
+
throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
1333
|
+
}
|
|
1334
|
+
if (!middleware[method]) {
|
|
1335
|
+
this.#tries[method] = new Trie;
|
|
1336
|
+
[middleware, routes].forEach((handlerMap) => {
|
|
1337
|
+
handlerMap[method] = /* @__PURE__ */ Object.create(null);
|
|
1338
|
+
Object.keys(handlerMap[METHOD_NAME_ALL]).forEach((p) => {
|
|
1339
|
+
handlerMap[method][p] = [...handlerMap[METHOD_NAME_ALL][p]];
|
|
1340
|
+
this.#insertPath(method, p);
|
|
1341
|
+
});
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1344
|
+
if (path === "/*") {
|
|
1345
|
+
path = "*";
|
|
1346
|
+
}
|
|
1347
|
+
const paramCount = (path.match(/\/:/g) || []).length;
|
|
1348
|
+
if (/\*$/.test(path)) {
|
|
1349
|
+
const re = buildWildcardRegExp(path);
|
|
1350
|
+
Object.keys(middleware).forEach((m) => {
|
|
1351
|
+
if ((method === METHOD_NAME_ALL || method === m) && !middleware[m][path]) {
|
|
1352
|
+
this.#insertPath(m, path);
|
|
1353
|
+
middleware[m][path] = findMiddleware(middleware[m], path) || findMiddleware(middleware[METHOD_NAME_ALL], path) || [];
|
|
1354
|
+
}
|
|
1355
|
+
});
|
|
1356
|
+
Object.keys(middleware).forEach((m) => {
|
|
1357
|
+
if (method === METHOD_NAME_ALL || method === m) {
|
|
1358
|
+
Object.keys(middleware[m]).forEach((p) => {
|
|
1359
|
+
re.test(p) && middleware[m][p].push([handler, paramCount]);
|
|
1360
|
+
});
|
|
1361
|
+
}
|
|
1362
|
+
});
|
|
1363
|
+
Object.keys(routes).forEach((m) => {
|
|
1364
|
+
if (method === METHOD_NAME_ALL || method === m) {
|
|
1365
|
+
Object.keys(routes[m]).forEach((p) => re.test(p) && routes[m][p].push([handler, paramCount]));
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
return;
|
|
1369
|
+
}
|
|
1370
|
+
const paths = checkOptionalParameter(path) || [path];
|
|
1371
|
+
for (let i = 0, len = paths.length;i < len; i++) {
|
|
1372
|
+
const path2 = paths[i];
|
|
1373
|
+
Object.keys(routes).forEach((m) => {
|
|
1374
|
+
if (method === METHOD_NAME_ALL || method === m) {
|
|
1375
|
+
if (!routes[m][path2]) {
|
|
1376
|
+
this.#insertPath(m, path2);
|
|
1377
|
+
routes[m][path2] = [
|
|
1378
|
+
...findMiddleware(middleware[m], path2) || findMiddleware(middleware[METHOD_NAME_ALL], path2) || []
|
|
1379
|
+
];
|
|
1380
|
+
}
|
|
1381
|
+
routes[m][path2].push([handler, paramCount - len + i + 1]);
|
|
1382
|
+
}
|
|
1383
|
+
});
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
match = match;
|
|
1387
|
+
buildAllMatchers() {
|
|
1388
|
+
const matchers = /* @__PURE__ */ Object.create(null);
|
|
1389
|
+
Object.keys(this.#routes).concat(Object.keys(this.#middleware)).forEach((method) => {
|
|
1390
|
+
matchers[method] ||= this.#buildMatcher(method);
|
|
1391
|
+
});
|
|
1392
|
+
this.#middleware = this.#routes = this.#tries = undefined;
|
|
1393
|
+
clearWildcardRegExpCache();
|
|
1394
|
+
return matchers;
|
|
1395
|
+
}
|
|
1396
|
+
#buildMatcher(method) {
|
|
1397
|
+
const middleware = this.#middleware[method];
|
|
1398
|
+
const routes = this.#routes[method];
|
|
1399
|
+
const trie = this.#tries[method];
|
|
1400
|
+
const staticMap = /* @__PURE__ */ Object.create(null);
|
|
1401
|
+
const handlerData = [];
|
|
1402
|
+
[middleware, routes].forEach((r) => {
|
|
1403
|
+
for (const path in r) {
|
|
1404
|
+
const handlers = r[path];
|
|
1405
|
+
const pathData = trie.paths[path];
|
|
1406
|
+
if (!pathData) {
|
|
1407
|
+
staticMap[path] = [handlers.map(([h]) => [h, /* @__PURE__ */ Object.create(null)]), emptyParam];
|
|
1408
|
+
continue;
|
|
1409
|
+
}
|
|
1410
|
+
const paramAssoc = pathData[1];
|
|
1411
|
+
handlerData[pathData[0]] = handlers.map(([h, paramCount]) => {
|
|
1412
|
+
const paramIndexMap = /* @__PURE__ */ Object.create(null);
|
|
1413
|
+
paramCount -= 1;
|
|
1414
|
+
for (;paramCount >= 0; paramCount--) {
|
|
1415
|
+
const [key, value] = paramAssoc[paramCount];
|
|
1416
|
+
paramIndexMap[key] = value;
|
|
1417
|
+
}
|
|
1418
|
+
return [h, paramIndexMap];
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1422
|
+
const [regexp, indexReplacementMap, paramReplacementMap] = trie.buildRegExp();
|
|
1423
|
+
for (let i = 0, len = handlerData.length;i < len; i++) {
|
|
1424
|
+
for (let j = 0, len2 = handlerData[i].length;j < len2; j++) {
|
|
1425
|
+
const map = handlerData[i][j]?.[1];
|
|
1426
|
+
if (!map) {
|
|
1427
|
+
continue;
|
|
1428
|
+
}
|
|
1429
|
+
const keys = Object.keys(map);
|
|
1430
|
+
for (let k = 0, len3 = keys.length;k < len3; k++) {
|
|
1431
|
+
map[keys[k]] = paramReplacementMap[map[keys[k]]];
|
|
1432
|
+
}
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
const handlerMap = [];
|
|
1436
|
+
for (const i in indexReplacementMap) {
|
|
1437
|
+
handlerMap[i] = handlerData[indexReplacementMap[i]];
|
|
1438
|
+
}
|
|
1439
|
+
return [regexp, handlerMap, staticMap];
|
|
1440
|
+
}
|
|
1441
|
+
};
|
|
1442
|
+
|
|
1443
|
+
// node_modules/hono/dist/router/reg-exp-router/prepared-router.js
|
|
1444
|
+
var PreparedRegExpRouter = class {
|
|
1445
|
+
name = "PreparedRegExpRouter";
|
|
1446
|
+
#matchers;
|
|
1447
|
+
#relocateMap;
|
|
1448
|
+
constructor(matchers, relocateMap) {
|
|
1449
|
+
this.#matchers = matchers;
|
|
1450
|
+
this.#relocateMap = relocateMap;
|
|
1451
|
+
}
|
|
1452
|
+
#addWildcard(method, handlerData) {
|
|
1453
|
+
const matcher = this.#matchers[method];
|
|
1454
|
+
matcher[1].forEach((list) => list && list.push(handlerData));
|
|
1455
|
+
Object.values(matcher[2]).forEach((list) => list[0].push(handlerData));
|
|
1456
|
+
}
|
|
1457
|
+
#addPath(method, path, handler, indexes, map) {
|
|
1458
|
+
const matcher = this.#matchers[method];
|
|
1459
|
+
if (!map) {
|
|
1460
|
+
matcher[2][path][0].push([handler, {}]);
|
|
1461
|
+
} else {
|
|
1462
|
+
indexes.forEach((index) => {
|
|
1463
|
+
if (typeof index === "number") {
|
|
1464
|
+
matcher[1][index].push([handler, map]);
|
|
1465
|
+
} else {
|
|
1466
|
+
matcher[2][index || path][0].push([handler, map]);
|
|
1467
|
+
}
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
add(method, path, handler) {
|
|
1472
|
+
if (!this.#matchers[method]) {
|
|
1473
|
+
const all = this.#matchers[METHOD_NAME_ALL];
|
|
1474
|
+
const staticMap = {};
|
|
1475
|
+
for (const key in all[2]) {
|
|
1476
|
+
staticMap[key] = [all[2][key][0].slice(), emptyParam];
|
|
1477
|
+
}
|
|
1478
|
+
this.#matchers[method] = [
|
|
1479
|
+
all[0],
|
|
1480
|
+
all[1].map((list) => Array.isArray(list) ? list.slice() : 0),
|
|
1481
|
+
staticMap
|
|
1482
|
+
];
|
|
1483
|
+
}
|
|
1484
|
+
if (path === "/*" || path === "*") {
|
|
1485
|
+
const handlerData = [handler, {}];
|
|
1486
|
+
if (method === METHOD_NAME_ALL) {
|
|
1487
|
+
for (const m in this.#matchers) {
|
|
1488
|
+
this.#addWildcard(m, handlerData);
|
|
1489
|
+
}
|
|
1490
|
+
} else {
|
|
1491
|
+
this.#addWildcard(method, handlerData);
|
|
1492
|
+
}
|
|
1493
|
+
return;
|
|
1494
|
+
}
|
|
1495
|
+
const data = this.#relocateMap[path];
|
|
1496
|
+
if (!data) {
|
|
1497
|
+
throw new Error(`Path ${path} is not registered`);
|
|
1498
|
+
}
|
|
1499
|
+
for (const [indexes, map] of data) {
|
|
1500
|
+
if (method === METHOD_NAME_ALL) {
|
|
1501
|
+
for (const m in this.#matchers) {
|
|
1502
|
+
this.#addPath(m, path, handler, indexes, map);
|
|
1503
|
+
}
|
|
1504
|
+
} else {
|
|
1505
|
+
this.#addPath(method, path, handler, indexes, map);
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
}
|
|
1509
|
+
buildAllMatchers() {
|
|
1510
|
+
return this.#matchers;
|
|
1511
|
+
}
|
|
1512
|
+
match = match;
|
|
1513
|
+
};
|
|
1514
|
+
|
|
1515
|
+
// node_modules/hono/dist/router/smart-router/router.js
|
|
1516
|
+
var SmartRouter = class {
|
|
1517
|
+
name = "SmartRouter";
|
|
1518
|
+
#routers = [];
|
|
1519
|
+
#routes = [];
|
|
1520
|
+
constructor(init) {
|
|
1521
|
+
this.#routers = init.routers;
|
|
1522
|
+
}
|
|
1523
|
+
add(method, path, handler) {
|
|
1524
|
+
if (!this.#routes) {
|
|
1525
|
+
throw new Error(MESSAGE_MATCHER_IS_ALREADY_BUILT);
|
|
1526
|
+
}
|
|
1527
|
+
this.#routes.push([method, path, handler]);
|
|
1528
|
+
}
|
|
1529
|
+
match(method, path) {
|
|
1530
|
+
if (!this.#routes) {
|
|
1531
|
+
throw new Error("Fatal error");
|
|
1532
|
+
}
|
|
1533
|
+
const routers = this.#routers;
|
|
1534
|
+
const routes = this.#routes;
|
|
1535
|
+
const len = routers.length;
|
|
1536
|
+
let i = 0;
|
|
1537
|
+
let res;
|
|
1538
|
+
for (;i < len; i++) {
|
|
1539
|
+
const router = routers[i];
|
|
1540
|
+
try {
|
|
1541
|
+
for (let i2 = 0, len2 = routes.length;i2 < len2; i2++) {
|
|
1542
|
+
router.add(...routes[i2]);
|
|
1543
|
+
}
|
|
1544
|
+
res = router.match(method, path);
|
|
1545
|
+
} catch (e) {
|
|
1546
|
+
if (e instanceof UnsupportedPathError) {
|
|
1547
|
+
continue;
|
|
1548
|
+
}
|
|
1549
|
+
throw e;
|
|
1550
|
+
}
|
|
1551
|
+
this.match = router.match.bind(router);
|
|
1552
|
+
this.#routers = [router];
|
|
1553
|
+
this.#routes = undefined;
|
|
1554
|
+
break;
|
|
1555
|
+
}
|
|
1556
|
+
if (i === len) {
|
|
1557
|
+
throw new Error("Fatal error");
|
|
1558
|
+
}
|
|
1559
|
+
this.name = `SmartRouter + ${this.activeRouter.name}`;
|
|
1560
|
+
return res;
|
|
1561
|
+
}
|
|
1562
|
+
get activeRouter() {
|
|
1563
|
+
if (this.#routes || this.#routers.length !== 1) {
|
|
1564
|
+
throw new Error("No active router has been determined yet.");
|
|
1565
|
+
}
|
|
1566
|
+
return this.#routers[0];
|
|
1567
|
+
}
|
|
1568
|
+
};
|
|
1569
|
+
|
|
1570
|
+
// node_modules/hono/dist/router/trie-router/node.js
|
|
1571
|
+
var emptyParams = /* @__PURE__ */ Object.create(null);
|
|
1572
|
+
var order = 0;
|
|
1573
|
+
var Node2 = class _Node2 {
|
|
1574
|
+
#methods = [];
|
|
1575
|
+
#children = /* @__PURE__ */ Object.create(null);
|
|
1576
|
+
#patterns = [];
|
|
1577
|
+
#pattern;
|
|
1578
|
+
#params = emptyParams;
|
|
1579
|
+
insert(method, path, handler) {
|
|
1580
|
+
let curNode = this;
|
|
1581
|
+
const parts = splitRoutingPath(path);
|
|
1582
|
+
const possibleKeys = /* @__PURE__ */ new Set;
|
|
1583
|
+
let i = 0;
|
|
1584
|
+
for (const p of parts) {
|
|
1585
|
+
const nextP = parts[++i];
|
|
1586
|
+
const pattern = getPattern(p, nextP) || (nextP === undefined && p && p.indexOf("*") === p.length - 1 ? p : null);
|
|
1587
|
+
const isParam = Array.isArray(pattern);
|
|
1588
|
+
const key = isParam ? pattern[0] : pattern || p;
|
|
1589
|
+
const child = curNode.#children[key] ||= new _Node2;
|
|
1590
|
+
if (pattern && !child.#pattern) {
|
|
1591
|
+
child.#pattern = pattern;
|
|
1592
|
+
curNode.#patterns.push(child);
|
|
1593
|
+
}
|
|
1594
|
+
curNode = child;
|
|
1595
|
+
if (isParam) {
|
|
1596
|
+
possibleKeys.add(pattern[1]);
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
curNode.#methods.push({
|
|
1600
|
+
[method]: {
|
|
1601
|
+
handler,
|
|
1602
|
+
possibleKeys: [...possibleKeys],
|
|
1603
|
+
score: ++order
|
|
1604
|
+
}
|
|
1605
|
+
});
|
|
1606
|
+
}
|
|
1607
|
+
#pushHandlerSets(handlerSets, node, method, nodeParams, params) {
|
|
1608
|
+
for (let i = 0, len = node.#methods.length;i < len; i++) {
|
|
1609
|
+
const m = node.#methods[i];
|
|
1610
|
+
const handlerSet = m[method] || m[METHOD_NAME_ALL];
|
|
1611
|
+
if (handlerSet) {
|
|
1612
|
+
handlerSet.params = /* @__PURE__ */ Object.create(null);
|
|
1613
|
+
handlerSets.push(handlerSet);
|
|
1614
|
+
for (let i2 = 0, len2 = handlerSet.possibleKeys.length;i2 < len2; i2++) {
|
|
1615
|
+
const key = handlerSet.possibleKeys[i2];
|
|
1616
|
+
handlerSet.params[key] = params?.[key] && !i2 ? params[key] : nodeParams[key] ?? params?.[key];
|
|
1617
|
+
}
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
search(method, path) {
|
|
1622
|
+
const handlerSets = [];
|
|
1623
|
+
this.#params = emptyParams;
|
|
1624
|
+
const curNode = this;
|
|
1625
|
+
let curNodes = [curNode];
|
|
1626
|
+
const parts = splitPath(path);
|
|
1627
|
+
const curNodesQueue = [];
|
|
1628
|
+
const len = parts.length;
|
|
1629
|
+
let partOffsets = null;
|
|
1630
|
+
for (let i = 0;i < len; i++) {
|
|
1631
|
+
const part = parts[i];
|
|
1632
|
+
const isLast = i === len - 1;
|
|
1633
|
+
const tempNodes = [];
|
|
1634
|
+
for (let j = 0, len2 = curNodes.length;j < len2; j++) {
|
|
1635
|
+
const node = curNodes[j];
|
|
1636
|
+
const nextNode = node.#children[part];
|
|
1637
|
+
if (nextNode) {
|
|
1638
|
+
nextNode.#params = node.#params;
|
|
1639
|
+
if (isLast) {
|
|
1640
|
+
if (nextNode.#children["*"]) {
|
|
1641
|
+
this.#pushHandlerSets(handlerSets, nextNode.#children["*"], method, node.#params);
|
|
1642
|
+
}
|
|
1643
|
+
this.#pushHandlerSets(handlerSets, nextNode, method, node.#params);
|
|
1644
|
+
} else {
|
|
1645
|
+
tempNodes.push(nextNode);
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
for (const child of node.#patterns) {
|
|
1649
|
+
const pattern = child.#pattern;
|
|
1650
|
+
const params = node.#params === emptyParams ? {} : { ...node.#params };
|
|
1651
|
+
if (typeof pattern === "string") {
|
|
1652
|
+
if (pattern === "*" || part.startsWith(pattern.slice(0, -1))) {
|
|
1653
|
+
this.#pushHandlerSets(handlerSets, child, method, node.#params);
|
|
1654
|
+
if (pattern === "*") {
|
|
1655
|
+
child.#params = params;
|
|
1656
|
+
tempNodes.push(child);
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
continue;
|
|
1660
|
+
}
|
|
1661
|
+
const [, name, matcher] = pattern;
|
|
1662
|
+
if (!part && matcher === true) {
|
|
1663
|
+
continue;
|
|
1664
|
+
}
|
|
1665
|
+
if (matcher !== true) {
|
|
1666
|
+
if (!partOffsets) {
|
|
1667
|
+
partOffsets = [];
|
|
1668
|
+
let offset = path[0] === "/" ? 1 : 0;
|
|
1669
|
+
for (let p = 0;p < len; p++) {
|
|
1670
|
+
partOffsets[p] = offset;
|
|
1671
|
+
offset += parts[p].length + 1;
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
const restPathString = path.slice(partOffsets[i]);
|
|
1675
|
+
const m = matcher.exec(restPathString);
|
|
1676
|
+
if (m) {
|
|
1677
|
+
params[name] = m[0];
|
|
1678
|
+
this.#pushHandlerSets(handlerSets, child, method, node.#params, params);
|
|
1679
|
+
if (m[0].length === restPathString.length && child.#children["*"]) {
|
|
1680
|
+
this.#pushHandlerSets(handlerSets, child.#children["*"], method, node.#params, params);
|
|
1681
|
+
}
|
|
1682
|
+
for (const _ in child.#children) {
|
|
1683
|
+
child.#params = params;
|
|
1684
|
+
const componentCount = m[0].match(/\//g)?.length ?? 0;
|
|
1685
|
+
const targetCurNodes = curNodesQueue[componentCount] ||= [];
|
|
1686
|
+
targetCurNodes.push(child);
|
|
1687
|
+
break;
|
|
1688
|
+
}
|
|
1689
|
+
continue;
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
if (matcher === true || matcher.test(part)) {
|
|
1693
|
+
params[name] = part;
|
|
1694
|
+
if (isLast) {
|
|
1695
|
+
this.#pushHandlerSets(handlerSets, child, method, params, node.#params);
|
|
1696
|
+
if (child.#children["*"]) {
|
|
1697
|
+
this.#pushHandlerSets(handlerSets, child.#children["*"], method, params, node.#params);
|
|
1698
|
+
}
|
|
1699
|
+
} else {
|
|
1700
|
+
child.#params = params;
|
|
1701
|
+
tempNodes.push(child);
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
const shifted = curNodesQueue.shift();
|
|
1707
|
+
curNodes = shifted ? tempNodes.concat(shifted) : tempNodes;
|
|
1708
|
+
}
|
|
1709
|
+
if (handlerSets[1]) {
|
|
1710
|
+
handlerSets.sort((a, b) => {
|
|
1711
|
+
return a.score - b.score;
|
|
1712
|
+
});
|
|
1713
|
+
}
|
|
1714
|
+
return [handlerSets.map(({ handler, params }) => [handler, params])];
|
|
1715
|
+
}
|
|
1716
|
+
};
|
|
1717
|
+
|
|
1718
|
+
// node_modules/hono/dist/router/trie-router/router.js
|
|
1719
|
+
var TrieRouter = class {
|
|
1720
|
+
name = "TrieRouter";
|
|
1721
|
+
#node = new Node2;
|
|
1722
|
+
add(method, path, handler) {
|
|
1723
|
+
for (const result of checkOptionalParameter(path) || [path]) {
|
|
1724
|
+
this.#node.insert(method, result, handler);
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
match(method, path) {
|
|
1728
|
+
return this.#node.search(method, path);
|
|
1729
|
+
}
|
|
1730
|
+
};
|
|
1731
|
+
|
|
1732
|
+
// node_modules/hono/dist/hono.js
|
|
1733
|
+
var Hono2 = class extends Hono {
|
|
1734
|
+
constructor(options = {}) {
|
|
1735
|
+
super(options);
|
|
1736
|
+
this.router = options.router ?? new SmartRouter({
|
|
1737
|
+
routers: [new RegExpRouter, new TrieRouter]
|
|
1738
|
+
});
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
|
|
1742
|
+
// src/providers.ts
|
|
1743
|
+
class UpstreamError extends Error {
|
|
1744
|
+
status;
|
|
1745
|
+
constructor(message, status = null) {
|
|
1746
|
+
super(message);
|
|
1747
|
+
this.status = status;
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
function extractErrorMessage(text) {
|
|
1751
|
+
const t = text.trim();
|
|
1752
|
+
if (!t)
|
|
1753
|
+
return null;
|
|
1754
|
+
try {
|
|
1755
|
+
const j = JSON.parse(t);
|
|
1756
|
+
const m = j?.error?.message ?? j?.message ?? j?.error;
|
|
1757
|
+
if (typeof m === "string" && m)
|
|
1758
|
+
return m;
|
|
1759
|
+
return JSON.stringify(j).slice(0, 500);
|
|
1760
|
+
} catch {
|
|
1761
|
+
return t.slice(0, 500);
|
|
1762
|
+
}
|
|
1763
|
+
}
|
|
1764
|
+
var encoder = new TextEncoder;
|
|
1765
|
+
function rewriteSSELine(line, alias, usageBox) {
|
|
1766
|
+
if (line.startsWith("data:") && !line.startsWith("data: [DONE]")) {
|
|
1767
|
+
const payload = line.slice(5).trim();
|
|
1768
|
+
if (payload) {
|
|
1769
|
+
try {
|
|
1770
|
+
const j = JSON.parse(payload);
|
|
1771
|
+
if (j && typeof j === "object") {
|
|
1772
|
+
j.model = alias;
|
|
1773
|
+
if (j.usage && typeof j.usage === "object") {
|
|
1774
|
+
usageBox.usage = {
|
|
1775
|
+
prompt_tokens: j.usage.prompt_tokens,
|
|
1776
|
+
completion_tokens: j.usage.completion_tokens,
|
|
1777
|
+
total_tokens: j.usage.total_tokens
|
|
1778
|
+
};
|
|
1779
|
+
}
|
|
1780
|
+
return `data: ${JSON.stringify(j)}
|
|
1781
|
+
`;
|
|
1782
|
+
}
|
|
1783
|
+
} catch {}
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
return line === "" ? `
|
|
1787
|
+
` : `${line}
|
|
1788
|
+
`;
|
|
1789
|
+
}
|
|
1790
|
+
function wrapSSEStream(upstream, alias, idleMs) {
|
|
1791
|
+
const reader = upstream.getReader();
|
|
1792
|
+
const usageBox = { usage: null };
|
|
1793
|
+
let lastActivity = Date.now();
|
|
1794
|
+
let timer = null;
|
|
1795
|
+
let terminated = false;
|
|
1796
|
+
const end = (fn) => {
|
|
1797
|
+
if (terminated)
|
|
1798
|
+
return;
|
|
1799
|
+
terminated = true;
|
|
1800
|
+
fn();
|
|
1801
|
+
};
|
|
1802
|
+
const stream = new ReadableStream({
|
|
1803
|
+
async start(controller) {
|
|
1804
|
+
timer = setInterval(() => {
|
|
1805
|
+
if (Date.now() - lastActivity > idleMs) {
|
|
1806
|
+
clearInterval(timer);
|
|
1807
|
+
reader.cancel().catch(() => {});
|
|
1808
|
+
end(() => controller.error(new Error(`upstream \u6D41\u5F0F\u7A7A\u95F2\u8D85\u65F6\uFF08${idleMs}ms \u65E0\u6570\u636E\uFF09`)));
|
|
1809
|
+
}
|
|
1810
|
+
}, 1000);
|
|
1811
|
+
const decoder = new TextDecoder;
|
|
1812
|
+
let lineBuf = "";
|
|
1813
|
+
try {
|
|
1814
|
+
while (true) {
|
|
1815
|
+
const { done, value } = await reader.read();
|
|
1816
|
+
if (done)
|
|
1817
|
+
break;
|
|
1818
|
+
lastActivity = Date.now();
|
|
1819
|
+
lineBuf += decoder.decode(value, { stream: true });
|
|
1820
|
+
let idx;
|
|
1821
|
+
while ((idx = lineBuf.indexOf(`
|
|
1822
|
+
`)) >= 0) {
|
|
1823
|
+
const line = lineBuf.slice(0, idx);
|
|
1824
|
+
lineBuf = lineBuf.slice(idx + 1);
|
|
1825
|
+
controller.enqueue(encoder.encode(rewriteSSELine(line, alias, usageBox)));
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
if (lineBuf.length > 0) {
|
|
1829
|
+
controller.enqueue(encoder.encode(rewriteSSELine(lineBuf, alias, usageBox)));
|
|
1830
|
+
}
|
|
1831
|
+
end(() => controller.close());
|
|
1832
|
+
} catch (e) {
|
|
1833
|
+
end(() => controller.error(e));
|
|
1834
|
+
} finally {
|
|
1835
|
+
if (timer)
|
|
1836
|
+
clearInterval(timer);
|
|
1837
|
+
}
|
|
1838
|
+
},
|
|
1839
|
+
cancel() {
|
|
1840
|
+
reader.cancel().catch(() => {});
|
|
1841
|
+
}
|
|
1842
|
+
});
|
|
1843
|
+
return { stream, usageBox };
|
|
1844
|
+
}
|
|
1845
|
+
function parseTarget(target) {
|
|
1846
|
+
const sep = target.indexOf(":");
|
|
1847
|
+
return { providerName: target.slice(0, sep), model: target.slice(sep + 1) };
|
|
1848
|
+
}
|
|
1849
|
+
async function chatWithFailover(cfg, alias, body, fetchImpl = fetch) {
|
|
1850
|
+
const targets = cfg.aliases[alias];
|
|
1851
|
+
const errors = [];
|
|
1852
|
+
const timeoutMs = cfg.timeout_seconds * 1000;
|
|
1853
|
+
const isStream = body.stream === true;
|
|
1854
|
+
for (const target of targets) {
|
|
1855
|
+
const { providerName, model } = parseTarget(target);
|
|
1856
|
+
const provider = cfg.providers[providerName];
|
|
1857
|
+
const upstreamBody = { ...body, model };
|
|
1858
|
+
const headers = {
|
|
1859
|
+
"content-type": "application/json",
|
|
1860
|
+
authorization: `Bearer ${provider.api_key}`
|
|
1861
|
+
};
|
|
1862
|
+
const url = `${provider.base_url}/chat/completions`;
|
|
1863
|
+
let headerController = null;
|
|
1864
|
+
let headerTimer = null;
|
|
1865
|
+
if (isStream) {
|
|
1866
|
+
headerController = new AbortController;
|
|
1867
|
+
headerTimer = setTimeout(() => headerController?.abort(), timeoutMs);
|
|
1868
|
+
}
|
|
1869
|
+
try {
|
|
1870
|
+
const res = await fetchImpl(url, {
|
|
1871
|
+
method: "POST",
|
|
1872
|
+
headers,
|
|
1873
|
+
body: JSON.stringify(upstreamBody),
|
|
1874
|
+
signal: isStream ? headerController.signal : AbortSignal.timeout(timeoutMs)
|
|
1875
|
+
});
|
|
1876
|
+
if (headerTimer)
|
|
1877
|
+
clearTimeout(headerTimer);
|
|
1878
|
+
if (!res.ok) {
|
|
1879
|
+
const text = await res.text().catch(() => "");
|
|
1880
|
+
throw new UpstreamError(extractErrorMessage(text) ?? `upstream ${res.status} ${res.statusText}`, res.status);
|
|
1881
|
+
}
|
|
1882
|
+
if (isStream && res.body) {
|
|
1883
|
+
const { stream, usageBox: usageBox2 } = wrapSSEStream(res.body, alias, timeoutMs);
|
|
1884
|
+
return {
|
|
1885
|
+
res: new Response(stream, {
|
|
1886
|
+
status: 200,
|
|
1887
|
+
headers: {
|
|
1888
|
+
"content-type": "text/event-stream",
|
|
1889
|
+
"cache-control": "no-cache"
|
|
1890
|
+
}
|
|
1891
|
+
}),
|
|
1892
|
+
realModel: `${providerName}:${model}`,
|
|
1893
|
+
usageBox: usageBox2,
|
|
1894
|
+
errors
|
|
1895
|
+
};
|
|
1896
|
+
}
|
|
1897
|
+
const j = await res.json().catch(() => null);
|
|
1898
|
+
if (!j || typeof j !== "object") {
|
|
1899
|
+
throw new UpstreamError("upstream \u8FD4\u56DE\u4E86\u975E JSON \u54CD\u5E94\u4F53");
|
|
1900
|
+
}
|
|
1901
|
+
const json = j;
|
|
1902
|
+
json.model = alias;
|
|
1903
|
+
const usageBox = {
|
|
1904
|
+
usage: json.usage && typeof json.usage === "object" ? json.usage : null
|
|
1905
|
+
};
|
|
1906
|
+
return {
|
|
1907
|
+
res: new Response(JSON.stringify(json), {
|
|
1908
|
+
status: 200,
|
|
1909
|
+
headers: { "content-type": "application/json" }
|
|
1910
|
+
}),
|
|
1911
|
+
realModel: `${providerName}:${model}`,
|
|
1912
|
+
usageBox,
|
|
1913
|
+
errors
|
|
1914
|
+
};
|
|
1915
|
+
} catch (e) {
|
|
1916
|
+
errors.push({
|
|
1917
|
+
target,
|
|
1918
|
+
message: e instanceof Error ? e.message : typeof e === "object" && e !== null && ("message" in e) ? String(e.message) : String(e),
|
|
1919
|
+
status: e instanceof UpstreamError ? e.status : null
|
|
1920
|
+
});
|
|
1921
|
+
continue;
|
|
1922
|
+
}
|
|
1923
|
+
}
|
|
1924
|
+
const last = errors[errors.length - 1];
|
|
1925
|
+
const status = last?.status && last.status >= 400 && last.status < 500 ? last.status : 502;
|
|
1926
|
+
const detail = errors.map((e) => `${e.target}: ${e.message}`).join("; ");
|
|
1927
|
+
const bodyErr = {
|
|
1928
|
+
error: {
|
|
1929
|
+
message: `\u522B\u540D "${alias}" \u7684\u6240\u6709 provider \u90FD\u5931\u8D25\u4E86\uFF08${errors.length} \u4E2A\u76EE\u6807\uFF09: ${detail}`,
|
|
1930
|
+
type: "upstream_error",
|
|
1931
|
+
code: "upstream_failed"
|
|
1932
|
+
}
|
|
1933
|
+
};
|
|
1934
|
+
return {
|
|
1935
|
+
res: new Response(JSON.stringify(bodyErr), {
|
|
1936
|
+
status,
|
|
1937
|
+
headers: { "content-type": "application/json" }
|
|
1938
|
+
}),
|
|
1939
|
+
realModel: "",
|
|
1940
|
+
usageBox: { usage: null },
|
|
1941
|
+
errors
|
|
1942
|
+
};
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1945
|
+
// src/logger.ts
|
|
1946
|
+
import { appendFileSync } from "fs";
|
|
1947
|
+
var usageBoxes = new WeakMap;
|
|
1948
|
+
function setUsageBox(rec, box) {
|
|
1949
|
+
usageBoxes.set(rec, box);
|
|
1950
|
+
}
|
|
1951
|
+
function applyUsageBox(rec) {
|
|
1952
|
+
const box = usageBoxes.get(rec);
|
|
1953
|
+
if (!box?.usage)
|
|
1954
|
+
return;
|
|
1955
|
+
rec.promptTokens = box.usage.prompt_tokens ?? rec.promptTokens;
|
|
1956
|
+
rec.completionTokens = box.usage.completion_tokens ?? rec.completionTokens;
|
|
1957
|
+
rec.totalTokens = box.usage.total_tokens ?? rec.totalTokens;
|
|
1958
|
+
}
|
|
1959
|
+
var accessEnabled = true;
|
|
1960
|
+
var accessPath = "access.log";
|
|
1961
|
+
function configureLogging(enabled, path) {
|
|
1962
|
+
accessEnabled = enabled;
|
|
1963
|
+
if (path)
|
|
1964
|
+
accessPath = path;
|
|
1965
|
+
}
|
|
1966
|
+
function writeAccessLog(r) {
|
|
1967
|
+
if (!accessEnabled)
|
|
1968
|
+
return;
|
|
1969
|
+
try {
|
|
1970
|
+
appendFileSync(accessPath, JSON.stringify(r) + `
|
|
1971
|
+
`);
|
|
1972
|
+
} catch {}
|
|
1973
|
+
}
|
|
1974
|
+
function consoleSummary(r) {
|
|
1975
|
+
const extra = [
|
|
1976
|
+
r.key && `key=${r.key}`,
|
|
1977
|
+
r.alias && `alias=${r.alias}`,
|
|
1978
|
+
r.realModel && `model=${r.realModel}`,
|
|
1979
|
+
r.totalTokens != null && `tokens=${r.totalTokens}`,
|
|
1980
|
+
r.stream && "stream"
|
|
1981
|
+
].filter(Boolean).join(" ");
|
|
1982
|
+
console.log(`[${r.ts}] ${r.method} ${r.path} ${r.status} ${r.ms}ms${extra ? " " + extra : ""}`);
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
// src/admin.ts
|
|
1986
|
+
import { readFileSync as readFileSync2, writeFileSync, renameSync } from "fs";
|
|
1987
|
+
import { resolve } from "path";
|
|
1988
|
+
import { createHmac, timingSafeEqual } from "crypto";
|
|
1989
|
+
|
|
1990
|
+
// src/admin-assets.generated.ts
|
|
1991
|
+
var adminAssets = {
|
|
1992
|
+
"assets/index-D4FpNvr-.css": ".auth-screen{box-sizing:border-box;background:linear-gradient(135deg,#eef2ff 0%,#faf0ff 45%,#fdf2f8 100%);justify-content:center;align-items:center;min-height:100dvh;padding:0;display:flex;overflow:auto}.auth-panel{flex-direction:column;align-items:center;width:100%;max-width:420px;display:flex}.auth-brand{text-align:center;margin-bottom:22px}.auth-logo{background:#fff;border-radius:18px;justify-content:center;align-items:center;width:72px;height:72px;margin:0 auto 14px;display:flex;box-shadow:0 10px 28px #6366f147}.auth-title{letter-spacing:.5px;background:linear-gradient(120deg,#6366f1,#8b5cf6,#d946ef);-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;margin:0;font-size:26px;font-weight:700}.auth-subtitle{color:#6b7280;margin:6px 0 0;font-size:13px}.auth-card{-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);background:#ffffffeb;border-radius:18px;width:100%;padding:6px 4px;box-shadow:0 18px 48px #6366f12e}.auth-icon{color:#6366f1;background:linear-gradient(135deg,#e0e7ff,#fae8ff);border-radius:50%;justify-content:center;align-items:center;width:56px;height:56px;margin:6px auto 14px;display:flex}.auth-icon.warn{color:#d97706;background:linear-gradient(135deg,#fef3c7,#fce7f3)}.auth-card-title{text-align:center;color:#1f2937;margin:0 0 4px;font-size:18px;font-weight:600}.auth-card-desc{text-align:center;color:#6b7280;margin:0 0 18px;font-size:13px}.auth-btn{background:linear-gradient(120deg,#6366f1,#8b5cf6);border:none;margin-top:6px;box-shadow:0 8px 20px #6366f159}.auth-btn:hover{background:linear-gradient(120deg,#5457e5,#7c4ddb);box-shadow:0 10px 24px #6366f173}.auth-input{border-radius:10px}.auth-alert{margin-bottom:14px}.inline-code{color:#4338ca;background:#f3f4f6;border-radius:4px;padding:0 5px;font-size:12px}@media (width<=760px){.auth-screen{padding:16px}.auth-title{font-size:23px}.auth-card{border-radius:16px}}.section-nav{flex-direction:column;flex-shrink:0;gap:4px;width:168px;display:flex;position:sticky;top:16px}.section-nav button{cursor:pointer;color:#555;text-align:left;background:0 0;border:none;border-radius:8px;align-items:center;gap:8px;padding:9px 12px;font-size:14px;transition:background .15s,color .15s;display:flex}.section-nav button:hover{background:#6366f114}.section-nav button.active{color:#4f46e5;background:#fff;font-weight:600;box-shadow:0 2px 8px #6366f12e}.nav-count{color:#999;background:#eef0f5;border-radius:10px;margin-left:auto;padding:0 8px;font-size:12px;line-height:18px}.section-nav button.active .nav-count{color:#4f46e5;background:#e0e7ff}@media (width<=760px){.section-nav{-webkit-overflow-scrolling:touch;flex-direction:row;gap:6px;width:100%;padding-bottom:2px;position:static;overflow-x:auto}.section-nav button{white-space:nowrap;flex-shrink:0;padding:7px 10px;font-size:13px}.nav-count{margin-left:4px}}.check-result{background:#fff;border:1px solid #e3e8ef;border-radius:12px;margin-bottom:16px;padding:12px 16px}.check-result.has-error{background:#fff7f7;border-color:#f5b5b8}.check-summary{color:#1f2937;align-items:center;gap:8px;font-weight:600;display:flex}.check-result.has-error .check-summary{color:#c0392b}.check-list{flex-direction:column;gap:8px;margin:10px 0 0;padding:0;list-style:none;display:flex}.check-list li{align-items:flex-start;gap:8px;font-size:13px;line-height:1.5;display:flex}.check-list li.warning .check-msg{color:#8a6d3b}.check-list li.error .check-msg{color:#b03a2e}@media (width<=760px){.check-result{margin-bottom:10px;padding:10px 12px}}.api-url-row{align-items:center;gap:12px;display:flex}.api-url{word-break:break-all;-webkit-user-select:all;user-select:all;background:#f5f5f5;border-radius:6px;flex:1;padding:6px 10px;font-size:14px}.key-add-row{flex-wrap:wrap}.key-row{border:1px solid #eee;border-radius:8px;flex-direction:row;align-items:center;gap:12px;padding:8px 12px;display:flex}.key-top{flex:auto;align-items:center;gap:12px;min-width:0;display:flex}.key-bottom{flex:none;align-items:center;gap:10px;display:flex}@media (width<=760px){.key-row{flex-direction:column;align-items:stretch;gap:6px}.key-top{flex-wrap:wrap;gap:8px}.key-bottom{flex-wrap:wrap;justify-content:space-between;gap:8px}.key-add-row{flex-direction:column;align-items:stretch}.key-add-row>*{width:100%}.key-name{min-width:0;width:auto!important}.key-value{word-break:break-all}}.item-card{border:1px solid #eee;border-radius:8px;min-width:0;padding:12px;position:relative;overflow:hidden}.item-card.field-error{border-color:var(--n-error-color,#e88080)}.item-card .item-card-del{z-index:1;position:absolute;top:6px;right:6px}.item-card-title{margin-bottom:8px;padding-right:28px;font-weight:600}.item-card-body{flex-direction:column;gap:8px;display:flex}@media (width<=760px){.provider-name-row{flex-direction:column;align-items:stretch;gap:12px}.provider-name-row>div{width:100%!important}}.alias-card{min-width:0;max-width:100%}.alias-target-select .n-base-selection-label{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.hero-header{color:#fff;background:linear-gradient(120deg,#6366f1,#8b5cf6,#d946ef);border-radius:14px;justify-content:space-between;align-items:center;gap:16px;margin-bottom:20px;padding:18px 22px;display:flex;box-shadow:0 8px 24px #6366f159}.hero-left{align-items:center;gap:12px;display:flex}.hero-logo{background:#ffffff2e;border-radius:12px;flex-shrink:0;justify-content:center;align-items:center;width:46px;height:46px;display:flex}.hero-logo svg{display:block}.card-title{align-items:center;gap:6px;display:inline-flex}.editor-content{min-width:0;padding-bottom:24px}.page-wrap{max-width:1200px;margin:0 auto;padding:24px;overflow-x:hidden}.page-wrap--auth{max-width:none;padding:0}.section-layout{align-items:flex-start;gap:20px;min-width:0;display:flex}.section-body{flex:1;width:100%;min-width:0}.field-error{border-color:#e5484d!important;box-shadow:0 0 0 3px #e5484d2e!important}.check-config-btn{color:#fff;background:#ffffff29;border:1px solid #ffffff59}.check-config-btn:hover{color:#fff;background:#ffffff47}.soft-card{border-radius:14px;transition:box-shadow .2s,transform .2s;box-shadow:0 4px 16px #6366f114}.soft-card:hover{transform:translateY(-2px);box-shadow:0 8px 24px #6366f129}@media (width<=760px){.page-wrap{padding:10px}.page-wrap--auth{padding:0}.editor-content{padding-bottom:12px}.soft-card{margin-bottom:10px!important}.hero-header{border-radius:10px;flex-direction:column;align-items:flex-start;margin-bottom:12px;padding:12px 14px}.section-layout{flex-direction:column;gap:10px}}html,body{background:linear-gradient(160deg,#eef2ff 0%,#f5f3ff 45%,#fdf4ff 100%);min-height:100%;margin:0}.app-bg{min-height:100dvh}\n",
|
|
1993
|
+
"assets/index-DVBoJLle.js": '(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),S=e=>x(e).slice(8,-1),C=e=>x(e)===`[object Object]`,w=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,T=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),E=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},D=/-\\w/g,O=E(e=>e.replace(D,e=>e.slice(1).toUpperCase())),ee=/\\B([A-Z])/g,te=E(e=>e.replace(ee,`-$1`).toLowerCase()),ne=E(e=>e.charAt(0).toUpperCase()+e.slice(1)),re=E(e=>e?`on${ne(e)}`:``),ie=(e,t)=>!Object.is(e,t),ae=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},oe=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},se=e=>{let t=parseFloat(e);return isNaN(t)?e:t},ce=e=>{let t=g(e)?Number(e):NaN;return isNaN(t)?e:t},le,ue=()=>le||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function k(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=g(r)?me(r):k(r);if(i)for(let e in i)t[e]=i[e]}return t}if(g(e)||v(e))return e}var de=/;(?![^(]*\\))/g,fe=/:([^]+)/,pe=/\\/\\*[^]*?\\*\\//g;function me(e){let t={};return e.replace(pe,``).split(de).forEach(e=>{if(e){let n=e.split(fe);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function he(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=he(e[n]);r&&(t+=r+` `)}else if(v(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var ge=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,_e=e(ge);ge+``;function ve(e){return!!e||e===``}function ye(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=be(e[r],t[r]);return n}function be(e,t){if(e===t)return!0;let n=m(e),r=m(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=_(e),r=_(t),n||r)return e===t;if(n=d(e),r=d(t),n||r)return n&&r?ye(e,t):!1;if(n=v(e),r=v(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!be(e[n],t[n]))return!1}}return String(e)===String(t)}var xe=e=>!!(e&&e.__v_isRef===!0),Se=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?xe(e)?Se(e.value):JSON.stringify(e,Ce,2):String(e),Ce=(e,t)=>xe(t)?Ce(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[we(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>we(e))}:_(t)?we(t):v(t)&&!d(t)&&!C(t)?String(t):t,we=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,Te,Ee=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Te&&(Te.active?(this.parent=Te,this.index=(Te.scopes||(Te.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=Te;try{return Te=this,e()}finally{Te=t}}}on(){++this._on===1&&(this.prevScope=Te,Te=this)}off(){if(this._on>0&&--this._on===0){if(Te===this)Te=this.prevScope;else{let e=Te;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function De(){return Te}var Oe,ke=new WeakSet,Ae=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Te&&(Te.active?Te.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ke.has(this)&&(ke.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Pe(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,qe(this),Le(this);let e=Oe,t=Ue;Oe=this,Ue=!0;try{return this.fn()}finally{Re(this),Oe=e,Ue=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Ve(e);this.deps=this.depsTail=void 0,qe(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ke.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ze(this)&&this.run()}get dirty(){return ze(this)}},je=0,Me,Ne;function Pe(e,t=!1){if(e.flags|=8,t){e.next=Ne,Ne=e;return}e.next=Me,Me=e}function Fe(){je++}function Ie(){if(--je>0)return;if(Ne){let e=Ne;for(Ne=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Me;){let t=Me;for(Me=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Le(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Re(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),Ve(r),He(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function ze(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Be(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Be(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Je)||(e.globalVersion=Je,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ze(e))))return;e.flags|=2;let t=e.dep,n=Oe,r=Ue;Oe=e,Ue=!0;try{Le(e);let n=e.fn(e._value);(t.version===0||ie(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{Oe=n,Ue=r,Re(e),e.flags&=-3}}function Ve(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)Ve(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function He(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Ue=!0,We=[];function Ge(){We.push(Ue),Ue=!1}function Ke(){let e=We.pop();Ue=e===void 0||e}function qe(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=Oe;Oe=void 0;try{t()}finally{Oe=e}}}var Je=0,Ye=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Xe=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Oe||!Ue||Oe===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Oe)t=this.activeLink=new Ye(Oe,this),Oe.deps?(t.prevDep=Oe.depsTail,Oe.depsTail.nextDep=t,Oe.depsTail=t):Oe.deps=Oe.depsTail=t,Ze(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=Oe.depsTail,t.nextDep=void 0,Oe.depsTail.nextDep=t,Oe.depsTail=t,Oe.deps===t&&(Oe.deps=e)}return t}trigger(e){this.version++,Je++,this.notify(e)}notify(e){Fe();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Ie()}}};function Ze(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Ze(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Qe=new WeakMap,$e=Symbol(``),et=Symbol(``),tt=Symbol(``);function nt(e,t,n){if(Ue&&Oe){let t=Qe.get(e);t||Qe.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Xe),r.map=t,r.key=n),r.track()}}function rt(e,t,n,r,i,a){let o=Qe.get(e);if(!o){Je++;return}let s=e=>{e&&e.trigger()};if(Fe(),t===`clear`)o.forEach(s);else{let i=d(e),a=i&&w(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===tt||!_(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(tt)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get($e)),f(e)&&s(o.get(et)));break;case`delete`:i||(s(o.get($e)),f(e)&&s(o.get(et)));break;case`set`:f(e)&&s(o.get($e))}}Ie()}function it(e,t){let n=Qe.get(e);return n&&n.get(t)}function at(e){let t=Kt(e);return t===e?t:(nt(t,`iterate`,tt),Wt(e)?t:t.map(Jt))}function ot(e){return nt(e=Kt(e),`iterate`,tt),e}function st(e,t){return Ut(e)?Yt(Ht(e)?Jt(t):t):Jt(t)}var ct={__proto__:null,[Symbol.iterator](){return lt(this,Symbol.iterator,e=>st(this,e))},concat(...e){return at(this).concat(...e.map(e=>d(e)?at(e):e))},entries(){return lt(this,`entries`,e=>(e[1]=st(this,e[1]),e))},every(e,t){return dt(this,`every`,e,t,void 0,arguments)},filter(e,t){return dt(this,`filter`,e,t,e=>e.map(e=>st(this,e)),arguments)},find(e,t){return dt(this,`find`,e,t,e=>st(this,e),arguments)},findIndex(e,t){return dt(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return dt(this,`findLast`,e,t,e=>st(this,e),arguments)},findLastIndex(e,t){return dt(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return dt(this,`forEach`,e,t,void 0,arguments)},includes(...e){return pt(this,`includes`,e)},indexOf(...e){return pt(this,`indexOf`,e)},join(e){return at(this).join(e)},lastIndexOf(...e){return pt(this,`lastIndexOf`,e)},map(e,t){return dt(this,`map`,e,t,void 0,arguments)},pop(){return mt(this,`pop`)},push(...e){return mt(this,`push`,e)},reduce(e,...t){return ft(this,`reduce`,e,t)},reduceRight(e,...t){return ft(this,`reduceRight`,e,t)},shift(){return mt(this,`shift`)},some(e,t){return dt(this,`some`,e,t,void 0,arguments)},splice(...e){return mt(this,`splice`,e)},toReversed(){return at(this).toReversed()},toSorted(e){return at(this).toSorted(e)},toSpliced(...e){return at(this).toSpliced(...e)},unshift(...e){return mt(this,`unshift`,e)},values(){return lt(this,`values`,e=>st(this,e))}};function lt(e,t,n){let r=ot(e),i=r[t]();return r!==e&&!Wt(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var ut=Array.prototype;function dt(e,t,n,r,i,a){let o=ot(e),s=o!==e&&!Wt(e),c=o[t];if(c!==ut[t]){let t=c.apply(e,a);return s?Jt(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,st(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function ft(e,t,n,r){let i=ot(e),a=i!==e&&!Wt(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=st(e,t)),n.call(this,t,st(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?st(e,c):c}function pt(e,t,n){let r=Kt(e);nt(r,`iterate`,tt);let i=r[t](...n);return(i===-1||i===!1)&&Gt(n[0])?(n[0]=Kt(n[0]),r[t](...n)):i}function mt(e,t,n=[]){Ge(),Fe();let r=Kt(e)[t].apply(e,n);return Ie(),Ke(),r}var ht=e(`__proto__,__v_isRef,__isVue`),gt=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(_));function _t(e){_(e)||(e=String(e));let t=Kt(this);return nt(t,`has`,e),t.hasOwnProperty(e)}var vt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?It:Ft:i?Pt:Nt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=d(e);if(!r){let e;if(a&&(e=ct[t]))return e;if(t===`hasOwnProperty`)return _t}let o=Reflect.get(e,t,Xt(e)?e:n);if((_(t)?gt.has(t):ht(t))||(r||nt(e,`get`,t),i))return o;if(Xt(o)){let e=a&&w(t)?o:o.value;return r&&v(e)?Bt(e):e}return v(o)?r?Bt(o):Rt(o):o}},yt=class extends vt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=d(e)&&w(t);if(!this._isShallow){let e=Ut(i);if(!Wt(n)&&!Ut(n)&&(i=Kt(i),n=Kt(n)),!a&&Xt(i)&&!Xt(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:u(e,t),s=Reflect.set(e,t,n,Xt(e)?e:r);return e===Kt(r)&&s&&(o?ie(n,i)&&rt(e,`set`,t,n,i):rt(e,`add`,t,n)),s}deleteProperty(e,t){let n=u(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&rt(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!_(t)||!gt.has(t))&&nt(e,`has`,t),n}ownKeys(e){return nt(e,`iterate`,d(e)?`length`:$e),Reflect.ownKeys(e)}},bt=class extends vt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},xt=new yt,St=new bt,Ct=new yt(!0),wt=e=>e,Tt=e=>Reflect.getPrototypeOf(e);function Et(e,t,n){return function(...r){let i=this.__v_raw,a=Kt(i),o=f(a),c=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?wt:t?Yt:Jt;return!t&&nt(a,`iterate`,l?et:$e),s(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function Dt(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Ot(e,t){let n={get(n){let r=this.__v_raw,i=Kt(r),a=Kt(n);e||(ie(n,a)&&nt(i,`get`,n),nt(i,`get`,a));let{has:o}=Tt(i),s=t?wt:e?Yt:Jt;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&nt(Kt(t),`iterate`,$e),t.size},has(t){let n=this.__v_raw,r=Kt(n),i=Kt(t);return e||(ie(t,i)&&nt(r,`has`,t),nt(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=Kt(a),s=t?wt:e?Yt:Jt;return!e&&nt(o,`iterate`,$e),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return s(n,e?{add:Dt(`add`),set:Dt(`set`),delete:Dt(`delete`),clear:Dt(`clear`)}:{add(e){let n=Kt(this),r=Tt(n),i=Kt(e),a=!t&&!Wt(e)&&!Ut(e)?i:e;return r.has.call(n,a)||ie(e,a)&&r.has.call(n,e)||ie(i,a)&&r.has.call(n,i)||(n.add(a),rt(n,`add`,a,a)),this},set(e,n){!t&&!Wt(n)&&!Ut(n)&&(n=Kt(n));let r=Kt(this),{has:i,get:a}=Tt(r),o=i.call(r,e);o||=(e=Kt(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?ie(n,s)&&rt(r,`set`,e,n,s):rt(r,`add`,e,n),this},delete(e){let t=Kt(this),{has:n,get:r}=Tt(t),i=n.call(t,e);i||=(e=Kt(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&rt(t,`delete`,e,void 0,a),o},clear(){let e=Kt(this),t=e.size!==0,n=e.clear();return t&&rt(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Et(r,e,t)}),n}function kt(e,t){let n=Ot(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(u(n,r)&&r in t?n:t,r,i)}var At={get:kt(!1,!1)},jt={get:kt(!1,!0)},Mt={get:kt(!0,!1)},Nt=new WeakMap,Pt=new WeakMap,Ft=new WeakMap,It=new WeakMap;function Lt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function Rt(e){return Ut(e)?e:Vt(e,!1,xt,At,Nt)}function zt(e){return Vt(e,!1,Ct,jt,Pt)}function Bt(e){return Vt(e,!0,St,Mt,Ft)}function Vt(e,t,n,r,i){if(!v(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Lt(S(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Ht(e){return Ut(e)?Ht(e.__v_raw):!!(e&&e.__v_isReactive)}function Ut(e){return!!(e&&e.__v_isReadonly)}function Wt(e){return!!(e&&e.__v_isShallow)}function Gt(e){return e?!!e.__v_raw:!1}function Kt(e){let t=e&&e.__v_raw;return t?Kt(t):e}function qt(e){return!u(e,`__v_skip`)&&Object.isExtensible(e)&&oe(e,`__v_skip`,!0),e}var Jt=e=>v(e)?Rt(e):e,Yt=e=>v(e)?Bt(e):e;function Xt(e){return e?e.__v_isRef===!0:!1}function A(e){return Qt(e,!1)}function Zt(e){return Qt(e,!0)}function Qt(e,t){return Xt(e)?e:new $t(e,t)}var $t=class{constructor(e,t){this.dep=new Xe,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Kt(e),this._value=t?e:Jt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Wt(e)||Ut(e);e=n?e:Kt(e),ie(e,t)&&(this._rawValue=e,this._value=n?e:Jt(e),this.dep.trigger())}};function j(e){return Xt(e)?e.value:e}var en={get:(e,t,n)=>t===`__v_raw`?e:j(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return Xt(i)&&!Xt(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function tn(e){return Ht(e)?e:new Proxy(e,en)}var nn=class{constructor(e,t,n){this._object=e,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=_(t)?t:String(t),this._raw=Kt(e);let r=!0,i=e;if(!d(e)||_(this._key)||!w(this._key))do r=!Gt(i)||Wt(i);while(r&&(i=i.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=j(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Xt(this._raw[this._key])){let t=this._object[this._key];if(Xt(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return it(this._raw,this._key)}},rn=class{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}};function M(e,t,n){return Xt(e)?e:h(e)?new rn(e):v(e)&&arguments.length>1?an(e,t,n):A(e)}function an(e,t,n){return new nn(e,t,n)}var on=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Xe(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Je-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Oe!==this)return Pe(this,!0),!0}get value(){let e=this.dep.track();return Be(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function sn(e,t,n=!1){let r,i;return h(e)?r=e:(r=e.get,i=e.set),new on(r,i,n)}var cn={},ln=new WeakMap,un=void 0;function dn(e,t=!1,n=un){if(n){let t=ln.get(n);t||ln.set(n,t=[]),t.push(e)}}function fn(e,n,i=t){let{immediate:a,deep:o,once:s,scheduler:l,augmentJob:u,call:f}=i,p=e=>o?e:Wt(e)||o===!1||o===0?pn(e,1):pn(e),m,g,_,v,y=!1,b=!1;if(Xt(e)?(g=()=>e.value,y=Wt(e)):Ht(e)?(g=()=>p(e),y=!0):d(e)?(b=!0,y=e.some(e=>Ht(e)||Wt(e)),g=()=>e.map(e=>{if(Xt(e))return e.value;if(Ht(e))return p(e);if(h(e))return f?f(e,2):e()})):g=h(e)?n?f?()=>f(e,2):e:()=>{if(_){Ge();try{_()}finally{Ke()}}let t=un;un=m;try{return f?f(e,3,[v]):e(v)}finally{un=t}}:r,n&&o){let e=g,t=o===!0?1/0:o;g=()=>pn(e(),t)}let x=De(),S=()=>{m.stop(),x&&x.active&&c(x.effects,m)};if(s&&n){let e=n;n=(...t)=>{let n=e(...t);return S(),n}}let C=b?Array(e.length).fill(cn):cn,w=e=>{if(!(!(m.flags&1)||!m.dirty&&!e)){if(n){let t=m.run();if(e||o||y||(b?t.some((e,t)=>ie(e,C[t])):ie(t,C))){_&&_();let e=un;un=m;try{let e=[t,C===cn?void 0:b&&C[0]===cn?[]:C,v];C=t,f?f(n,3,e):n(...e)}finally{un=e}}}else m.run()}};return u&&u(w),m=new Ae(g),m.scheduler=l?()=>l(w,!1):w,v=e=>dn(e,!1,m),_=m.onStop=()=>{let e=ln.get(m);if(e){if(f)f(e,4);else for(let t of e)t();ln.delete(m)}},n?a?w(!0):C=m.run():l?l(w.bind(null,!0),!0):m.run(),S.pause=m.pause.bind(m),S.resume=m.resume.bind(m),S.stop=S,S}function pn(e,t=1/0,n){if(t<=0||!v(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Xt(e))pn(e.value,t,n);else if(d(e))for(let r=0;r<e.length;r++)pn(e[r],t,n);else if(p(e)||f(e))e.forEach(e=>{pn(e,t,n)});else if(C(e)){for(let r in e)pn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&pn(e[r],t,n)}return e}function mn(e,t,n,r){try{return r?e(...r):e()}catch(e){gn(e,t,n)}}function hn(e,t,n,r){if(h(e)){let i=mn(e,t,n,r);return i&&y(i)&&i.catch(e=>{gn(e,t,n)}),i}if(d(e)){let i=[];for(let a=0;a<e.length;a++)i.push(hn(e[a],t,n,r));return i}}function gn(e,n,r,i=!0){let a=n?n.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=n&&n.appContext.config||t;if(n){let t=n.parent,i=n.proxy,a=`https://vuejs.org/error-reference/#runtime-${r}`;for(;t;){let n=t.ec;if(n){for(let t=0;t<n.length;t++)if(n[t](e,i,a)===!1)return}t=t.parent}if(o){Ge(),mn(o,null,10,[e,i,a]),Ke();return}}_n(e,r,a,i,s)}function _n(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var vn=[],yn=-1,bn=[],xn=null,Sn=0,Cn=Promise.resolve(),wn=null;function Tn(e){let t=wn||Cn;return e?t.then(this?e.bind(this):e):t}function En(e){let t=yn+1,n=vn.length;for(;t<n;){let r=t+n>>>1,i=vn[r],a=Mn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Dn(e){if(!(e.flags&1)){let t=Mn(e),n=vn[vn.length-1];!n||!(e.flags&2)&&t>=Mn(n)?vn.push(e):vn.splice(En(t),0,e),e.flags|=1,On()}}function On(){wn||=Cn.then(Nn)}function kn(e){if(!d(e))xn&&e.id===-1?xn.splice(Sn+1,0,e):e.flags&1||(bn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)bn.push(e[t]);On()}function An(e,t,n=yn+1){for(;n<vn.length;n++){let t=vn[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;vn.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function jn(e){if(bn.length){let e=[...new Set(bn)].sort((e,t)=>Mn(e)-Mn(t));if(bn.length=0,xn){for(let t=0;t<e.length;t++)xn.push(e[t]);return}for(xn=e,Sn=0;Sn<xn.length;Sn++){let e=xn[Sn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}xn=null,Sn=0}}var Mn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Nn(e){try{for(yn=0;yn<vn.length;yn++){let e=vn[yn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),mn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;yn<vn.length;yn++){let e=vn[yn];e&&(e.flags&=-2)}yn=-1,vn.length=0,jn(e),wn=null,(vn.length||bn.length)&&Nn(e)}}var Pn=null,Fn=null;function In(e){let t=Pn;return Pn=e,Fn=e&&e.type.__scopeId||null,t}function N(e,t=Pn,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&ba(-1);let i=In(t),a=ga.length,o;try{o=e(...n)}finally{for(let e=ga.length;e>a;e--)va();In(i),r._d&&ba(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Ln(e,n){if(Pn===null)return e;let r=eo(Pn),i=e.dirs||=[];for(let e=0;e<n.length;e++){let[a,o,s,c=t]=n[e];a&&(h(a)&&(a={mounted:a,updated:a}),a.deep&&pn(o),i.push({dir:a,instance:r,value:o,oldValue:void 0,arg:s,modifiers:c}))}return e}function Rn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(Ge(),hn(c,n,8,[e.el,s,e,t]),Ke())}}function zn(e,t){if(Ba){let n=Ba.provides,r=Ba.parent&&Ba.parent.provides;r===n&&(n=Ba.provides=Object.create(r)),n[e]=t}}function P(e,t,n=!1){let r=Va();if(r||Ci){let i=Ci?Ci._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&h(t)?t.call(r&&r.proxy):t}}var Bn=Symbol.for(`v-scx`),Vn=()=>P(Bn);function Hn(e,t){return Wn(e,null,t)}function Un(e,t,n){return Wn(e,t,n)}function Wn(e,n,i=t){let{immediate:a,deep:o,flush:c,once:l}=i,u=s({},i),d=n&&a||!n&&c!==`post`,f;if(qa){if(c===`sync`){let e=Vn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}}let p=Ba;u.call=(e,t,n)=>hn(e,p,t,n);let m=!1;c===`post`?u.scheduler=e=>{ea(e,p&&p.suspense)}:c!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():Dn(e)}),u.augmentJob=e=>{n&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=fn(e,n,u);return qa&&(f?f.push(h):d&&h()),h}function Gn(e,t,n){let r=this.proxy,i=g(e)?e.includes(`.`)?Kn(r,e):()=>r[e]:e.bind(r,r),a;h(t)?a=t:(a=t.handler,n=t);let o=Wa(this),s=Wn(i,a.bind(r),n);return o(),s}function Kn(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var qn=new WeakMap,Jn=Symbol(`_vte`),Yn=e=>e.__isTeleport,Xn=e=>e&&(e.disabled||e.disabled===``),Zn=e=>e&&(e.defer||e.defer===``),Qn=e=>typeof SVGElement<`u`&&e instanceof SVGElement,$n=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,er=(e,t)=>{let n=e&&e.to;return g(n)?t?t(n):null:n},tr={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=Xn(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=Xn(e.props),r=e.target=er(e.props,m),a=or(r,e,h,p);r&&(o!==`svg`&&Qn(r)?o=`svg`:o!==`mathml`&&$n(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),ar(e,!1)))},S=e=>{let t=()=>{if(qn.get(e)===t){if(qn.delete(e),Xn(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),ar(e,!0)}x(e)}};qn.set(e,t),ea(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Zn(t.props)||a&&a.pendingBranch){S(t);return}v&&(b(t,n,i),ar(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=qn.get(e);if(u){u.flags|=8,qn.delete(e),S(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Xn(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||Qn(p)?o=`svg`:(o===`mathml`||$n(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),oa(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):nr(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=er(t.props,m);e&&(t.target=e,nr(t,e,null,l,0))}else g&&nr(t,p,h,l,1);ar(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=Xn(f),m=a||!p,h=qn.get(e);if(h&&(h.flags|=8,qn.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:nr,hydrate:rr};function nr(e,t,n,{o:{insert:r},m:i},a=2){a===0&&r(e.targetAnchor,t,n);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!qn.has(e)&&(!d||Xn(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function rr(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=er(t.props,c),h=Xn(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||or(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||or(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),ar(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var ir=tr;function ar(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function or(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[Jn]=o,e&&(r(a,e,i),r(o,e,i)),o}var sr=Symbol(`_leaveCb`),cr=Symbol(`_enterCb`);function lr(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ir(()=>{e.isMounted=!0}),zr(()=>{e.isUnmounting=!0}),e}var ur=[Function,Array],dr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:ur,onEnter:ur,onAfterEnter:ur,onEnterCancelled:ur,onBeforeLeave:ur,onLeave:ur,onAfterLeave:ur,onLeaveCancelled:ur,onBeforeAppear:ur,onAppear:ur,onAfterAppear:ur,onAppearCancelled:ur},fr=e=>{let t=e.subTree;return t.component?fr(t.component):t},pr={name:`BaseTransition`,props:dr,setup(e,{slots:t}){let n=Va(),r=lr();return()=>{let i=t.default&&xr(t.default(),!0),a=i&&i.length?mr(i):n.subTree?ja():void 0;if(!a)return;let o=Kt(e),{mode:s}=o;if(r.isLeaving)return vr(a);let c=yr(a);if(!c)return vr(a);let l=_r(c,o,r,n,e=>l=e);c.type!==ma&&br(c,l);let u=n.subTree&&yr(n.subTree);if(u&&u.type!==ma&&!Ca(u,c)&&fr(n).type!==ma){let e=_r(u,o,r,n);if(br(u,e),s===`out-in`&&c.type!==ma)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},vr(a);s===`in-out`&&c.type!==ma?e.delayLeave=(e,t,n)=>{let i=gr(r,u);i[String(u.key)]=u,e[sr]=()=>{t(),e[sr]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function mr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==ma){t=n;break}}return t}var hr=pr;function gr(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function _r(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),S=gr(n,e),C=(e,t)=>{e&&hn(e,r,9,t)},w=(e,t)=>{let n=t[1];C(e,t),d(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},T={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted){if(a)r=_||c;else return}t[sr]&&t[sr](!0);let i=S[x];i&&Ca(e,i)&&i.el[sr]&&i.el[sr](),C(r,[t])},enter(t){if(S[x]===e)return;let r=l,i=u,o=f;if(!n.isMounted){if(a)r=v||l,i=y||u,o=b||f;else return}let s=!1;t[cr]=e=>{s||(s=!0,C(e?o:i,[t]),T.delayedLeave&&T.delayedLeave(),t[cr]=void 0)};let c=t[cr].bind(null,!1);r?w(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[cr]&&t[cr](!0),n.isUnmounting)return r();C(p,[t]);let a=!1;t[sr]=n=>{a||(a=!0,r(),C(n?g:h,[t]),t[sr]=void 0,S[i]===e&&delete S[i])};let o=t[sr].bind(null,!1);S[i]=e,m?w(m,[t,o]):o()},clone(e){let a=_r(e,t,n,r,i);return i&&i(a),a}};return T}function vr(e){if(Or(e))return e=Oa(e),e.children=null,e}function yr(e){if(!Or(e))return Yn(e.type)&&e.children?mr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&h(n.default))return n.default()}}function br(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;br(Yn(n.type)&&yr(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function xr(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===I?(o.patchFlag&128&&i++,r=r.concat(xr(o.children,t,s))):(t||o.type!==ma)&&r.push(s==null?o:Oa(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function F(e,t){return h(e)?s({name:e.name},t,{setup:e}):e}function Sr(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function Cr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var wr=new WeakMap;function Tr(e,n,r,a,o=!1){if(d(e)){e.forEach((e,t)=>Tr(e,n&&(d(n)?n[t]:n),r,a,o));return}if(Dr(a)&&!o){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&Tr(e,n,r,a.component.subTree);return}let s=a.shapeFlag&4?eo(a.component):a.el,l=o?null:s,{i:f,r:p}=e,m=n&&n.r,_=f.refs===t?f.refs={}:f.refs,v=f.setupState,y=Kt(v),b=v===t?i:e=>!Cr(_,e)&&u(y,e),x=(e,t)=>!(t&&Cr(_,t));if(m!=null&&m!==p){if(Er(n),g(m))_[m]=null,b(m)&&(v[m]=null);else if(Xt(m)){let e=n;x(m,e.k)&&(m.value=null),e.k&&(_[e.k]=null)}}if(h(p))mn(p,f,12,[l,_]);else{let t=g(p),n=Xt(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:_[p]:x(p)||!e.k?p.value:_[e.k];if(o)d(n)&&c(n,s);else if(d(n))n.includes(s)||n.push(s);else if(t)_[p]=[s],b(p)&&(v[p]=_[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(_[e.k]=t)}}else t?(_[p]=l,b(p)&&(v[p]=l)):n&&(x(p,e.k)&&(p.value=l),e.k&&(_[e.k]=l))};if(l){let t=()=>{i(),wr.delete(e)};t.id=-1,wr.set(e,t),ea(t,r)}else Er(e),i()}}}function Er(e){let t=wr.get(e);t&&(t.flags|=8,wr.delete(e))}ue().requestIdleCallback,ue().cancelIdleCallback;var Dr=e=>!!e.type.__asyncLoader,Or=e=>e.type.__isKeepAlive;function kr(e,t){jr(e,`a`,t)}function Ar(e,t){jr(e,`da`,t)}function jr(e,t,n=Ba){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Nr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Or(e.parent.vnode)&&Mr(r,t,n,e),e=e.parent}}function Mr(e,t,n,r){let i=Nr(t,e,r,!0);Br(()=>{c(r[t],i)},n)}function Nr(e,t,n=Ba,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Ge();let i=Wa(n),a=hn(t,n,e,r);return i(),Ke(),a};return r?i.unshift(a):i.push(a),a}}var Pr=e=>(t,n=Ba)=>{(!qa||e===`sp`)&&Nr(e,(...e)=>t(...e),n)},Fr=Pr(`bm`),Ir=Pr(`m`),Lr=Pr(`bu`),Rr=Pr(`u`),zr=Pr(`bum`),Br=Pr(`um`),Vr=Pr(`sp`),Hr=Pr(`rtg`),Ur=Pr(`rtc`);function Wr(e,t=Ba){Nr(`ec`,e,t)}var Gr=`components`;function Kr(e,t){return Yr(Gr,e,!0,t)||e}var qr=Symbol.for(`v-ndc`);function Jr(e){return g(e)?Yr(Gr,e,!1)||e:e||qr}function Yr(e,t,n=!0,r=!1){let i=Pn||Ba;if(i){let n=i.type;if(e===Gr){let e=to(n,!1);if(e&&(e===t||e===O(t)||e===ne(O(t))))return n}let a=Xr(i[e]||n[e],t)||Xr(i.appContext[e],t);return!a&&r?n:a}}function Xr(e,t){return e&&(e[t]||e[O(t)]||e[ne(O(t))])}function Zr(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||g(e)){let n=o&&Ht(e),r=!1,s=!1;n&&(r=!Wt(e),s=Ut(e),e=ot(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?Yt(Jt(e[n])):Jt(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(v(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function Qr(e,t,n,r,i,a){if(n??={},Pn.ce||Pn.parent&&Dr(Pn.parent)&&Pn.parent.ce){let e=a!=null&&n.key==null?s({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),L(),z(I,null,[V(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let c=ga.length;L();let l;try{let i=o&&$r(o(n)),s=n.key||a||i&&i.key;l=z(I,{key:(s&&!_(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=ga.length;e>c;e--)va();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+`-s`]),l}function $r(e){return e.some(e=>!Sa(e)||!(e.type===ma||e.type===I&&!$r(e.children)))?e:null}var ei=e=>e?Ka(e)?eo(e):ei(e.parent):null,ti=s(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ei(e.parent),$root:e=>ei(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ui(e),$forceUpdate:e=>e.f||=()=>{Dn(e.update)},$nextTick:e=>e.n||=Tn.bind(e.proxy),$watch:e=>Gn.bind(e)}),ni=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),ri={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(ni(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else ai&&(s[n]=0)}let d=ti[n],f,p;if(d)return n===`$attrs`&&nt(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return ni(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||ni(n,c)||u(o,c)||u(i,c)||u(ti,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function ii(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var ai=!0;function oi(e){let t=ui(e),n=e.proxy,i=e.ctx;ai=!1,t.beforeCreate&&ci(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:g,updated:_,activated:y,deactivated:b,beforeDestroy:x,beforeUnmount:S,destroyed:C,unmounted:w,render:T,renderTracked:E,renderTriggered:D,errorCaptured:O,serverPrefetch:ee,expose:te,inheritAttrs:ne,components:re,directives:ie,filters:ae}=t;if(u&&si(u,i,null),s)for(let e in s){let t=s[e];h(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);v(t)&&(e.data=Rt(t))}if(ai=!0,o)for(let e in o){let t=o[e],a=H({get:h(t)?t.bind(n,n):h(t.get)?t.get.bind(n,n):r,set:!h(t)&&h(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)li(c[e],i,n,e);if(l){let e=h(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{zn(t,e[t])})}f&&ci(f,e,`c`);function oe(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(oe(Fr,p),oe(Ir,m),oe(Lr,g),oe(Rr,_),oe(kr,y),oe(Ar,b),oe(Wr,O),oe(Ur,E),oe(Hr,D),oe(zr,S),oe(Br,w),oe(Vr,ee),d(te)){if(te.length){let t=e.exposed||={};te.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}T&&e.render===r&&(e.render=T),ne!=null&&(e.inheritAttrs=ne),re&&(e.components=re),ie&&(e.directives=ie),ee&&Sr(e)}function si(e,t,n=r){d(e)&&(e=hi(e));for(let n in e){let r=e[n],i;i=v(r)?`default`in r?P(r.from||n,r.default,!0):P(r.from||n):P(r),Xt(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function ci(e,t,n){hn(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function li(e,t,n,r){let i=r.includes(`.`)?Kn(n,r):()=>n[r];if(g(e)){let n=t[e];h(n)&&Un(i,n)}else if(h(e))Un(i,e.bind(n));else if(v(e)){if(d(e))e.forEach(e=>li(e,t,n,r));else{let r=h(e.handler)?e.handler.bind(n):t[e.handler];h(r)&&Un(i,r,e)}}}function ui(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>di(c,e,o,!0)),di(c,t,o)),v(t)&&a.set(t,c),c}function di(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&di(e,a,n,!0),i&&i.forEach(t=>di(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=fi[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var fi={data:pi,props:vi,emits:vi,methods:_i,computed:_i,beforeCreate:gi,created:gi,beforeMount:gi,mounted:gi,beforeUpdate:gi,updated:gi,beforeDestroy:gi,beforeUnmount:gi,destroyed:gi,unmounted:gi,activated:gi,deactivated:gi,errorCaptured:gi,serverPrefetch:gi,components:_i,directives:_i,watch:yi,provide:pi,inject:mi};function pi(e,t){return t?e?function(){return s(h(e)?e.call(this,this):e,h(t)?t.call(this,this):t)}:t:e}function mi(e,t){return _i(hi(e),hi(t))}function hi(e){if(d(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function gi(e,t){return e?[...new Set([].concat(e,t))]:t}function _i(e,t){return e?s(Object.create(null),e,t):t}function vi(e,t){return e?d(e)&&d(t)?[...new Set([...e,...t])]:s(Object.create(null),ii(e),ii(t??{})):t}function yi(e,t){if(!e)return t;if(!t)return e;let n=s(Object.create(null),e);for(let r in t)n[r]=gi(e[r],t[r]);return n}function bi(){return{app:null,config:{isNativeTag:i,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var xi=0;function Si(e,t){return function(n,r=null){h(n)||(n=s({},n)),r!=null&&!v(r)&&(r=null);let i=bi(),a=new WeakSet,o=[],c=!1,l=i.app={_uid:xi++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:io,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&h(e.install)?(a.add(e),e.install(l,...t)):h(e)&&(a.add(e),e(l,...t))),l},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),l},component(e,t){return t?(i.components[e]=t,l):i.components[e]},directive(e,t){return t?(i.directives[e]=t,l):i.directives[e]},mount(a,o,s){if(!c){let u=l._ceVNode||V(n,r);return u.appContext=i,s===!0?s=`svg`:s===!1&&(s=void 0),o&&t?t(u,a):e(u,a,s),c=!0,l._container=a,a.__vue_app__=l,eo(u.component)}},onUnmount(e){o.push(e)},unmount(){c&&(hn(o,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide(e,t){return i.provides[e]=t,l},runWithContext(e){let t=Ci;Ci=l;try{return e()}finally{Ci=t}}};return l}}var Ci=null,wi=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${O(t)}Modifiers`]||e[`${te(t)}Modifiers`];function Ti(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&wi(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>g(e)?e.trim():e)),s.number&&(a=r.map(se)));let c,l=i[c=re(n)]||i[c=re(O(n))];!l&&o&&(l=i[c=re(te(n))]),l&&hn(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,hn(u,e,6,a)}}var Ei=new WeakMap;function Di(e,t,n=!1){let r=n?Ei:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!h(e)){let r=e=>{let n=Di(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(v(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),v(e)&&r.set(e,o),o)}function Oi(e,t){return!e||!a(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,te(t))||u(e,t))}function ki(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=In(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Ma(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=Ma(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:Ai(c)}}catch(t){ga.length=0,gn(t,e,1),v=V(ma)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=ji(y,a)),b=Oa(b,y,!1,!0))}return n.dirs&&(b=Oa(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&br(Yn(b.type)&&yr(b)||b,n.transition),v=b,In(_),v}var Ai=e=>{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},ji=(e,t)=>{let n={};for(let r in e)(!o(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Mi(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Ni(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Pi(o,r,n)&&!Oi(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Ni(r,o,l):!!o;return!1}function Ni(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Pi(t,e,a)&&!Oi(n,a))return!0}return!1}function Pi(e,t,n){let r=e[n],i=t[n];return n===`style`&&v(r)&&v(i)?!be(r,i):r!==i}function Fi({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Ii={},Li=()=>Object.create(Ii),Ri=e=>Object.getPrototypeOf(e)===Ii;function zi(e,t,n,r=!1){let i={},a=Li();e.propsDefaults=Object.create(null),Vi(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:zt(i):e.type.props?i:a,e.attrs=a}function Bi(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=Kt(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Oi(e.emitsOptions,o))continue;let d=t[o];if(c){if(u(a,o))d!==a[o]&&(a[o]=d,l=!0);else{let t=O(o);i[t]=Hi(c,s,t,d,e,!1)}}else d!==a[o]&&(a[o]=d,l=!0)}}}else{Vi(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!u(t,a)&&((r=te(a))===a||!u(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Hi(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!u(t,e))&&(delete a[e],l=!0)}l&&rt(e.attrs,`set`,``)}function Vi(e,n,r,i){let[a,o]=e.propsOptions,s=!1,c;if(n)for(let t in n){if(T(t))continue;let l=n[t],d;a&&u(a,d=O(t))?!o||!o.includes(d)?r[d]=l:(c||={})[d]=l:Oi(e.emitsOptions,t)||(!(t in i)||l!==i[t])&&(i[t]=l,s=!0)}if(o){let n=Kt(r),i=c||t;for(let t=0;t<o.length;t++){let s=o[t];r[s]=Hi(a,n,s,i[s],e,!u(i,s))}}return s}function Hi(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=u(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&h(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Wa(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===te(n))&&(r=!0))}return r}var Ui=new WeakMap;function Wi(e,r,i=!1){let a=i?Ui:r.propsCache,o=a.get(e);if(o)return o;let c=e.props,l={},f=[],p=!1;if(!h(e)){let t=e=>{p=!0;let[t,n]=Wi(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return v(e)&&a.set(e,n),n;if(d(c))for(let e=0;e<c.length;e++){let n=O(c[e]);Gi(n)&&(l[n]=t)}else if(c)for(let e in c){let t=O(e);if(Gi(t)){let n=c[e],r=l[t]=d(n)||h(n)?{type:n}:s({},n),i=r.type,a=!1,o=!0;if(d(i))for(let e=0;e<i.length;++e){let t=i[e],n=h(t)&&t.name;if(n===`Boolean`){a=!0;break}n===`String`&&(o=!1)}else a=h(i)&&i.name===`Boolean`;r[0]=a,r[1]=o,(a||u(r,`default`))&&f.push(t)}}let m=[l,f];return v(e)&&a.set(e,m),m}function Gi(e){return e[0]!==`$`&&!T(e)}var Ki=e=>e===`_`||e===`_ctx`||e===`$stable`,qi=e=>d(e)?e.map(Ma):[Ma(e)],Ji=(e,t,n)=>{if(t._n)return t;let r=N((...e)=>qi(t(...e)),n);return r._c=!1,r},Yi=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Ki(n))continue;let i=e[n];if(h(i))t[n]=Ji(n,i,r);else if(i!=null){let e=qi(i);t[n]=()=>e}}},Xi=(e,t)=>{let n=qi(t);e.slots.default=()=>n},Zi=(e,t,n)=>{for(let r in t)(n||!Ki(r))&&(e[r]=t[r])},Qi=(e,t,n)=>{let r=e.slots=Li();if(e.vnode.shapeFlag&32){let e=t._;e?(Zi(r,t,n),n&&oe(r,`_`,e,!0)):Yi(t,r)}else t&&Xi(e,t)},$i=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:Zi(a,n,r):(o=!n.$stable,Yi(n,a)),s=n}else n&&(Xi(e,n),s={default:1});if(o)for(let e in a)!Ki(e)&&s[e]==null&&delete a[e]},ea=fa;function ta(e){return na(e)}function na(e,i){let a=ue();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Ca(e,t)&&(r=ye(e),me(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case pa:y(e,t,n,r);break;case ma:b(e,t,n,r);break;case ha:e??x(t,n,r,o);break;case I:re(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?ie(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,Se)}u!=null&&i?Tr(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Tr(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)E(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),ee(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},E=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&O(e.children,d,null,r,i,ra(e,a),s,u),_&&Rn(e,null,r,`created`),D(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!T(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Ia(f,r,e)}_&&Rn(e,null,r,`beforeMount`);let v=aa(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&ea(()=>{try{f&&Ia(f,r,e),v&&g.enter(d),_&&Rn(e,null,r,`mounted`)}finally{}},i)},D=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||da(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;D(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},O=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?Na(e[l]):Ma(e[l]);v(null,c,t,n,r,i,a,o,s)}},ee=(e,n,r,i,a,o,s)=>{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&ia(r,!1),(g=h.onVnodeBeforeUpdate)&&Ia(g,r,n,e),f&&Rn(n,e,r,`beforeUpdate`),r&&ia(r,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?te(e.dynamicChildren,d,l,r,i,ra(n,a),o):s||k(e,n,l,null,r,i,ra(n,a),o,!1),u>0){if(u&16)ne(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t],i=m[n],o=h[n];(o!==i||n===`value`)&&c(l,n,i,o,a,r)}}u&1&&e.children!==n.children&&p(l,n.children)}else!s&&d==null&&ne(l,m,h,r,a);((g=h.onVnodeUpdated)||f)&&ea(()=>{g&&Ia(g,r,n,e),f&&Rn(n,e,r,`updated`)},i)},te=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===I||!Ca(c,l)||c.shapeFlag&198)?m(c.el):n;v(c,l,u,null,r,i,a,o,!0)}},ne=(e,n,r,i,a)=>{if(n!==r){if(n!==t)for(let t in n)!T(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(T(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},re=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),O(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(te(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&oa(e,t,!0)):k(e,t,n,f,i,a,s,c,l)},ie=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):oe(t,n,r,i,a,o,c):se(e,t,c)},oe=(e,t,n,r,i,a,o)=>{let s=e.component=za(e,r,i);if(Or(e)&&(s.ctx.renderer=Se),Ja(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,ce,o),!e.el){let r=s.subTree=V(ma);b(null,r,t,n),e.placeholder=r.el}}else ce(s,e,t,n,i,a,o)},se=(e,t,n)=>{let r=t.component=e.component;if(Mi(e,t,n)){if(r.asyncDep&&!r.asyncResolved){le(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},ce=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=ca(e);if(n){t&&(t.el=c.el,le(e,t,o)),n.asyncDep.then(()=>{ea(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;ia(e,!1),t?(t.el=c.el,le(e,t,o)):t=c,n&&ae(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Ia(d,s,t,c),ia(e,!0);let f=ki(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),ye(p),e,i,a),t.el=f.el,u===null&&Fi(e,f.el),r&&ea(r,i),(d=t.props&&t.props.onVnodeUpdated)&&ea(()=>Ia(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Dr(t);if(ia(e,!1),l&&ae(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Ia(o,d,t),ia(e,!0),s&&we){let t=()=>{e.subTree=ki(e),we(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=ki(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&ea(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;ea(()=>Ia(o,d,e),i)}(t.shapeFlag&256||d&&Dr(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&ea(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Ae(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Dn(u),ia(e,!0),l()},le=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Bi(e,t.props,r,n),$i(e,t.children,n),Ge(),An(e),Ke()},k=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){fe(l,d,n,r,i,a,o,s,c);return}if(f&256){de(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&ve(l,i,a),d!==l&&p(n,d)):u&16?m&16?fe(l,d,n,r,i,a,o,s,c):ve(l,i,a,!0):(u&8&&p(n,``),m&16&&O(d,n,r,i,a,o,s,c))},de=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;p<f;p++){let n=t[p]=l?Na(t[p]):Ma(t[p]);v(e[p],n,r,null,a,o,s,c,l)}u>d?ve(e,a,o,!0,!1,f):O(t,r,i,a,o,s,c,l,f)},fe=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?Na(t[u]):Ma(t[u]);if(Ca(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?Na(t[p]):Ma(t[p]);if(Ca(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=e<d?t[e].el:i;for(;u<=p;)v(null,t[u]=l?Na(t[u]):Ma(t[u]),r,n,a,o,s,c,l),u++}}else if(u>p)for(;u<=f;)me(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Na(t[u]):Ma(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u<b;u++)C[u]=0;for(u=m;u<=f;u++){let n=e[u];if(y>=b){me(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&Ca(n,t[_])){i=_;break}i===void 0?me(n,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let w=x?sa(C):n;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1<d?f.el||ua(f):i;C[u]===0?v(null,n,r,p,a,o,s,c,l):x&&(_<0||u!==w[_]?pe(n,r,p,2):_--)}}},pe=(e,t,n,r,i=null)=>{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){pe(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,Se);return}if(c===I){o(a,t,n);for(let e=0;e<u.length;e++)pe(u[e],t,n,r);o(e.anchor,t,n);return}if(c===ha){S(e,t,n);return}if(r!==2&&d&1&&l){if(r===0)l.persisted&&!a[sr]?o(a,t,n):(l.beforeEnter(a),o(a,t,n),ea(()=>l.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[sr];a._isLeaving&&a[sr](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}}else o(a,t,n)},me=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(Ge(),Tr(s,null,n,e,!0),Ke()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Dr(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Ia(_,t,e),u&6)_e(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Rn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,Se,r):l&&!l.hasOnce&&(a!==I||d>0&&d&64)?ve(l,t,n,!1,!0):(a===I&&d&384||!i&&u&16)&&ve(c,t,n),r&&he(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&ea(()=>{_&&Ia(_,t,e),h&&Rn(e,null,t,`unmounted`),v&&(e.el=null)},n)},he=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===I){ge(n,r);return}if(t===ha){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},ge=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},_e=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;la(c),la(l),r&&ae(r),i.stop(),a&&(a.flags|=8,me(o,e,t,n)),s&&ea(s,t),ea(()=>{e.isUnmounted=!0},t)},ve=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)me(e[o],t,n,r,i)},ye=e=>{if(e.shapeFlag&6)return ye(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Jn];return n?h(n):t},be=!1,xe=(e,t,n)=>{let r;e==null?t._vnode&&(me(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,be||=(be=!0,An(r),jn(),!1)},Se={p:v,um:me,m:pe,r:he,mt:oe,mc:O,pc:k,pbc:te,n:ye,o:e},Ce,we;return i&&([Ce,we]=i(Se)),{render:xe,hydrate:Ce,createApp:Si(xe,Ce)}}function ra({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function ia({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function aa(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function oa(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Na(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&oa(t,a)),a.type===pa&&(a.patchFlag===-1&&(a=i[e]=Na(a)),a.el=t.el),a.type===ma&&!a.el&&(a.el=t.el)}}function sa(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function ca(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ca(t)}function la(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ua(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?ua(t.subTree):null}var da=e=>e.__isSuspense;function fa(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):kn(e)}var I=Symbol.for(`v-fgt`),pa=Symbol.for(`v-txt`),ma=Symbol.for(`v-cmt`),ha=Symbol.for(`v-stc`),ga=[],_a=null;function L(e=!1){ga.push(_a=e?null:[])}function va(){ga.pop(),_a=ga[ga.length-1]||null}var ya=1;function ba(e,t=!1){ya+=e,e<0&&_a&&t&&(_a.hasOnce=!0)}function xa(e){return e.dynamicChildren=ya>0?_a||n:null,va(),ya>0&&_a&&_a.push(e),e}function R(e,t,n,r,i,a){return xa(B(e,t,n,r,i,a,!0))}function z(e,t,n,r,i){return xa(V(e,t,n,r,i,!0))}function Sa(e){return e?e.__v_isVNode===!0:!1}function Ca(e,t){return e.type===t.type&&e.key===t.key}var wa=({key:e})=>e??null,Ta=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:g(e)||Xt(e)||h(e)?{i:Pn,r:e,k:t,f:!!n}:e);function B(e,t=null,n=null,r=0,i=null,a=e===I?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&wa(t),ref:t&&Ta(t),scopeId:Fn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Pn};return s?(Pa(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),ya>0&&!o&&_a&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&_a.push(c),c}var V=Ea;function Ea(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===qr)&&(e=ma),Sa(e)){let r=Oa(e,t,!0);return n&&Pa(r,n),ya>0&&!a&&_a&&(r.shapeFlag&6?_a[_a.indexOf(e)]=r:_a.push(r)),r.patchFlag=-2,r}if(no(e)&&(e=e.__vccOpts),t){t=Da(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=he(e)),v(n)&&(Gt(n)&&!d(n)&&(n=s({},n)),t.style=k(n))}let o=g(e)?1:da(e)?128:Yn(e)?64:v(e)?4:h(e)?2:0;return B(e,t,n,r,i,o,a,!0)}function Da(e){return e?Gt(e)||Ri(e)?s({},e):e:null}function Oa(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Fa(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&wa(l),ref:t&&t.ref?n&&a?d(a)?a.concat(Ta(t)):[a,Ta(t)]:Ta(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==I?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Oa(e.ssContent),ssFallback:e.ssFallback&&Oa(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&br(u,c.clone(u)),u}function ka(e=` `,t=0){return V(pa,null,e,t)}function Aa(e,t){let n=V(ha,null,e);return n.staticCount=t,n}function ja(e=``,t=!1){return t?(L(),z(ma,null,e)):V(ma,null,e)}function Ma(e){return e==null||typeof e==`boolean`?V(ma):d(e)?V(I,null,e.slice()):Sa(e)?Na(e):V(pa,null,String(e))}function Na(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Oa(e)}function Pa(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Pa(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Ri(t)?t._ctx=Pn:r===3&&Pn&&(Pn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(h(t)){if(r&65){Pa(e,{default:t});return}t={default:t,_ctx:Pn},n=32}else t=String(t),r&64?(n=16,t=[ka(t)]):n=8;e.children=t,e.shapeFlag|=n}function Fa(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=he([t.class,r.class]));else if(e===`style`)t.style=k([t.style,r.style]);else if(a(e)){let n=t[e],i=r[e];i&&n!==i&&!(d(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!o(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Ia(e,t,n,r=null){hn(e,t,7,[n,r])}var La=bi(),Ra=0;function za(e,n,r){let i=e.type,a=(n?n.appContext:e.appContext)||La,o={uid:Ra++,vnode:e,type:i,parent:n,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ee(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(a.provides),ids:n?n.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Wi(i,a),emitsOptions:Di(i,a),emit:null,emitted:null,propsDefaults:t,inheritAttrs:i.inheritAttrs,ctx:t,data:t,props:t,attrs:t,slots:t,refs:t,setupState:t,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=n?n.root:o,o.emit=Ti.bind(null,o),e.ce&&e.ce(o),o}var Ba=null,Va=()=>Ba||Pn,Ha,Ua;{let e=ue(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Ha=t(`__VUE_INSTANCE_SETTERS__`,e=>Ba=e),Ua=t(`__VUE_SSR_SETTERS__`,e=>qa=e)}var Wa=e=>{let t=Ba;return Ha(e),e.scope.on(),()=>{e.scope.off(),Ha(t)}},Ga=()=>{Ba&&Ba.scope.off(),Ha(null)};function Ka(e){return e.vnode.shapeFlag&4}var qa=!1;function Ja(e,t=!1,n=!1){t&&Ua(t);let{props:r,children:i}=e.vnode,a=Ka(e);zi(e,r,a,t),Qi(e,i,n||t);let o=a?Ya(e,t):void 0;return t&&Ua(!1),o}function Ya(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ri);let{setup:r}=n;if(r){Ge();let n=e.setupContext=r.length>1?$a(e):null,i=Wa(e),a=mn(r,e,0,[e.props,n]),o=y(a);if(Ke(),i(),(o||e.sp)&&!Dr(e)&&Sr(e),o){if(a.then(Ga,Ga),t)return a.then(n=>{Ua(!0);try{Xa(e,n,t)}finally{Ua(!1)}}).catch(t=>{gn(t,e,0)});e.asyncDep=a}else Xa(e,a,t)}else Za(e,t)}function Xa(e,t,n){h(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:v(t)&&(e.setupState=tn(t)),Za(e,n)}function Za(e,t,n){let i=e.type;e.render||=i.render||r;{let t=Wa(e);Ge();try{oi(e)}finally{Ke(),t()}}}var Qa={get(e,t){return nt(e,`get`,``),e[t]}};function $a(e){return{attrs:new Proxy(e.attrs,Qa),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function eo(e){return e.exposed?e.exposeProxy||=new Proxy(tn(qt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in ti)return ti[n](e)},has(e,t){return t in e||t in ti}}):e.proxy}function to(e,t=!0){return h(e)?e.displayName||e.name:e.name||t&&e.__name}function no(e){return h(e)&&`__vccOpts`in e}var H=(e,t)=>sn(e,t,qa);function ro(e,t,n){try{ba(-1);let r=arguments.length;return r===2?v(t)&&!d(t)?Sa(t)?V(e,null,[t]):V(e,t):V(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Sa(n)&&(n=[n]),V(e,t,n))}finally{ba(1)}}var io=`3.5.41`,ao=void 0,oo=typeof window<`u`&&window.trustedTypes;if(oo)try{ao=oo.createPolicy(`vue`,{createHTML:e=>e})}catch{}var so=ao?e=>ao.createHTML(e):e=>e,co=`http://www.w3.org/2000/svg`,lo=`http://www.w3.org/1998/Math/MathML`,uo=typeof document<`u`?document:null,fo=uo&&uo.createElement(`template`),po={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?uo.createElementNS(co,e):t===`mathml`?uo.createElementNS(lo,e):n?uo.createElement(e,{is:n}):uo.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>uo.createTextNode(e),createComment:e=>uo.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>uo.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{fo.innerHTML=so(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=fo.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},mo=`transition`,ho=`animation`,go=Symbol(`_vtc`),_o={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},vo=s({},dr,_o),yo=(e=>(e.displayName=`Transition`,e.props=vo,e))((e,{slots:t})=>ro(hr,So(e),t)),bo=(e,t=[])=>{d(e)?e.forEach(e=>e(...t)):e&&e(...t)},xo=e=>e?d(e)?e.some(e=>e.length>1):e.length>1:!1;function So(e){let t={};for(let n in e)n in _o||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:l=a,appearActiveClass:u=o,appearToClass:d=c,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=Co(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:S,onBeforeAppear:C=v,onAppear:w=y,onAppearCancelled:T=b}=t,E=(e,t,n,r)=>{e._enterCancelled=r,Eo(e,t?d:c),Eo(e,t?u:o),n&&n()},D=(e,t)=>{e._isLeaving=!1,Eo(e,f),Eo(e,m),Eo(e,p),t&&t()},O=e=>(t,n)=>{let i=e?w:y,o=()=>E(t,e,n);bo(i,[t,o]),Do(()=>{Eo(t,e?l:a),To(t,e?d:c),xo(i)||ko(t,r,g,o)})};return s(t,{onBeforeEnter(e){bo(v,[e]),To(e,a),To(e,o)},onBeforeAppear(e){bo(C,[e]),To(e,l),To(e,u)},onEnter:O(!1),onAppear:O(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>D(e,t);To(e,f),e._enterCancelled?(To(e,p),No(e)):(No(e),To(e,p)),Do(()=>{e._isLeaving&&(Eo(e,f),To(e,m),xo(x)||ko(e,r,_,n))}),bo(x,[e,n])},onEnterCancelled(e){E(e,!1,void 0,!0),bo(b,[e])},onAppearCancelled(e){E(e,!0,void 0,!0),bo(T,[e])},onLeaveCancelled(e){D(e),bo(S,[e])}})}function Co(e){if(e==null)return null;if(v(e))return[wo(e.enter),wo(e.leave)];{let t=wo(e);return[t,t]}}function wo(e){return ce(e)}function To(e,t){t.split(/\\s+/).forEach(t=>t&&e.classList.add(t)),(e[go]||(e[go]=new Set)).add(t)}function Eo(e,t){t.split(/\\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[go];n&&(n.delete(t),n.size||(e[go]=void 0))}function Do(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var Oo=0;function ko(e,t,n,r){let i=e._endId=++Oo,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Ao(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Ao(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${mo}Delay`),a=r(`${mo}Duration`),o=jo(i,a),s=r(`${ho}Delay`),c=r(`${ho}Duration`),l=jo(s,c),u=null,d=0,f=0;t===mo?o>0&&(u=mo,d=o,f=a.length):t===ho?l>0&&(u=ho,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?mo:ho:null,f=u?u===mo?a.length:c.length:0);let p=u===mo&&/\\b(?:transform|all)(?:,|$)/.test(r(`${mo}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function jo(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>Mo(t)+Mo(e[n])))}function Mo(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function No(e){return(e?e.ownerDocument:document).body.offsetHeight}function Po(e,t,n){let r=e[go];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Fo=Symbol(`_vod`),Io=Symbol(`_vsh`),Lo={name:`show`,beforeMount(e,{value:t},{transition:n}){e[Fo]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):Ro(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),Ro(e,!0),r.enter(e)):r.leave(e,()=>{Ro(e,!1)}):Ro(e,t))},beforeUnmount(e,{value:t}){Ro(e,t)}};function Ro(e,t){e.style.display=t?e[Fo]:`none`,e[Io]=!t}var zo=Symbol(``),Bo=/(?:^|;)\\s*display\\s*:/;function Vo(e,t,n){let r=e.style,i=g(n),a=!1;if(n&&!i){if(t){if(g(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Uo(r,t,``)}else for(let e in t)n[e]??Uo(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Uo(r,i,``):qo(e,i,!g(t)&&t?t[i]:void 0,o)||Uo(r,i,o)}}else if(i){if(t!==n){let e=r[zo];e&&(n+=`;`+e),r.cssText=n,a=Bo.test(n)}}else t&&e.removeAttribute(`style`);Fo in e&&(e[Fo]=a?r.display:``,e[Io]&&(r.display=`none`))}var Ho=/\\s*!important$/;function Uo(e,t,n){if(d(n))n.forEach(n=>Uo(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Ko(e,t);Ho.test(n)?e.setProperty(te(r),n.replace(Ho,``),`important`):e[r]=n}}var Wo=[`Webkit`,`Moz`,`ms`],Go={};function Ko(e,t){let n=Go[t];if(n)return n;let r=O(t);if(r!==`filter`&&r in e)return Go[t]=r;r=ne(r);for(let n=0;n<Wo.length;n++){let i=Wo[n]+r;if(i in e)return Go[t]=i}return t}function qo(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&g(r)&&n===r}var Jo=`http://www.w3.org/1999/xlink`;function Yo(e,t,n,r,i,a=_e(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Jo,t.slice(6,t.length)):e.setAttributeNS(Jo,t,n):n==null||a&&!ve(n)?e.removeAttribute(t):e.setAttribute(t,a?``:_(n)?String(n):n)}function Xo(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?so(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=ve(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Zo(e,t,n,r){e.addEventListener(t,n,r)}function Qo(e,t,n,r){e.removeEventListener(t,n,r)}var $o=Symbol(`_vei`);function es(e,t,n,r,i=null){let a=e[$o]||(e[$o]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=rs(t);r?Zo(e,n,a[t]=ss(r,i),s):o&&(Qo(e,n,o,s),a[t]=void 0)}}var ts=/(Once|Passive|Capture)$/,ns=/^on:?(?:Once|Passive|Capture)$/;function rs(e){let t,n;for(;(n=e.match(ts))&&!ns.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):te(e.slice(2)),t]}var is=0,as=Promise.resolve(),os=()=>is||=(as.then(()=>is=0),Date.now());function ss(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(d(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&hn(e,t,5,a)}}else hn(r,t,5,[e])};return n.value=e,n.attached=os(),n}var cs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,ls=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?Po(e,r,c):t===`style`?Vo(e,n,r):a(t)?o(t)||es(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):us(e,t,r,c))?(Xo(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Yo(e,t,r,c,s,t!==`value`)):e._isVueCE&&(ds(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!g(r)))?Xo(e,O(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Yo(e,t,r,c))};function us(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&cs(t)&&h(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return cs(t)&&g(n)?!1:t in e}function ds(e,t){let n=e._def.props;if(!n)return!1;let r=O(t);return Array.isArray(n)?n.some(e=>O(e)===r):Object.keys(n).some(e=>O(e)===r)}var fs=new WeakMap,ps=new WeakMap,ms=Symbol(`_moveCb`),hs=Symbol(`_enterCb`),gs=(e=>(delete e.props.mode,e))({name:`TransitionGroup`,props:s({},vo,{tag:String,moveClass:String}),setup(e,{slots:t}){let n=Va(),r=lr(),i,a;return Rr(()=>{if(!i.length)return;let t=e.moveClass||`${e.name||`v`}-move`;if(!xs(i[0].el,n.vnode.el,t)){i=[];return}i.forEach(_s),i.forEach(vs);let r=i.filter(ys);No(n.vnode.el),r.forEach(e=>{let n=e.el,r=n.style;To(n,t),r.transform=r.webkitTransform=r.transitionDuration=``;let i=n[ms]=e=>{e&&e.target!==n||(!e||e.propertyName.endsWith(`transform`))&&(n.removeEventListener(`transitionend`,i),n[ms]=null,Eo(n,t))};n.addEventListener(`transitionend`,i)}),i=[]}),()=>{let o=Kt(e),s=So(o),c=o.tag||I;if(i=[],a)for(let e=0;e<a.length;e++){let t=a[e];t.el&&t.el instanceof Element&&!t.el[Io]&&(i.push(t),br(t,_r(t,s,r,n)),fs.set(t,bs(t.el)))}a=t.default?xr(t.default()):[];for(let e=0;e<a.length;e++){let t=a[e];t.key!=null&&br(t,_r(t,s,r,n))}return V(c,null,a)}}});function _s(e){let t=e.el;t[ms]&&t[ms](),t[hs]&&t[hs]()}function vs(e){ps.set(e,bs(e.el))}function ys(e){let t=fs.get(e),n=ps.get(e),r=t.left-n.left,i=t.top-n.top;if(r||i){let t=e.el,n=t.style,a=t.getBoundingClientRect(),o=1,s=1;return t.offsetWidth&&(o=a.width/t.offsetWidth),t.offsetHeight&&(s=a.height/t.offsetHeight),(!Number.isFinite(o)||o===0)&&(o=1),(!Number.isFinite(s)||s===0)&&(s=1),Math.abs(o-1)<.01&&(o=1),Math.abs(s-1)<.01&&(s=1),n.transform=n.webkitTransform=`translate(${r/o}px,${i/s}px)`,n.transitionDuration=`0s`,e}}function bs(e){let t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function xs(e,t,n){let r=e.cloneNode(),i=e[go];i&&i.forEach(e=>{e.split(/\\s+/).forEach(e=>e&&r.classList.remove(e))}),n.split(/\\s+/).forEach(e=>e&&r.classList.add(e)),r.style.display=`none`;let a=t.nodeType===1?t:t.parentNode;a.appendChild(r);let{hasTransform:o}=Ao(r);return a.removeChild(r),o}var Ss=[`ctrl`,`shift`,`alt`,`meta`],Cs={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>Ss.some(n=>e[`${n}Key`]&&!t.includes(n))},ws=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=Cs[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},Ts={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Es=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=te(n.key);if(t.some(e=>e===r||Ts[e]===r))return e(n)}))},Ds=s({patchProp:ls},po),Os;function ks(){return Os||=ta(Ds)}var As=((...e)=>{let t=ks().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=Ms(e);if(!r)return;let i=t._component;!h(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,js(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function js(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function Ms(e){return g(e)?document.querySelector(e):e}function Ns(e){let t=`.`,n=`__`,r=`--`,i;if(e){let i=e.blockPrefix;i&&(t=i),i=e.elementPrefix,i&&(n=i),i=e.modifierPrefix,i&&(r=i)}let a={install(e){i=e.c;let t=e.context;t.bem={},t.bem.b=null,t.bem.els=null}};function o(e){let n,r;return{before(e){n=e.bem.b,r=e.bem.els,e.bem.els=null},after(e){e.bem.b=n,e.bem.els=r},$({context:n,props:r}){return e=typeof e==`string`?e:e({context:n,props:r}),n.bem.b=e,`${r?.bPrefix||t}${n.bem.b}`}}}function s(e){let r;return{before(e){r=e.bem.els},after(e){e.bem.els=r},$({context:r,props:i}){return e=typeof e==`string`?e:e({context:r,props:i}),r.bem.els=e.split(`,`).map(e=>e.trim()),r.bem.els.map(e=>`${i?.bPrefix||t}${r.bem.b}${n}${e}`).join(`, `)}}}function c(e){return{$({context:i,props:a}){e=typeof e==`string`?e:e({context:i,props:a});let o=e.split(`,`).map(e=>e.trim());function s(e){return o.map(o=>`&${a?.bPrefix||t}${i.bem.b}${e===void 0?``:`${n}${e}`}${r}${o}`).join(`, `)}let c=i.bem.els;return c===null?s():s(c[0])}}}function l(e){return{$({context:i,props:a}){e=typeof e==`string`?e:e({context:i,props:a});let o=i.bem.els;return`&:not(${a?.bPrefix||t}${i.bem.b}${o!==null&&o.length>0?`${n}${o[0]}`:``}${r}${e})`}}}return Object.assign(a,{cB:((...e)=>i(o(e[0]),e[1],e[2])),cE:((...e)=>i(s(e[0]),e[1],e[2])),cM:((...e)=>i(c(e[0]),e[1],e[2])),cNotM:((...e)=>i(l(e[0]),e[1],e[2]))}),a}function Ps(e){let t=0;for(let n=0;n<e.length;++n)e[n]===`&`&&++t;return t}var Fs=/\\s*,(?![^(]*\\))\\s*/g,Is=/\\s+/g;function Ls(e,t){let n=[];return t.split(Fs).forEach(t=>{let r=Ps(t);if(!r){e.forEach(e=>{n.push((e&&e+` `)+t)});return}if(r===1){e.forEach(e=>{n.push(t.replace(`&`,e))});return}let i=[t];for(;r--;){let t=[];i.forEach(n=>{e.forEach(e=>{t.push(n.replace(`&`,e))})}),i=t}i.forEach(e=>n.push(e))}),n}function Rs(e,t){let n=[];return t.split(Fs).forEach(t=>{e.forEach(e=>{n.push((e&&e+` `)+t)})}),n}function zs(e){let t=[``];return e.forEach(e=>{e&&=e.trim(),e&&(t=e.includes(`&`)?Ls(t,e):Rs(t,e))}),t.join(`, `).replace(Is,` `)}function Bs(e){if(!e)return;let t=e.parentElement;t&&t.removeChild(e)}function Vs(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function Hs(e){let t=document.createElement(`style`);return t.setAttribute(`cssr-id`,e),t}function Us(e){return e?/^\\s*@(s|m)/.test(e):!1}var Ws=/[A-Z]/g;function Gs(e){return e.replace(Ws,e=>`-`+e.toLowerCase())}function Ks(e,t=` `){return typeof e==`object`&&e?` {\n`+Object.entries(e).map(e=>t+` ${Gs(e[0])}: ${e[1]};`).join(`\n`)+`\n`+t+`}`:`: ${e};`}function qs(e,t,n){return typeof e==`function`?e({context:t.context,props:n}):e}function Js(e,t,n,r){if(!t)return``;let i=qs(t,n,r);if(!i)return``;if(typeof i==`string`)return`${e} {\\n${i}\\n}`;let a=Object.keys(i);if(a.length===0)return n.config.keepEmptyBlock?e+` {\n}`:``;let o=e?[e+` {`]:[];return a.forEach(e=>{let t=i[e];if(e===`raw`){o.push(`\n`+t+`\n`);return}e=Gs(e),t!=null&&o.push(` ${e}${Ks(t)}`)}),e&&o.push(`}`),o.join(`\n`)}function Ys(e,t,n){e&&e.forEach(e=>{if(Array.isArray(e))Ys(e,t,n);else if(typeof e==`function`){let r=e(t);Array.isArray(r)?Ys(r,t,n):r&&n(r)}else e&&n(e)})}function Xs(e,t,n,r,i){let a=e.$,o=``;if(!a||typeof a==`string`)Us(a)?o=a:t.push(a);else if(typeof a==`function`){let e=a({context:r.context,props:i});Us(e)?o=e:t.push(e)}else if(a.before&&a.before(r.context),!a.$||typeof a.$==`string`)Us(a.$)?o=a.$:t.push(a.$);else if(a.$){let e=a.$({context:r.context,props:i});Us(e)?o=e:t.push(e)}let s=zs(t),c=Js(s,e.props,r,i);o?n.push(`${o} {`):c.length&&n.push(c),e.children&&Ys(e.children,{context:r.context,props:i},e=>{if(typeof e==`string`){let t=Js(s,{raw:e},r,i);n.push(t)}else Xs(e,t,n,r,i)}),t.pop(),o&&n.push(`}`),a&&a.after&&a.after(r.context)}function Zs(e,t,n){let r=[];return Xs(e,[],r,t,n),r.join(`\n\n`)}function Qs(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<`u`&&(window.__cssrContext={});function $s(e,t,n,r){let{els:i}=t;if(n===void 0)i.forEach(Bs),t.els=[];else{let e=Vs(n,r);e&&i.includes(e)&&(Bs(e),t.els=i.filter(t=>t!==e))}}function ec(e,t){e.push(t)}function tc(e,t,n,r,i,a,o,s,c){let l;if(n===void 0&&(l=t.render(r),n=Qs(l)),c){c.adapter(n,l??t.render(r));return}s===void 0&&(s=document.head);let u=Vs(n,s);if(u!==null&&!a)return u;let d=u??Hs(n);if(l===void 0&&(l=t.render(r)),d.textContent=l,u!==null)return u;if(o){let e=s.querySelector(`meta[name="${o}"]`);if(e)return s.insertBefore(d,e),ec(t.els,d),d}return i?s.insertBefore(d,s.querySelector(`style, link`)):s.appendChild(d),ec(t.els,d),d}function nc(e){return Zs(this,this.instance,e)}function rc(e={}){let{id:t,ssr:n,props:r,head:i=!1,force:a=!1,anchorMetaName:o,parent:s}=e;return tc(this.instance,this,t,r,i,a,o,s,n)}function ic(e={}){let{id:t,parent:n}=e;$s(this.instance,this,t,n)}var ac=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:nc,mount:rc,unmount:ic}},oc=function(e,t,n,r){return Array.isArray(t)?ac(e,{$:null},null,t):Array.isArray(n)?ac(e,t,null,n):Array.isArray(r)?ac(e,t,n,r):ac(e,t,n,null)};function sc(e={}){let t={c:((...e)=>oc(t,...e)),use:(e,...n)=>e.install(t,...n),find:Vs,context:{},config:e};return t}function cc(e,t){if(e===void 0)return!1;if(t){let{context:{ids:n}}=t;return n.has(e)}return Vs(e)!==null}var lc=`.n-`,uc=`__`,dc=`--`,fc=sc(),pc=Ns({blockPrefix:lc,elementPrefix:uc,modifierPrefix:dc});fc.use(pc);var{c:U,find:mc}=fc,{cB:W,cE:G,cM:K,cNotM:hc}=pc;function gc(e){return U(({props:{bPrefix:e}})=>`${e||lc}modal, ${e||lc}drawer`,[e])}function _c(e){return U(({props:{bPrefix:e}})=>`${e||lc}popover`,[e])}function vc(e){return U(({props:{bPrefix:e}})=>`&${e||lc}modal`,e)}var yc=(...e)=>U(`>`,[W(...e)]);function q(e,t){return e+(t==="default"?``:t.replace(/^[a-z]/,e=>e.toUpperCase()))}var bc={name:`en-US`,global:{undo:`Undo`,redo:`Redo`,confirm:`Confirm`,clear:`Clear`},Popconfirm:{positiveText:`Confirm`,negativeText:`Cancel`},Cascader:{placeholder:`Please Select`,loading:`Loading`,loadingRequiredMessage:e=>`Please load all ${e}\'s descendants before checking it.`},Time:{dateFormat:`yyyy-MM-dd`,dateTimeFormat:`yyyy-MM-dd HH:mm:ss`},DatePicker:{yearFormat:`yyyy`,monthFormat:`MMM`,dayFormat:`eeeeee`,yearTypeFormat:`yyyy`,monthTypeFormat:`yyyy-MM`,dateFormat:`yyyy-MM-dd`,dateTimeFormat:`yyyy-MM-dd HH:mm:ss`,quarterFormat:`yyyy-qqq`,weekFormat:`YYYY-w`,clear:`Clear`,now:`Now`,confirm:`Confirm`,selectTime:`Select Time`,selectDate:`Select Date`,datePlaceholder:`Select Date`,datetimePlaceholder:`Select Date and Time`,monthPlaceholder:`Select Month`,yearPlaceholder:`Select Year`,quarterPlaceholder:`Select Quarter`,weekPlaceholder:`Select Week`,startDatePlaceholder:`Start Date`,endDatePlaceholder:`End Date`,startDatetimePlaceholder:`Start Date and Time`,endDatetimePlaceholder:`End Date and Time`,startMonthPlaceholder:`Start Month`,endMonthPlaceholder:`End Month`,monthBeforeYear:!0,firstDayOfWeek:6,today:`Today`},DataTable:{checkTableAll:`Select all in the table`,uncheckTableAll:`Unselect all in the table`,confirm:`Confirm`,clear:`Clear`},LegacyTransfer:{sourceTitle:`Source`,targetTitle:`Target`},Transfer:{selectAll:`Select all`,unselectAll:`Unselect all`,clearAll:`Clear`,total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:`No Data`},Select:{placeholder:`Please Select`},TimePicker:{placeholder:`Select Time`,positiveText:`OK`,negativeText:`Cancel`,now:`Now`,clear:`Clear`},Pagination:{goto:`Goto`,selectionSuffix:`page`},DynamicTags:{add:`Add`},Log:{loading:`Loading`},Input:{placeholder:`Please Input`},InputNumber:{placeholder:`Please Input`},DynamicInput:{create:`Create`},ThemeEditor:{title:`Theme Editor`,clearAllVars:`Clear All Variables`,clearSearch:`Clear Search`,filterCompName:`Filter Component Name`,filterVarName:`Filter Variable Name`,import:`Import`,export:`Export`,restore:`Reset to Default`},Image:{tipPrevious:`Previous picture (\u2190)`,tipNext:`Next picture (\u2192)`,tipCounterclockwise:`Counterclockwise`,tipClockwise:`Clockwise`,tipZoomOut:`Zoom out`,tipZoomIn:`Zoom in`,tipDownload:`Download`,tipClose:`Close (Esc)`,tipOriginalSize:`Zoom to original size`},Heatmap:{less:`less`,more:`more`,monthFormat:`MMM`,weekdayFormat:`eee`}};function xc(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function Sc(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function Cc(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?Tc(s,e=>e.test(o)):wc(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function wc(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Tc(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Ec(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Dc={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},Oc=(e,t,n)=>{let r,i=Dc[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},kc={lastWeek:`\'last\' eeee \'at\' p`,yesterday:`\'yesterday at\' p`,today:`\'today at\' p`,tomorrow:`\'tomorrow at\' p`,nextWeek:`eeee \'at\' p`,other:`P`},Ac=(e,t,n,r)=>kc[e],jc={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:Sc({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:Sc({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:Sc({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:Sc({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:Sc({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})},Mc={ordinalNumber:Ec({matchPattern:/^(\\d+)(th|st|nd|rd)?/i,parsePattern:/\\d+/i,valueCallback:e=>parseInt(e,10)}),era:Cc({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\\.?\\s?c\\.?|b\\.?\\s?c\\.?\\s?e\\.?|a\\.?\\s?d\\.?|c\\.?\\s?e\\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:Cc({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:Cc({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:Cc({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:Cc({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\\.?\\s?m\\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},Nc={name:`en-US`,locale:{code:`en-US`,formatDistance:Oc,formatLong:{date:xc({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:xc({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:xc({formats:{full:`{{date}} \'at\' {{time}}`,long:`{{date}} \'at\' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:Ac,localize:jc,match:Mc,options:{weekStartsOn:0,firstWeekContainsDate:1}}},Pc=typeof global==`object`&&global&&global.Object===Object&&global,Fc=typeof self==`object`&&self&&self.Object===Object&&self,Ic=Pc||Fc||Function(`return this`)(),Lc=Ic.Symbol,Rc=Object.prototype,zc=Rc.hasOwnProperty,Bc=Rc.toString,Vc=Lc?Lc.toStringTag:void 0;function Hc(e){var t=zc.call(e,Vc),n=e[Vc];try{e[Vc]=void 0;var r=!0}catch{}var i=Bc.call(e);return r&&(t?e[Vc]=n:delete e[Vc]),i}var Uc=Object.prototype.toString;function Wc(e){return Uc.call(e)}var Gc=`[object Null]`,Kc=`[object Undefined]`,qc=Lc?Lc.toStringTag:void 0;function Jc(e){return e==null?e===void 0?Kc:Gc:qc&&qc in Object(e)?Hc(e):Wc(e)}function Yc(e){return typeof e==`object`&&!!e}var Xc=`[object Symbol]`;function Zc(e){return typeof e==`symbol`||Yc(e)&&Jc(e)==Xc}function Qc(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var $c=Array.isArray,el=1/0,tl=Lc?Lc.prototype:void 0,nl=tl?tl.toString:void 0;function rl(e){if(typeof e==`string`)return e;if($c(e))return Qc(e,rl)+``;if(Zc(e))return nl?nl.call(e):``;var t=e+``;return t==`0`&&1/e==-el?`-0`:t}function il(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}function al(e){return e}var ol=`[object AsyncFunction]`,sl=`[object Function]`,cl=`[object GeneratorFunction]`,ll=`[object Proxy]`;function ul(e){if(!il(e))return!1;var t=Jc(e);return t==sl||t==cl||t==ol||t==ll}var dl=Ic[`__core-js_shared__`],fl=function(){var e=/[^.]+$/.exec(dl&&dl.keys&&dl.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function pl(e){return!!fl&&fl in e}var ml=Function.prototype.toString;function hl(e){if(e!=null){try{return ml.call(e)}catch{}try{return e+``}catch{}}return``}var gl=/[\\\\^$.*+?()[\\]{}|]/g,_l=/^\\[object .+?Constructor\\]$/,vl=Function.prototype,yl=Object.prototype,bl=vl.toString,xl=yl.hasOwnProperty,Sl=RegExp(`^`+bl.call(xl).replace(gl,`\\\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g,`$1.*?`)+`$`);function Cl(e){return!il(e)||pl(e)?!1:(ul(e)?Sl:_l).test(hl(e))}function wl(e,t){return e?.[t]}function Tl(e,t){var n=wl(e,t);return Cl(n)?n:void 0}var El=Tl(Ic,`WeakMap`),Dl=Object.create,Ol=function(){function e(){}return function(t){if(!il(t))return{};if(Dl)return Dl(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function kl(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)}function Al(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var jl=800,Ml=16,Nl=Date.now;function Pl(e){var t=0,n=0;return function(){var r=Nl(),i=Ml-(r-n);if(n=r,i>0){if(++t>=jl)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Fl(e){return function(){return e}}var Il=function(){try{var e=Tl(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),Ll=Pl(Il?function(e,t){return Il(e,`toString`,{configurable:!0,enumerable:!1,value:Fl(t),writable:!0})}:al),Rl=9007199254740991,zl=/^(?:0|[1-9]\\d*)$/;function Bl(e,t){var n=typeof e;return t??=Rl,!!t&&(n==`number`||n!=`symbol`&&zl.test(e))&&e>-1&&e%1==0&&e<t}function Vl(e,t,n){t==`__proto__`&&Il?Il(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Hl(e,t){return e===t||e!==e&&t!==t}var Ul=Object.prototype.hasOwnProperty;function Wl(e,t,n){var r=e[t];(!(Ul.call(e,t)&&Hl(r,n))||n===void 0&&!(t in e))&&Vl(e,t,n)}function Gl(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?Vl(n,s,c):Wl(n,s,c)}return n}var Kl=Math.max;function ql(e,t,n){return t=Kl(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=Kl(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),kl(e,this,s)}}function Jl(e,t){return Ll(ql(e,t,al),e+``)}var Yl=9007199254740991;function Xl(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=Yl}function Zl(e){return e!=null&&Xl(e.length)&&!ul(e)}function Ql(e,t,n){if(!il(n))return!1;var r=typeof t;return(r==`number`?Zl(n)&&Bl(t,n.length):r==`string`&&t in n)?Hl(n[t],e):!1}function $l(e){return Jl(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&Ql(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var eu=Object.prototype;function tu(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||eu)}function nu(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var ru=`[object Arguments]`;function iu(e){return Yc(e)&&Jc(e)==ru}var au=Object.prototype,ou=au.hasOwnProperty,su=au.propertyIsEnumerable,cu=iu(function(){return arguments}())?iu:function(e){return Yc(e)&&ou.call(e,`callee`)&&!su.call(e,`callee`)};function lu(){return!1}var uu=typeof exports==`object`&&exports&&!exports.nodeType&&exports,du=uu&&typeof module==`object`&&module&&!module.nodeType&&module,fu=du&&du.exports===uu?Ic.Buffer:void 0,pu=(fu?fu.isBuffer:void 0)||lu,mu=`[object Arguments]`,hu=`[object Array]`,gu=`[object Boolean]`,_u=`[object Date]`,vu=`[object Error]`,yu=`[object Function]`,bu=`[object Map]`,xu=`[object Number]`,Su=`[object Object]`,Cu=`[object RegExp]`,wu=`[object Set]`,Tu=`[object String]`,Eu=`[object WeakMap]`,Du=`[object ArrayBuffer]`,Ou=`[object DataView]`,ku=`[object Float32Array]`,Au=`[object Float64Array]`,ju=`[object Int8Array]`,Mu=`[object Int16Array]`,Nu=`[object Int32Array]`,Pu=`[object Uint8Array]`,Fu=`[object Uint8ClampedArray]`,Iu=`[object Uint16Array]`,Lu=`[object Uint32Array]`,Ru={};Ru[ku]=Ru[Au]=Ru[ju]=Ru[Mu]=Ru[Nu]=Ru[Pu]=Ru[Fu]=Ru[Iu]=Ru[Lu]=!0,Ru[mu]=Ru[hu]=Ru[Du]=Ru[gu]=Ru[Ou]=Ru[_u]=Ru[vu]=Ru[yu]=Ru[bu]=Ru[xu]=Ru[Su]=Ru[Cu]=Ru[wu]=Ru[Tu]=Ru[Eu]=!1;function zu(e){return Yc(e)&&Xl(e.length)&&!!Ru[Jc(e)]}function Bu(e){return function(t){return e(t)}}var Vu=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Hu=Vu&&typeof module==`object`&&module&&!module.nodeType&&module,Uu=Hu&&Hu.exports===Vu&&Pc.process,Wu=function(){try{return Hu&&Hu.require&&Hu.require(`util`).types||Uu&&Uu.binding&&Uu.binding(`util`)}catch{}}(),Gu=Wu&&Wu.isTypedArray,Ku=Gu?Bu(Gu):zu,qu=Object.prototype.hasOwnProperty;function Ju(e,t){var n=$c(e),r=!n&&cu(e),i=!n&&!r&&pu(e),a=!n&&!r&&!i&&Ku(e),o=n||r||i||a,s=o?nu(e.length,String):[],c=s.length;for(var l in e)(t||qu.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||Bl(l,c)))&&s.push(l);return s}function Yu(e,t){return function(n){return e(t(n))}}var Xu=Yu(Object.keys,Object),Zu=Object.prototype.hasOwnProperty;function Qu(e){if(!tu(e))return Xu(e);var t=[];for(var n in Object(e))Zu.call(e,n)&&n!=`constructor`&&t.push(n);return t}function $u(e){return Zl(e)?Ju(e):Qu(e)}function ed(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var td=Object.prototype.hasOwnProperty;function nd(e){if(!il(e))return ed(e);var t=tu(e),n=[];for(var r in e)r==`constructor`&&(t||!td.call(e,r))||n.push(r);return n}function rd(e){return Zl(e)?Ju(e,!0):nd(e)}var id=/\\.|\\[(?:[^[\\]]*|(["\'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,ad=/^\\w*$/;function od(e,t){if($c(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||Zc(e)?!0:ad.test(e)||!id.test(e)||t!=null&&e in Object(t)}var sd=Tl(Object,`create`);function cd(){this.__data__=sd?sd(null):{},this.size=0}function ld(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var ud=`__lodash_hash_undefined__`,dd=Object.prototype.hasOwnProperty;function fd(e){var t=this.__data__;if(sd){var n=t[e];return n===ud?void 0:n}return dd.call(t,e)?t[e]:void 0}var pd=Object.prototype.hasOwnProperty;function md(e){var t=this.__data__;return sd?t[e]!==void 0:pd.call(t,e)}var hd=`__lodash_hash_undefined__`;function gd(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=sd&&t===void 0?hd:t,this}function _d(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}_d.prototype.clear=cd,_d.prototype.delete=ld,_d.prototype.get=fd,_d.prototype.has=md,_d.prototype.set=gd;function vd(){this.__data__=[],this.size=0}function yd(e,t){for(var n=e.length;n--;)if(Hl(e[n][0],t))return n;return-1}var bd=Array.prototype.splice;function xd(e){var t=this.__data__,n=yd(t,e);return n<0?!1:(n==t.length-1?t.pop():bd.call(t,n,1),--this.size,!0)}function Sd(e){var t=this.__data__,n=yd(t,e);return n<0?void 0:t[n][1]}function Cd(e){return yd(this.__data__,e)>-1}function wd(e,t){var n=this.__data__,r=yd(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Td(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Td.prototype.clear=vd,Td.prototype.delete=xd,Td.prototype.get=Sd,Td.prototype.has=Cd,Td.prototype.set=wd;var Ed=Tl(Ic,`Map`);function Dd(){this.size=0,this.__data__={hash:new _d,map:new(Ed||Td),string:new _d}}function Od(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function kd(e,t){var n=e.__data__;return Od(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Ad(e){var t=kd(this,e).delete(e);return this.size-=+!!t,t}function jd(e){return kd(this,e).get(e)}function Md(e){return kd(this,e).has(e)}function Nd(e,t){var n=kd(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function Pd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Pd.prototype.clear=Dd,Pd.prototype.delete=Ad,Pd.prototype.get=jd,Pd.prototype.has=Md,Pd.prototype.set=Nd;var Fd=`Expected a function`;function Id(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(Fd);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Id.Cache||Pd),n}Id.Cache=Pd;var Ld=500;function Rd(e){var t=Id(e,function(e){return n.size===Ld&&n.clear(),e}),n=t.cache;return t}var zd=/[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g,Bd=/\\\\(\\\\)?/g,Vd=Rd(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(zd,function(e,n,r,i){t.push(r?i.replace(Bd,`$1`):n||e)}),t});function Hd(e){return e==null?``:rl(e)}function Ud(e,t){return $c(e)?e:od(e,t)?[e]:Vd(Hd(e))}var Wd=1/0;function Gd(e){if(typeof e==`string`||Zc(e))return e;var t=e+``;return t==`0`&&1/e==-Wd?`-0`:t}function Kd(e,t){t=Ud(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[Gd(t[n++])];return n&&n==r?e:void 0}function qd(e,t,n){var r=e==null?void 0:Kd(e,t);return r===void 0?n:r}function Jd(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Yd=Yu(Object.getPrototypeOf,Object),Xd=`[object Object]`,Zd=Function.prototype,Qd=Object.prototype,$d=Zd.toString,ef=Qd.hasOwnProperty,tf=$d.call(Object);function nf(e){if(!Yc(e)||Jc(e)!=Xd)return!1;var t=Yd(e);if(t===null)return!0;var n=ef.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&$d.call(n)==tf}function rf(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var a=Array(i);++r<i;)a[r]=e[r+t];return a}function af(e,t,n){var r=e.length;return n=n===void 0?r:n,!t&&n>=r?e:rf(e,t,n)}var of=RegExp(`[\\\\u200d\\\\ud800-\\\\udfff\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff\\\\ufe0e\\\\ufe0f]`);function sf(e){return of.test(e)}function cf(e){return e.split(``)}var lf=`\\\\ud800-\\\\udfff`,uf=`\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe2f\\\\u20d0-\\\\u20ff`,df=`\\\\ufe0e\\\\ufe0f`,ff=`[`+lf+`]`,pf=`[`+uf+`]`,mf=`\\\\ud83c[\\\\udffb-\\\\udfff]`,hf=`(?:`+pf+`|`+mf+`)`,gf=`[^`+lf+`]`,_f=`(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}`,vf=`[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]`,yf=`\\\\u200d`,bf=hf+`?`,xf=`[`+df+`]?`,Sf=`(?:`+yf+`(?:`+[gf,_f,vf].join(`|`)+`)`+xf+bf+`)*`,Cf=xf+bf+Sf,wf=`(?:`+[gf+pf+`?`,pf,_f,vf,ff].join(`|`)+`)`,Tf=RegExp(mf+`(?=`+mf+`)|`+wf+Cf,`g`);function Ef(e){return e.match(Tf)||[]}function Df(e){return sf(e)?Ef(e):cf(e)}function Of(e){return function(t){t=Hd(t);var n=sf(t)?Df(t):void 0,r=n?n[0]:t.charAt(0),i=n?af(n,1).join(``):t.slice(1);return r[e]()+i}}var kf=Of(`toUpperCase`);function Af(){this.__data__=new Td,this.size=0}function jf(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Mf(e){return this.__data__.get(e)}function Nf(e){return this.__data__.has(e)}var Pf=200;function Ff(e,t){var n=this.__data__;if(n instanceof Td){var r=n.__data__;if(!Ed||r.length<Pf-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Pd(r)}return n.set(e,t),this.size=n.size,this}function If(e){var t=this.__data__=new Td(e);this.size=t.size}If.prototype.clear=Af,If.prototype.delete=jf,If.prototype.get=Mf,If.prototype.has=Nf,If.prototype.set=Ff;var Lf=typeof exports==`object`&&exports&&!exports.nodeType&&exports,Rf=Lf&&typeof module==`object`&&module&&!module.nodeType&&module,zf=Rf&&Rf.exports===Lf?Ic.Buffer:void 0,Bf=zf?zf.allocUnsafe:void 0;function Vf(e,t){if(t)return e.slice();var n=e.length,r=Bf?Bf(n):new e.constructor(n);return e.copy(r),r}function Hf(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}function Uf(){return[]}var Wf=Object.prototype.propertyIsEnumerable,Gf=Object.getOwnPropertySymbols,Kf=Gf?function(e){return e==null?[]:(e=Object(e),Hf(Gf(e),function(t){return Wf.call(e,t)}))}:Uf;function qf(e,t,n){var r=t(e);return $c(e)?r:Jd(r,n(e))}function Jf(e){return qf(e,$u,Kf)}var Yf=Tl(Ic,`DataView`),Xf=Tl(Ic,`Promise`),Zf=Tl(Ic,`Set`),Qf=`[object Map]`,$f=`[object Object]`,ep=`[object Promise]`,tp=`[object Set]`,np=`[object WeakMap]`,rp=`[object DataView]`,ip=hl(Yf),ap=hl(Ed),op=hl(Xf),sp=hl(Zf),cp=hl(El),lp=Jc;(Yf&&lp(new Yf(new ArrayBuffer(1)))!=rp||Ed&&lp(new Ed)!=Qf||Xf&&lp(Xf.resolve())!=ep||Zf&&lp(new Zf)!=tp||El&&lp(new El)!=np)&&(lp=function(e){var t=Jc(e),n=t==$f?e.constructor:void 0,r=n?hl(n):``;if(r)switch(r){case ip:return rp;case ap:return Qf;case op:return ep;case sp:return tp;case cp:return np}return t});var up=lp,dp=Ic.Uint8Array;function fp(e){var t=new e.constructor(e.byteLength);return new dp(t).set(new dp(e)),t}function pp(e,t){var n=t?fp(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function mp(e){return typeof e.constructor==`function`&&!tu(e)?Ol(Yd(e)):{}}var hp=`__lodash_hash_undefined__`;function gp(e){return this.__data__.set(e,hp),this}function _p(e){return this.__data__.has(e)}function vp(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new Pd;++t<n;)this.add(e[t])}vp.prototype.add=vp.prototype.push=gp,vp.prototype.has=_p;function yp(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function bp(e,t){return e.has(t)}var xp=1,Sp=2;function Cp(e,t,n,r,i,a){var o=n&xp,s=e.length,c=t.length;if(s!=c&&!(o&&c>s))return!1;var l=a.get(e),u=a.get(t);if(l&&u)return l==t&&u==e;var d=-1,f=!0,p=n&Sp?new vp:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var m=e[d],h=t[d];if(r)var g=o?r(h,m,d,t,e,a):r(m,h,d,e,t,a);if(g!==void 0){if(g)continue;f=!1;break}if(p){if(!yp(t,function(e,t){if(!bp(p,t)&&(m===e||i(m,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(!(m===h||i(m,h,n,r,a))){f=!1;break}}return a.delete(e),a.delete(t),f}function wp(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function Tp(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}var Ep=1,Dp=2,Op=`[object Boolean]`,kp=`[object Date]`,Ap=`[object Error]`,jp=`[object Map]`,Mp=`[object Number]`,Np=`[object RegExp]`,Pp=`[object Set]`,Fp=`[object String]`,Ip=`[object Symbol]`,Lp=`[object ArrayBuffer]`,Rp=`[object DataView]`,zp=Lc?Lc.prototype:void 0,Bp=zp?zp.valueOf:void 0;function Vp(e,t,n,r,i,a,o){switch(n){case Rp:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Lp:return!(e.byteLength!=t.byteLength||!a(new dp(e),new dp(t)));case Op:case kp:case Mp:return Hl(+e,+t);case Ap:return e.name==t.name&&e.message==t.message;case Np:case Fp:return e==t+``;case jp:var s=wp;case Pp:var c=r&Ep;if(s||=Tp,e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;r|=Dp,o.set(e,t);var u=Cp(s(e),s(t),r,i,a,o);return o.delete(e),u;case Ip:if(Bp)return Bp.call(e)==Bp.call(t)}return!1}var Hp=1,Up=Object.prototype.hasOwnProperty;function Wp(e,t,n,r,i,a){var o=n&Hp,s=Jf(e),c=s.length;if(c!=Jf(t).length&&!o)return!1;for(var l=c;l--;){var u=s[l];if(!(o?u in t:Up.call(t,u)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var m=o;++l<c;){u=s[l];var h=e[u],g=t[u];if(r)var _=o?r(g,h,u,t,e,a):r(h,g,u,e,t,a);if(!(_===void 0?h===g||i(h,g,n,r,a):_)){p=!1;break}m||=u==`constructor`}if(p&&!m){var v=e.constructor,y=t.constructor;v!=y&&`constructor`in e&&`constructor`in t&&!(typeof v==`function`&&v instanceof v&&typeof y==`function`&&y instanceof y)&&(p=!1)}return a.delete(e),a.delete(t),p}var Gp=1,Kp=`[object Arguments]`,qp=`[object Array]`,Jp=`[object Object]`,Yp=Object.prototype.hasOwnProperty;function Xp(e,t,n,r,i,a){var o=$c(e),s=$c(t),c=o?qp:up(e),l=s?qp:up(t);c=c==Kp?Jp:c,l=l==Kp?Jp:l;var u=c==Jp,d=l==Jp,f=c==l;if(f&&pu(e)){if(!pu(t))return!1;o=!0,u=!1}if(f&&!u)return a||=new If,o||Ku(e)?Cp(e,t,n,r,i,a):Vp(e,t,c,n,r,i,a);if(!(n&Gp)){var p=u&&Yp.call(e,`__wrapped__`),m=d&&Yp.call(t,`__wrapped__`);if(p||m){var h=p?e.value():e,g=m?t.value():t;return a||=new If,i(h,g,n,r,a)}}return f?(a||=new If,Wp(e,t,n,r,i,a)):!1}function Zp(e,t,n,r,i){return e===t?!0:e==null||t==null||!Yc(e)&&!Yc(t)?e!==e&&t!==t:Xp(e,t,n,r,Zp,i)}var Qp=1,$p=2;function em(e,t,n,r){var i=n.length,a=i,o=!r;if(e==null)return!a;for(e=Object(e);i--;){var s=n[i];if(o&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<a;){s=n[i];var c=s[0],l=e[c],u=s[1];if(o&&s[2]){if(l===void 0&&!(c in e))return!1}else{var d=new If;if(r)var f=r(l,u,c,e,t,d);if(!(f===void 0?Zp(u,l,Qp|$p,r,d):f))return!1}}return!0}function tm(e){return e===e&&!il(e)}function nm(e){for(var t=$u(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,tm(i)]}return t}function rm(e,t){return function(n){return n!=null&&n[e]===t&&(t!==void 0||e in Object(n))}}function im(e){var t=nm(e);return t.length==1&&t[0][2]?rm(t[0][0],t[0][1]):function(n){return n===e||em(n,e,t)}}function am(e,t){return e!=null&&t in Object(e)}function om(e,t,n){t=Ud(t,e);for(var r=-1,i=t.length,a=!1;++r<i;){var o=Gd(t[r]);if(!(a=e!=null&&n(e,o)))break;e=e[o]}return a||++r!=i?a:(i=e==null?0:e.length,!!i&&Xl(i)&&Bl(o,i)&&($c(e)||cu(e)))}function sm(e,t){return e!=null&&om(e,t,am)}var cm=1,lm=2;function um(e,t){return od(e)&&tm(t)?rm(Gd(e),t):function(n){var r=qd(n,e);return r===void 0&&r===t?sm(n,e):Zp(t,r,cm|lm)}}function dm(e){return function(t){return t?.[e]}}function fm(e){return function(t){return Kd(t,e)}}function pm(e){return od(e)?dm(Gd(e)):fm(e)}function mm(e){return typeof e==`function`?e:e==null?al:typeof e==`object`?$c(e)?um(e[0],e[1]):im(e):pm(e)}function hm(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var gm=hm();function _m(e,t){return e&&gm(e,t,$u)}function vm(e,t){return function(n,r){if(n==null)return n;if(!Zl(n))return e(n,r);for(var i=n.length,a=t?i:-1,o=Object(n);(t?a--:++a<i)&&r(o[a],a,o)!==!1;);return n}}var ym=vm(_m);function bm(e,t,n){(n!==void 0&&!Hl(e[t],n)||n===void 0&&!(t in e))&&Vl(e,t,n)}function xm(e){return Yc(e)&&Zl(e)}function Sm(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}function Cm(e){return Gl(e,rd(e))}function wm(e,t,n,r,i,a,o){var s=Sm(e,n),c=Sm(t,n),l=o.get(c);if(l){bm(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=$c(c),p=!f&&pu(c),m=!f&&!p&&Ku(c);u=c,f||p||m?$c(s)?u=s:xm(s)?u=Al(s):p?(d=!1,u=Vf(c,!0)):m?(d=!1,u=pp(c,!0)):u=[]:nf(c)||cu(c)?(u=s,cu(s)?u=Cm(s):(!il(s)||ul(s))&&(u=mp(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),bm(e,n,u)}function Tm(e,t,n,r,i){e!==t&&gm(t,function(a,o){if(i||=new If,il(a))wm(e,t,o,n,Tm,r,i);else{var s=r?r(Sm(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),bm(e,o,s)}},rd)}function Em(e,t){var n=-1,r=Zl(e)?Array(e.length):[];return ym(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function Dm(e,t){return($c(e)?Qc:Em)(e,mm(t,3))}var Om=$l(function(e,t,n){Tm(e,t,n)});function km(e,t){console.error(`[naive/${e}]: ${t}`)}function Am(e,t){throw Error(`[naive/${e}]: ${t}`)}function jm(e){return Object.keys(e)}function Mm(e){return e}var Nm=Mm(`n-config-provider`);function Pm(e={},t={defaultBordered:!0}){let n=P(Nm,null);return{inlineThemeDisabled:n?.inlineThemeDisabled,mergedRtlRef:n?.mergedRtlRef,mergedComponentPropsRef:n?.mergedComponentPropsRef,mergedBreakpointsRef:n?.mergedBreakpointsRef,mergedBorderedRef:H(()=>{let{bordered:r}=e;return r===void 0?n?.mergedBorderedRef.value??t.defaultBordered??!0:r}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:Zt(`n`),namespaceRef:H(()=>n?.mergedNamespaceRef.value)}}var Fm=`naive-ui-style`,Im={fontFamily:`v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"`,fontFamilyMono:`v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace`,fontWeight:`400`,fontWeightStrong:`500`,cubicBezierEaseInOut:`cubic-bezier(.4, 0, .2, 1)`,cubicBezierEaseOut:`cubic-bezier(0, 0, .2, 1)`,cubicBezierEaseIn:`cubic-bezier(.4, 0, 1, 1)`,borderRadius:`3px`,borderRadiusSmall:`2px`,fontSize:`14px`,fontSizeMini:`12px`,fontSizeTiny:`12px`,fontSizeSmall:`14px`,fontSizeMedium:`14px`,fontSizeLarge:`15px`,fontSizeHuge:`16px`,lineHeight:`1.6`,heightMini:`16px`,heightTiny:`22px`,heightSmall:`28px`,heightMedium:`34px`,heightLarge:`40px`,heightHuge:`46px`},{fontSize:Lm,fontFamily:Rm,lineHeight:zm}=Im,Bm=U(`body`,`\n margin: 0;\n font-size: ${Lm};\n font-family: ${Rm};\n line-height: ${zm};\n -webkit-text-size-adjust: 100%;\n -webkit-tap-highlight-color: transparent;\n`,[U(`input`,`\n font-family: inherit;\n font-size: inherit;\n `)]),Vm=`@css-render/vue3-ssr`;function Hm(e,t){return`<style cssr-id="${e}">\\n${t}\\n</style>`}function Um(e,t,n){let{styles:r,ids:i}=n;i.has(e)||r!==null&&(i.add(e),r.push(Hm(e,t)))}var Wm=typeof document<`u`;function Gm(){if(Wm)return;let e=P(Vm,null);if(e!==null)return{adapter:(t,n)=>Um(t,n,e),context:e}}function Km(e,t,n){if(!t)return;let r=Gm(),i=P(Nm,null),a=()=>{let a=n.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:Fm,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:i?.styleMountTarget}),i?.preflightStyleDisabled||Bm.mount({id:`n-global`,head:!0,anchorMetaName:Fm,ssr:r,parent:i?.styleMountTarget})};r?a():Fr(a)}var qm=new WeakMap;function Jm(e){let t=Va();if(t){qm.has(t)||qm.set(t,{});let n=qm.get(t);return n[e]||(n[e]=[])}return[]}function J(e,t=1){let n=V,r=!1;return typeof e==`function`&&(r=!0,L(),n=z,e=e()),Sa(e)?r?z(Ym(e)):Ym(e):Array.isArray(e)?r?R(I,null,e.map(e=>J(()=>e)),-2):B(I,null,e.slice()):e==null||typeof e==`boolean`?n(ma):n(pa,null,String(e),t)}function Ym(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Oa(e)}var Xm=e=>Array.isArray(e)?e.map(e=>J(e)):[J(e)],Zm=e=>e._n?e:N((...t)=>Xm(e(...t))),Qm=e=>typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!Sa(e)?e:{default:N(()=>[J(()=>e)])},Y=e=>he(e)||null,$m=[],eh=new WeakMap;function th(){$m.forEach(e=>e(...eh.get(e))),$m=[]}function nh(e,...t){eh.set(e,t),!$m.includes(e)&&$m.push(e)===1&&requestAnimationFrame(th)}function rh(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function ih(e){return e.composedPath()[0]||null}function ah(e){return typeof e==`string`?e.endsWith(`px`)?Number(e.slice(0,e.length-2)):Number(e):e}function oh(e){if(e!=null)return typeof e==`number`?`${e}px`:e.endsWith(`px`)?e:`${e}px`}function sh(e,t){let n=e.trim().split(/\\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw Error(`[seemly/getMargin]:`+e+` is not a valid value.`)}return t===void 0?r:r[t]}function ch(e,t){let[n,r]=e.split(` `);return t?t===`row`?n:r:{row:n,col:r||n}}var lh={aliceblue:`#F0F8FF`,antiquewhite:`#FAEBD7`,aqua:`#0FF`,aquamarine:`#7FFFD4`,azure:`#F0FFFF`,beige:`#F5F5DC`,bisque:`#FFE4C4`,black:`#000`,blanchedalmond:`#FFEBCD`,blue:`#00F`,blueviolet:`#8A2BE2`,brown:`#A52A2A`,burlywood:`#DEB887`,cadetblue:`#5F9EA0`,chartreuse:`#7FFF00`,chocolate:`#D2691E`,coral:`#FF7F50`,cornflowerblue:`#6495ED`,cornsilk:`#FFF8DC`,crimson:`#DC143C`,cyan:`#0FF`,darkblue:`#00008B`,darkcyan:`#008B8B`,darkgoldenrod:`#B8860B`,darkgray:`#A9A9A9`,darkgrey:`#A9A9A9`,darkgreen:`#006400`,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:`#F0F`,gainsboro:`#DCDCDC`,ghostwhite:`#F8F8FF`,gold:`#FFD700`,goldenrod:`#DAA520`,gray:`#808080`,grey:`#808080`,green:`#008000`,greenyellow:`#ADFF2F`,honeydew:`#F0FFF0`,hotpink:`#FF69B4`,indianred:`#CD5C5C`,indigo:`#4B0082`,ivory:`#FFFFF0`,khaki:`#F0E68C`,lavender:`#E6E6FA`,lavenderblush:`#FFF0F5`,lawngreen:`#7CFC00`,lemonchiffon:`#FFFACD`,lightblue:`#ADD8E6`,lightcoral:`#F08080`,lightcyan:`#E0FFFF`,lightgoldenrodyellow:`#FAFAD2`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,lightgreen:`#90EE90`,lightpink:`#FFB6C1`,lightsalmon:`#FFA07A`,lightseagreen:`#20B2AA`,lightskyblue:`#87CEFA`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#B0C4DE`,lightyellow:`#FFFFE0`,lime:`#0F0`,limegreen:`#32CD32`,linen:`#FAF0E6`,magenta:`#F0F`,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:`#F00`,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:`#FFF`,whitesmoke:`#F5F5F5`,yellow:`#FF0`,yellowgreen:`#9ACD32`,transparent:`#0000`};function uh(e,t,n){t/=100,n/=100;let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function dh(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0)*255,i(8)*255,i(4)*255]}var fh=`^\\\\s*`,ph=`\\\\s*$`,mh=`\\\\s*((\\\\.\\\\d+)|(\\\\d+(\\\\.\\\\d*)?))%\\\\s*`,hh=`\\\\s*((\\\\.\\\\d+)|(\\\\d+(\\\\.\\\\d*)?))\\\\s*`,gh=`([0-9A-Fa-f])`,_h=`([0-9A-Fa-f]{2})`,vh=RegExp(`${fh}hsl\\\\s*\\\\(${hh},${mh},${mh}\\\\)${ph}`),yh=RegExp(`${fh}hsv\\\\s*\\\\(${hh},${mh},${mh}\\\\)${ph}`),bh=RegExp(`${fh}hsla\\\\s*\\\\(${hh},${mh},${mh},${hh}\\\\)${ph}`),xh=RegExp(`${fh}hsva\\\\s*\\\\(${hh},${mh},${mh},${hh}\\\\)${ph}`),Sh=RegExp(`${fh}rgb\\\\s*\\\\(${hh},${hh},${hh}\\\\)${ph}`),Ch=RegExp(`${fh}rgba\\\\s*\\\\(${hh},${hh},${hh},${hh}\\\\)${ph}`),wh=RegExp(`${fh}#${gh}${gh}${gh}${ph}`),Th=RegExp(`${fh}#${_h}${_h}${_h}${ph}`),Eh=RegExp(`${fh}#${gh}${gh}${gh}${gh}${ph}`),Dh=RegExp(`${fh}#${_h}${_h}${_h}${_h}${ph}`);function Oh(e){return parseInt(e,16)}function kh(e){try{let t;if(t=bh.exec(e))return[Rh(t[1]),Bh(t[5]),Bh(t[9]),Lh(t[13])];if(t=vh.exec(e))return[Rh(t[1]),Bh(t[5]),Bh(t[9]),1];throw Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(e){throw e}}function Ah(e){try{let t;if(t=xh.exec(e))return[Rh(t[1]),Bh(t[5]),Bh(t[9]),Lh(t[13])];if(t=yh.exec(e))return[Rh(t[1]),Bh(t[5]),Bh(t[9]),1];throw Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(e){throw e}}function jh(e){try{let t;if(t=Th.exec(e))return[Oh(t[1]),Oh(t[2]),Oh(t[3]),1];if(t=Sh.exec(e))return[zh(t[1]),zh(t[5]),zh(t[9]),1];if(t=Ch.exec(e))return[zh(t[1]),zh(t[5]),zh(t[9]),Lh(t[13])];if(t=wh.exec(e))return[Oh(t[1]+t[1]),Oh(t[2]+t[2]),Oh(t[3]+t[3]),1];if(t=Dh.exec(e))return[Oh(t[1]),Oh(t[2]),Oh(t[3]),Lh(Oh(t[4])/255)];if(t=Eh.exec(e))return[Oh(t[1]+t[1]),Oh(t[2]+t[2]),Oh(t[3]+t[3]),Lh(Oh(t[4]+t[4])/255)];if(e in lh)return jh(lh[e]);if(vh.test(e)||bh.test(e)){let[t,n,r,i]=kh(e);return[...dh(t,n,r),i]}if(yh.test(e)||xh.test(e)){let[t,n,r,i]=Ah(e);return[...uh(t,n,r),i]}throw Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(e){throw e}}function Mh(e){return e>1?1:e<0?0:e}function Nh(e,t,n,r){return`rgba(${zh(e)}, ${zh(t)}, ${zh(n)}, ${Mh(r)})`}function Ph(e,t,n,r,i){return zh((e*t*(1-r)+n*r)/i)}function Fh(e,t){Array.isArray(e)||(e=jh(e)),Array.isArray(t)||(t=jh(t));let n=e[3],r=t[3],i=Lh(n+r-n*r);return Nh(Ph(e[0],n,t[0],r,i),Ph(e[1],n,t[1],r,i),Ph(e[2],n,t[2],r,i),i)}function X(e,t){let[n,r,i,a=1]=Array.isArray(e)?e:jh(e);return typeof t.alpha==`number`?Nh(n,r,i,t.alpha):Nh(n,r,i,a)}function Ih(e,t){let[n,r,i,a=1]=Array.isArray(e)?e:jh(e),{lightness:o=1,alpha:s=1}=t;return Vh([n*o,r*o,i*o,a*s])}function Lh(e){let t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function Rh(e){let t=Math.round(Number(e));return t>=360||t<0?0:t}function zh(e){let t=Math.round(Number(e));return t>255?255:t<0?0:t}function Bh(e){let t=Math.round(Number(e));return t>100?100:t<0?0:t}function Vh(e){let[t,n,r]=e;return 3 in e?`rgba(${zh(t)}, ${zh(n)}, ${zh(r)}, ${Lh(e[3])})`:`rgba(${zh(t)}, ${zh(n)}, ${zh(r)}, 1)`}function Hh(e=8){return Math.random().toString(16).slice(2,2+e)}var Z={neutralBase:`#FFF`,neutralInvertBase:`#000`,neutralTextBase:`#000`,neutralPopover:`#fff`,neutralCard:`#fff`,neutralModal:`#fff`,neutralBody:`#fff`,alpha1:`0.82`,alpha2:`0.72`,alpha3:`0.38`,alpha4:`0.24`,alpha5:`0.18`,alphaClose:`0.6`,alphaDisabled:`0.5`,alphaDisabledInput:`0.02`,alphaPending:`0.05`,alphaTablePending:`0.02`,alphaPressed:`0.07`,alphaAvatar:`0.2`,alphaRail:`0.14`,alphaProgressRail:`.08`,alphaBorder:`0.12`,alphaDivider:`0.06`,alphaInput:`0`,alphaAction:`0.02`,alphaTab:`0.04`,alphaScrollbar:`0.25`,alphaScrollbarHover:`0.4`,alphaCode:`0.05`,alphaTag:`0.02`,primaryHover:`#36ad6a`,primaryDefault:`#18a058`,primaryActive:`#0c7a43`,primarySuppl:`#36ad6a`,infoHover:`#4098fc`,infoDefault:`#2080f0`,infoActive:`#1060c9`,infoSuppl:`#4098fc`,errorHover:`#de576d`,errorDefault:`#d03050`,errorActive:`#ab1f3f`,errorSuppl:`#de576d`,warningHover:`#fcb040`,warningDefault:`#f0a020`,warningActive:`#c97c10`,warningSuppl:`#fcb040`,successHover:`#36ad6a`,successDefault:`#18a058`,successActive:`#0c7a43`,successSuppl:`#36ad6a`},Uh=jh(Z.neutralBase),Wh=jh(Z.neutralInvertBase),Gh=`rgba(${Wh.slice(0,3).join(`, `)}, `;function Kh(e){return`${Gh+String(e)})`}function qh(e){let t=Array.from(Wh);return t[3]=Number(e),Fh(Uh,t)}var Jh={name:`common`,...Im,baseColor:Z.neutralBase,primaryColor:Z.primaryDefault,primaryColorHover:Z.primaryHover,primaryColorPressed:Z.primaryActive,primaryColorSuppl:Z.primarySuppl,infoColor:Z.infoDefault,infoColorHover:Z.infoHover,infoColorPressed:Z.infoActive,infoColorSuppl:Z.infoSuppl,successColor:Z.successDefault,successColorHover:Z.successHover,successColorPressed:Z.successActive,successColorSuppl:Z.successSuppl,warningColor:Z.warningDefault,warningColorHover:Z.warningHover,warningColorPressed:Z.warningActive,warningColorSuppl:Z.warningSuppl,errorColor:Z.errorDefault,errorColorHover:Z.errorHover,errorColorPressed:Z.errorActive,errorColorSuppl:Z.errorSuppl,textColorBase:Z.neutralTextBase,textColor1:`rgb(31, 34, 37)`,textColor2:`rgb(51, 54, 57)`,textColor3:`rgb(118, 124, 130)`,textColorDisabled:qh(Z.alpha4),placeholderColor:qh(Z.alpha4),placeholderColorDisabled:qh(Z.alpha5),iconColor:qh(Z.alpha4),iconColorHover:Ih(qh(Z.alpha4),{lightness:.75}),iconColorPressed:Ih(qh(Z.alpha4),{lightness:.9}),iconColorDisabled:qh(Z.alpha5),opacity1:Z.alpha1,opacity2:Z.alpha2,opacity3:Z.alpha3,opacity4:Z.alpha4,opacity5:Z.alpha5,dividerColor:`rgb(239, 239, 245)`,borderColor:`rgb(224, 224, 230)`,closeIconColor:qh(Number(Z.alphaClose)),closeIconColorHover:qh(Number(Z.alphaClose)),closeIconColorPressed:qh(Number(Z.alphaClose)),closeColorHover:`rgba(0, 0, 0, .09)`,closeColorPressed:`rgba(0, 0, 0, .13)`,clearColor:qh(Z.alpha4),clearColorHover:Ih(qh(Z.alpha4),{lightness:.75}),clearColorPressed:Ih(qh(Z.alpha4),{lightness:.9}),scrollbarColor:Kh(Z.alphaScrollbar),scrollbarColorHover:Kh(Z.alphaScrollbarHover),scrollbarWidth:`5px`,scrollbarHeight:`5px`,scrollbarBorderRadius:`5px`,progressRailColor:qh(Z.alphaProgressRail),railColor:`rgb(219, 219, 223)`,popoverColor:Z.neutralPopover,tableColor:Z.neutralCard,cardColor:Z.neutralCard,modalColor:Z.neutralModal,bodyColor:Z.neutralBody,tagColor:`#eee`,avatarColor:qh(Z.alphaAvatar),invertedColor:`rgb(0, 20, 40)`,inputColor:qh(Z.alphaInput),codeColor:`rgb(244, 244, 248)`,tabColor:`rgb(247, 247, 250)`,actionColor:`rgb(250, 250, 252)`,tableHeaderColor:`rgb(250, 250, 252)`,hoverColor:`rgb(243, 243, 245)`,tableColorHover:`rgba(0, 0, 100, 0.03)`,tableColorStriped:`rgba(0, 0, 100, 0.02)`,pressedColor:`rgb(237, 237, 239)`,opacityDisabled:Z.alphaDisabled,inputColorDisabled:`rgb(250, 250, 252)`,buttonColor2:`rgba(46, 51, 56, .05)`,buttonColor2Hover:`rgba(46, 51, 56, .09)`,buttonColor2Pressed:`rgba(46, 51, 56, .13)`,boxShadow1:`0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)`,boxShadow2:`0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)`,boxShadow3:`0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)`},Yh={railInsetHorizontalBottom:`auto 2px 4px 2px`,railInsetHorizontalTop:`4px 2px auto 2px`,railInsetVerticalRight:`2px 4px 2px auto`,railInsetVerticalLeft:`2px auto 2px 4px`,railColor:`transparent`};function Xh(e){let{scrollbarColor:t,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:i,scrollbarBorderRadius:a}=e;return{...Yh,height:r,width:i,borderRadius:a,color:t,colorHover:n}}var Zh={name:`Scrollbar`,common:Jh,self:Xh},Qh={iconSizeTiny:`28px`,iconSizeSmall:`34px`,iconSizeMedium:`40px`,iconSizeLarge:`46px`,iconSizeHuge:`52px`};function $h(e){let{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c}=e;return{...Qh,fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r}}var eg={name:`Empty`,common:Jh,self:$h};function tg(e,t,n,r){n||Am(`useThemeClass`,`cssVarsRef is not passed`);let i=P(Nm,null),a=i?.mergedThemeHashRef,o=i?.styleMountTarget,s=A(``),c=Gm(),l,u=`__${e}`,d=()=>{let e=u,i=t?t.value:void 0,d=a?.value;d&&(e+=`-${d}`),i&&(e+=`-${i}`);let{themeOverrides:f,builtinThemeOverrides:p}=r;f&&(e+=`-${Qs(JSON.stringify(f))}`),p&&(e+=`-${Qs(JSON.stringify(p))}`),s.value=e,l=()=>{let t=n.value,r=``;for(let e in t)r+=`${e}: ${t[e]};`;U(`.${e}`,r).mount({id:e,ssr:c,parent:o}),l=void 0}};return Hn(()=>{d()}),{themeClass:s,onRender:()=>{l?.()}}}function ng(e){let{mergedLocaleRef:t,mergedDateLocaleRef:n}=P(Nm,null)||{},r=H(()=>t?.value?.[e]??bc[e]);return{dateLocaleRef:H(()=>n?.value??Nc),localeRef:r}}function rg(e){return e}function Q(e,t,n,r,i,a){let o=Gm(),s=P(Nm,null);if(n){let e=()=>{let e=a?.value;n.mount({id:e===void 0?t:e+t,head:!0,props:{bPrefix:e?`.${e}-`:void 0},anchorMetaName:Fm,ssr:o,parent:s?.styleMountTarget}),s?.preflightStyleDisabled||Bm.mount({id:`n-global`,head:!0,anchorMetaName:Fm,ssr:o,parent:s?.styleMountTarget})};o?e():Fr(e)}return H(()=>{let{theme:{common:t,self:n,peers:a={}}={},themeOverrides:o={},builtinThemeOverrides:c={}}=i,{common:l,peers:u}=o,{common:d=void 0,[e]:{common:f=void 0,self:p=void 0,peers:m={}}={}}=s?.mergedThemeRef.value||{},{common:h=void 0,[e]:g={}}=s?.mergedThemeOverridesRef.value||{},{common:_,peers:v={}}=g,y=Om({},t||f||d||r.common,h,_,l);return{common:y,self:Om((n||p||r.self)?.(y),c,g,o),peers:Om({},r.peers,m,a),peerOverrides:Om({},c.peers,v,u)}})}Q.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};var ig=W(`base-icon`,`\n height: 1em;\n width: 1em;\n line-height: 1em;\n text-align: center;\n display: inline-block;\n position: relative;\n fill: currentColor;\n`,[U(`svg`,`\n height: 1em;\n width: 1em;\n `)]),ag=[`onClick`,`onMousedown`,`onMouseup`,`role`,`aria-label`,`aria-hidden`,`aria-disabled`],og=F({name:`BaseIcon`,props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){Km(`-base-icon`,ig,M(e,`clsPrefix`))},render(){return L(),R(`i`,{class:Y(`${this.clsPrefix}-base-icon`),onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},[J(()=>this.$slots.default?.())],42,ag)}}),sg=F({name:`Empty`,render(){return(()=>{let e=Jm(`15c1a247ae156450`);return e[0]||=B(`svg`,{viewBox:`0 0 28 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[B(`path`,{d:`M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z`,fill:`currentColor`}),B(`path`,{d:`M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z`,fill:`currentColor`})],-1)})()}}),cg=W(`empty`,`\n display: flex;\n flex-direction: column;\n align-items: center;\n font-size: var(--n-font-size);\n`,[G(`icon`,`\n width: var(--n-icon-size);\n height: var(--n-icon-size);\n font-size: var(--n-icon-size);\n line-height: var(--n-icon-size);\n color: var(--n-icon-color);\n transition:\n color .3s var(--n-bezier);\n `,[U(`+`,[G(`description`,`\n margin-top: 8px;\n `)])]),G(`description`,`\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n `),G(`extra`,`\n text-align: center;\n transition: color .3s var(--n-bezier);\n margin-top: 12px;\n color: var(--n-extra-text-color);\n `)]),lg=F({name:`Empty`,props:{...Q.props,description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:`medium`},renderIcon:Function},slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=Pm(e),i=Q(`Empty`,`-empty`,cg,eg,e,t),{localeRef:a}=ng(`Empty`),o=H(()=>e.description??r?.value?.Empty?.description),s=H(()=>r?.value?.Empty?.renderIcon||(()=>(L(),z(sg)))),c=H(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{[q(`iconSize`,t)]:r,[q(`fontSize`,t)]:a,textColor:o,iconColor:s,extraTextColor:c}}=i.value;return{"--n-icon-size":r,"--n-font-size":a,"--n-bezier":n,"--n-text-color":o,"--n-icon-color":s,"--n-extra-text-color":c}}),l=n?tg(`empty`,H(()=>{let t=``,{size:n}=e;return t+=n[0],t}),c,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:s,localizedDescription:H(()=>o.value||a.value.description),cssVars:n?void 0:c,themeClass:l?.themeClass,onRender:l?.onRender}},render(){let{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n?.(),L(),R(`div`,{class:Y([`${t}-empty`,this.themeClass]),style:k(this.cssVars)},[this.showIcon?(L(),R(`div`,{key:0,class:Y(`${t}-empty__icon`)},[e.icon?(L(),R(I,{key:0},[J(()=>e.icon())],64)):(L(),z(og,{key:1,clsPrefix:t},{default:this.mergedRenderIcon},1032,[`clsPrefix`]))],2)):J(()=>null),this.showDescription?(L(),R(`div`,{key:2,class:Y(`${t}-empty__description`)},[e.default?(L(),R(I,{key:0},[J(()=>e.default())],64)):(L(),R(I,{key:1},[J(()=>this.localizedDescription)],64))],2)):J(()=>null),e.extra?(L(),R(`div`,{key:4,class:Y(`${t}-empty__extra`)},[J(()=>e.extra())],2)):J(()=>null)],6)}}),ug={height:`calc(var(--n-option-height) * 7.6)`,paddingTiny:`4px 0`,paddingSmall:`4px 0`,paddingMedium:`4px 0`,paddingLarge:`4px 0`,paddingHuge:`4px 0`,optionPaddingTiny:`0 12px`,optionPaddingSmall:`0 12px`,optionPaddingMedium:`0 12px`,optionPaddingLarge:`0 12px`,optionPaddingHuge:`0 12px`,loadingSize:`18px`};function dg(e){let{borderRadius:t,popoverColor:n,textColor3:r,dividerColor:i,textColor2:a,primaryColorPressed:o,textColorDisabled:s,primaryColor:c,opacityDisabled:l,hoverColor:u,fontSizeTiny:d,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:m,fontSizeHuge:h,heightTiny:g,heightSmall:_,heightMedium:v,heightLarge:y,heightHuge:b}=e;return{...ug,optionFontSizeTiny:d,optionFontSizeSmall:f,optionFontSizeMedium:p,optionFontSizeLarge:m,optionFontSizeHuge:h,optionHeightTiny:g,optionHeightSmall:_,optionHeightMedium:v,optionHeightLarge:y,optionHeightHuge:b,borderRadius:t,color:n,groupHeaderTextColor:r,actionDividerColor:i,optionTextColor:a,optionTextColorPressed:o,optionTextColorDisabled:s,optionTextColorActive:c,optionOpacityDisabled:l,optionCheckColor:c,optionColorPending:u,optionColorActive:`rgba(0, 0, 0, 0)`,optionColorActivePending:u,actionTextColor:a,loadingColor:c}}var fg=rg({name:`InternalSelectMenu`,common:Jh,peers:{Scrollbar:Zh,Empty:eg},self:dg}),pg={space:`6px`,spaceArrow:`10px`,arrowOffset:`10px`,arrowOffsetVertical:`10px`,arrowHeight:`6px`,padding:`8px 14px`};function mg(e){let{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:i,fontSize:a,dividerColor:o}=e;return{...pg,fontSize:a,borderRadius:i,color:n,dividerColor:o,textColor:r,boxShadow:t}}var hg=rg({name:`Popover`,common:Jh,peers:{Scrollbar:Zh},self:mg}),gg=Mm(`n-internal-select-menu`),_g=Mm(`n-internal-select-menu-body`),vg=Mm(`n-drawer-body`),yg=Mm(`n-modal-body`),bg=Mm(`n-modal-provider`),xg=Mm(`n-modal`),Sg=Mm(`n-popover-body`);function Cg(e){return e.composedPath()[0]}var wg={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Tg(e,t,n){if(e===`mousemoveoutside`){let e=e=>{t.contains(Cg(e))||n(e)};return{mousemove:e,touchstart:e}}if(e===`clickoutside`){let e=!1,r=n=>{e=!t.contains(Cg(n))},i=r=>{e&&(t.contains(Cg(r))||n(r))};return{mousedown:r,mouseup:i,touchstart:r,touchend:i}}return console.error(`[evtd/create-trap-handler]: name \\`${e}\\` is invalid. This could be a bug of evtd.`),{}}function Eg(e,t,n){let r=wg[e],i=r.get(t);i===void 0&&r.set(t,i=new WeakMap);let a=i.get(n);return a===void 0&&i.set(n,a=Tg(e,t,n)),a}function Dg(e,t,n,r){if(e===`mousemoveoutside`||e===`clickoutside`){let i=Eg(e,t,n);return Object.keys(i).forEach(e=>{Ag(e,document,i[e],r)}),!0}return!1}function Og(e,t,n,r){if(e===`mousemoveoutside`||e===`clickoutside`){let i=Eg(e,t,n);return Object.keys(i).forEach(e=>{jg(e,document,i[e],r)}),!0}return!1}function kg(){if(typeof window>`u`)return{on:()=>{},off:()=>{}};let e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function i(e,t,n){let r=e[t];return e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)},e}function a(e,t){e[t]=Event.prototype[t]}let o=new WeakMap,s=Object.getOwnPropertyDescriptor(Event.prototype,`currentTarget`);function c(){return o.get(this)??null}function l(e,t){s!==void 0&&Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:t??s.get})}let u={bubble:{},capture:{}},d={};function f(){let s=function(s){let{type:d,eventPhase:f,bubbles:p}=s,m=Cg(s);if(f===2)return;let h=f===1?`capture`:`bubble`,g=m,_=[];for(;g===null&&(g=window),_.push(g),g!==window;)g=g.parentNode||null;let v=u.capture[d],y=u.bubble[d];if(i(s,`stopPropagation`,n),i(s,`stopImmediatePropagation`,r),l(s,c),h===`capture`){if(v===void 0)return;for(let n=_.length-1;n>=0&&!e.has(s);--n){let e=_[n],r=v.get(e);if(r!==void 0){o.set(s,e);for(let e of r){if(t.has(s))break;e(s)}}if(n===0&&!p&&y!==void 0){let n=y.get(e);if(n!==void 0)for(let e of n){if(t.has(s))break;e(s)}}}}else if(h===`bubble`){if(y===void 0)return;for(let n=0;n<_.length&&!e.has(s);++n){let e=_[n],r=y.get(e);if(r!==void 0){o.set(s,e);for(let e of r){if(t.has(s))break;e(s)}}}}a(s,`stopPropagation`),a(s,`stopImmediatePropagation`),l(s)};return s.displayName=`evtdUnifiedHandler`,s}function p(){let e=function(e){let{type:t,eventPhase:n}=e;if(n!==2)return;let r=d[t];r!==void 0&&r.forEach(t=>t(e))};return e.displayName=`evtdUnifiedWindowEventHandler`,e}let m=f(),h=p();function g(e,t){let n=u[e];return n[t]===void 0&&(n[t]=new Map,window.addEventListener(t,m,e===`capture`)),n[t]}function _(e){return d[e]===void 0&&(d[e]=new Set,window.addEventListener(e,h)),d[e]}function v(e,t){let n=e.get(t);return n===void 0&&e.set(t,n=new Set),n}function y(e,t,n,r){let i=u[t][n];if(i!==void 0){let t=i.get(e);if(t!==void 0&&t.has(r))return!0}return!1}function b(e,t){let n=d[e];return!!(n!==void 0&&n.has(t))}function x(e,t,n,r){let i;if(i=typeof r==`object`&&r.once===!0?a=>{S(e,t,i,r),n(a)}:n,Dg(e,t,i,r))return;let a=v(g(r===!0||typeof r==`object`&&r.capture===!0?`capture`:`bubble`,e),t);if(a.has(i)||a.add(i),t===window){let t=_(e);t.has(i)||t.add(i)}}function S(e,t,n,r){if(Og(e,t,n,r))return;let i=r===!0||typeof r==`object`&&r.capture===!0,a=i?`capture`:`bubble`,o=g(a,e),s=v(o,t);if(t===window&&!y(t,i?`bubble`:`capture`,e,n)&&b(e,n)){let t=d[e];t.delete(n),t.size===0&&(window.removeEventListener(e,h),d[e]=void 0)}s.has(n)&&s.delete(n),s.size===0&&o.delete(t),o.size===0&&(window.removeEventListener(e,m,a===`capture`),u[a][e]=void 0)}return{on:x,off:S}}var{on:Ag,off:jg}=kg();function Mg(e){let t=A(!!e.value);if(t.value)return Bt(t);let n=Un(e,e=>{e&&(t.value=!0,n())});return Bt(t)}function Ng(e){let t=H(e),n=A(t.value);return Un(t,e=>{n.value=e}),typeof e==`function`?n:{__v_isRef:!0,get value(){return n.value},set value(t){e.set(t)}}}function Pg(){return Va()!==null}var Fg=typeof window<`u`,Ig=Fg?document?.fonts?.ready:void 0,Lg=!1;Ig===void 0?Lg=!0:Ig.then(()=>{Lg=!0});function Rg(e){if(Lg)return;let t=!1;Ir(()=>{Lg||Ig?.then(()=>{t||e()})}),zr(()=>{t=!0})}var zg=A(null);function Bg(e){if(e.clientX>0||e.clientY>0)zg.value={x:e.clientX,y:e.clientY};else{let{target:t}=e;if(t instanceof Element){let{left:e,top:n,width:r,height:i}=t.getBoundingClientRect();zg.value=e>0||n>0?{x:e+r/2,y:n+i/2}:{x:0,y:0}}else zg.value=null}}var Vg=0,Hg=!0;function Ug(){if(!Fg)return Bt(A(null));Vg===0&&Ag(`click`,document,Bg,!0);let e=()=>{Vg+=1};return(Hg&&=Pg())?(Fr(e),zr(()=>{--Vg,Vg===0&&jg(`click`,document,Bg,!0)})):e(),Bt(zg)}var Wg=A(void 0),Gg=0;function Kg(){Wg.value=Date.now()}var qg=!0;function Jg(e){if(!Fg)return Bt(A(!1));let t=A(!1),n=null;function r(){n!==null&&window.clearTimeout(n)}function i(){r(),t.value=!0,n=window.setTimeout(()=>{t.value=!1},e)}Gg===0&&Ag(`click`,window,Kg,!0);let a=()=>{Gg+=1,Ag(`click`,window,i,!0)};return(qg&&=Pg())?(Fr(a),zr(()=>{--Gg,Gg===0&&jg(`click`,window,Kg,!0),jg(`click`,window,i,!0),r()})):a(),Bt(t)}function Yg(e,t){return Un(e,e=>{e!==void 0&&(t.value=e)}),H(()=>e.value===void 0?t.value:e.value)}function Xg(){let e=A(!1);return Ir(()=>{e.value=!0}),Bt(e)}function Zg(e,t){return H(()=>{for(let n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}var Qg=(typeof window>`u`?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1)&&!window.MSStream;function $g(){return Qg}function e_(e={},t){let n=Rt({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:r,keyup:i}=e,a=e=>{switch(e.key){case`Control`:n.ctrl=!0;break;case`Meta`:n.command=!0,n.win=!0;break;case`Shift`:n.shift=!0;break;case`Tab`:n.tab=!0}r!==void 0&&Object.keys(r).forEach(t=>{if(t!==e.key)return;let n=r[t];if(typeof n==`function`)n(e);else{let{stop:t=!1,prevent:r=!1}=n;t&&e.stopPropagation(),r&&e.preventDefault(),n.handler(e)}})},o=e=>{switch(e.key){case`Control`:n.ctrl=!1;break;case`Meta`:n.command=!1,n.win=!1;break;case`Shift`:n.shift=!1;break;case`Tab`:n.tab=!1}i!==void 0&&Object.keys(i).forEach(t=>{if(t!==e.key)return;let n=i[t];if(typeof n==`function`)n(e);else{let{stop:t=!1,prevent:r=!1}=n;t&&e.stopPropagation(),r&&e.preventDefault(),n.handler(e)}})},s=()=>{(t===void 0||t.value)&&(Ag(`keydown`,document,a),Ag(`keyup`,document,o)),t!==void 0&&Un(t,e=>{e?(Ag(`keydown`,document,a),Ag(`keyup`,document,o)):(jg(`keydown`,document,a),jg(`keyup`,document,o))})};return Pg()?(Fr(s),zr(()=>{(t===void 0||t.value)&&(jg(`keydown`,document,a),jg(`keyup`,document,o))})):s(),Bt(n)}var t_=`__disabled__`;function n_(e){let t=P(yg,null),n=P(vg,null),r=P(Sg,null),i=P(_g,null),a=A();if(typeof document<`u`){a.value=document.fullscreenElement;let e=()=>{a.value=document.fullscreenElement};Ir(()=>{Ag(`fullscreenchange`,document,e)}),zr(()=>{jg(`fullscreenchange`,document,e)})}return Ng(()=>{let{to:o}=e;return o===void 0?t?.value?t.value.$el??t.value:n?.value?n.value:r?.value?r.value:i?.value?i.value:o??(a.value||`body`):o===!1?t_:o===!0?a.value||`body`:o})}n_.tdkey=t_,n_.propTo={type:[String,Object,Boolean],default:void 0};function $(e,...t){if(Array.isArray(e))e.forEach(e=>$(e,...t));else return e(...t)}function r_(e,t=!0,n=[]){return e.forEach(e=>{if(e!==null){if(typeof e!=`object`){(typeof e==`string`||typeof e==`number`)&&n.push(ka(String(e)));return}if(Array.isArray(e)){r_(e,t,n);return}if(e.type===I){if(e.children===null)return;Array.isArray(e.children)&&r_(e.children,t,n)}else{if(e.type===ma&&t)return;n.push(e)}}}),n}function i_(e,t=`default`,n=void 0){let r=e[t];if(!r)return km(`getFirstSlotVNode`,`slot[${t}] is empty`),null;let i=r_(r(n));return i.length===1?i[0]:(km(`getFirstSlotVNode`,`slot[${t}] should have exactly one child`),null)}function a_(e,t,n){if(!t)return null;let r=r_(t(n));return r.length===1?r[0]:(km(`getFirstSlotVNode`,`slot[${e}] should have exactly one child`),null)}function o_(e,t=[],n){let r={};return t.forEach(t=>{r[t]=e[t]}),Object.assign(r,n)}var s_=/^(\\d|\\.)+$/,c_=/(\\d|\\.)+/;function l_(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e==`number`){let r=(e+n)*t;return r===0?`0`:`${r}px`}if(typeof e==`string`){if(s_.test(e)){let i=(Number(e)+n)*t;return r?i===0?`0`:`${i}px`:`${i}`}{let r=c_.exec(e);return r?e.replace(c_,String((Number(r[0])+n)*t)):e}}return e}var u_;function d_(){return u_===void 0&&(u_=navigator.userAgent.includes(`Node.js`)||navigator.userAgent.includes(`jsdom`)),u_}function f_(e){return e.some(e=>!Sa(e)||!(e.type===ma||e.type===I&&!f_(e.children)))?e:null}function p_(e,t){return e&&f_(e())||t()}function m_(e,t,n){return e&&f_(e(t))||n(t)}function h_(e,t){return t(e&&f_(e())||null)}function g_(e,t,n){return n(e&&f_(e(t))||null)}function __(e){return!(e&&f_(e()))}function v_(e,t,n){if(!t)return;let r=Gm(),i=H(()=>{let{value:n}=t;if(!n)return;let r=n[e];if(r)return r}),a=P(Nm,null),o=()=>{Hn(()=>{let{value:t}=n,o=`${t}${e}Rtl`;if(cc(o,r))return;let{value:s}=i;s&&s.style.mount({id:o,head:!0,anchorMetaName:Fm,props:{bPrefix:t?`.${t}-`:void 0},ssr:r,parent:a?.styleMountTarget})})};return r?o():Fr(o),i}function y_(e){let t={isDeactivated:!1},n=!1;return kr(()=>{if(t.isDeactivated=!1,!n){n=!0;return}e()}),Ar(()=>{t.isDeactivated=!0,n||=!0}),t}function b_(e){let{left:t,right:n,top:r,bottom:i}=sh(e);return`${r} ${t} ${i} ${n}`}var x_=F({render(){return this.$slots.default?.()}}),{cubicBezierEaseInOut:S_}=Im;function C_({name:e=`fade-in`,enterDuration:t=`0.2s`,leaveDuration:n=`0.2s`,enterCubicBezier:r=S_,leaveCubicBezier:i=S_}={}){return[U(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),U(`&.${e}-transition-leave-active`,{transition:`all ${n} ${i}!important`}),U(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),U(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}var w_=W(`scrollbar`,`\n overflow: hidden;\n position: relative;\n z-index: auto;\n height: 100%;\n width: 100%;\n`,[U(`>`,[W(`scrollbar-container`,`\n width: 100%;\n overflow: scroll;\n height: 100%;\n min-height: inherit;\n max-height: inherit;\n scrollbar-width: none;\n `,[U(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`\n width: 0;\n height: 0;\n display: none;\n `),U(`>`,[W(`scrollbar-content`,`\n box-sizing: border-box;\n min-width: 100%;\n `)])])]),U(`>, +`,[W(`scrollbar-rail`,`\n position: absolute;\n pointer-events: none;\n user-select: none;\n background: var(--n-scrollbar-rail-color);\n -webkit-user-select: none;\n `,[K(`horizontal`,`\n height: var(--n-scrollbar-height);\n `,[U(`>`,[G(`scrollbar`,`\n height: var(--n-scrollbar-height);\n border-radius: var(--n-scrollbar-border-radius);\n right: 0;\n `)])]),K(`horizontal--top`,`\n top: var(--n-scrollbar-rail-top-horizontal-top); \n right: var(--n-scrollbar-rail-right-horizontal-top); \n bottom: var(--n-scrollbar-rail-bottom-horizontal-top); \n left: var(--n-scrollbar-rail-left-horizontal-top); \n `),K(`horizontal--bottom`,`\n top: var(--n-scrollbar-rail-top-horizontal-bottom); \n right: var(--n-scrollbar-rail-right-horizontal-bottom); \n bottom: var(--n-scrollbar-rail-bottom-horizontal-bottom); \n left: var(--n-scrollbar-rail-left-horizontal-bottom); \n `),K(`vertical`,`\n width: var(--n-scrollbar-width);\n `,[U(`>`,[G(`scrollbar`,`\n width: var(--n-scrollbar-width);\n border-radius: var(--n-scrollbar-border-radius);\n bottom: 0;\n `)])]),K(`vertical--left`,`\n top: var(--n-scrollbar-rail-top-vertical-left); \n right: var(--n-scrollbar-rail-right-vertical-left); \n bottom: var(--n-scrollbar-rail-bottom-vertical-left); \n left: var(--n-scrollbar-rail-left-vertical-left); \n `),K(`vertical--right`,`\n top: var(--n-scrollbar-rail-top-vertical-right); \n right: var(--n-scrollbar-rail-right-vertical-right); \n bottom: var(--n-scrollbar-rail-bottom-vertical-right); \n left: var(--n-scrollbar-rail-left-vertical-right); \n `),K(`disabled`,[U(`>`,[G(`scrollbar`,`pointer-events: none;`)])]),U(`>`,[G(`scrollbar`,`\n z-index: 1;\n position: absolute;\n cursor: pointer;\n pointer-events: all;\n background-color: var(--n-scrollbar-color);\n transition: background-color .2s var(--n-scrollbar-bezier);\n `,[C_(),U(`&:hover`,`background-color: var(--n-scrollbar-color-hover);`)])])])])]);function T_(e,t,n=`default`){let r=t[n];if(r===void 0)throw Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function E_(e,t=!0,n=[]){return e.forEach(e=>{if(e!==null){if(typeof e!=`object`){(typeof e==`string`||typeof e==`number`)&&n.push(ka(String(e)));return}if(Array.isArray(e)){E_(e,t,n);return}if(e.type===I){if(e.children===null)return;Array.isArray(e.children)&&E_(e.children,t,n)}else(e.type!==ma||!t)&&n.push(e)}}),n}function D_(e,t,n=`default`){let r=t[n];if(r===void 0)throw Error(`[vueuc/${e}]: slot[${n}] is empty.`);let i=E_(r());if(i.length===1)return i[0];throw Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}var O_=null;function k_(){if(O_===null&&(O_=document.getElementById(`v-binder-view-measurer`),O_===null)){O_=document.createElement(`div`),O_.id=`v-binder-view-measurer`;let{style:e}=O_;e.position=`fixed`,e.left=`0`,e.right=`0`,e.top=`0`,e.bottom=`0`,e.pointerEvents=`none`,e.visibility=`hidden`,document.body.appendChild(O_)}return O_.getBoundingClientRect()}function A_(e,t){let n=k_();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function j_(e){let t=e.getBoundingClientRect(),n=k_();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function M_(e){return e.nodeType===9?null:e.parentNode}function N_(e){if(e===null)return null;let t=M_(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){let{overflow:e,overflowX:n,overflowY:r}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e+r+n))return t}return N_(t)}var P_=F({name:`Binder`,props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){zn(`VBinder`,Va()?.proxy);let t=P(`VBinder`,null),n=A(null),r=r=>{n.value=r,t&&e.syncTargetWithParent&&t.setTargetRef(r)},i=[],a=()=>{let e=n.value;for(;e=N_(e),e!==null;)i.push(e);for(let e of i)Ag(`scroll`,e,u,!0)},o=()=>{for(let e of i)jg(`scroll`,e,u,!0);i=[]},s=new Set,c=e=>{s.size===0&&a(),s.has(e)||s.add(e)},l=e=>{s.has(e)&&s.delete(e),s.size===0&&o()},u=()=>{nh(d)},d=()=>{s.forEach(e=>e())},f=new Set,p=e=>{f.size===0&&Ag(`resize`,window,h),f.has(e)||f.add(e)},m=e=>{f.has(e)&&f.delete(e),f.size===0&&jg(`resize`,window,h)},h=()=>{f.forEach(e=>e())};return zr(()=>{jg(`resize`,window,h),o()}),{targetRef:n,setTargetRef:r,addScrollListener:c,removeScrollListener:l,addResizeListener:p,removeResizeListener:m}},render(){return T_(`binder`,this.$slots)}}),F_=F({name:`Target`,setup(){let{setTargetRef:e,syncTarget:t}=P(`VBinder`);return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){let{syncTarget:e,setTargetDirective:t}=this;return e?Ln(D_(`follower`,this.$slots),[[t]]):D_(`follower`,this.$slots)}}),I_=`@@mmoContext`,L_={mounted(e,{value:t}){e[I_]={handler:void 0},typeof t==`function`&&(e[I_].handler=t,Ag(`mousemoveoutside`,e,t))},updated(e,{value:t}){let n=e[I_];typeof t==`function`?n.handler?n.handler!==t&&(jg(`mousemoveoutside`,e,n.handler),n.handler=t,Ag(`mousemoveoutside`,e,t)):(e[I_].handler=t,Ag(`mousemoveoutside`,e,t)):n.handler&&=(jg(`mousemoveoutside`,e,n.handler),void 0)},unmounted(e){let{handler:t}=e[I_];t&&jg(`mousemoveoutside`,e,t),e[I_].handler=void 0}},R_=`@@coContext`,z_={mounted(e,{value:t,modifiers:n}){e[R_]={handler:void 0},typeof t==`function`&&(e[R_].handler=t,Ag(`clickoutside`,e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){let r=e[R_];typeof t==`function`?r.handler?r.handler!==t&&(jg(`clickoutside`,e,r.handler,{capture:n.capture}),r.handler=t,Ag(`clickoutside`,e,t,{capture:n.capture})):(e[R_].handler=t,Ag(`clickoutside`,e,t,{capture:n.capture})):r.handler&&=(jg(`clickoutside`,e,r.handler,{capture:n.capture}),void 0)},unmounted(e,{modifiers:t}){let{handler:n}=e[R_];n&&jg(`clickoutside`,e,n,{capture:t.capture}),e[R_].handler=void 0}};function B_(e,t){console.error(`[vdirs/${e}]: ${t}`)}var V_=new class{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,t){let{elementZIndex:n}=this;if(t!==void 0){e.style.zIndex=`${t}`,n.delete(e);return}let{nextZIndex:r}=this;n.has(e)&&n.get(e)+1===this.nextZIndex||(e.style.zIndex=`${r}`,n.set(e,r),this.nextZIndex=r+1,this.squashState())}unregister(e,t){let{elementZIndex:n}=this;n.has(e)?n.delete(e):t===void 0&&B_(`z-index-manager/unregister-element`,`Element not found when unregistering.`),this.squashState()}squashState(){let{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){let e=Array.from(this.elementZIndex.entries());e.sort((e,t)=>e[1]-t[1]),this.nextZIndex=2e3,e.forEach(e=>{let t=e[0],n=this.nextZIndex++;`${n}`!==t.style.zIndex&&(t.style.zIndex=`${n}`)})}},H_=`@@ziContext`,U_={mounted(e,t){let{value:n={}}=t,{zIndex:r,enabled:i}=n;e[H_]={enabled:!!i,initialized:!1},i&&(V_.ensureZIndex(e,r),e[H_].initialized=!0)},updated(e,t){let{value:n={}}=t,{zIndex:r,enabled:i}=n,a=e[H_].enabled;i&&!a&&(V_.ensureZIndex(e,r),e[H_].initialized=!0),e[H_].enabled=!!i},unmounted(e,t){if(!e[H_].initialized)return;let{value:n={}}=t,{zIndex:r}=n;V_.unregister(e,r)}};function W_(e,t){console.error(`[vueuc/${e}]: ${t}`)}var{c:G_}=sc(),K_=`vueuc-style`;function q_(e){return e&-e}var J_=class{constructor(e,t){this.l=e,this.min=t;let n=Array(e+1);for(let t=0;t<e+1;++t)n[t]=0;this.ft=n}add(e,t){if(t===0)return;let{l:n,ft:r}=this;for(e+=1;e<=n;)r[e]+=t,e+=q_(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;let{ft:t,min:n,l:r}=this;if(e>r)throw Error("[FinweckTree.sum]: `i` is larger than length.");let i=e*n;for(;e>0;)i+=t[e],e-=q_(e);return i}getBound(e){let t=0,n=this.l;for(;n>t;){let r=Math.floor((t+n)/2),i=this.sum(r);if(i>e){n=r;continue}if(i<e){if(t===r)return this.sum(t+1)<=e?t+1:r;t=r}else return r}return t}};function Y_(e){return typeof e==`string`?document.querySelector(e):e()??null}var X_=F({name:`LazyTeleport`,props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:Mg(M(e,`show`)),mergedTo:H(()=>{let{to:t}=e;return t??`body`})}},render(){return this.showTeleport?this.disabled?T_(`lazy-teleport`,this.$slots):ro(ir,{disabled:this.disabled,to:this.mergedTo},T_(`lazy-teleport`,this.$slots)):null}}),Z_={top:`bottom`,bottom:`top`,left:`right`,right:`left`},Q_={start:`end`,center:`center`,end:`start`},$_={top:`height`,bottom:`height`,left:`width`,right:`width`},ev={"bottom-start":`top left`,bottom:`top center`,"bottom-end":`top right`,"top-start":`bottom left`,top:`bottom center`,"top-end":`bottom right`,"right-start":`top left`,right:`center left`,"right-end":`bottom left`,"left-start":`top right`,left:`center right`,"left-end":`bottom right`},tv={"bottom-start":`bottom left`,bottom:`bottom center`,"bottom-end":`bottom right`,"top-start":`top left`,top:`top center`,"top-end":`top right`,"right-start":`top right`,right:`center right`,"right-end":`bottom right`,"left-start":`top left`,left:`center left`,"left-end":`bottom left`},nv={"bottom-start":`right`,"bottom-end":`left`,"top-start":`right`,"top-end":`left`,"right-start":`bottom`,"right-end":`top`,"left-start":`bottom`,"left-end":`top`},rv={top:!0,bottom:!1,left:!0,right:!1},iv={top:`end`,bottom:`start`,left:`end`,right:`start`};function av(e,t,n,r,i,a){if(!i||a)return{placement:e,top:0,left:0};let[o,s]=e.split(`-`),c=s??`center`,l={top:0,left:0},u=(e,i,a)=>{let o=0,s=0,c=n[e]-t[i]-t[e];return c>0&&r&&(a?s=rv[i]?c:-c:o=rv[i]?c:-c),{left:o,top:s}},d=o===`left`||o===`right`;if(c!==`center`){let r=nv[e],i=Z_[r],a=$_[r];if(n[a]>t[a]){if(t[r]+t[a]<n[a]){let e=(n[a]-t[a])/2;t[r]<e||t[i]<e?t[r]<t[i]?(c=Q_[s],l=u(a,i,d)):l=u(a,r,d):c=`center`}}else n[a]<t[a]&&t[i]<0&&t[r]>t[i]&&(c=Q_[s])}else{let e=o===`bottom`||o===`top`?`left`:`top`,r=Z_[e],i=$_[e],a=(n[i]-t[i])/2;(t[e]<a||t[r]<a)&&(t[e]>t[r]?(c=iv[e],l=u(i,e,d)):(c=iv[r],l=u(i,r,d)))}let f=o;return t[o]<n[$_[o]]&&t[o]<t[Z_[o]]&&(f=Z_[o]),{placement:c===`center`?f:`${f}-${c}`,left:l.left,top:l.top}}function ov(e,t){return t?tv[e]:ev[e]}function sv(e,t,n,r,i,a){if(a)switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`top-end`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-50%)`};default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%) translateY(-100%)`}}switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:``};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-100%)`};case`top-end`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:``};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%)`};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateY(-100%) translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-50%) translateX(-100%)`};default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateX(-50%)`}}}var cv=G_([G_(`.v-binder-follower-container`,{position:`absolute`,left:`0`,right:`0`,top:`0`,height:`0`,pointerEvents:`none`,zIndex:`auto`}),G_(`.v-binder-follower-content`,{position:`absolute`,zIndex:`auto`},[G_(`> *`,{pointerEvents:`all`})])]),lv=F({name:`Follower`,inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:`bottom`},syncTrigger:{type:Array,default:[`resize`,`scroll`]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){let t=P(`VBinder`),n=Ng(()=>e.enabled===void 0?e.show:e.enabled),r=A(null),i=A(null),a=()=>{let{syncTrigger:n}=e;n.includes(`scroll`)&&t.addScrollListener(c),n.includes(`resize`)&&t.addResizeListener(c)},o=()=>{t.removeScrollListener(c),t.removeResizeListener(c)};Ir(()=>{n.value&&(c(),a())});let s=Gm();cv.mount({id:`vueuc/binder`,head:!0,anchorMetaName:K_,ssr:s}),zr(()=>{o()}),Rg(()=>{n.value&&c()});let c=()=>{if(!n.value)return;let a=r.value;if(a===null)return;let o=t.targetRef,{x:s,y:c,overlap:l}=e,u=s!==void 0&&c!==void 0?A_(s,c):j_(o);a.style.setProperty(`--v-target-width`,`${Math.round(u.width)}px`),a.style.setProperty(`--v-target-height`,`${Math.round(u.height)}px`);let{width:d,minWidth:f,placement:p,internalShift:m,flip:h}=e;a.setAttribute(`v-placement`,p),l?a.setAttribute(`v-overlap`,``):a.removeAttribute(`v-overlap`);let{style:g}=a;g.width=d===`target`?`${u.width}px`:d===void 0?``:d,g.minWidth=f===`target`?`${u.width}px`:f===void 0?``:f;let _=j_(a),v=j_(i.value),{left:y,top:b,placement:x}=av(p,u,_,m,h,l),S=ov(x,l),{left:C,top:w,transform:T}=sv(x,v,u,b,y,l);a.setAttribute(`v-placement`,x),a.style.setProperty(`--v-offset-left`,`${Math.round(y)}px`),a.style.setProperty(`--v-offset-top`,`${Math.round(b)}px`),a.style.transform=`translateX(${C}) translateY(${w}) ${T}`,a.style.setProperty(`--v-transform-origin`,S),a.style.transformOrigin=S};Un(n,e=>{e?(a(),l()):o()});let l=()=>{Tn().then(c).catch(e=>console.error(e))};[`placement`,`x`,`y`,`internalShift`,`flip`,`width`,`overlap`,`minWidth`].forEach(t=>{Un(M(e,t),c)}),[`teleportDisabled`].forEach(t=>{Un(M(e,t),l)}),Un(M(e,`syncTrigger`),e=>{e.includes(`resize`)?t.addResizeListener(c):t.removeResizeListener(c),e.includes(`scroll`)?t.addScrollListener(c):t.removeScrollListener(c)});let u=Xg();return{VBinder:t,mergedEnabled:n,offsetContainerRef:i,followerRef:r,mergedTo:Ng(()=>{let{to:t}=e;if(t!==void 0)return t;u.value}),syncPosition:c}},render(){return ro(X_,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e;let t=ro(`div`,{class:[`v-binder-follower-container`,this.containerClass],ref:`offsetContainerRef`},[ro(`div`,{class:`v-binder-follower-content`,ref:`followerRef`},(e=this.$slots).default?.call(e))]);return this.zindexable?Ln(t,[[U_,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):t}})}}),uv=[],dv=function(){return uv.some(function(e){return e.activeTargets.length>0})},fv=function(){return uv.some(function(e){return e.skippedTargets.length>0})},pv=`ResizeObserver loop completed with undelivered notifications.`,mv=function(){var e;typeof ErrorEvent==`function`?e=new ErrorEvent(`error`,{message:pv}):(e=document.createEvent(`Event`),e.initEvent(`error`,!1,!1),e.message=pv),window.dispatchEvent(e)},hv;(function(e){e.BORDER_BOX=`border-box`,e.CONTENT_BOX=`content-box`,e.DEVICE_PIXEL_CONTENT_BOX=`device-pixel-content-box`})(hv||={});var gv=function(e){return Object.freeze(e)},_v=function(){function e(e,t){this.inlineSize=e,this.blockSize=t,gv(this)}return e}(),vv=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,gv(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),yv=function(e){return e instanceof SVGElement&&`getBBox`in e},bv=function(e){if(yv(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||e.getClientRects().length)},xv=function(e){if(e instanceof Element)return!0;var t=e?.ownerDocument?.defaultView;return!!(t&&e instanceof t.Element)},Sv=function(e){switch(e.tagName){case`INPUT`:if(e.type!==`image`)break;case`VIDEO`:case`AUDIO`:case`EMBED`:case`OBJECT`:case`CANVAS`:case`IFRAME`:case`IMG`:return!0}return!1},Cv=typeof window<`u`?window:{},wv=new WeakMap,Tv=/auto|scroll/,Ev=/^tb|vertical/,Dv=/msie|trident/i.test(Cv.navigator&&Cv.navigator.userAgent),Ov=function(e){return parseFloat(e||`0`)},kv=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new _v((n?t:e)||0,(n?e:t)||0)},Av=gv({devicePixelContentBoxSize:kv(),borderBoxSize:kv(),contentBoxSize:kv(),contentRect:new vv(0,0,0,0)}),jv=function(e,t){if(t===void 0&&(t=!1),wv.has(e)&&!t)return wv.get(e);if(bv(e))return wv.set(e,Av),Av;var n=getComputedStyle(e),r=yv(e)&&e.ownerSVGElement&&e.getBBox(),i=!Dv&&n.boxSizing===`border-box`,a=Ev.test(n.writingMode||``),o=!r&&Tv.test(n.overflowY||``),s=!r&&Tv.test(n.overflowX||``),c=r?0:Ov(n.paddingTop),l=r?0:Ov(n.paddingRight),u=r?0:Ov(n.paddingBottom),d=r?0:Ov(n.paddingLeft),f=r?0:Ov(n.borderTopWidth),p=r?0:Ov(n.borderRightWidth),m=r?0:Ov(n.borderBottomWidth),h=r?0:Ov(n.borderLeftWidth),g=d+l,_=c+u,v=h+p,y=f+m,b=s?e.offsetHeight-y-e.clientHeight:0,x=o?e.offsetWidth-v-e.clientWidth:0,S=i?g+v:0,C=i?_+y:0,w=r?r.width:Ov(n.width)-S-x,T=r?r.height:Ov(n.height)-C-b,E=w+g+x+v,D=T+_+b+y,O=gv({devicePixelContentBoxSize:kv(Math.round(w*devicePixelRatio),Math.round(T*devicePixelRatio),a),borderBoxSize:kv(E,D,a),contentBoxSize:kv(w,T,a),contentRect:new vv(d,c,w,T)});return wv.set(e,O),O},Mv=function(e,t,n){var r=jv(e,n),i=r.borderBoxSize,a=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(t){case hv.DEVICE_PIXEL_CONTENT_BOX:return o;case hv.BORDER_BOX:return i;default:return a}},Nv=function(){function e(e){var t=jv(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=gv([t.borderBoxSize]),this.contentBoxSize=gv([t.contentBoxSize]),this.devicePixelContentBoxSize=gv([t.devicePixelContentBoxSize])}return e}(),Pv=function(e){if(bv(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Fv=function(){var e=1/0,t=[];uv.forEach(function(n){if(n.activeTargets.length!==0){var r=[];n.activeTargets.forEach(function(t){var n=new Nv(t.target),i=Pv(t.target);r.push(n),t.lastReportedSize=Mv(t.target,t.observedBox),i<e&&(e=i)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var i=r[n];i()}return e},Iv=function(e){uv.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(Pv(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},Lv=function(){var e=0;for(Iv(e);dv();)e=Fv(),Iv(e);return fv()&&mv(),e>0},Rv,zv=[],Bv=function(){return zv.splice(0).forEach(function(e){return e()})},Vv=function(e){if(!Rv){var t=0,n=document.createTextNode(``);new MutationObserver(function(){return Bv()}).observe(n,{characterData:!0}),Rv=function(){n.textContent=`${t?t--:t++}`}}zv.push(e),Rv()},Hv=function(e){Vv(function(){requestAnimationFrame(e)})},Uv=0,Wv=function(){return!!Uv},Gv=250,Kv={attributes:!0,characterData:!0,childList:!0,subtree:!0},qv=[`resize`,`load`,`transitionend`,`animationend`,`animationstart`,`animationiteration`,`keyup`,`keydown`,`mouseup`,`mousedown`,`mouseover`,`mouseout`,`blur`,`focus`],Jv=function(e){return e===void 0&&(e=0),Date.now()+e},Yv=!1,Xv=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(e===void 0&&(e=Gv),!Yv){Yv=!0;var n=Jv(e);Hv(function(){var r=!1;try{r=Lv()}finally{if(Yv=!1,e=n-Jv(),!Wv())return;r?t.run(1e3):e>0?t.run(e):t.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Kv)};document.body?t():Cv.addEventListener(`DOMContentLoaded`,t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),qv.forEach(function(t){return Cv.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||=(this.observer&&this.observer.disconnect(),qv.forEach(function(t){return Cv.removeEventListener(t,e.listener,!0)}),!0)},e}()),Zv=function(e){!Uv&&e>0&&Xv.start(),Uv+=e,!Uv&&Xv.stop()},Qv=function(e){return!yv(e)&&!Sv(e)&&getComputedStyle(e).display===`inline`},$v=function(){function e(e,t){this.target=e,this.observedBox=t||hv.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=Mv(this.target,this.observedBox,!0);return Qv(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),ey=function(){function e(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return e}(),ty=new WeakMap,ny=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},ry=function(){function e(){}return e.connect=function(e,t){var n=new ey(e,t);ty.set(e,n)},e.observe=function(e,t,n){var r=ty.get(e),i=r.observationTargets.length===0;ny(r.observationTargets,t)<0&&(i&&uv.push(r),r.observationTargets.push(new $v(t,n&&n.box)),Zv(1),Xv.schedule())},e.unobserve=function(e,t){var n=ty.get(e),r=ny(n.observationTargets,t),i=n.observationTargets.length===1;r>=0&&(i&&uv.splice(uv.indexOf(n),1),n.observationTargets.splice(r,1),Zv(-1))},e.disconnect=function(e){var t=this,n=ty.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),iy=function(){function e(e){if(arguments.length===0)throw TypeError(`Failed to construct \'ResizeObserver\': 1 argument required, but only 0 present.`);if(typeof e!=`function`)throw TypeError(`Failed to construct \'ResizeObserver\': The callback provided as parameter 1 is not a function.`);ry.connect(this,e)}return e.prototype.observe=function(e,t){if(arguments.length===0)throw TypeError(`Failed to execute \'observe\' on \'ResizeObserver\': 1 argument required, but only 0 present.`);if(!xv(e))throw TypeError(`Failed to execute \'observe\' on \'ResizeObserver\': parameter 1 is not of type \'Element`);ry.observe(this,e,t)},e.prototype.unobserve=function(e){if(arguments.length===0)throw TypeError(`Failed to execute \'unobserve\' on \'ResizeObserver\': 1 argument required, but only 0 present.`);if(!xv(e))throw TypeError(`Failed to execute \'unobserve\' on \'ResizeObserver\': parameter 1 is not of type \'Element`);ry.unobserve(this,e)},e.prototype.disconnect=function(){ry.disconnect(this)},e.toString=function(){return`function ResizeObserver () { [polyfill code] }`},e}(),ay=new class{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<`u`&&window.ResizeObserver||iy)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(let t of e){let e=this.elHandlersMap.get(t.target);e!==void 0&&e(t)}}registerHandler(e,t){this.elHandlersMap.set(e,t),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}},oy=F({name:`ResizeObserver`,props:{onResize:Function},setup(e){let t=!1,n=Va().proxy;function r(t){let{onResize:n}=e;n!==void 0&&n(t)}Ir(()=>{let e=n.$el;if(e===void 0){W_(`resize-observer`,`$el does not exist.`);return}if(e.nextElementSibling!==e.nextSibling&&e.nodeType===3&&e.nodeValue!==``){W_(`resize-observer`,`$el can not be observed (it may be a text node).`);return}e.nextElementSibling!==null&&(ay.registerHandler(e.nextElementSibling,r),t=!0)}),zr(()=>{t&&ay.unregisterHandler(n.$el.nextElementSibling)})},render(){return Qr(this.$slots,`default`)}}),sy;function cy(){return typeof document>`u`?!1:(sy===void 0&&(sy=`matchMedia`in window&&window.matchMedia(`(pointer:coarse)`).matches),sy)}var ly;function uy(){return typeof document>`u`?1:(ly===void 0&&(ly=`chrome`in window?window.devicePixelRatio:1),ly)}var dy=`VVirtualListXScroll`;function fy({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){let r=A(0),i=A(0),a=H(()=>{let t=e.value;if(t.length===0)return null;let n=new J_(t.length,0);return t.forEach((e,t)=>{n.add(t,e.width)}),n});return zn(dy,{startIndexRef:Ng(()=>{let e=a.value;return e===null?0:Math.max(e.getBound(i.value)-1,0)}),endIndexRef:Ng(()=>{let t=a.value;return t===null?0:Math.min(t.getBound(i.value+r.value)+1,e.value.length-1)}),columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:e=>{let t=a.value;return t===null?0:t.sum(e)}}),{listWidthRef:r,scrollLeftRef:i}}var py=F({name:`VirtualListRow`,props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){let{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:r,renderColRef:i,renderItemWithColsRef:a}=P(dy);return{startIndex:e,endIndex:t,columns:n,renderCol:i,renderItemWithCols:a,getLeft:r}},render(){let{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:i,getLeft:a,item:o}=this;if(i!=null)return i({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:o,getLeft:a});if(r!=null){let i=[];for(let s=e;s<=t;++s){let e=n[s];i.push(r({column:e,left:a(s),item:o}))}return i}return null}}),my=G_(`.v-vl`,{maxHeight:`inherit`,height:`100%`,overflow:`auto`,minWidth:`1px`},[G_(`&:not(.v-vl--show-scrollbar)`,{scrollbarWidth:`none`},[G_(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,{width:0,height:0,display:`none`})])]),hy=F({name:`VirtualList`,inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:`div`},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:`key`},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){let t=Gm();my.mount({id:`vueuc/virtual-list`,head:!0,anchorMetaName:K_,ssr:t}),Ir(()=>{let{defaultScrollIndex:t,defaultScrollKey:n}=e;t==null?n!=null&&g({key:n}):g({index:t})});let n=!1,r=!1;kr(()=>{if(n=!1,!r){r=!0;return}g({top:p.value,left:o.value})}),Ar(()=>{n=!0,r||=!0});let i=Ng(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let t=0;return e.columns.forEach(e=>{t+=e.width}),t}),a=H(()=>{let t=new Map,{keyField:n}=e;return e.items.forEach((e,r)=>{t.set(e[n],r)}),t}),{scrollLeftRef:o,listWidthRef:s}=fy({columnsRef:M(e,`columns`),renderColRef:M(e,`renderCol`),renderItemWithColsRef:M(e,`renderItemWithCols`)}),c=A(null),l=A(void 0),u=new Map,d=H(()=>{let{items:t,itemSize:n,keyField:r}=e,i=new J_(t.length,n);return t.forEach((e,t)=>{let n=e[r],a=u.get(n);a!==void 0&&i.add(t,a)}),i}),f=A(0),p=A(0),m=Ng(()=>Math.max(d.value.getBound(p.value-ah(e.paddingTop))-1,0)),h=H(()=>{let{value:t}=l;if(t===void 0)return[];let{items:n,itemSize:r}=e,i=m.value,a=Math.min(i+Math.ceil(t/r+1),n.length-1),o=[];for(let e=i;e<=a;++e)o.push(n[e]);return o}),g=(e,t)=>{if(typeof e==`number`){b(e,t,`auto`);return}let{left:n,top:r,index:i,key:o,position:s,behavior:c,debounce:l=!0}=e;if(n!==void 0||r!==void 0)b(n,r,c);else if(i!==void 0)y(i,c,l);else if(o!==void 0){let e=a.value.get(o);e!==void 0&&y(e,c,l)}else s===`bottom`?b(0,2**53-1,c):s===`top`&&b(0,0,c)},_,v=null;function y(t,n,r){let i=c.value;if(i==null)return;let{value:a}=d,o=a.sum(t)+ah(e.paddingTop);if(!r)i.scrollTo({left:0,top:o,behavior:n});else{_=t,v!==null&&window.clearTimeout(v),v=window.setTimeout(()=>{_=void 0,v=null},16);let{scrollTop:e,offsetHeight:r}=i;if(o>e){let s=a.get(t);o+s<=e+r||i.scrollTo({left:0,top:o+s-r,behavior:n})}else i.scrollTo({left:0,top:o,behavior:n})}}function b(e,t,n){c.value?.scrollTo({left:e,top:t,behavior:n})}function x(t,r){if(n||e.ignoreItemResize||O(r.target))return;let{value:i}=d,o=a.value.get(t),s=i.get(o),l=r.borderBoxSize?.[0]?.blockSize??r.contentRect.height;if(l===s)return;l-e.itemSize===0?u.delete(t):u.set(t,l-e.itemSize);let p=l-s;if(p===0)return;i.add(o,p);let m=c.value;if(m!=null){if(_===void 0){let e=i.sum(o);m.scrollTop>e&&m.scrollBy(0,p)}else(o<_||o===_&&l+i.sum(o)>m.scrollTop+m.offsetHeight)&&m.scrollBy(0,p);D()}f.value++}let S=!cy(),C=!1;function w(t){var n;(n=e.onScroll)==null||n.call(e,t),(!S||!C)&&D()}function T(t){var n;if((n=e.onWheel)==null||n.call(e,t),S){let e=c.value;if(e!=null){if(t.deltaX===0&&(e.scrollTop===0&&t.deltaY<=0||e.scrollTop+e.offsetHeight>=e.scrollHeight&&t.deltaY>=0))return;t.preventDefault(),e.scrollTop+=t.deltaY/uy(),e.scrollLeft+=t.deltaX/uy(),D(),C=!0,nh(()=>{C=!1})}}}function E(t){if(n||O(t.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(t.contentRect.height===l.value)return}else if(t.contentRect.height===l.value&&t.contentRect.width===s.value)return;l.value=t.contentRect.height,s.value=t.contentRect.width;let{onResize:r}=e;r!==void 0&&r(t)}function D(){let{value:e}=c;e!=null&&(p.value=e.scrollTop,o.value=e.scrollLeft)}function O(e){let t=e;for(;t!==null;){if(t.style.display===`none`)return!0;t=t.parentElement}return!1}return{listHeight:l,listStyle:{overflow:`auto`},keyToIndex:a,itemsStyle:H(()=>{let{itemResizable:t}=e,n=oh(d.value.sum());return f.value,[e.itemsStyle,{boxSizing:`content-box`,width:oh(i.value),height:t?``:n,minHeight:t?n:``,paddingTop:oh(e.paddingTop),paddingBottom:oh(e.paddingBottom)}]}),visibleItemsStyle:H(()=>(f.value,{transform:`translateY(${oh(d.value.sum(m.value))})`})),viewportItems:h,listElRef:c,itemsElRef:A(null),scrollTo:g,handleListResize:E,handleListScroll:w,handleListWheel:T,handleItemResize:x}},render(){let{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:r}=this;return ro(oy,{onResize:this.handleListResize},{default:()=>{var i;return ro(`div`,Fa(this.$attrs,{class:[`v-vl`,this.showScrollbar&&`v-vl--show-scrollbar`],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:`listElRef`}),[this.items.length===0?(i=this.$slots).empty?.call(i):ro(`div`,{ref:`itemsElRef`,class:`v-vl-items`,style:this.itemsStyle},[ro(r,Object.assign({class:`v-vl-visible-items`,style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{let{renderCol:r,renderItemWithCols:i}=this;return this.viewportItems.map(a=>{let o=a[t],s=n.get(o),c=r==null?void 0:ro(py,{index:s,item:a}),l=i==null?void 0:ro(py,{index:s,item:a}),u=this.$slots.default({item:a,renderedCols:c,renderedItemWithCols:l,index:s})[0];return e?ro(oy,{key:o,onResize:e=>this.handleItemResize(o,e)},{default:()=>u}):(u.key=o,u)})}})])])}})}}),gy=`v-hidden`,_y=G_(`[v-hidden]`,{display:`none!important`}),vy=F({name:`Overflow`,props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){let n=A(null),r=A(null);function i(i){let{value:a}=n,{getCounter:o,getTail:s}=e,c;if(c=o===void 0?r.value:o(),!a||!c)return;c.hasAttribute(gy)&&c.removeAttribute(gy);let{children:l}=a;if(i.showAllItemsBeforeCalculate)for(let e of l)e.hasAttribute(gy)&&e.removeAttribute(gy);let u=a.offsetWidth,d=[],f=t.tail?s?.():null,p=f?f.offsetWidth:0,m=!1,h=a.children.length-+!!t.tail;for(let t=0;t<h-1;++t){if(t<0)continue;let n=l[t];if(m){n.hasAttribute(gy)||n.setAttribute(gy,``);continue}n.hasAttribute(gy)&&n.removeAttribute(gy);let r=n.offsetWidth;if(p+=r,d[t]=r,p>u){let{updateCounter:n}=e;for(let r=t;r>=0;--r){let i=h-1-r;n===void 0?c.textContent=`${i}`:n(i);let a=c.offsetWidth;if(p-=d[r],p+a<=u||r===0){m=!0,t=r-1,f&&(t===-1?(f.style.maxWidth=`${u-a}px`,f.style.boxSizing=`border-box`):f.style.maxWidth=``);let{onUpdateCount:n}=e;n&&n(i);break}}}}let{onUpdateOverflow:g}=e;m?g!==void 0&&g(!0):(g!==void 0&&g(!1),c.setAttribute(gy,``))}let a=Gm();return _y.mount({id:`vueuc/overflow`,head:!0,anchorMetaName:K_,ssr:a}),Ir(()=>i({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:i}},render(){let{$slots:e}=this;return Tn(()=>this.sync({showAllItemsBeforeCalculate:!1})),ro(`div`,{class:`v-overflow`,ref:`selfRef`},[Qr(e,`default`),e.counter?e.counter():ro(`span`,{style:{display:`inline-block`},ref:`counterRef`}),e.tail?e.tail():null])}});function yy(e){return e instanceof HTMLElement}function by(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes[t];if(yy(n)&&(Sy(n)||by(n)))return!0}return!1}function xy(e){for(let t=e.childNodes.length-1;t>=0;t--){let n=e.childNodes[t];if(yy(n)&&(Sy(n)||xy(n)))return!0}return!1}function Sy(e){if(!Cy(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Cy(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute(`tabIndex`)!==null)return!0;if(e.getAttribute(`disabled`))return!1;switch(e.nodeName){case`A`:return!!e.href&&e.rel!==`ignore`;case`INPUT`:return e.type!==`hidden`&&e.type!==`file`;case`SELECT`:case`TEXTAREA`:return!0;default:return!1}}var wy=[],Ty=F({name:`FocusTrap`,props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){let t=Hh(),n=A(null),r=A(null),i=!1,a=!1,o=typeof document>`u`?null:document.activeElement;function s(){return wy[wy.length-1]===t}function c(t){var n;t.code===`Escape`&&s()&&((n=e.onEsc)==null||n.call(e,t))}Ir(()=>{Un(()=>e.active,e=>{e?(d(),Ag(`keydown`,document,c)):(jg(`keydown`,document,c),i&&f())},{immediate:!0})}),zr(()=>{jg(`keydown`,document,c),i&&f()});function l(e){if(!a&&s()){let t=u();if(t===null||t.contains(ih(e)))return;p(`first`)}}function u(){let e=n.value;if(e===null)return null;let t=e;for(;t=t.nextSibling,!(t===null||t instanceof Element&&t.tagName===`DIV`););return t}function d(){var n;if(!e.disabled){if(wy.push(t),e.autoFocus){let{initialFocusTo:t}=e;t===void 0?p(`first`):(n=Y_(t))==null||n.focus({preventScroll:!0})}i=!0,document.addEventListener(`focus`,l,!0)}}function f(){var n;if(e.disabled||(document.removeEventListener(`focus`,l,!0),wy=wy.filter(e=>e!==t),s()))return;let{finalFocusTo:r}=e;r===void 0?e.returnFocusOnDeactivated&&o instanceof HTMLElement&&(a=!0,o.focus({preventScroll:!0}),a=!1):(n=Y_(r))==null||n.focus({preventScroll:!0})}function p(t){if(s()&&e.active){let e=n.value,i=r.value;if(e!==null&&i!==null){let n=u();if(n==null||n===i){a=!0,e.focus({preventScroll:!0}),a=!1;return}a=!0;let r=t===`first`?by(n):xy(n);a=!1,r||(a=!0,e.focus({preventScroll:!0}),a=!1)}}}function m(e){if(a)return;let t=u();t!==null&&(e.relatedTarget!==null&&t.contains(e.relatedTarget)?p(`last`):p(`first`))}function h(e){a||(e.relatedTarget!==null&&e.relatedTarget===n.value?p(`last`):p(`first`))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:`position: absolute; height: 0; width: 0;`,handleStartFocus:m,handleEndFocus:h}},render(){let{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();let{active:t,focusableStyle:n}=this;return ro(I,null,[ro(`div`,{"aria-hidden":`true`,tabindex:t?`0`:`-1`,ref:`focusableStartRef`,style:n,onFocus:this.handleStartFocus}),e(),ro(`div`,{"aria-hidden":`true`,style:n,ref:`focusableEndRef`,tabindex:t?`0`:`-1`,onFocus:this.handleEndFocus})])}}),Ey=[`onMousedown`],Dy=[`onScroll`,`onWheel`],Oy=[`onMousedown`],ky=F({name:`Scrollbar`,props:{...Q.props,duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:`hover`},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,internalExposeWidthCssVar:Boolean,yPlacement:{type:String,default:`right`},xPlacement:{type:String,default:`bottom`}},inheritAttrs:!1,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=Pm(e),i=v_(`Scrollbar`,r,t),a=A(null),o=A(null),s=A(null),c=A(null),l=A(null),u=A(null),d=A(null),f=A(null),p=A(null),m=A(null),h=A(null),g=A(0),_=A(0),v=A(!1),y=A(!1),b=!1,x=!1,S,C,w=0,T=0,E=0,D=0,O=$g(),ee=Q(`Scrollbar`,`-scrollbar`,w_,Zh,e,t),te=H(()=>{let{value:e}=f,{value:t}=u,{value:n}=m;return e===null||t===null||n===null?0:Math.min(e,n*e/t+ah(ee.value.self.width)*1.5)}),ne=H(()=>`${te.value}px`),re=H(()=>{let{value:e}=p,{value:t}=d,{value:n}=h;return e===null||t===null||n===null?0:n*e/t+ah(ee.value.self.height)*1.5}),ie=H(()=>`${re.value}px`),ae=H(()=>{let{value:e}=f,{value:t}=g,{value:n}=u,{value:r}=m;if(e===null||n===null||r===null)return 0;{let i=n-e;return i?t/i*(r-te.value):0}}),oe=H(()=>`${ae.value}px`),se=H(()=>{let{value:e}=p,{value:t}=_,{value:n}=d,{value:r}=h;if(e===null||n===null||r===null)return 0;{let i=n-e;return i?t/i*(r-re.value):0}}),ce=H(()=>`${se.value}px`),le=H(()=>{let{value:e}=f,{value:t}=u;return e!==null&&t!==null&&t>e}),ue=H(()=>{let{value:e}=p,{value:t}=d;return e!==null&&t!==null&&t>e}),k=H(()=>{let{trigger:t}=e;return t===`none`||v.value}),de=H(()=>{let{trigger:t}=e;return t===`none`||y.value}),fe=H(()=>{let{container:t}=e;return t?t():o.value}),pe=H(()=>{let{content:t}=e;return t?t():s.value}),me=(t,n)=>{if(!e.scrollable)return;if(typeof t==`number`){ye(t,n??0,0,!1,`auto`);return}let{left:r,top:i,index:a,elSize:o,position:s,behavior:c,el:l,debounce:u=!0}=t;(r!==void 0||i!==void 0)&&ye(r??0,i??0,0,!1,c),l===void 0?a!==void 0&&o!==void 0?ye(0,a*o,o,u,c):s===`bottom`?ye(0,2**53-1,0,!1,c):s===`top`&&ye(0,0,0,!1,c):ye(0,l.offsetTop,l.offsetHeight,u,c)},he=y_(()=>{e.container||me({top:g.value,left:_.value})}),ge=()=>{he.isDeactivated||je()},_e=t=>{if(he.isDeactivated)return;let{onResize:n}=e;n&&n(t),je()},ve=(t,n)=>{if(!e.scrollable)return;let{value:r}=fe;r&&(typeof t==`object`?r.scrollBy(t):r.scrollBy(t,n||0))};function ye(e,t,n,r,i){let{value:a}=fe;if(a){if(r){let{scrollTop:r,offsetHeight:o}=a;if(t>r){t+n<=r+o||a.scrollTo({left:e,top:t+n-o,behavior:i});return}}a.scrollTo({left:e,top:t,behavior:i})}}function be(){Te(),Ee(),je()}function xe(){Se()}function Se(){Ce(),we()}function Ce(){C!==void 0&&window.clearTimeout(C),C=window.setTimeout(()=>{y.value=!1},e.duration)}function we(){S!==void 0&&window.clearTimeout(S),S=window.setTimeout(()=>{v.value=!1},e.duration)}function Te(){S!==void 0&&window.clearTimeout(S),v.value=!0}function Ee(){C!==void 0&&window.clearTimeout(C),y.value=!0}function De(t){let{onScroll:n}=e;n&&n(t),Oe()}function Oe(){let{value:e}=fe;e&&(g.value=e.scrollTop,_.value=e.scrollLeft*(i?.value?-1:1))}function ke(){let{value:e}=pe;e&&(u.value=e.offsetHeight,d.value=e.offsetWidth);let{value:t}=fe;t&&(f.value=t.offsetHeight,p.value=t.offsetWidth);let{value:n}=l,{value:r}=c;n&&(h.value=n.offsetWidth),r&&(m.value=r.offsetHeight)}function Ae(){let{value:e}=fe;e&&(g.value=e.scrollTop,_.value=e.scrollLeft*(i?.value?-1:1),f.value=e.offsetHeight,p.value=e.offsetWidth,u.value=e.scrollHeight,d.value=e.scrollWidth);let{value:t}=l,{value:n}=c;t&&(h.value=t.offsetWidth),n&&(m.value=n.offsetHeight)}function je(){e.scrollable&&(e.useUnifiedContainer?Ae():(ke(),Oe()))}function Me(e){return!a.value?.contains(ih(e))}function Ne(e){e.preventDefault(),e.stopPropagation(),x=!0,Ag(`mousemove`,window,Pe,!0),Ag(`mouseup`,window,Fe,!0),T=_.value,E=i?.value?window.innerWidth-e.clientX:e.clientX}function Pe(t){if(!x)return;S!==void 0&&window.clearTimeout(S),C!==void 0&&window.clearTimeout(C);let{value:n}=p,{value:r}=d,{value:a}=re;if(n===null||r===null)return;let o=(i?.value?window.innerWidth-t.clientX-E:t.clientX-E)*(r-n)/(n-a),s=r-n,c=T+o;c=Math.min(s,c),c=Math.max(c,0);let{value:l}=fe;if(l){l.scrollLeft=c*(i?.value?-1:1);let{internalOnUpdateScrollLeft:t}=e;t&&t(c)}}function Fe(e){e.preventDefault(),e.stopPropagation(),jg(`mousemove`,window,Pe,!0),jg(`mouseup`,window,Fe,!0),x=!1,je(),Me(e)&&Se()}function Ie(e){e.preventDefault(),e.stopPropagation(),b=!0,Ag(`mousemove`,window,Le,!0),Ag(`mouseup`,window,Re,!0),w=g.value,D=e.clientY}function Le(e){if(!b)return;S!==void 0&&window.clearTimeout(S),C!==void 0&&window.clearTimeout(C);let{value:t}=f,{value:n}=u,{value:r}=te;if(t===null||n===null)return;let i=(e.clientY-D)*(n-t)/(t-r),a=n-t,o=w+i;o=Math.min(a,o),o=Math.max(o,0);let{value:s}=fe;s&&(s.scrollTop=o)}function Re(e){e.preventDefault(),e.stopPropagation(),jg(`mousemove`,window,Le,!0),jg(`mouseup`,window,Re,!0),b=!1,je(),Me(e)&&Se()}Hn(()=>{let{value:e}=ue,{value:n}=le,{value:r}=t,{value:i}=l,{value:a}=c;i&&(e?i.classList.remove(`${r}-scrollbar-rail--disabled`):i.classList.add(`${r}-scrollbar-rail--disabled`)),a&&(n?a.classList.remove(`${r}-scrollbar-rail--disabled`):a.classList.add(`${r}-scrollbar-rail--disabled`))}),Ir(()=>{e.container||je()}),zr(()=>{S!==void 0&&window.clearTimeout(S),C!==void 0&&window.clearTimeout(C),jg(`mousemove`,window,Le,!0),jg(`mouseup`,window,Re,!0)});let ze=H(()=>{let{common:{cubicBezierEaseInOut:e},self:{color:t,colorHover:n,height:r,width:a,borderRadius:o,railInsetHorizontalTop:s,railInsetHorizontalBottom:c,railInsetVerticalRight:l,railInsetVerticalLeft:u,railColor:d}}=ee.value,{top:f,right:p,bottom:m,left:h}=sh(s),{top:g,right:_,bottom:v,left:y}=sh(c),{top:b,right:x,bottom:S,left:C}=sh(i?.value?b_(l):l),{top:w,right:T,bottom:E,left:D}=sh(i?.value?b_(u):u);return{"--n-scrollbar-bezier":e,"--n-scrollbar-color":t,"--n-scrollbar-color-hover":n,"--n-scrollbar-border-radius":o,"--n-scrollbar-width":a,"--n-scrollbar-height":r,"--n-scrollbar-rail-top-horizontal-top":f,"--n-scrollbar-rail-right-horizontal-top":p,"--n-scrollbar-rail-bottom-horizontal-top":m,"--n-scrollbar-rail-left-horizontal-top":h,"--n-scrollbar-rail-top-horizontal-bottom":g,"--n-scrollbar-rail-right-horizontal-bottom":_,"--n-scrollbar-rail-bottom-horizontal-bottom":v,"--n-scrollbar-rail-left-horizontal-bottom":y,"--n-scrollbar-rail-top-vertical-right":b,"--n-scrollbar-rail-right-vertical-right":x,"--n-scrollbar-rail-bottom-vertical-right":S,"--n-scrollbar-rail-left-vertical-right":C,"--n-scrollbar-rail-top-vertical-left":w,"--n-scrollbar-rail-right-vertical-left":T,"--n-scrollbar-rail-bottom-vertical-left":E,"--n-scrollbar-rail-left-vertical-left":D,"--n-scrollbar-rail-color":d}}),Be=n?tg(`scrollbar`,void 0,ze,e):void 0;return{scrollTo:me,scrollBy:ve,sync:je,syncUnifiedContainer:Ae,handleMouseEnterWrapper:be,handleMouseLeaveWrapper:xe,mergedClsPrefix:t,rtlEnabled:i,containerScrollTop:g,wrapperRef:a,containerRef:o,contentRef:s,yRailRef:c,xRailRef:l,needYBar:le,needXBar:ue,yBarSizePx:ne,xBarSizePx:ie,yBarTopPx:oe,xBarLeftPx:ce,isShowXBar:k,isShowYBar:de,isIos:O,handleScroll:De,handleContentResize:ge,handleContainerResize:_e,handleYScrollMouseDown:Ie,handleXScrollMouseDown:Ne,containerWidth:p,cssVars:n?void 0:ze,themeClass:Be?.themeClass,onRender:Be?.onRender}},render(){let{$slots:e,mergedClsPrefix:t,triggerDisplayManually:n,rtlEnabled:r,internalHoistYRail:i,yPlacement:a,xPlacement:o,xScrollable:s}=this;if(!this.scrollable)return e.default?.();let c=this.trigger===`none`,l=(e,n)=>(L(),R(`div`,{ref:`yRailRef`,class:Y([`${t}-scrollbar-rail`,`${t}-scrollbar-rail--vertical`,`${t}-scrollbar-rail--vertical--${a}`,e]),"data-scrollbar-rail":!0,style:k([n||``,this.verticalRailStyle]),"aria-hidden":!0},[J(()=>ro(c?x_:yo,c?null:{name:`fade-in-transition`},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?(L(),R(`div`,{key:1,class:Y(`${t}-scrollbar-rail__scrollbar`),style:k({height:this.yBarSizePx,top:this.yBarTopPx}),onMousedown:this.handleYScrollMouseDown},null,46,Ey)):null}))],6)),u=()=>(this.onRender?.(),ro(`div`,Fa(this.$attrs,{role:`none`,ref:`wrapperRef`,class:[`${t}-scrollbar`,this.themeClass,r&&`${t}-scrollbar--rtl`],style:this.cssVars,onMouseenter:n?void 0:this.handleMouseEnterWrapper,onMouseleave:n?void 0:this.handleMouseLeaveWrapper}),[this.container?e.default?.():(L(),R(`div`,{key:2,role:`none`,ref:`containerRef`,class:Y([`${t}-scrollbar-container`,this.containerClass]),style:k([this.containerStyle,this.internalExposeWidthCssVar?{"--n-scrollbar-current-width":oh(this.containerWidth)}:void 0]),onScroll:this.handleScroll,onWheel:this.onWheel},[(L(),z(oy,{onResize:this.handleContentResize},{default:()=>(L(),R(`div`,{ref:`contentRef`,role:`none`,style:k([{width:this.xScrollable?`fit-content`:null},this.contentStyle]),class:Y([`${t}-scrollbar-content`,this.contentClass])},[J(()=>e.default?.())],6))},1032,[`onResize`]))],46,Dy)),i?null:l(void 0,void 0),s&&(L(),R(`div`,{ref:`xRailRef`,class:Y([`${t}-scrollbar-rail`,`${t}-scrollbar-rail--horizontal`,`${t}-scrollbar-rail--horizontal--${o}`]),style:k(this.horizontalRailStyle),"data-scrollbar-rail":!0,"aria-hidden":!0},[J(()=>ro(c?x_:yo,c?null:{name:`fade-in-transition`},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?(L(),R(`div`,{key:3,class:Y(`${t}-scrollbar-rail__scrollbar`),style:k({width:this.xBarSizePx,right:r?this.xBarLeftPx:void 0,left:r?void 0:this.xBarLeftPx}),onMousedown:this.handleXScrollMouseDown},null,46,Oy)):null}))],6))])),d=this.container?u():(L(),z(oy,{key:4,onResize:this.handleContainerResize},{default:u},1032,[`onResize`]));return i?(L(),R(I,{key:5},[J(()=>d),J(()=>l(this.themeClass,this.cssVars))],64)):d}}),Ay=ky,jy={top:`bottom`,bottom:`top`,left:`right`,right:`left`},My=`var(--n-arrow-height) * 1.414`,Ny=U([W(`popover`,`\n transition:\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n position: relative;\n font-size: var(--n-font-size);\n color: var(--n-text-color);\n box-shadow: var(--n-box-shadow);\n word-break: break-word;\n `,[U(`>`,[W(`scrollbar`,`\n height: inherit;\n max-height: inherit;\n `)]),hc(`raw`,`\n background-color: var(--n-color);\n border-radius: var(--n-border-radius);\n `,[hc(`scrollable`,[hc(`show-header-or-footer`,`padding: var(--n-padding);`)])]),G(`header`,`\n padding: var(--n-padding);\n border-bottom: 1px solid var(--n-divider-color);\n transition: border-color .3s var(--n-bezier);\n `),G(`footer`,`\n padding: var(--n-padding);\n border-top: 1px solid var(--n-divider-color);\n transition: border-color .3s var(--n-bezier);\n `),K(`scrollable, show-header-or-footer`,[G(`content`,`\n padding: var(--n-padding);\n `)])]),W(`popover-shared`,`\n transform-origin: inherit;\n `,[W(`popover-arrow-wrapper`,`\n position: absolute;\n overflow: hidden;\n pointer-events: none;\n `,[W(`popover-arrow`,`\n transition: background-color .3s var(--n-bezier);\n position: absolute;\n display: block;\n width: calc(${My});\n height: calc(${My});\n box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);\n transform: rotate(45deg);\n background-color: var(--n-color);\n pointer-events: all;\n `)]),U(`&.popover-transition-enter-from, &.popover-transition-leave-to`,`\n opacity: 0;\n transform: scale(.85);\n `),U(`&.popover-transition-enter-to, &.popover-transition-leave-from`,`\n transform: scale(1);\n opacity: 1;\n `),U(`&.popover-transition-enter-active`,`\n transition:\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .15s var(--n-bezier-ease-out),\n transform .15s var(--n-bezier-ease-out);\n `),U(`&.popover-transition-leave-active`,`\n transition:\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n opacity .15s var(--n-bezier-ease-in),\n transform .15s var(--n-bezier-ease-in);\n `)]),Fy(`top-start`,`\n top: calc(${My} / -2);\n left: calc(${Py(`top-start`)} - var(--v-offset-left));\n `),Fy(`top`,`\n top: calc(${My} / -2);\n transform: translateX(calc(${My} / -2)) rotate(45deg);\n left: 50%;\n `),Fy(`top-end`,`\n top: calc(${My} / -2);\n right: calc(${Py(`top-end`)} + var(--v-offset-left));\n `),Fy(`bottom-start`,`\n bottom: calc(${My} / -2);\n left: calc(${Py(`bottom-start`)} - var(--v-offset-left));\n `),Fy(`bottom`,`\n bottom: calc(${My} / -2);\n transform: translateX(calc(${My} / -2)) rotate(45deg);\n left: 50%;\n `),Fy(`bottom-end`,`\n bottom: calc(${My} / -2);\n right: calc(${Py(`bottom-end`)} + var(--v-offset-left));\n `),Fy(`left-start`,`\n left: calc(${My} / -2);\n top: calc(${Py(`left-start`)} - var(--v-offset-top));\n `),Fy(`left`,`\n left: calc(${My} / -2);\n transform: translateY(calc(${My} / -2)) rotate(45deg);\n top: 50%;\n `),Fy(`left-end`,`\n left: calc(${My} / -2);\n bottom: calc(${Py(`left-end`)} + var(--v-offset-top));\n `),Fy(`right-start`,`\n right: calc(${My} / -2);\n top: calc(${Py(`right-start`)} - var(--v-offset-top));\n `),Fy(`right`,`\n right: calc(${My} / -2);\n transform: translateY(calc(${My} / -2)) rotate(45deg);\n top: 50%;\n `),Fy(`right-end`,`\n right: calc(${My} / -2);\n bottom: calc(${Py(`right-end`)} + var(--v-offset-top));\n `),...Dm({top:[`right-start`,`left-start`],right:[`top-end`,`bottom-end`],bottom:[`right-end`,`left-end`],left:[`top-start`,`bottom-start`]},(e,t)=>{let n=[`right`,`left`].includes(t),r=n?`width`:`height`;return e.map(e=>{let i=e.split(`-`)[1]===`end`,a=`calc((${`var(--v-target-${r}, 0px)`} - ${My}) / 2)`,o=Py(e);return U(`[v-placement="${e}"] >`,[W(`popover-shared`,[K(`center-arrow`,[W(`popover-arrow`,`${t}: calc(max(${a}, ${o}) ${i?`+`:`-`} var(--v-offset-${n?`left`:`top`}));`)])])])})})]);function Py(e){return[`top`,`bottom`].includes(e.split(`-`)[0])?`var(--n-arrow-offset)`:`var(--n-arrow-offset-vertical)`}function Fy(e,t){let n=e.split(`-`)[0],r=[`top`,`bottom`].includes(n)?`height: var(--n-space-arrow);`:`width: var(--n-space-arrow);`;return U(`[v-placement="${e}"] >`,[W(`popover-shared`,`\n margin-${jy[n]}: var(--n-space);\n `,[K(`show-arrow`,`\n margin-${jy[n]}: var(--n-space-arrow);\n `),K(`overlap`,`\n margin: 0;\n `),yc(`popover-arrow-wrapper`,`\n right: 0;\n left: 0;\n top: 0;\n bottom: 0;\n ${n}: 100%;\n ${jy[n]}: auto;\n ${r}\n `,[W(`popover-arrow`,t)])])])}var Iy={...Q.props,to:n_.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number};function Ly({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:i}){return L(),R(`div`,{key:`__popover-arrow__`,style:k(r),class:Y([`${i}-popover-arrow-wrapper`,n])},[B(`div`,{class:Y([`${i}-popover-arrow`,e]),style:k(t)},null,6)],6)}var Ry=F({name:`PopoverBody`,inheritAttrs:!1,props:Iy,setup(e,{slots:t,attrs:n}){let{namespaceRef:r,mergedClsPrefixRef:i,inlineThemeDisabled:a,mergedRtlRef:o}=Pm(e),s=Q(`Popover`,`-popover`,Ny,hg,e,i),c=v_(`Popover`,o,i),l=A(null),u=P(`NPopover`),d=A(null),f=A(e.show),p=A(!1);Hn(()=>{let{show:t}=e;t&&!d_()&&!e.internalDeactivateImmediately&&(p.value=!0)});let m=H(()=>{let{trigger:t,onClickoutside:n}=e,r=[],{positionManuallyRef:{value:i}}=u;return i||(t===`click`&&!n&&r.push([z_,S,void 0,{capture:!0}]),t===`hover`&&r.push([L_,x])),n&&r.push([z_,S,void 0,{capture:!0}]),(e.displayDirective===`show`||e.animated&&p.value)&&r.push([Lo,e.show]),r}),h=H(()=>{let{common:{cubicBezierEaseInOut:e,cubicBezierEaseIn:t,cubicBezierEaseOut:n},self:{space:r,spaceArrow:i,padding:a,fontSize:o,textColor:c,dividerColor:l,color:u,boxShadow:d,borderRadius:f,arrowHeight:p,arrowOffset:m,arrowOffsetVertical:h}}=s.value;return{"--n-box-shadow":d,"--n-bezier":e,"--n-bezier-ease-in":t,"--n-bezier-ease-out":n,"--n-font-size":o,"--n-text-color":c,"--n-color":u,"--n-divider-color":l,"--n-border-radius":f,"--n-arrow-height":p,"--n-arrow-offset":m,"--n-arrow-offset-vertical":h,"--n-padding":a,"--n-space":r,"--n-space-arrow":i}}),g=H(()=>{let t=e.width===`trigger`?void 0:l_(e.width),n=[];t&&n.push({width:t});let{maxWidth:r,minWidth:i}=e;return r&&n.push({maxWidth:l_(r)}),i&&n.push({maxWidth:l_(i)}),a||n.push(h.value),n}),_=a?tg(`popover`,void 0,h,e):void 0;u.setBodyInstance({syncPosition:v}),zr(()=>{u.setBodyInstance(null)}),Un(M(e,`show`),t=>{e.animated||(t?f.value=!0:f.value=!1)});function v(){l.value?.syncPosition()}function y(t){e.trigger===`hover`&&e.keepAliveOnHover&&e.show&&u.handleMouseEnter(t)}function b(t){e.trigger===`hover`&&e.keepAliveOnHover&&u.handleMouseLeave(t)}function x(t){e.trigger===`hover`&&!C().contains(ih(t))&&u.handleMouseMoveOutside(t)}function S(t){(e.trigger===`click`&&!C().contains(ih(t))||e.onClickoutside)&&u.handleClickOutside(t)}function C(){return u.getTriggerElement()}zn(Sg,d),zn(vg,null),zn(yg,null);function w(){if(_?.onRender(),!(e.displayDirective===`show`||e.show||e.animated&&p.value))return null;let r,a=u.internalRenderBodyRef.value,{value:o}=i;if(a)r=a([`${o}-popover-shared`,c?.value&&`${o}-popover--rtl`,_?.themeClass.value,e.overlap&&`${o}-popover-shared--overlap`,e.showArrow&&`${o}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${o}-popover-shared--center-arrow`],d,g.value,y,b);else{let{value:i}=u.extraClassRef,{internalTrapFocus:a}=e,l=!__(t.header)||!__(t.footer),f=()=>{let n=l?(L(),R(I,{key:1},[J(()=>h_(t.header,t=>t?(L(),R(`div`,{key:2,class:Y([`${o}-popover__header`,e.headerClass]),style:k(e.headerStyle)},[J(()=>t)],6)):null)),J(()=>h_(t.default,n=>n?(L(),R(`div`,{key:3,class:Y([`${o}-popover__content`,e.contentClass]),style:k(e.contentStyle)},[J(()=>t.default?.())],6)):null)),J(()=>h_(t.footer,t=>t?(L(),R(`div`,{key:4,class:Y([`${o}-popover__footer`,e.footerClass]),style:k(e.footerStyle)},[J(()=>t)],6)):null))],64)):e.scrollable?t.default?.():(L(),R(`div`,{key:5,class:Y([`${o}-popover__content`,e.contentClass]),style:k(e.contentStyle)},[J(()=>t.default?.())],6));return[e.scrollable?(L(),z(Ay,{key:6,themeOverrides:s.value.peerOverrides.Scrollbar,theme:s.value.peers.Scrollbar,contentClass:l?void 0:`${o}-popover__content ${e.contentClass??``}`,contentStyle:l?void 0:e.contentStyle},{default:()=>n},1032,[`themeOverrides`,`theme`,`contentClass`,`contentStyle`])):n,e.showArrow?Ly({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:o}):null]};r=ro(`div`,Fa({class:[`${o}-popover`,`${o}-popover-shared`,c?.value&&`${o}-popover--rtl`,_?.themeClass.value,i.map(e=>`${o}-${e}`),{[`${o}-popover--scrollable`]:e.scrollable,[`${o}-popover--show-header-or-footer`]:l,[`${o}-popover--raw`]:e.raw,[`${o}-popover-shared--overlap`]:e.overlap,[`${o}-popover-shared--show-arrow`]:e.showArrow,[`${o}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:d,style:g.value,onKeydown:u.handleKeydown,onMouseenter:y,onMouseleave:b},n),a?(L(),z(Ty,{key:7,active:e.show,autoFocus:!0},{default:f},1032,[`active`])):f())}return Ln(r,m.value)}return{displayed:p,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:l,adjustedTo:n_(e),followerEnabled:f,renderContentNode:w}},render(){return L(),z(lv,{ref:`followerRef`,zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width===`trigger`?`target`:void 0,teleportDisabled:this.adjustedTo===n_.tdkey},{_:1,default:Zm(()=>this.animated?(L(),z(yo,{key:8,name:`popover-transition`,appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{this.internalOnAfterLeave?.(),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode},1032,[`appear`,`onEnter`,`onAfterLeave`])):this.renderContentNode())},8,[`zIndex`,`show`,`enabled`,`to`,`x`,`y`,`flip`,`placement`,`containerClass`,`overlap`,`width`,`teleportDisabled`])}}),zy={key:1,style:{position:`fixed`,top:0,right:0,bottom:0,left:0}},By=Object.keys(Iy),Vy={focus:[`onFocus`,`onBlur`],click:[`onClick`],hover:[`onMouseenter`,`onMouseleave`],manual:[],nested:[`onFocus`,`onBlur`,`onMouseenter`,`onMouseleave`,`onClick`]};function Hy(e,t,n){Vy[t].forEach(t=>{e.props=e.props?Object.assign({},e.props):{};let r=e.props[t],i=n[t];r?e.props[t]=(...e)=>{r(...e),i(...e)}:e.props[t]=i})}var Uy={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:`hover`},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:`top`},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:`if`},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:n_.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Wy=F({name:`Popover`,inheritAttrs:!1,props:{...Q.props,...Uy,internalOnAfterLeave:Function,internalRenderBody:Function},slots:Object,__popover__:!0,setup(e){let t=Xg(),n=A(null),r=H(()=>e.show),i=A(e.defaultShow),a=Yg(r,i),o=Ng(()=>!e.disabled&&a.value),s=()=>{if(e.disabled)return!0;let{getDisabled:t}=e;return!!t?.()},c=()=>!s()&&a.value,l=Zg(e,[`arrow`,`showArrow`]),u=H(()=>!e.overlap&&l.value),d=null,f=A(null),p=A(null),m=Ng(()=>e.x!==void 0&&e.y!==void 0);function h(t){let{"onUpdate:show":n,onUpdateShow:r,onShow:a,onHide:o}=e;i.value=t,n&&$(n,t),r&&$(r,t),t&&a&&$(a,!0),t&&o&&$(o,!1)}function g(){d&&d.syncPosition()}function _(){let{value:e}=f;e&&(window.clearTimeout(e),f.value=null)}function v(){let{value:e}=p;e&&(window.clearTimeout(e),p.value=null)}function y(){let t=s();if(e.trigger===`focus`&&!t){if(c())return;h(!0)}}function b(){let t=s();if(e.trigger===`focus`&&!t){if(!c())return;h(!1)}}function x(){let t=s();if(e.trigger===`hover`&&!t){if(v(),f.value!==null||c())return;let t=()=>{h(!0),f.value=null},{delay:n}=e;n===0?t():f.value=window.setTimeout(t,n)}}function S(){let t=s();if(e.trigger===`hover`&&!t){if(_(),p.value!==null||!c())return;let t=()=>{h(!1),p.value=null},{duration:n}=e;n===0?t():p.value=window.setTimeout(t,n)}}function C(){S()}function w(t){c()&&(e.trigger===`click`&&(_(),v(),h(!1)),e.onClickoutside?.(t))}function T(){e.trigger===`click`&&!s()&&(_(),v(),h(!c()))}function E(t){e.internalTrapFocus&&t.key===`Escape`&&(_(),v(),h(!1))}function D(e){i.value=e}function O(){return n.value?.targetRef}function ee(e){d=e}return zn(`NPopover`,{getTriggerElement:O,handleKeydown:E,handleMouseEnter:x,handleMouseLeave:S,handleClickOutside:w,handleMouseMoveOutside:C,setBodyInstance:ee,positionManuallyRef:m,isMountedRef:t,zIndexRef:M(e,`zIndex`),extraClassRef:M(e,`internalExtraClass`),internalRenderBodyRef:M(e,`internalRenderBody`)}),Hn(()=>{a.value&&s()&&h(!1)}),{binderInstRef:n,positionManually:m,mergedShowConsideringDisabledProp:o,uncontrolledShow:i,mergedShowArrow:u,getMergedShow:c,setShow:D,handleClick:T,handleMouseEnter:x,handleMouseLeave:S,handleFocus:y,handleBlur:b,syncPosition:g}},render(){let{positionManually:e,$slots:t}=this,n,r=!1;if(!e&&(n=i_(t,`trigger`),n)){n=Oa(n),n=n.type===pa?ro(`span`,[n]):n;let t={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(n.type?.__popover__)r=!0,n.props||(n.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),n.props.internalSyncTargetWithParent=!0,n.props.internalInheritedEventHandlers?n.props.internalInheritedEventHandlers=[t,...n.props.internalInheritedEventHandlers]:n.props.internalInheritedEventHandlers=[t];else{let{internalInheritedEventHandlers:r}=this,i=[t,...r];Hy(n,r?`nested`:e?`manual`:this.trigger,{onBlur:e=>{i.forEach(t=>{t.onBlur(e)})},onFocus:e=>{i.forEach(t=>{t.onFocus(e)})},onClick:e=>{i.forEach(t=>{t.onClick(e)})},onMouseenter:e=>{i.forEach(t=>{t.onMouseenter(e)})},onMouseleave:e=>{i.forEach(t=>{t.onMouseleave(e)})}})}}return L(),z(P_,{ref:`binderInstRef`,syncTarget:!r,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;let t=this.getMergedShow();return[this.internalTrapFocus&&t?Ln((L(),R(`div`,zy)),[[U_,{enabled:t,zIndex:this.zIndex}]]):null,e?null:ro(F_,null,{default:()=>n}),ro(Ry,o_(this.$props,By,{...this.$attrs,showArrow:this.mergedShowArrow,show:t}),{default:()=>this.$slots.default?.(),header:()=>this.$slots.header?.(),footer:()=>this.$slots.footer?.()})]}},1032,[`syncTarget`,`syncTargetWithParent`])}}),Gy={closeIconSizeTiny:`12px`,closeIconSizeSmall:`12px`,closeIconSizeMedium:`14px`,closeIconSizeLarge:`14px`,closeSizeTiny:`16px`,closeSizeSmall:`16px`,closeSizeMedium:`18px`,closeSizeLarge:`18px`,padding:`0 7px`,closeMargin:`0 0 0 4px`};function Ky(e){return e.replace(/#|\\(|\\)|,|\\s|\\./g,`_`)}function qy(e,t){let n=F({render(){return t()}});return F({name:kf(e),setup(){let t=P(Nm,null)?.mergedIconsRef;return()=>{let r=t?.value?.[e];return r?r():(L(),z(n,{key:1}))}}})}var Jy=qy(`close`,()=>(()=>{let e=Jm(`6b30a2290cd08d4`);return e[0]||=B(`svg`,{viewBox:`0 0 12 12`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0},[B(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},[B(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},[B(`path`,{d:`M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z`})])])],-1)})()),Yy=W(`base-close`,`\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n background-color: transparent;\n color: var(--n-close-icon-color);\n border-radius: var(--n-close-border-radius);\n height: var(--n-close-size);\n width: var(--n-close-size);\n font-size: var(--n-close-icon-size);\n outline: none;\n border: none;\n position: relative;\n padding: 0;\n`,[K(`absolute`,`\n height: var(--n-close-icon-size);\n width: var(--n-close-icon-size);\n `),U(`&::before`,`\n content: "";\n position: absolute;\n width: var(--n-close-size);\n height: var(--n-close-size);\n left: 50%;\n top: 50%;\n transform: translateY(-50%) translateX(-50%);\n transition: inherit;\n border-radius: inherit;\n `),hc(`disabled`,[U(`&:hover`,`\n color: var(--n-close-icon-color-hover);\n `),U(`&:hover::before`,`\n background-color: var(--n-close-color-hover);\n `),U(`&:focus::before`,`\n background-color: var(--n-close-color-hover);\n `),U(`&:active`,`\n color: var(--n-close-icon-color-pressed);\n `),U(`&:active::before`,`\n background-color: var(--n-close-color-pressed);\n `)]),K(`disabled`,`\n cursor: not-allowed;\n color: var(--n-close-icon-color-disabled);\n background-color: transparent;\n `),K(`round`,[U(`&::before`,`\n border-radius: 50%;\n `)])]),Xy=F({name:`BaseClose`,props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return Km(`-base-close`,Yy,M(e,`clsPrefix`)),()=>{let{clsPrefix:t,disabled:n,absolute:r,round:i,isButtonTag:a}=e,o=a?`button`:`div`;return(()=>{let s=Jm(`b5bdc9fe09f5ae00`);return L(),z(o,{type:a?`button`:void 0,tabindex:n||!e.focusable?-1:0,"aria-disabled":n,"aria-label":`close`,role:a?void 0:`button`,disabled:n,class:Y([`${t}-base-close`,r&&`${t}-base-close--absolute`,n&&`${t}-base-close--disabled`,i&&`${t}-base-close--round`]),onMousedown:s[0]||=t=>{e.focusable||t.preventDefault()},onClick:e.onClick},{default:N(()=>[(L(),z(og,{clsPrefix:t},{default:()=>(L(),z(Jy))},1032,[`clsPrefix`]))]),_:2},1032,[`type`,`tabindex`,`aria-disabled`,`role`,`disabled`,`class`,`onClick`])})()}}});function Zy(e){let{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:i,infoColor:a,successColor:o,warningColor:s,errorColor:c,baseColor:l,borderColor:u,opacityDisabled:d,tagColor:f,closeIconColor:p,closeIconColorHover:m,closeIconColorPressed:h,borderRadiusSmall:g,fontSizeMini:_,fontSizeTiny:v,fontSizeSmall:y,fontSizeMedium:b,heightMini:x,heightTiny:S,heightSmall:C,heightMedium:w,closeColorHover:T,closeColorPressed:E,buttonColor2Hover:D,buttonColor2Pressed:O,fontWeightStrong:ee}=e;return{...Gy,closeBorderRadius:g,heightTiny:x,heightSmall:S,heightMedium:C,heightLarge:w,borderRadius:g,opacityDisabled:d,fontSizeTiny:_,fontSizeSmall:v,fontSizeMedium:y,fontSizeLarge:b,fontWeightStrong:ee,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:l,colorCheckable:`#0000`,colorHoverCheckable:D,colorPressedCheckable:O,colorChecked:i,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:t,color:f,colorBordered:`rgb(250, 250, 252)`,closeIconColor:p,closeIconColorHover:m,closeIconColorPressed:h,closeColorHover:T,closeColorPressed:E,borderPrimary:`1px solid ${X(i,{alpha:.3})}`,textColorPrimary:i,colorPrimary:X(i,{alpha:.12}),colorBorderedPrimary:X(i,{alpha:.1}),closeIconColorPrimary:i,closeIconColorHoverPrimary:i,closeIconColorPressedPrimary:i,closeColorHoverPrimary:X(i,{alpha:.12}),closeColorPressedPrimary:X(i,{alpha:.18}),borderInfo:`1px solid ${X(a,{alpha:.3})}`,textColorInfo:a,colorInfo:X(a,{alpha:.12}),colorBorderedInfo:X(a,{alpha:.1}),closeIconColorInfo:a,closeIconColorHoverInfo:a,closeIconColorPressedInfo:a,closeColorHoverInfo:X(a,{alpha:.12}),closeColorPressedInfo:X(a,{alpha:.18}),borderSuccess:`1px solid ${X(o,{alpha:.3})}`,textColorSuccess:o,colorSuccess:X(o,{alpha:.12}),colorBorderedSuccess:X(o,{alpha:.1}),closeIconColorSuccess:o,closeIconColorHoverSuccess:o,closeIconColorPressedSuccess:o,closeColorHoverSuccess:X(o,{alpha:.12}),closeColorPressedSuccess:X(o,{alpha:.18}),borderWarning:`1px solid ${X(s,{alpha:.35})}`,textColorWarning:s,colorWarning:X(s,{alpha:.15}),colorBorderedWarning:X(s,{alpha:.12}),closeIconColorWarning:s,closeIconColorHoverWarning:s,closeIconColorPressedWarning:s,closeColorHoverWarning:X(s,{alpha:.12}),closeColorPressedWarning:X(s,{alpha:.18}),borderError:`1px solid ${X(c,{alpha:.23})}`,textColorError:c,colorError:X(c,{alpha:.1}),colorBorderedError:X(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:X(c,{alpha:.12}),closeColorPressedError:X(c,{alpha:.18})}}var Qy={name:`Tag`,common:Jh,self:Zy},$y={color:Object,type:{type:String,default:`default`},round:Boolean,size:String,closable:Boolean,disabled:{type:Boolean,default:void 0}},eb=W(`tag`,`\n --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);\n white-space: nowrap;\n position: relative;\n box-sizing: border-box;\n cursor: default;\n display: inline-flex;\n align-items: center;\n flex-wrap: nowrap;\n padding: var(--n-padding);\n border-radius: var(--n-border-radius);\n color: var(--n-text-color);\n background-color: var(--n-color);\n transition: \n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n opacity .3s var(--n-bezier);\n line-height: 1;\n height: var(--n-height);\n font-size: var(--n-font-size);\n`,[K(`strong`,`\n font-weight: var(--n-font-weight-strong);\n `),G(`border`,`\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n border-radius: inherit;\n border: var(--n-border);\n transition: border-color .3s var(--n-bezier);\n `),G(`icon`,`\n display: flex;\n margin: 0 4px 0 0;\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n font-size: var(--n-avatar-size-override);\n `),G(`avatar`,`\n display: flex;\n margin: 0 6px 0 0;\n `),G(`close`,`\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n `),K(`round`,`\n padding: 0 calc(var(--n-height) / 3);\n border-radius: calc(var(--n-height) / 2);\n `,[G(`icon`,`\n margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);\n `),G(`avatar`,`\n margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);\n `),K(`closable`,`\n padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);\n `)]),K(`icon, avatar`,[K(`round`,`\n padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2);\n `)]),K(`disabled`,`\n cursor: not-allowed !important;\n opacity: var(--n-opacity-disabled);\n `),K(`checkable`,`\n cursor: pointer;\n box-shadow: none;\n color: var(--n-text-color-checkable);\n background-color: var(--n-color-checkable);\n `,[hc(`disabled`,[U(`&:hover`,`background-color: var(--n-color-hover-checkable);`,[hc(`checked`,`color: var(--n-text-color-hover-checkable);`)]),U(`&:active`,`background-color: var(--n-color-pressed-checkable);`,[hc(`checked`,`color: var(--n-text-color-pressed-checkable);`)])]),K(`checked`,`\n color: var(--n-text-color-checked);\n background-color: var(--n-color-checked);\n `,[hc(`disabled`,[U(`&:hover`,`background-color: var(--n-color-checked-hover);`),U(`&:active`,`background-color: var(--n-color-checked-pressed);`)])])])]),tb=[`onClick`,`onMouseenter`,`onMouseleave`],nb={...Q.props,...$y,bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function},rb=Mm(`n-tag`),ib=F({name:`Tag`,props:nb,slots:Object,setup(e){let t=A(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:i,mergedRtlRef:a,mergedComponentPropsRef:o}=Pm(e),s=H(()=>e.size||o?.value?.Tag?.size||`medium`),c=Q(`Tag`,`-tag`,eb,Qy,e,r);zn(rb,{roundRef:M(e,`round`)});function l(){if(!e.disabled&&e.checkable){let{checked:t,onCheckedChange:n,onUpdateChecked:r,"onUpdate:checked":i}=e;r&&r(!t),i&&i(!t),n&&n(!t)}}function u(t){if(e.triggerClickOnClose||t.stopPropagation(),!e.disabled){let{onClose:n}=e;n&&$(n,t)}}let d={setTextContent(e){let{value:n}=t;n&&(n.textContent=e)}},f=v_(`Tag`,a,r),p=H(()=>{let{type:t,color:{color:r,textColor:i}={}}=e,a=s.value,{common:{cubicBezierEaseInOut:o},self:{padding:l,closeMargin:u,borderRadius:d,opacityDisabled:f,textColorCheckable:p,textColorHoverCheckable:m,textColorPressedCheckable:h,textColorChecked:g,colorCheckable:_,colorHoverCheckable:v,colorPressedCheckable:y,colorChecked:b,colorCheckedHover:x,colorCheckedPressed:S,closeBorderRadius:C,fontWeightStrong:w,[q(`colorBordered`,t)]:T,[q(`closeSize`,a)]:E,[q(`closeIconSize`,a)]:D,[q(`fontSize`,a)]:O,[q(`height`,a)]:ee,[q(`color`,t)]:te,[q(`textColor`,t)]:ne,[q(`border`,t)]:re,[q(`closeIconColor`,t)]:ie,[q(`closeIconColorHover`,t)]:ae,[q(`closeIconColorPressed`,t)]:oe,[q(`closeColorHover`,t)]:se,[q(`closeColorPressed`,t)]:ce}}=c.value,le=sh(u);return{"--n-font-weight-strong":w,"--n-avatar-size-override":`calc(${ee} - 8px)`,"--n-bezier":o,"--n-border-radius":d,"--n-border":re,"--n-close-icon-size":D,"--n-close-color-pressed":ce,"--n-close-color-hover":se,"--n-close-border-radius":C,"--n-close-icon-color":ie,"--n-close-icon-color-hover":ae,"--n-close-icon-color-pressed":oe,"--n-close-icon-color-disabled":ie,"--n-close-margin-top":le.top,"--n-close-margin-right":le.right,"--n-close-margin-bottom":le.bottom,"--n-close-margin-left":le.left,"--n-close-size":E,"--n-color":r||(n.value?T:te),"--n-color-checkable":_,"--n-color-checked":b,"--n-color-checked-hover":x,"--n-color-checked-pressed":S,"--n-color-hover-checkable":v,"--n-color-pressed-checkable":y,"--n-font-size":O,"--n-height":ee,"--n-opacity-disabled":f,"--n-padding":l,"--n-text-color":i||ne,"--n-text-color-checkable":p,"--n-text-color-checked":g,"--n-text-color-hover-checkable":m,"--n-text-color-pressed-checkable":h}}),m=i?tg(`tag`,H(()=>{let t=``,{type:r,color:{color:i,textColor:a}={}}=e;return t+=r[0],t+=s.value[0],i&&(t+=`a${Ky(i)}`),a&&(t+=`b${Ky(a)}`),n.value&&(t+=`c`),t}),p,e):void 0;return{...d,rtlEnabled:f,mergedClsPrefix:r,contentRef:t,mergedBordered:n,handleClick:l,handleCloseClick:u,cssVars:i?void 0:p,themeClass:m?.themeClass,onRender:m?.onRender}},render(){let{mergedClsPrefix:e,rtlEnabled:t,closable:n,color:{borderColor:r}={},round:i,onRender:a,$slots:o}=this;a?.();let s=h_(o.avatar,t=>t&&(L(),R(`div`,{class:Y(`${e}-tag__avatar`)},[J(()=>t)],2))),c=h_(o.icon,t=>t&&(L(),R(`div`,{class:Y(`${e}-tag__icon`)},[J(()=>t)],2)));return L(),R(`div`,{class:Y([`${e}-tag`,this.themeClass,{[`${e}-tag--rtl`]:t,[`${e}-tag--strong`]:this.strong,[`${e}-tag--disabled`]:this.disabled,[`${e}-tag--checkable`]:this.checkable,[`${e}-tag--checked`]:this.checkable&&this.checked,[`${e}-tag--round`]:i,[`${e}-tag--avatar`]:s,[`${e}-tag--icon`]:c,[`${e}-tag--closable`]:n}]),style:k(this.cssVars),onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},[J(()=>c||s),B(`span`,{class:Y(`${e}-tag__content`),ref:`contentRef`},[J(()=>this.$slots.default?.())],2),!this.checkable&&n?(L(),z(Xy,{key:0,clsPrefix:e,class:Y(`${e}-tag__close`),disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:i,isButtonTag:this.internalCloseIsButtonTag,absolute:!0},null,8,[`clsPrefix`,`class`,`disabled`,`onClick`,`focusable`,`round`,`isButtonTag`])):J(()=>null),!this.checkable&&this.mergedBordered?(L(),R(`div`,{key:2,class:Y(`${e}-tag__border`),style:k({borderColor:r})},null,6)):J(()=>null)],46,tb)}}),ab={paddingSingle:`0 26px 0 12px`,paddingMultiple:`3px 26px 0 12px`,clearSize:`16px`,arrowSize:`16px`},ob={iconMargin:`11px 8px 0 12px`,iconMarginRtl:`11px 12px 0 8px`,iconSize:`24px`,closeIconSize:`16px`,closeSize:`20px`,closeMargin:`13px 14px 0 0`,closeMarginRtl:`13px 0 0 14px`,padding:`13px`},sb=qy(`error`,()=>(()=>{let e=Jm(`550229f72e94547c`);return e[0]||=B(`svg`,{viewBox:`0 0 48 48`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},[B(`g`,{stroke:`none`,"stroke-width":`1`,"fill-rule":`evenodd`},[B(`g`,{"fill-rule":`nonzero`},[B(`path`,{d:`M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z`})])])],-1)})()),cb=qy(`info`,()=>(()=>{let e=Jm(`1d7d3032c5ab60`);return e[0]||=B(`svg`,{viewBox:`0 0 28 28`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},[B(`g`,{stroke:`none`,"stroke-width":`1`,"fill-rule":`evenodd`},[B(`g`,{"fill-rule":`nonzero`},[B(`path`,{d:`M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z`})])])],-1)})()),lb=qy(`success`,()=>(()=>{let e=Jm(`2d4548faff86b4af`);return e[0]||=B(`svg`,{viewBox:`0 0 48 48`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},[B(`g`,{stroke:`none`,"stroke-width":`1`,"fill-rule":`evenodd`},[B(`g`,{"fill-rule":`nonzero`},[B(`path`,{d:`M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z`})])])],-1)})()),ub=qy(`warning`,()=>(()=>{let e=Jm(`eb9505c3181fdf04`);return e[0]||=B(`svg`,{viewBox:`0 0 24 24`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},[B(`g`,{stroke:`none`,"stroke-width":`1`,"fill-rule":`evenodd`},[B(`g`,{"fill-rule":`nonzero`},[B(`path`,{d:`M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z`})])])],-1)})()),db=F({name:`FadeInExpandTransition`,props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function n(t){e.width?t.style.maxWidth=`${t.offsetWidth}px`:t.style.maxHeight=`${t.offsetHeight}px`,t.offsetWidth}function r(t){e.width?t.style.maxWidth=`0`:t.style.maxHeight=`0`,t.offsetWidth;let{onLeave:n}=e;n&&n()}function i(t){e.width?t.style.maxWidth=``:t.style.maxHeight=``;let{onAfterLeave:n}=e;n&&n()}function a(t){if(t.style.transition=`none`,e.width){let e=t.offsetWidth;t.style.maxWidth=`0`,t.offsetWidth,t.style.transition=``,t.style.maxWidth=`${e}px`}else if(e.reverse)t.style.maxHeight=`${t.offsetHeight}px`,t.offsetHeight,t.style.transition=``,t.style.maxHeight=`0`;else{let e=t.offsetHeight;t.style.maxHeight=`0`,t.offsetWidth,t.style.transition=``,t.style.maxHeight=`${e}px`}t.offsetWidth}function o(t){e.width?t.style.maxWidth=``:e.reverse||(t.style.maxHeight=``),e.onAfterEnter?.()}return()=>{let{group:s,width:c,appear:l,mode:u}=e,d=s?gs:yo,f={name:c?`fade-in-width-expand-transition`:`fade-in-height-expand-transition`,appear:l,onEnter:a,onAfterEnter:o,onBeforeLeave:n,onLeave:r,onAfterLeave:i};return s||(f.mode=u),ro(d,f,t)}}});function fb(e){let{lineHeight:t,borderRadius:n,fontWeightStrong:r,baseColor:i,dividerColor:a,actionColor:o,textColor1:s,textColor2:c,closeColorHover:l,closeColorPressed:u,closeIconColor:d,closeIconColorHover:f,closeIconColorPressed:p,infoColor:m,successColor:h,warningColor:g,errorColor:_,fontSize:v}=e;return{...ob,fontSize:v,lineHeight:t,titleFontWeight:r,borderRadius:n,border:`1px solid ${a}`,color:o,titleTextColor:s,iconColor:c,contentTextColor:c,closeBorderRadius:n,closeColorHover:l,closeColorPressed:u,closeIconColor:d,closeIconColorHover:f,closeIconColorPressed:p,borderInfo:`1px solid ${Fh(i,X(m,{alpha:.25}))}`,colorInfo:Fh(i,X(m,{alpha:.08})),titleTextColorInfo:s,iconColorInfo:m,contentTextColorInfo:c,closeColorHoverInfo:l,closeColorPressedInfo:u,closeIconColorInfo:d,closeIconColorHoverInfo:f,closeIconColorPressedInfo:p,borderSuccess:`1px solid ${Fh(i,X(h,{alpha:.25}))}`,colorSuccess:Fh(i,X(h,{alpha:.08})),titleTextColorSuccess:s,iconColorSuccess:h,contentTextColorSuccess:c,closeColorHoverSuccess:l,closeColorPressedSuccess:u,closeIconColorSuccess:d,closeIconColorHoverSuccess:f,closeIconColorPressedSuccess:p,borderWarning:`1px solid ${Fh(i,X(g,{alpha:.33}))}`,colorWarning:Fh(i,X(g,{alpha:.08})),titleTextColorWarning:s,iconColorWarning:g,contentTextColorWarning:c,closeColorHoverWarning:l,closeColorPressedWarning:u,closeIconColorWarning:d,closeIconColorHoverWarning:f,closeIconColorPressedWarning:p,borderError:`1px solid ${Fh(i,X(_,{alpha:.25}))}`,colorError:Fh(i,X(_,{alpha:.08})),titleTextColorError:s,iconColorError:_,contentTextColorError:c,closeColorHoverError:l,closeColorPressedError:u,closeIconColorError:d,closeIconColorHoverError:f,closeIconColorPressedError:p}}var pb={name:`Alert`,common:Jh,self:fb},{cubicBezierEaseInOut:mb,cubicBezierEaseOut:hb,cubicBezierEaseIn:gb}=Im;function _b({overflow:e=`hidden`,duration:t=`.3s`,originalTransition:n=``,leavingDelay:r=`0s`,foldPadding:i=!1,enterToProps:a=void 0,leaveToProps:o=void 0,reverse:s=!1}={}){let c=s?`leave`:`enter`,l=s?`enter`:`leave`;return[U(`&.fade-in-height-expand-transition-${l}-from,\n &.fade-in-height-expand-transition-${c}-to`,{...a,opacity:1}),U(`&.fade-in-height-expand-transition-${l}-to,\n &.fade-in-height-expand-transition-${c}-from`,{...o,opacity:0,marginTop:`0 !important`,marginBottom:`0 !important`,paddingTop:i?`0 !important`:void 0,paddingBottom:i?`0 !important`:void 0}),U(`&.fade-in-height-expand-transition-${l}-active`,`\n overflow: ${e};\n transition:\n max-height ${t} ${mb} ${r},\n opacity ${t} ${hb} ${r},\n margin-top ${t} ${mb} ${r},\n margin-bottom ${t} ${mb} ${r},\n padding-top ${t} ${mb} ${r},\n padding-bottom ${t} ${mb} ${r}\n ${n?`,${n}`:``}\n `),U(`&.fade-in-height-expand-transition-${c}-active`,`\n overflow: ${e};\n transition:\n max-height ${t} ${mb},\n opacity ${t} ${gb},\n margin-top ${t} ${mb},\n margin-bottom ${t} ${mb},\n padding-top ${t} ${mb},\n padding-bottom ${t} ${mb}\n ${n?`,${n}`:``}\n `)]}var vb=W(`alert`,`\n line-height: var(--n-line-height);\n border-radius: var(--n-border-radius);\n position: relative;\n transition: background-color .3s var(--n-bezier);\n background-color: var(--n-color);\n text-align: start;\n word-break: break-word;\n`,[G(`border`,`\n border-radius: inherit;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n transition: border-color .3s var(--n-bezier);\n border: var(--n-border);\n pointer-events: none;\n `),K(`closable`,[W(`alert-body`,[G(`title`,`\n padding-right: 24px;\n `)])]),G(`icon`,{color:`var(--n-icon-color)`}),W(`alert-body`,{padding:`var(--n-padding)`},[G(`title`,{color:`var(--n-title-text-color)`}),G(`content`,{color:`var(--n-content-text-color)`})]),_b({originalTransition:`transform .3s var(--n-bezier)`,enterToProps:{transform:`scale(1)`},leaveToProps:{transform:`scale(0.9)`}}),G(`icon`,`\n position: absolute;\n left: 0;\n top: 0;\n align-items: center;\n justify-content: center;\n display: flex;\n width: var(--n-icon-size);\n height: var(--n-icon-size);\n font-size: var(--n-icon-size);\n margin: var(--n-icon-margin);\n `),G(`close`,`\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n position: absolute;\n right: 0;\n top: 0;\n margin: var(--n-close-margin);\n `),K(`show-icon`,[W(`alert-body`,{paddingLeft:`calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))`})]),K(`right-adjust`,[W(`alert-body`,{paddingRight:`calc(var(--n-close-size) + var(--n-padding) + 2px)`})]),W(`alert-body`,`\n border-radius: var(--n-border-radius);\n transition: border-color .3s var(--n-bezier);\n `,[G(`title`,`\n transition: color .3s var(--n-bezier);\n font-size: 16px;\n line-height: 19px;\n font-weight: var(--n-title-font-weight);\n `,[U(`& +`,[G(`content`,{marginTop:`9px`})])]),G(`content`,{transition:`color .3s var(--n-bezier)`,fontSize:`var(--n-font-size)`})]),G(`icon`,{transition:`color .3s var(--n-bezier)`})]),yb=F({name:`Alert`,inheritAttrs:!1,props:{...Q.props,title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:`default`},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function},slots:Object,setup(e){let{mergedClsPrefixRef:t,mergedBorderedRef:n,inlineThemeDisabled:r,mergedRtlRef:i}=Pm(e),a=Q(`Alert`,`-alert`,vb,pb,e,t),o=v_(`Alert`,i,t),s=H(()=>{let{common:{cubicBezierEaseInOut:t},self:n}=a.value,{fontSize:r,borderRadius:i,titleFontWeight:o,lineHeight:s,iconSize:c,iconMargin:l,iconMarginRtl:u,closeIconSize:d,closeBorderRadius:f,closeSize:p,closeMargin:m,closeMarginRtl:h,padding:g}=n,{type:_}=e,{left:v,right:y}=sh(l);return{"--n-bezier":t,"--n-color":n[q(`color`,_)],"--n-close-icon-size":d,"--n-close-border-radius":f,"--n-close-color-hover":n[q(`closeColorHover`,_)],"--n-close-color-pressed":n[q(`closeColorPressed`,_)],"--n-close-icon-color":n[q(`closeIconColor`,_)],"--n-close-icon-color-hover":n[q(`closeIconColorHover`,_)],"--n-close-icon-color-pressed":n[q(`closeIconColorPressed`,_)],"--n-icon-color":n[q(`iconColor`,_)],"--n-border":n[q(`border`,_)],"--n-title-text-color":n[q(`titleTextColor`,_)],"--n-content-text-color":n[q(`contentTextColor`,_)],"--n-line-height":s,"--n-border-radius":i,"--n-font-size":r,"--n-title-font-weight":o,"--n-icon-size":c,"--n-icon-margin":l,"--n-icon-margin-rtl":u,"--n-close-size":p,"--n-close-margin":m,"--n-close-margin-rtl":h,"--n-padding":g,"--n-icon-margin-left":v,"--n-icon-margin-right":y}}),c=r?tg(`alert`,H(()=>e.type[0]),s,e):void 0,l=A(!0),u=()=>{let{onAfterLeave:t,onAfterHide:n}=e;t&&t(),n&&n()};return{rtlEnabled:o,mergedClsPrefix:t,mergedBordered:n,visible:l,handleCloseClick:()=>{Promise.resolve(e.onClose?.()).then(e=>{e!==!1&&(l.value=!1)})},handleAfterLeave:()=>{u()},mergedTheme:a,cssVars:r?void 0:s,themeClass:c?.themeClass,onRender:c?.onRender}},render(){return this.onRender?.(),L(),z(db,{onAfterLeave:this.handleAfterLeave},{default:()=>{let{mergedClsPrefix:e,$slots:t}=this,n={class:[`${e}-alert`,this.themeClass,this.closable&&`${e}-alert--closable`,this.showIcon&&`${e}-alert--show-icon`,!this.title&&this.closable&&`${e}-alert--right-adjust`,this.rtlEnabled&&`${e}-alert--rtl`],style:this.cssVars,role:`alert`};return this.visible?(L(),R(`div`,Fa({key:1},Fa(this.$attrs,n)),[J(()=>this.closable&&(L(),z(Xy,{clsPrefix:e,class:Y(`${e}-alert__close`),onClick:this.handleCloseClick},null,8,[`clsPrefix`,`class`,`onClick`]))),J(()=>this.bordered&&(L(),R(`div`,{class:Y(`${e}-alert__border`)},null,2))),J(()=>this.showIcon&&(L(),R(`div`,{class:Y(`${e}-alert__icon`),"aria-hidden":`true`},[J(()=>p_(t.icon,()=>[(L(),z(og,{clsPrefix:e},{default:()=>{switch(this.type){case`success`:return L(),z(lb,{key:3});case`info`:return L(),z(cb,{key:4});case`warning`:return L(),z(ub,{key:5});case`error`:return L(),z(sb,{key:6});default:return null}}},1032,[`clsPrefix`]))]))],2))),B(`div`,{class:Y([`${e}-alert-body`,this.mergedBordered&&`${e}-alert-body--bordered`])},[J(()=>h_(t.header,t=>{let n=t||this.title;return n?(L(),R(`div`,{key:2,class:Y(`${e}-alert-body__title`)},[J(()=>n)],2)):null})),J(()=>t.default&&(L(),R(`div`,{class:Y(`${e}-alert-body__content`)},[J(()=>t.default())],2)))],2)],16)):null}},1032,[`onAfterLeave`])}});function bb(e,t,n){let r=P(e,null);if(r===null)return;let i=Va()?.proxy;Un(n,a),a(n.value),zr(()=>{a(void 0,n.value)});function a(e,n){if(!r)return;let i=r[t];n!==void 0&&o(i,n),e!==void 0&&s(i,e)}function o(e,t){e[t]||(e[t]=[]),e[t].splice(e[t].findIndex(e=>e===i),1)}function s(e,t){e[t]||(e[t]=[]),~e[t].findIndex(e=>e===i)||e[t].push(i)}}function xb(e){switch(typeof e){case`string`:return e||void 0;case`number`:return String(e);default:return}}var Sb={paddingTiny:`0 8px`,paddingSmall:`0 10px`,paddingMedium:`0 12px`,paddingLarge:`0 14px`,clearSize:`16px`},Cb=Mm(`n-form-item`);function wb(e,{defaultSize:t=`medium`,mergedSize:n,mergedDisabled:r}={}){let i=P(Cb,null);zn(Cb,null);let a=H(n?()=>n(i):()=>{let{size:n}=e;if(n)return n;if(i){let{mergedSize:e}=i;if(e.value!==void 0)return e.value}return t}),o=H(r?()=>r(i):()=>{let{disabled:t}=e;return t===void 0?i?i.disabled.value:!1:t}),s=H(()=>{let{status:t}=e;return t||i?.mergedValidationStatus.value});return zr(()=>{i&&i.restoreValidation()}),{mergedSizeRef:a,mergedDisabledRef:o,mergedStatusRef:s,nTriggerFormBlur(){i&&i.handleContentBlur()},nTriggerFormChange(){i&&i.handleContentChange()},nTriggerFormFocus(){i&&i.handleContentFocus()},nTriggerFormInput(){i&&i.handleContentInput()}}}var Tb=F({name:`Eye`,render(){return(()=>{let e=Jm(`ae479a1970012861`);return e[0]||=B(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},[B(`path`,{d:`M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`}),B(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`})],-1)})()}}),Eb=F({name:`EyeOff`,render(){return(()=>{let e=Jm(`2c06203b450ce879`);return e[0]||=B(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},[B(`path`,{d:`M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z`,fill:`currentColor`}),B(`path`,{d:`M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z`,fill:`currentColor`}),B(`path`,{d:`M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z`,fill:`currentColor`}),B(`path`,{d:`M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z`,fill:`currentColor`}),B(`path`,{d:`M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z`,fill:`currentColor`})],-1)})()}}),Db=F({name:`BaseIconSwitchTransition`,setup(e,{slots:t}){let n=Xg();return()=>(L(),z(yo,{name:`icon-switch-transition`,appear:n.value},Qm(t),1032,[`appear`]))}}),Ob=qy(`clear`,()=>(()=>{let e=Jm(`c93f8499adf26ca3`);return e[0]||=B(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},[B(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},[B(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},[B(`path`,{d:`M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z`})])])],-1)})()),{cubicBezierEaseInOut:kb}=Im;function Ab({originalTransform:e=``,left:t=0,top:n=0,transition:r=`all .3s ${kb} !important`}={}){return[U(`&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to`,{transform:`${e} scale(0.75)`,left:t,top:n,opacity:0}),U(`&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from`,{transform:`scale(1) ${e}`,left:t,top:n,opacity:1}),U(`&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active`,{transformOrigin:`center`,position:`absolute`,left:t,top:n,transition:r})]}var jb=W(`base-clear`,`\n flex-shrink: 0;\n height: 1em;\n width: 1em;\n position: relative;\n`,[U(`>`,[G(`clear`,`\n font-size: var(--n-clear-size);\n height: 1em;\n width: 1em;\n cursor: pointer;\n color: var(--n-clear-color);\n transition: color .3s var(--n-bezier);\n display: flex;\n `,[U(`&:hover`,`\n color: var(--n-clear-color-hover)!important;\n `),U(`&:active`,`\n color: var(--n-clear-color-pressed)!important;\n `)]),G(`placeholder`,`\n display: flex;\n `),G(`clear, placeholder`,`\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n `,[Ab({originalTransform:`translateX(-50%) translateY(-50%)`,left:`50%`,top:`50%`})])])]),Mb=[`onClick`,`onMousedown`],Nb=F({name:`BaseClear`,props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return Km(`-base-clear`,jb,M(e,`clsPrefix`)),{handleMouseDown(e){e.preventDefault()}}},render(){let{clsPrefix:e}=this;return L(),R(`div`,{class:Y(`${e}-base-clear`)},[V(Db,null,{default:()=>this.show?(L(),R(`div`,{key:`dismiss`,class:Y(`${e}-base-clear__clear`),onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},[J(()=>p_(this.$slots.icon,()=>[(L(),z(og,{clsPrefix:e},{default:()=>(L(),z(Ob))},1032,[`clsPrefix`]))]))],42,Mb)):(L(),R(`div`,{key:`icon`,class:Y(`${e}-base-clear__placeholder`)},[J(()=>this.$slots.placeholder?.())],2))},1024)],2)}}),Pb=F({name:`ChevronDown`,render(){return(()=>{let e=Jm(`ae90ecf811a811ac`);return e[0]||=B(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[B(`path`,{d:`M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z`,fill:`currentColor`})],-1)})()}}),Fb=U([U(`@keyframes rotator`,`\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }`),W(`base-loading`,`\n position: relative;\n line-height: 0;\n width: 1em;\n height: 1em;\n `,[G(`transition-wrapper`,`\n position: absolute;\n width: 100%;\n height: 100%;\n `,[Ab()]),G(`placeholder`,`\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n `,[Ab({left:`50%`,top:`50%`,originalTransform:`translateX(-50%) translateY(-50%)`})]),G(`container`,`\n animation: rotator 3s linear infinite both;\n `,[G(`icon`,`\n height: 1em;\n width: 1em;\n `)])])]),Ib=[`viewBox`],Lb=[`values`,`dur`],Rb=[`stroke-width`,`cx`,`cy`,`r`,`stroke-dasharray`,`stroke-dashoffset`],zb=[`values`,`dur`],Bb=[`values`,`dur`],Vb=`1.6s`,Hb=F({name:`BaseLoading`,props:{clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0},scale:{type:Number,default:1},radius:{type:Number,default:100}},setup(e){Km(`-base-loading`,Fb,M(e,`clsPrefix`))},render(){let{clsPrefix:e,radius:t,strokeWidth:n,stroke:r,scale:i}=this,a=t/i;return L(),R(`div`,{class:Y(`${e}-base-loading`),role:`img`,"aria-label":`loading`},[V(Db,null,{default:()=>this.show?(L(),R(`div`,{key:`icon`,class:Y(`${e}-base-loading__transition-wrapper`)},[B(`div`,{class:Y(`${e}-base-loading__container`)},[(L(),R(`svg`,{class:Y(`${e}-base-loading__icon`),viewBox:`0 0 ${2*a} ${2*a}`,xmlns:`http://www.w3.org/2000/svg`,style:k({color:r})},[B(`g`,null,[B(`animateTransform`,{attributeName:`transform`,type:`rotate`,values:`0 ${a} ${a};270 ${a} ${a}`,begin:`0s`,dur:Vb,fill:`freeze`,repeatCount:`indefinite`},null,8,Lb),B(`circle`,{class:Y(`${e}-base-loading__icon`),fill:`none`,stroke:`currentColor`,"stroke-width":n,"stroke-linecap":`round`,cx:a,cy:a,r:t-n/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},[B(`animateTransform`,{attributeName:`transform`,type:`rotate`,values:`0 ${a} ${a};135 ${a} ${a};450 ${a} ${a}`,begin:`0s`,dur:Vb,fill:`freeze`,repeatCount:`indefinite`},null,8,zb),B(`animate`,{attributeName:`stroke-dashoffset`,values:`${5.67*t};${1.42*t};${5.67*t}`,begin:`0s`,dur:Vb,fill:`freeze`,repeatCount:`indefinite`},null,8,Bb)],10,Rb)])],14,Ib))],2)],2)):(L(),R(`div`,{key:`placeholder`,class:Y(`${e}-base-loading__placeholder`)},[J(()=>this.$slots.default?.())],2))},1024)],2)}}),Ub=F({name:`InternalSelectionSuffix`,props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:Boolean,onClear:Function},setup(e,{slots:t}){return()=>{let{clsPrefix:n}=e;return L(),z(Hb,{clsPrefix:n,class:Y(`${n}-base-suffix`),strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?(L(),z(Nb,{key:1,clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>(L(),z(og,{clsPrefix:n,class:Y(`${n}-base-suffix__arrow`)},{default:()=>p_(t.default,()=>[(L(),z(Pb))])},1032,[`clsPrefix`,`class`]))},1032,[`clsPrefix`,`show`,`onClear`])):null},1032,[`clsPrefix`,`class`,`show`])}}}),Wb=typeof document<`u`&&typeof window<`u`,Gb=Wb&&`chrome`in window;Wb&&navigator.userAgent.includes(`Firefox`);var Kb=Wb&&navigator.userAgent.includes(`Safari`)&&!Gb;function qb(e){let{textColor2:t,textColor3:n,textColorDisabled:r,primaryColor:i,primaryColorHover:a,inputColor:o,inputColorDisabled:s,borderColor:c,warningColor:l,warningColorHover:u,errorColor:d,errorColorHover:f,borderRadius:p,lineHeight:m,fontSizeTiny:h,fontSizeSmall:g,fontSizeMedium:_,fontSizeLarge:v,heightTiny:y,heightSmall:b,heightMedium:x,heightLarge:S,actionColor:C,clearColor:w,clearColorHover:T,clearColorPressed:E,placeholderColor:D,placeholderColorDisabled:O,iconColor:ee,iconColorDisabled:te,iconColorHover:ne,iconColorPressed:re,fontWeight:ie}=e;return{...Sb,fontWeight:ie,countTextColorDisabled:r,countTextColor:n,heightTiny:y,heightSmall:b,heightMedium:x,heightLarge:S,fontSizeTiny:h,fontSizeSmall:g,fontSizeMedium:_,fontSizeLarge:v,lineHeight:m,lineHeightTextarea:m,borderRadius:p,iconSize:`16px`,groupLabelColor:C,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:i,placeholderColor:D,placeholderColorDisabled:O,color:o,colorHover:o,colorDisabled:s,colorFocus:o,groupLabelBorder:`1px solid ${c}`,border:`1px solid ${c}`,borderHover:`1px solid ${a}`,borderDisabled:`1px solid ${c}`,borderFocus:`1px solid ${a}`,boxShadowFocus:`0 0 0 2px ${X(i,{alpha:.2})}`,loadingColor:i,loadingColorWarning:l,borderWarning:`1px solid ${l}`,borderHoverWarning:`1px solid ${u}`,colorFocusWarning:o,borderFocusWarning:`1px solid ${u}`,boxShadowFocusWarning:`0 0 0 2px ${X(l,{alpha:.2})}`,caretColorWarning:l,loadingColorError:d,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${f}`,colorFocusError:o,borderFocusError:`1px solid ${f}`,boxShadowFocusError:`0 0 0 2px ${X(d,{alpha:.2})}`,caretColorError:d,clearColor:w,clearColorHover:T,clearColorPressed:E,iconColor:ee,iconColorDisabled:te,iconColorHover:ne,iconColorPressed:re,suffixTextColor:t}}var Jb=rg({name:`Input`,common:Jh,peers:{Scrollbar:Zh},self:qb}),Yb=Mm(`n-input`),Xb=W(`input`,`\n max-width: 100%;\n cursor: text;\n line-height: 1.5;\n z-index: auto;\n outline: none;\n box-sizing: border-box;\n position: relative;\n display: inline-flex;\n border-radius: var(--n-border-radius);\n background-color: var(--n-color);\n transition: background-color .3s var(--n-bezier);\n font-size: var(--n-font-size);\n font-weight: var(--n-font-weight);\n --n-padding-vertical: calc((var(--n-height) - 1.5 * var(--n-font-size)) / 2);\n`,[G(`input, textarea`,`\n overflow: hidden;\n flex-grow: 1;\n position: relative;\n `),G(`input-el, textarea-el, input-mirror, textarea-mirror, separator, placeholder`,`\n box-sizing: border-box;\n font-size: inherit;\n line-height: 1.5;\n font-family: inherit;\n border: none;\n outline: none;\n background-color: #0000;\n text-align: inherit;\n transition:\n -webkit-text-fill-color .3s var(--n-bezier),\n caret-color .3s var(--n-bezier),\n color .3s var(--n-bezier),\n text-decoration-color .3s var(--n-bezier);\n `),G(`input-el, textarea-el`,`\n -webkit-appearance: none;\n scrollbar-width: none;\n width: 100%;\n min-width: 0;\n text-decoration-color: var(--n-text-decoration-color);\n color: var(--n-text-color);\n caret-color: var(--n-caret-color);\n background-color: transparent;\n `,[U(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,`\n width: 0;\n height: 0;\n display: none;\n `),U(`&::placeholder`,`\n color: #0000;\n -webkit-text-fill-color: transparent !important;\n `),U(`&:-webkit-autofill ~`,[G(`placeholder`,`display: none;`)])]),K(`round`,[hc(`textarea`,`border-radius: calc(var(--n-height) / 2);`)]),G(`placeholder`,`\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n overflow: hidden;\n color: var(--n-placeholder-color);\n `,[U(`span`,`\n width: 100%;\n display: inline-block;\n `)]),K(`textarea`,[G(`placeholder`,`overflow: visible;`)]),hc(`autosize`,`width: 100%;`),K(`autosize`,[G(`textarea-el, input-el`,`\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n `)]),W(`input-wrapper`,`\n overflow: hidden;\n display: inline-flex;\n flex-grow: 1;\n position: relative;\n padding-left: var(--n-padding-left);\n padding-right: var(--n-padding-right);\n `),G(`input-mirror`,`\n padding: 0;\n height: var(--n-height);\n line-height: var(--n-height);\n overflow: hidden;\n visibility: hidden;\n position: static;\n white-space: pre;\n pointer-events: none;\n `),G(`input-el`,`\n padding: 0;\n height: var(--n-height);\n line-height: var(--n-height);\n `,[U(`&[type=password]::-ms-reveal`,`display: none;`),U(`+`,[G(`placeholder`,`\n display: flex;\n align-items: center; \n `)])]),hc(`textarea`,[G(`placeholder`,`white-space: nowrap;`)]),G(`eye`,`\n display: flex;\n align-items: center;\n justify-content: center;\n transition: color .3s var(--n-bezier);\n `),K(`textarea`,`width: 100%;`,[W(`input-word-count`,`\n position: absolute;\n right: var(--n-padding-right);\n bottom: var(--n-padding-vertical);\n `),K(`resizable`,[W(`input-wrapper`,`\n resize: vertical;\n min-height: var(--n-height);\n `)]),G(`textarea-el, textarea-mirror, placeholder`,`\n height: 100%;\n padding-left: 0;\n padding-right: 0;\n padding-top: var(--n-padding-vertical);\n padding-bottom: var(--n-padding-vertical);\n word-break: break-word;\n display: inline-block;\n vertical-align: bottom;\n box-sizing: border-box;\n line-height: var(--n-line-height-textarea);\n margin: 0;\n resize: none;\n white-space: pre-wrap;\n scroll-padding-block-end: var(--n-padding-vertical);\n `),G(`textarea-mirror`,`\n width: 100%;\n pointer-events: none;\n overflow: hidden;\n visibility: hidden;\n position: static;\n white-space: pre-wrap;\n overflow-wrap: break-word;\n `)]),K(`pair`,[G(`input-el, placeholder`,`text-align: center;`),G(`separator`,`\n display: flex;\n align-items: center;\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n white-space: nowrap;\n `,[W(`icon`,`\n color: var(--n-icon-color);\n `),W(`base-icon`,`\n color: var(--n-icon-color);\n `)])]),K(`disabled`,`\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n `,[G(`border`,`border: var(--n-border-disabled);`),G(`input-el, textarea-el`,`\n cursor: not-allowed;\n color: var(--n-text-color-disabled);\n text-decoration-color: var(--n-text-color-disabled);\n `),G(`placeholder`,`color: var(--n-placeholder-color-disabled);`),G(`separator`,`color: var(--n-text-color-disabled);`,[W(`icon`,`\n color: var(--n-icon-color-disabled);\n `),W(`base-icon`,`\n color: var(--n-icon-color-disabled);\n `)]),W(`input-word-count`,`\n color: var(--n-count-text-color-disabled);\n `),G(`suffix, prefix`,`color: var(--n-text-color-disabled);`,[W(`icon`,`\n color: var(--n-icon-color-disabled);\n `),W(`internal-icon`,`\n color: var(--n-icon-color-disabled);\n `)])]),hc(`disabled`,[G(`eye`,`\n color: var(--n-icon-color);\n cursor: pointer;\n `,[U(`&:hover`,`\n color: var(--n-icon-color-hover);\n `),U(`&:active`,`\n color: var(--n-icon-color-pressed);\n `)]),U(`&:hover`,`background-color: var(--n-color-hover);`,[G(`state-border`,`border: var(--n-border-hover);`)]),K(`focus`,`background-color: var(--n-color-focus);`,[G(`state-border`,`\n border: var(--n-border-focus);\n box-shadow: var(--n-box-shadow-focus);\n `)])]),G(`border, state-border`,`\n box-sizing: border-box;\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n border-radius: inherit;\n border: var(--n-border);\n transition:\n box-shadow .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n `),G(`state-border`,`\n border-color: #0000;\n z-index: 1;\n `),G(`prefix`,`margin-right: 4px;`),G(`suffix`,`\n margin-left: 4px;\n `),G(`suffix, prefix`,`\n transition: color .3s var(--n-bezier);\n flex-wrap: nowrap;\n flex-shrink: 0;\n line-height: var(--n-height);\n white-space: nowrap;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--n-suffix-text-color);\n `,[W(`base-loading`,`\n font-size: var(--n-icon-size);\n margin: 0 2px;\n color: var(--n-loading-color);\n `),W(`base-clear`,`\n font-size: var(--n-icon-size);\n `,[G(`placeholder`,[W(`base-icon`,`\n transition: color .3s var(--n-bezier);\n color: var(--n-icon-color);\n font-size: var(--n-icon-size);\n `)])]),U(`>`,[W(`icon`,`\n transition: color .3s var(--n-bezier);\n color: var(--n-icon-color);\n font-size: var(--n-icon-size);\n `)]),W(`base-icon`,`\n font-size: var(--n-icon-size);\n `)]),W(`input-word-count`,`\n pointer-events: none;\n line-height: 1.5;\n font-size: .85em;\n color: var(--n-count-text-color);\n transition: color .3s var(--n-bezier);\n margin-left: 4px;\n font-variant: tabular-nums;\n `),[`warning`,`error`].map(e=>K(`${e}-status`,[hc(`disabled`,[W(`base-loading`,`\n color: var(--n-loading-color-${e})\n `),G(`input-el, textarea-el`,`\n caret-color: var(--n-caret-color-${e});\n `),G(`state-border`,`\n border: var(--n-border-${e});\n `),U(`&:hover`,[G(`state-border`,`\n border: var(--n-border-hover-${e});\n `)]),U(`&:focus`,`\n background-color: var(--n-color-focus-${e});\n `,[G(`state-border`,`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)]),K(`focus`,`\n background-color: var(--n-color-focus-${e});\n `,[G(`state-border`,`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)])])]))]),Zb=W(`input`,[K(`disabled`,[G(`input-el, textarea-el`,`\n -webkit-text-fill-color: var(--n-text-color-disabled);\n `)])]);function Qb(e){let t=0;for(let n of e)t++;return t}function $b(e){return e===``||e==null}function ex(e){let t=A(null);function n(){let{value:n}=e;if(!n?.focus){i();return}let{selectionStart:r,selectionEnd:a,value:o}=n;if(r==null||a==null){i();return}t.value={start:r,end:a,beforeText:o.slice(0,r),afterText:o.slice(a)}}function r(){let{value:n}=t,{value:r}=e;if(!n||!r)return;let{value:i}=r,{start:a,beforeText:o,afterText:s}=n,c=i.length;if(i.endsWith(s))c=i.length-s.length;else if(i.startsWith(o))c=o.length;else{let e=o[a-1],t=i.indexOf(e,a-1);t!==-1&&(c=t+1)}r.setSelectionRange?.(c,c)}function i(){t.value=null}return Un(e,i),{recordCursor:n,restoreCursor:r}}var tx=F({name:`InputWordCount`,setup(e,{slots:t}){let{mergedValueRef:n,maxlengthRef:r,mergedClsPrefixRef:i,countGraphemesRef:a}=P(Yb),o=H(()=>{let{value:e}=n;return e===null||Array.isArray(e)?0:(a.value||Qb)(e)});return()=>{let{value:e}=r,{value:a}=n;return L(),R(`span`,{class:Y(`${i.value}-input-word-count`)},[J(()=>m_(t.default,{value:a===null||Array.isArray(a)?``:a},()=>[e===void 0?o.value:`${o.value} / ${e}`]))],2)}}}),nx=[`autofocus`,`rows`,`placeholder`,`value`,`disabled`,`maxlength`,`minlength`,`readonly`,`tabindex`,`onBlur`,`onFocus`,`onInput`,`onChange`,`onScroll`],rx=[`type`,`tabindex`,`placeholder`,`disabled`,`maxlength`,`minlength`,`value`,`readonly`,`autofocus`,`size`,`onBlur`,`onFocus`,`onInput`,`onChange`],ix=[`onMousedown`,`onClick`],ax=[`type`,`tabindex`,`placeholder`,`disabled`,`maxlength`,`minlength`,`value`,`readonly`,`onBlur`,`onFocus`,`onInput`,`onChange`],ox=[`tabindex`,`onFocus`,`onBlur`,`onClick`,`onMousedown`,`onMouseenter`,`onMouseleave`,`onCompositionstart`,`onCompositionend`,`onKeyup`,`onKeydown`],sx=F({name:`Input`,props:{...Q.props,bordered:{type:Boolean,default:void 0},type:{type:String,default:`text`},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean},slots:Object,setup(e){let{mergedClsPrefixRef:t,mergedBorderedRef:n,inlineThemeDisabled:r,mergedRtlRef:i,mergedComponentPropsRef:a}=Pm(e),o=Q(`Input`,`-input`,Xb,Jb,e,t);Kb&&Km(`-input-safari`,Zb,t);let s=A(null),c=A(null),l=A(null),u=A(null),d=A(null),f=A(null),p=A(null),m=ex(p),h=A(null),{localeRef:g}=ng(`Input`),_=A(e.defaultValue),v=Yg(M(e,`value`),_),y=wb(e,{mergedSize:t=>{let{size:n}=e;if(n)return n;let{mergedSize:r}=t||{};return r?.value?r.value:a?.value?.Input?.size||`medium`}}),{mergedSizeRef:b,mergedDisabledRef:x,mergedStatusRef:S}=y,C=A(!1),w=A(!1),T=A(!1),E=A(!1),D=null,O=H(()=>{let{placeholder:t,pair:n}=e;return n?Array.isArray(t)?t:t===void 0?[``,``]:[t,t]:t===void 0?[g.value.placeholder]:[t]}),ee=H(()=>{let{value:e}=T,{value:t}=v,{value:n}=O;return!e&&($b(t)||Array.isArray(t)&&$b(t[0]))&&n[0]}),te=H(()=>{let{value:e}=T,{value:t}=v,{value:n}=O;return!e&&n[1]&&($b(t)||Array.isArray(t)&&$b(t[1]))}),ne=Ng(()=>e.internalForceFocus||C.value),re=Ng(()=>{if(x.value||e.readonly||!e.clearable||!ne.value&&!w.value)return!1;let{value:t}=v,{value:n}=ne;return e.pair?!!(Array.isArray(t)&&(t[0]||t[1]))&&(w.value||n):!!t&&(w.value||n)}),ie=H(()=>{let{showPasswordOn:t}=e;if(t)return t;if(e.showPasswordToggle)return`click`}),ae=A(!1),oe=H(()=>{let{textDecoration:t}=e;return t?Array.isArray(t)?t.map(e=>({textDecoration:e})):[{textDecoration:t}]:[``,``]}),se=A(void 0),ce=()=>{if(e.type===`textarea`){let{autosize:t}=e;if(t&&(se.value=h.value?.$el?.offsetWidth),!c.value||typeof t==`boolean`)return;let{paddingTop:n,paddingBottom:r,lineHeight:i}=window.getComputedStyle(c.value),a=Number(n.slice(0,-2)),o=Number(r.slice(0,-2)),s=Number(i.slice(0,-2)),{value:u}=l;if(!u)return;if(t.minRows){let e=Math.max(t.minRows,1),n=`${a+o+s*e}px`;u.style.minHeight=n}if(t.maxRows){let e=`${a+o+s*t.maxRows}px`;u.style.maxHeight=e}}},le=H(()=>{let{maxlength:t}=e;return t===void 0?void 0:Number(t)});Ir(()=>{let{value:e}=v;Array.isArray(e)||Xe(e)});let ue=Va().proxy;function k(t,n){let{onUpdateValue:r,"onUpdate:value":i,onInput:a}=e,{nTriggerFormInput:o}=y;r&&$(r,t,n),i&&$(i,t,n),a&&$(a,t,n),_.value=t,o()}function de(t,n){let{onChange:r}=e,{nTriggerFormChange:i}=y;r&&$(r,t,n),_.value=t,i()}function fe(t){let{onBlur:n}=e,{nTriggerFormBlur:r}=y;n&&$(n,t),r()}function pe(t){let{onFocus:n}=e,{nTriggerFormFocus:r}=y;n&&$(n,t),r()}function me(t){let{onClear:n}=e;n&&$(n,t)}function he(t){let{onInputBlur:n}=e;n&&$(n,t)}function ge(t){let{onInputFocus:n}=e;n&&$(n,t)}function _e(){let{onDeactivate:t}=e;t&&$(t)}function ve(){let{onActivate:t}=e;t&&$(t)}function ye(t){let{onClick:n}=e;n&&$(n,t)}function be(t){let{onWrapperFocus:n}=e;n&&$(n,t)}function xe(t){let{onWrapperBlur:n}=e;n&&$(n,t)}function Se(){T.value=!0}function Ce(e){T.value=!1,e.target===f.value?we(e,1):we(e,0)}function we(t,n=0,r=`input`){let i=t.target.value;if(Xe(i),t instanceof InputEvent&&!t.isComposing&&(T.value=!1),e.type===`textarea`){let{value:e}=h;e&&e.syncUnifiedContainer()}if(D=i,T.value)return;m.recordCursor();let a=Te(i);if(a){if(!e.pair)r===`input`?k(i,{source:n}):de(i,{source:n});else{let{value:e}=v;e=Array.isArray(e)?[e[0],e[1]]:[``,``],e[n]=i,r===`input`?k(e,{source:n}):de(e,{source:n})}}ue.$forceUpdate(),a||Tn(m.restoreCursor)}function Te(t){let{countGraphemes:n,maxlength:r,minlength:i}=e;if(n){let e;if(r!==void 0&&(e===void 0&&(e=n(t)),e>Number(r))||i!==void 0&&(e===void 0&&(e=n(t)),e<Number(r)))return!1}let{allowInput:a}=e;return typeof a!=`function`||a(t)}function Ee(e){he(e),e.relatedTarget===s.value&&_e(),(e.relatedTarget===null||e.relatedTarget!==d.value&&e.relatedTarget!==f.value&&e.relatedTarget!==c.value)&&(E.value=!1),Ae(e,`blur`),p.value=null}function De(e,t){ge(e),C.value=!0,E.value=!0,ve(),Ae(e,`focus`),t===0?p.value=d.value:t===1?p.value=f.value:t===2&&(p.value=c.value)}function Oe(t){e.passivelyActivated&&(xe(t),Ae(t,`blur`))}function ke(t){e.passivelyActivated&&(C.value=!0,be(t),Ae(t,`focus`))}function Ae(e,t){e.relatedTarget!==null&&(e.relatedTarget===d.value||e.relatedTarget===f.value||e.relatedTarget===c.value||e.relatedTarget===s.value)||(t===`focus`?(pe(e),C.value=!0):t===`blur`&&(fe(e),C.value=!1))}function je(e,t){we(e,t,`change`)}function Me(e){ye(e)}function Ne(e){me(e),Pe()}function Pe(){e.pair?(k([``,``],{source:`clear`}),de([``,``],{source:`clear`})):(k(``,{source:`clear`}),de(``,{source:`clear`}))}function Fe(t){let{onMousedown:n}=e;n&&n(t);let{tagName:r}=t.target;if(r!==`INPUT`&&r!==`TEXTAREA`){if(e.resizable){let{value:e}=s;if(e){let{left:n,top:r,width:i,height:a}=e.getBoundingClientRect();if(n+i-14<t.clientX&&t.clientX<n+i&&r+a-14<t.clientY&&t.clientY<r+a)return}}t.preventDefault(),C.value||We()}}function Ie(){w.value=!0,e.type===`textarea`&&h.value?.handleMouseEnterWrapper()}function Le(){w.value=!1,e.type===`textarea`&&h.value?.handleMouseLeaveWrapper()}function Re(){x.value||ie.value===`click`&&(ae.value=!ae.value)}function ze(e){if(x.value)return;e.preventDefault();let t=e=>{e.preventDefault(),jg(`mouseup`,document,t)};if(Ag(`mouseup`,document,t),ie.value!==`mousedown`)return;ae.value=!0;let n=()=>{ae.value=!1,jg(`mouseup`,document,n)};Ag(`mouseup`,document,n)}function Be(t){e.onKeyup&&$(e.onKeyup,t)}function Ve(t){switch(e.onKeydown&&$(e.onKeydown,t),t.key){case`Escape`:Ue();break;case`Enter`:He(t)}}function He(t){if(e.passivelyActivated){let{value:n}=E;if(n){e.internalDeactivateOnEnter&&Ue();return}t.preventDefault(),e.type===`textarea`?c.value?.focus():d.value?.focus()}}function Ue(){e.passivelyActivated&&(E.value=!1,Tn(()=>{s.value?.focus()}))}function We(){x.value||(e.passivelyActivated?s.value?.focus():(c.value?.focus(),d.value?.focus()))}function Ge(){s.value?.contains(document.activeElement)&&document.activeElement.blur()}function Ke(){c.value?.select(),d.value?.select()}function qe(){x.value||(c.value?c.value.focus():d.value&&d.value.focus())}function Je(){let{value:e}=s;e?.contains(document.activeElement)&&e!==document.activeElement&&Ue()}function Ye(t){if(e.type===`textarea`){let{value:e}=c;e?.scrollTo(t)}else{let{value:e}=d;e?.scrollTo(t)}}function Xe(t){let{type:n,pair:r,autosize:i}=e;if(!r&&i){if(n===`textarea`){let{value:e}=l;e&&(e.textContent=`${t??``}\\r\\n`)}else{let{value:e}=u;e&&(t?e.textContent=t:e.innerHTML=` `)}}}function Ze(){ce()}let Qe=A({top:`0`});function $e(e){let{scrollTop:t}=e.target;Qe.value.top=`${-t}px`,h.value?.syncUnifiedContainer()}let et=null;Hn(()=>{let{autosize:t,type:n}=e;t&&n===`textarea`?et=Un(v,e=>{!Array.isArray(e)&&e!==D&&Xe(e)}):et?.()});let tt=null;Hn(()=>{e.type===`textarea`?tt=Un(v,e=>{!Array.isArray(e)&&e!==D&&h.value?.syncUnifiedContainer()}):tt?.()}),zn(Yb,{mergedValueRef:v,maxlengthRef:le,mergedClsPrefixRef:t,countGraphemesRef:M(e,`countGraphemes`)});let nt={wrapperElRef:s,inputElRef:d,textareaElRef:c,isCompositing:T,clear:Pe,focus:We,blur:Ge,select:Ke,deactivate:Je,activate:qe,scrollTo:Ye},rt=v_(`Input`,i,t),it=H(()=>{let{value:e}=b,{common:{cubicBezierEaseInOut:t},self:{color:n,colorHover:r,borderRadius:i,textColor:a,caretColor:s,caretColorError:c,caretColorWarning:l,textDecorationColor:u,border:d,borderDisabled:f,borderHover:p,borderFocus:m,placeholderColor:h,placeholderColorDisabled:g,lineHeightTextarea:_,colorDisabled:v,colorFocus:y,textColorDisabled:x,boxShadowFocus:S,iconSize:C,colorFocusWarning:w,boxShadowFocusWarning:T,borderWarning:E,borderFocusWarning:D,borderHoverWarning:O,colorFocusError:ee,boxShadowFocusError:te,borderError:ne,borderFocusError:re,borderHoverError:ie,clearSize:ae,clearColor:oe,clearColorHover:se,clearColorPressed:ce,iconColor:le,iconColorDisabled:ue,suffixTextColor:k,countTextColor:de,countTextColorDisabled:fe,iconColorHover:pe,iconColorPressed:me,loadingColor:he,loadingColorError:ge,loadingColorWarning:_e,fontWeight:ve,[q(`padding`,e)]:ye,[q(`fontSize`,e)]:be,[q(`height`,e)]:xe}}=o.value,{left:Se,right:Ce}=sh(ye);return{"--n-bezier":t,"--n-count-text-color":de,"--n-count-text-color-disabled":fe,"--n-color":n,"--n-color-hover":r,"--n-font-size":be,"--n-font-weight":ve,"--n-border-radius":i,"--n-height":xe,"--n-padding-left":Se,"--n-padding-right":Ce,"--n-text-color":a,"--n-caret-color":s,"--n-text-decoration-color":u,"--n-border":d,"--n-border-disabled":f,"--n-border-hover":p,"--n-border-focus":m,"--n-placeholder-color":h,"--n-placeholder-color-disabled":g,"--n-icon-size":C,"--n-line-height-textarea":_,"--n-color-disabled":v,"--n-color-focus":y,"--n-text-color-disabled":x,"--n-box-shadow-focus":S,"--n-loading-color":he,"--n-caret-color-warning":l,"--n-color-focus-warning":w,"--n-box-shadow-focus-warning":T,"--n-border-warning":E,"--n-border-focus-warning":D,"--n-border-hover-warning":O,"--n-loading-color-warning":_e,"--n-caret-color-error":c,"--n-color-focus-error":ee,"--n-box-shadow-focus-error":te,"--n-border-error":ne,"--n-border-focus-error":re,"--n-border-hover-error":ie,"--n-loading-color-error":ge,"--n-clear-color":oe,"--n-clear-size":ae,"--n-clear-color-hover":se,"--n-clear-color-pressed":ce,"--n-icon-color":le,"--n-icon-color-hover":pe,"--n-icon-color-pressed":me,"--n-icon-color-disabled":ue,"--n-suffix-text-color":k}}),at=r?tg(`input`,H(()=>{let{value:e}=b;return e[0]}),it,e):void 0;return{...nt,wrapperElRef:s,inputElRef:d,inputMirrorElRef:u,inputEl2Ref:f,textareaElRef:c,textareaMirrorElRef:l,textareaScrollbarInstRef:h,rtlEnabled:rt,uncontrolledValue:_,mergedValue:v,passwordVisible:ae,mergedPlaceholder:O,showPlaceholder1:ee,showPlaceholder2:te,mergedFocus:ne,isComposing:T,activated:E,showClearButton:re,mergedSize:b,mergedDisabled:x,textDecorationStyle:oe,mergedClsPrefix:t,mergedBordered:n,mergedShowPasswordOn:ie,placeholderStyle:Qe,mergedStatus:S,textAreaScrollContainerWidth:se,handleTextAreaScroll:$e,handleCompositionStart:Se,handleCompositionEnd:Ce,handleInput:we,handleInputBlur:Ee,handleInputFocus:De,handleWrapperBlur:Oe,handleWrapperFocus:ke,handleMouseEnter:Ie,handleMouseLeave:Le,handleMouseDown:Fe,handleChange:je,handleClick:Me,handleClear:Ne,handlePasswordToggleClick:Re,handlePasswordToggleMousedown:ze,handleWrapperKeydown:Ve,handleWrapperKeyup:Be,handleTextAreaMirrorResize:Ze,getTextareaScrollContainer:()=>c.value,mergedTheme:o,cssVars:r?void 0:it,themeClass:at?.themeClass,onRender:at?.onRender}},render(){let{mergedClsPrefix:e,mergedStatus:t,themeClass:n,type:r,countGraphemes:i,onRender:a}=this,o=this.$slots;return a?.(),L(),R(`div`,{ref:`wrapperElRef`,class:Y([`${e}-input`,`${e}-input--${this.mergedSize}-size`,n,t&&`${e}-input--${t}-status`,{[`${e}-input--rtl`]:this.rtlEnabled,[`${e}-input--disabled`]:this.mergedDisabled,[`${e}-input--textarea`]:r===`textarea`,[`${e}-input--resizable`]:this.resizable&&!this.autosize,[`${e}-input--autosize`]:this.autosize,[`${e}-input--round`]:this.round&&r!==`textarea`,[`${e}-input--pair`]:this.pair,[`${e}-input--focus`]:this.mergedFocus,[`${e}-input--stateful`]:this.stateful}]),style:k(this.cssVars),tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},[B(`div`,{class:Y(`${e}-input-wrapper`)},[J(()=>h_(o.prefix,t=>t&&(L(),R(`div`,{class:Y(`${e}-input__prefix`)},[J(()=>t)],2)))),r===`textarea`?(L(),z(ky,{key:0,ref:`textareaScrollbarInstRef`,class:Y(`${e}-input__textarea`),container:this.getTextareaScrollContainer,theme:this.theme?.peers?.Scrollbar,themeOverrides:this.themeOverrides?.peers?.Scrollbar,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{let{textAreaScrollContainerWidth:t}=this,n={width:this.autosize&&t&&`${t}px`};return L(),R(I,null,[B(`textarea`,Fa(this.inputProps,{ref:`textareaElRef`,class:[`${e}-input__textarea-el`,this.inputProps?.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],this.inputProps?.style,n],onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll}),null,16,nx),this.showPlaceholder1?(L(),R(`div`,{class:Y(`${e}-input__placeholder`),style:k([this.placeholderStyle,n]),key:`placeholder`},[J(()=>this.mergedPlaceholder[0])],6)):J(()=>null),this.autosize?(L(),z(oy,{key:2,onResize:this.handleTextAreaMirrorResize},{default:()=>(L(),R(`div`,{ref:`textareaMirrorElRef`,class:Y(`${e}-input__textarea-mirror`),key:`mirror`},null,2))},1032,[`onResize`])):J(()=>null)],64)}},1032,[`class`,`container`,`theme`,`themeOverrides`])):(L(),R(`div`,{key:1,class:Y(`${e}-input__input`)},[B(`input`,Fa({type:r===`password`&&this.mergedShowPasswordOn&&this.passwordVisible?`text`:r},this.inputProps,{ref:`inputElRef`,class:[`${e}-input__input-el`,this.inputProps?.class],style:[this.textDecorationStyle[0],this.inputProps?.style],tabindex:this.passivelyActivated&&!this.activated?-1:this.inputProps?.tabindex,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,0)},onInput:e=>{this.handleInput(e,0)},onChange:e=>{this.handleChange(e,0)}}),null,16,rx),this.showPlaceholder1?(L(),R(`div`,{key:0,class:Y(`${e}-input__placeholder`)},[B(`span`,null,[J(()=>this.mergedPlaceholder[0])])],2)):J(()=>null),this.autosize?(L(),R(`div`,{class:Y(`${e}-input__input-mirror`),key:`mirror`,ref:`inputMirrorElRef`},`\\xA0`,2)):J(()=>null)],2)),J(()=>!this.pair&&h_(o.suffix,t=>t||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?(L(),R(`div`,{key:1,class:Y(`${e}-input__suffix`)},[J(()=>[h_(o[`clear-icon-placeholder`],t=>(this.clearable||t)&&(L(),z(Nb,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>t,icon:()=>this.$slots[`clear-icon`]?.()},1032,[`clsPrefix`,`show`,`onClear`]))),this.internalLoadingBeforeSuffix?null:t,this.loading===void 0?null:(L(),z(Ub,{key:2,clsPrefix:e,loading:this.loading,showArrow:!1,showClear:!1,style:k(this.cssVars)},null,8,[`clsPrefix`,`loading`,`style`])),this.internalLoadingBeforeSuffix?t:null,this.showCount&&this.type!==`textarea`?(L(),z(tx,{key:3},{default:e=>{let{renderCount:t}=this;return t?t(e):o.count?.(e)}},1024)):null,this.mergedShowPasswordOn&&this.type===`password`?(L(),R(`div`,{key:4,class:Y(`${e}-input__eye`),onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},[this.passwordVisible?(L(),R(I,{key:0},[J(()=>p_(o[`password-visible-icon`],()=>[(L(),z(og,{clsPrefix:e},{default:()=>(L(),z(Tb))},1032,[`clsPrefix`]))]))],64)):(L(),R(I,{key:1},[J(()=>p_(o[`password-invisible-icon`],()=>[(L(),z(og,{clsPrefix:e},{default:()=>(L(),z(Eb))},1032,[`clsPrefix`]))]))],64))],42,ix)):null])],2)):null))],2),this.pair?(L(),R(`span`,{key:0,class:Y(`${e}-input__separator`)},[J(()=>p_(o.separator,()=>[this.separator]))],2)):J(()=>null),this.pair?(L(),R(`div`,{key:2,class:Y(`${e}-input-wrapper`)},[B(`div`,{class:Y(`${e}-input__input`)},[B(`input`,{ref:`inputEl2Ref`,type:this.type,class:Y(`${e}-input__input-el`),tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:i?void 0:this.maxlength,minlength:i?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:k(this.textDecorationStyle[1]),onBlur:this.handleInputBlur,onFocus:e=>{this.handleInputFocus(e,1)},onInput:e=>{this.handleInput(e,1)},onChange:e=>{this.handleChange(e,1)}},null,46,ax),this.showPlaceholder2?(L(),R(`div`,{key:0,class:Y(`${e}-input__placeholder`)},[B(`span`,null,[J(()=>this.mergedPlaceholder[1])])],2)):J(()=>null)],2),J(()=>h_(o.suffix,t=>(this.clearable||t)&&(L(),R(`div`,{class:Y(`${e}-input__suffix`)},[J(()=>[this.clearable&&(L(),z(Nb,{clsPrefix:e,show:this.showClearButton,onClear:this.handleClear},{icon:()=>o[`clear-icon`]?.(),placeholder:()=>o[`clear-icon-placeholder`]?.()},1032,[`clsPrefix`,`show`,`onClear`])),t])],2))))],2)):J(()=>null),this.mergedBordered?(L(),R(`div`,{key:4,class:Y(`${e}-input__border`)},null,2)):J(()=>null),this.mergedBordered?(L(),R(`div`,{key:6,class:Y(`${e}-input__state-border`)},null,2)):J(()=>null),this.showCount&&r===`textarea`?(L(),z(tx,{key:8},{default:e=>{let{renderCount:t}=this;return t?t(e):o.count?.(e)}},1024)):J(()=>null)],46,ox)}});function cx(e,t){t&&(Ir(()=>{let{value:n}=e;n&&ay.registerHandler(n,t)}),Un(e,(e,t)=>{t&&ay.unregisterHandler(t)},{deep:!1}),zr(()=>{let{value:t}=e;t&&ay.unregisterHandler(t)}))}var lx=F({props:{onFocus:Function,onBlur:Function},setup(e){return()=>(()=>{let t=Jm(`d16ead82505dc285`);return L(),R(`div`,{style:`width: 0; height: 0`,tabindex:0,onFocus:t[0]||=(...t)=>e.onFocus(...t),onBlur:t[1]||=(...t)=>e.onBlur(...t)},null,32)})()}});function ux(e,...t){return typeof e==`function`?e(...t):typeof e==`string`?ka(e):typeof e==`number`?ka(String(e)):null}var dx=F({name:`NBaseSelectGroupHeader`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){let{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:r}=P(gg);return{labelField:n,nodeProps:r,renderLabel:e,renderOption:t}},render(){let{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:r,tmNode:{rawNode:i}}=this,a=r?.(i),o=t?t(i,!1):ux(i[this.labelField],i,!1),s=(L(),R(`div`,Fa(a,{class:[`${e}-base-select-group-header`,a?.class]}),[J(()=>o)],16));return i.render?i.render({node:s,option:i}):n?n({node:s,option:i,selected:!1}):s}});function fx(e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?t[0]:t=>{e.forEach(e=>{e&&e(t)})}}var px=F({name:`Checkmark`,render(){return(()=>{let e=Jm(`3c84eac8ae4e1f96`);return e[0]||=B(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`},[B(`g`,{fill:`none`},[B(`path`,{d:`M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z`,fill:`currentColor`})])],-1)})()}}),mx=[`onClick`,`onMouseenter`,`onMousemove`];function hx(e,t){return L(),z(yo,{name:`fade-in-scale-up-transition`},{default:()=>e?(L(),z(og,{key:1,clsPrefix:t,class:Y(`${t}-base-select-option__check`)},{default:()=>ro(px)},1032,[`clsPrefix`,`class`])):null},1024)}var gx=F({name:`NBaseSelectOption`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){let{valueRef:t,pendingTmNodeRef:n,multipleRef:r,valueSetRef:i,renderLabelRef:a,renderOptionRef:o,labelFieldRef:s,valueFieldRef:c,showCheckmarkRef:l,nodePropsRef:u,handleOptionClick:d,handleOptionMouseEnter:f}=P(gg),p=Ng(()=>{let{value:t}=n;return t?e.tmNode.key===t.key:!1});function m(t){let{tmNode:n}=e;n.disabled||d(t,n)}function h(t){let{tmNode:n}=e;n.disabled||f(t,n)}function g(t){let{tmNode:n}=e,{value:r}=p;n.disabled||r||f(t,n)}return{multiple:r,isGrouped:Ng(()=>{let{tmNode:t}=e,{parent:n}=t;return n&&n.rawNode.type===`group`}),showCheckmark:l,nodeProps:u,isPending:p,isSelected:Ng(()=>{let{value:n}=t,{value:a}=r;if(n===null)return!1;let o=e.tmNode.rawNode[c.value];if(a){let{value:e}=i;return e.has(o)}return n===o}),labelField:s,renderLabel:a,renderOption:o,handleMouseMove:g,handleMouseEnter:h,handleClick:m}},render(){let{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:r,isGrouped:i,showCheckmark:a,nodeProps:o,renderOption:s,renderLabel:c,handleClick:l,handleMouseEnter:u,handleMouseMove:d}=this,f=hx(n,e),p=c?[c(t,n),a&&f]:[ux(t[this.labelField],t,n),a&&f],m=o?.(t),h=(L(),R(`div`,Fa(m,{class:[`${e}-base-select-option`,t.class,m?.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:i,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:a}],style:[m?.style||``,t.style||``],onClick:fx([l,m?.onClick]),onMouseenter:fx([u,m?.onMouseenter]),onMousemove:fx([d,m?.onMousemove])}),[B(`div`,{class:Y(`${e}-base-select-option__content`)},[J(()=>p)],2)],16,mx));return t.render?t.render({node:h,option:t,selected:n}):s?s({node:h,option:t,selected:n}):h}}),{cubicBezierEaseIn:_x,cubicBezierEaseOut:vx}=Im;function yx({transformOrigin:e=`inherit`,duration:t=`.2s`,enterScale:n=`.9`,originalTransform:r=``,originalTransition:i=``}={}){return[U(`&.fade-in-scale-up-transition-leave-active`,{transformOrigin:e,transition:`opacity ${t} ${_x}, transform ${t} ${_x} ${i&&`,${i}`}`}),U(`&.fade-in-scale-up-transition-enter-active`,{transformOrigin:e,transition:`opacity ${t} ${vx}, transform ${t} ${vx} ${i&&`,${i}`}`}),U(`&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to`,{opacity:0,transform:`${r} scale(${n})`}),U(`&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to`,{opacity:1,transform:`${r} scale(1)`})]}var bx=W(`base-select-menu`,`\n line-height: 1.5;\n outline: none;\n z-index: 0;\n position: relative;\n border-radius: var(--n-border-radius);\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n background-color: var(--n-color);\n`,[W(`scrollbar`,`\n max-height: var(--n-height);\n `),W(`virtual-list`,`\n max-height: var(--n-height);\n `),W(`base-select-option`,`\n min-height: var(--n-option-height);\n font-size: var(--n-option-font-size);\n display: flex;\n align-items: center;\n `,[G(`content`,`\n z-index: 1;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n `)]),W(`base-select-group-header`,`\n min-height: var(--n-option-height);\n font-size: .93em;\n display: flex;\n align-items: center;\n `),W(`base-select-menu-option-wrapper`,`\n position: relative;\n width: 100%;\n `),G(`loading, empty`,`\n display: flex;\n padding: 12px 32px;\n flex: 1;\n justify-content: center;\n `),G(`loading`,`\n color: var(--n-loading-color);\n font-size: var(--n-loading-size);\n `),G(`header`,`\n padding: 8px var(--n-option-padding-left);\n font-size: var(--n-option-font-size);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n border-bottom: 1px solid var(--n-action-divider-color);\n color: var(--n-action-text-color);\n `),G(`action`,`\n padding: 8px var(--n-option-padding-left);\n font-size: var(--n-option-font-size);\n transition: \n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n border-top: 1px solid var(--n-action-divider-color);\n color: var(--n-action-text-color);\n `),W(`base-select-group-header`,`\n position: relative;\n cursor: default;\n padding: var(--n-option-padding);\n color: var(--n-group-header-text-color);\n `),W(`base-select-option`,`\n cursor: pointer;\n position: relative;\n padding: var(--n-option-padding);\n transition:\n color .3s var(--n-bezier),\n opacity .3s var(--n-bezier);\n box-sizing: border-box;\n color: var(--n-option-text-color);\n opacity: 1;\n `,[K(`show-checkmark`,`\n padding-right: calc(var(--n-option-padding-right) + 20px);\n `),U(`&::before`,`\n content: "";\n position: absolute;\n left: 4px;\n right: 4px;\n top: 0;\n bottom: 0;\n border-radius: var(--n-border-radius);\n transition: background-color .3s var(--n-bezier);\n `),U(`&:active`,`\n color: var(--n-option-text-color-pressed);\n `),K(`grouped`,`\n padding-left: calc(var(--n-option-padding-left) * 1.5);\n `),K(`pending`,[U(`&::before`,`\n background-color: var(--n-option-color-pending);\n `)]),K(`selected`,`\n color: var(--n-option-text-color-active);\n `,[U(`&::before`,`\n background-color: var(--n-option-color-active);\n `),K(`pending`,[U(`&::before`,`\n background-color: var(--n-option-color-active-pending);\n `)])]),K(`disabled`,`\n cursor: not-allowed;\n `,[hc(`selected`,`\n color: var(--n-option-text-color-disabled);\n `),K(`selected`,`\n opacity: var(--n-option-opacity-disabled);\n `)]),G(`check`,`\n font-size: 16px;\n position: absolute;\n right: calc(var(--n-option-padding-right) - 4px);\n top: calc(50% - 7px);\n color: var(--n-option-check-color);\n transition: color .3s var(--n-bezier);\n `,[yx({enterScale:`0.5`})])])]);function xx(e){return Array.isArray(e)?e:[e]}var Sx={STOP:`STOP`};function Cx(e,t){let n=t(e);e.children!==void 0&&n!==Sx.STOP&&e.children.forEach(e=>Cx(e,t))}function wx(e,t={}){let{preserveGroup:n=!1}=t,r=[],i=n?e=>{e.isLeaf||(r.push(e.key),a(e.children))}:e=>{e.isLeaf||(e.isGroup||r.push(e.key),a(e.children))};function a(e){e.forEach(i)}return a(e),r}function Tx(e,t){let{isLeaf:n}=e;return n===void 0?!t(e):n}function Ex(e){return e.children}function Dx(e){return e.key}function Ox(){return!1}function kx(e,t){let{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function Ax(e){return e.disabled===!0}function jx(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function Mx(e){return e==null?[]:Array.isArray(e)?e:e.checkedKeys??[]}function Nx(e){return e==null||Array.isArray(e)?[]:e.indeterminateKeys??[]}function Px(e,t){let n=new Set(e);return t.forEach(e=>{n.has(e)||n.add(e)}),Array.from(n)}function Fx(e,t){let n=new Set(e);return t.forEach(e=>{n.has(e)&&n.delete(e)}),Array.from(n)}function Ix(e){return e?.type===`group`}function Lx(e){let t=new Map;return e.forEach((e,n)=>{t.set(e.key,n)}),e=>t.get(e)??null}var Rx=class extends Error{constructor(){super(),this.message=`SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded.`}};function zx(e,t,n,r){return Ux(t.concat(e),n,r,!1)}function Bx(e,t){let n=new Set;return e.forEach(e=>{let r=t.treeNodeMap.get(e);if(r!==void 0){let e=r.parent;for(;e!==null&&!(e.disabled||n.has(e.key));)n.add(e.key),e=e.parent}}),n}function Vx(e,t,n,r){let i=Ux(t,n,r,!1),a=Ux(e,n,r,!0),o=Bx(e,n),s=[];return i.forEach(e=>{(a.has(e)||o.has(e))&&s.push(e)}),s.forEach(e=>i.delete(e)),i}function Hx(e,t){let{checkedKeys:n,keysToCheck:r,keysToUncheck:i,indeterminateKeys:a,cascade:o,leafOnly:s,checkStrategy:c,allowNotLoaded:l}=e;if(!o)return r===void 0?i===void 0?{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)}:{checkedKeys:Fx(n,i),indeterminateKeys:Array.from(a)}:{checkedKeys:Px(n,r),indeterminateKeys:Array.from(a)};let{levelTreeNodeMap:u}=t,d;d=i===void 0?r===void 0?Ux(n,t,l,!1):zx(r,n,t,l):Vx(i,n,t,l);let f=c===`parent`,p=c===`child`||s,m=d,h=new Set,g=Math.max.apply(null,Array.from(u.keys()));for(let e=g;e>=0;--e){let t=e===0,n=u.get(e);for(let e of n){if(e.isLeaf)continue;let{key:n,shallowLoaded:r}=e;if(p&&r&&e.children.forEach(e=>{!e.disabled&&!e.isLeaf&&e.shallowLoaded&&m.has(e.key)&&m.delete(e.key)}),e.disabled||!r)continue;let i=!0,a=!1,o=!0;for(let t of e.children){let e=t.key;if(!t.disabled){if(o&&=!1,m.has(e))a=!0;else if(h.has(e)){a=!0,i=!1;break}else if(i=!1,a)break}}i&&!o?(f&&e.children.forEach(e=>{!e.disabled&&m.has(e.key)&&m.delete(e.key)}),m.add(n)):a&&h.add(n),t&&p&&m.has(n)&&m.delete(n)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(h)}}function Ux(e,t,n,r){let{treeNodeMap:i,getChildren:a}=t,o=new Set,s=new Set(e);return e.forEach(e=>{let t=i.get(e);t!==void 0&&Cx(t,e=>{if(e.disabled)return Sx.STOP;let{key:t}=e;if(!o.has(t)&&(o.add(t),s.add(t),jx(e.rawNode,a))){if(r)return Sx.STOP;if(!n)throw new Rx}})}),s}function Wx(e,{includeGroup:t=!1,includeSelf:n=!0},r){let i=r.treeNodeMap,a=e==null?null:i.get(e)??null,o={keyPath:[],treeNodePath:[],treeNode:a};if(a?.ignored)return o.treeNode=null,o;for(;a;)!a.ignored&&(t||!a.isGroup)&&o.treeNodePath.push(a),a=a.parent;return o.treeNodePath.reverse(),n||o.treeNodePath.pop(),o.keyPath=o.treeNodePath.map(e=>e.key),o}function Gx(e){if(e.length===0)return null;let t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function Kx(e,t){let n=e.siblings,r=n.length,{index:i}=e;return t?n[(i+1)%r]:i===n.length-1?null:n[i+1]}function qx(e,t,{loop:n=!1,includeDisabled:r=!1}={}){let i=t===`prev`?Jx:Kx,a={reverse:t===`prev`},o=!1,s=null;function c(t){if(t!==null){if(t===e){if(!o)o=!0;else if(!e.disabled&&!e.isGroup){s=e;return}}else if((!t.disabled||r)&&!t.ignored&&!t.isGroup){s=t;return}if(t.isGroup){let e=Xx(t,a);e===null?c(i(t,n)):s=e}else{let e=i(t,!1);if(e!==null)c(e);else{let e=Yx(t);e?.isGroup?c(i(e,n)):n&&c(i(t,!0))}}}}return c(e),s}function Jx(e,t){let n=e.siblings,r=n.length,{index:i}=e;return t?n[(i-1+r)%r]:i===0?null:n[i-1]}function Yx(e){return e.parent}function Xx(e,t={}){let{reverse:n=!1}=t,{children:r}=e;if(r){let{length:e}=r,i=n?e-1:0,a=n?-1:e,o=n?-1:1;for(let e=i;e!==a;e+=o){let n=r[e];if(!n.disabled&&!n.ignored){if(n.isGroup){let e=Xx(n,t);if(e!==null)return e}else return n}}}return null}var Zx={getChild(){return this.ignored?null:Xx(this)},getParent(){let{parent:e}=this;return e?.isGroup?e.getParent():e},getNext(e={}){return qx(this,`next`,e)},getPrev(e={}){return qx(this,`prev`,e)}};function Qx(e,t){let n=t?new Set(t):void 0,r=[];function i(e){e.forEach(e=>{r.push(e),!(e.isLeaf||!e.children||e.ignored)&&(e.isGroup||n===void 0||n.has(e.key))&&i(e.children)})}return i(e),r}function $x(e,t){let n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}function eS(e,t,n,r,i,a=null,o=0){let s=[];return e.forEach((c,l)=>{var u;let d=Object.create(r);if(d.rawNode=c,d.siblings=s,d.level=o,d.index=l,d.isFirstChild=l===0,d.isLastChild=l+1===e.length,d.parent=a,!d.ignored){let e=i(c);Array.isArray(e)&&(d.children=eS(e,t,n,r,i,d,o+1))}s.push(d),t.set(d.key,d),n.has(o)||n.set(o,[]),(u=n.get(o))==null||u.push(d)}),s}function tS(e,t={}){let n=new Map,r=new Map,{getDisabled:i=Ax,getIgnored:a=Ox,getIsGroup:o=Ix,getKey:s=Dx}=t,c=t.getChildren??Ex,l=t.ignoreEmptyChildren?e=>{let t=c(e);return Array.isArray(t)?t.length?t:null:t}:c,u=eS(e,n,r,Object.assign({get key(){return s(this.rawNode)},get disabled(){return i(this.rawNode)},get isGroup(){return o(this.rawNode)},get isLeaf(){return Tx(this.rawNode,l)},get shallowLoaded(){return kx(this.rawNode,l)},get ignored(){return a(this.rawNode)},contains(e){return $x(this,e)}},Zx),l);function d(e){if(e==null)return null;let t=n.get(e);return t&&!t.isGroup&&!t.ignored?t:null}function f(e){if(e==null)return null;let t=n.get(e);return t&&!t.ignored?t:null}function p(e,t){let n=f(e);return n?n.getPrev(t):null}function m(e,t){let n=f(e);return n?n.getNext(t):null}function h(e){let t=f(e);return t?t.getParent():null}function g(e){let t=f(e);return t?t.getChild():null}let _={treeNodes:u,treeNodeMap:n,levelTreeNodeMap:r,maxLevel:Math.max(...r.keys()),getChildren:l,getFlattenedNodes(e){return Qx(u,e)},getNode:d,getPrev:p,getNext:m,getParent:h,getChild:g,getFirstAvailableNode(){return Gx(u)},getPath(e,t={}){return Wx(e,t,_)},getCheckedKeys(e,t={}){let{cascade:n=!0,leafOnly:r=!1,checkStrategy:i=`all`,allowNotLoaded:a=!1}=t;return Hx({checkedKeys:Mx(e),indeterminateKeys:Nx(e),cascade:n,leafOnly:r,checkStrategy:i,allowNotLoaded:a},_)},check(e,t,n={}){let{cascade:r=!0,leafOnly:i=!1,checkStrategy:a=`all`,allowNotLoaded:o=!1}=n;return Hx({checkedKeys:Mx(t),indeterminateKeys:Nx(t),keysToCheck:e==null?[]:xx(e),cascade:r,leafOnly:i,checkStrategy:a,allowNotLoaded:o},_)},uncheck(e,t,n={}){let{cascade:r=!0,leafOnly:i=!1,checkStrategy:a=`all`,allowNotLoaded:o=!1}=n;return Hx({checkedKeys:Mx(t),indeterminateKeys:Nx(t),keysToUncheck:e==null?[]:xx(e),cascade:r,leafOnly:i,checkStrategy:a,allowNotLoaded:o},_)},getNonLeafKeys(e={}){return wx(u,e)}};return _}var nS=[`tabindex`,`onFocusin`,`onFocusout`,`onKeyup`,`onKeydown`,`onMousedown`,`onMouseenter`,`onMouseleave`],rS=F({name:`InternalSelectMenu`,props:{...Q.props,clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:`medium`},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,scrollbarProps:Object,onToggle:Function},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n,mergedComponentPropsRef:r}=Pm(e),i=v_(`InternalSelectMenu`,n,t),a=Q(`InternalSelectMenu`,`-internal-select-menu`,bx,fg,e,M(e,`clsPrefix`)),o=A(null),s=A(null),c=A(null),l=H(()=>e.treeMate.getFlattenedNodes()),u=H(()=>Lx(l.value)),d=A(null);function f(){let{treeMate:t}=e,n=null,{value:r}=e;r===null?n=t.getFirstAvailableNode():(n=e.multiple?t.getNode((r||[])[(r||[]).length-1]):t.getNode(r),(!n||n.disabled)&&(n=t.getFirstAvailableNode())),re(n||null)}function p(){let{value:t}=d;t&&!e.treeMate.getNode(t.key)&&(d.value=null)}let m;Un(()=>e.show,t=>{t?m=Un(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?f():p(),Tn(ie)):p()},{immediate:!0}):m?.()},{immediate:!0}),zr(()=>{m?.()});let h=H(()=>ah(a.value.self[q(`optionHeight`,e.size)])),g=H(()=>sh(a.value.self[q(`padding`,e.size)])),_=H(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),v=H(()=>{let e=l.value;return e&&e.length===0}),y=H(()=>r?.value?.Select?.renderEmpty);function b(t){let{onToggle:n}=e;n&&n(t)}function x(t){let{onScroll:n}=e;n&&n(t)}function S(e){c.value?.sync(),x(e)}function C(){c.value?.sync()}function w(){let{value:e}=d;return e||null}function T(e,t){t.disabled||re(t,!1)}function E(e,t){t.disabled||b(t)}function D(t){rh(t,`action`)||e.onKeyup?.(t)}function O(t){rh(t,`action`)||e.onKeydown?.(t)}function ee(t){e.onMousedown?.(t),!e.focusable&&t.preventDefault()}function te(){let{value:e}=d;e&&re(e.getNext({loop:!0}),!0)}function ne(){let{value:e}=d;e&&re(e.getPrev({loop:!0}),!0)}function re(e,t=!1){d.value=e,t&&ie()}function ie(){let t=d.value;if(!t)return;let n=u.value(t.key);n!==null&&(e.virtualScroll?s.value?.scrollTo({index:n}):c.value?.scrollTo({index:n,elSize:h.value}))}function ae(t){o.value?.contains(t.target)&&e.onFocus?.(t)}function oe(t){o.value?.contains(t.relatedTarget)||e.onBlur?.(t)}zn(gg,{handleOptionMouseEnter:T,handleOptionClick:E,valueSetRef:_,pendingTmNodeRef:d,nodePropsRef:M(e,`nodeProps`),showCheckmarkRef:M(e,`showCheckmark`),multipleRef:M(e,`multiple`),valueRef:M(e,`value`),renderLabelRef:M(e,`renderLabel`),renderOptionRef:M(e,`renderOption`),labelFieldRef:M(e,`labelField`),valueFieldRef:M(e,`valueField`)}),zn(_g,o),Ir(()=>{let{value:e}=c;e&&e.sync()});let se=H(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{height:r,borderRadius:i,color:o,groupHeaderTextColor:s,actionDividerColor:c,optionTextColorPressed:l,optionTextColor:u,optionTextColorDisabled:d,optionTextColorActive:f,optionOpacityDisabled:p,optionCheckColor:m,actionTextColor:h,optionColorPending:g,optionColorActive:_,loadingColor:v,loadingSize:y,optionColorActivePending:b,[q(`optionFontSize`,t)]:x,[q(`optionHeight`,t)]:S,[q(`optionPadding`,t)]:C}}=a.value;return{"--n-height":r,"--n-action-divider-color":c,"--n-action-text-color":h,"--n-bezier":n,"--n-border-radius":i,"--n-color":o,"--n-option-font-size":x,"--n-group-header-text-color":s,"--n-option-check-color":m,"--n-option-color-pending":g,"--n-option-color-active":_,"--n-option-color-active-pending":b,"--n-option-height":S,"--n-option-opacity-disabled":p,"--n-option-text-color":u,"--n-option-text-color-active":f,"--n-option-text-color-disabled":d,"--n-option-text-color-pressed":l,"--n-option-padding":C,"--n-option-padding-left":sh(C,`left`),"--n-option-padding-right":sh(C,`right`),"--n-loading-color":v,"--n-loading-size":y}}),{inlineThemeDisabled:ce}=e,le=ce?tg(`internal-select-menu`,H(()=>e.size[0]),se,e):void 0,ue={selfRef:o,next:te,prev:ne,getPendingTmNode:w};return cx(o,e.onResize),{mergedTheme:a,mergedClsPrefix:t,rtlEnabled:i,virtualListRef:s,scrollbarRef:c,itemSize:h,padding:g,flattenedNodes:l,empty:v,mergedRenderEmpty:y,virtualListContainer(){let{value:e}=s;return e?.listElRef},virtualListContent(){let{value:e}=s;return e?.itemsElRef},doScroll:x,handleFocusin:ae,handleFocusout:oe,handleKeyUp:D,handleKeyDown:O,handleMouseDown:ee,handleVirtualListResize:C,handleVirtualListScroll:S,cssVars:ce?void 0:se,themeClass:le?.themeClass,onRender:le?.onRender,...ue}},render(){let{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:r,themeClass:i,onRender:a}=this;return a?.(),L(),R(`div`,{ref:`selfRef`,tabindex:this.focusable?0:-1,class:Y([`${n}-base-select-menu`,`${n}-base-select-menu--${this.size}-size`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,i,this.multiple&&`${n}-base-select-menu--multiple`]),style:k(this.cssVars),onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},[J(()=>h_(e.header,e=>e&&(L(),R(`div`,{class:Y(`${n}-base-select-menu__header`),"data-header":!0,key:`header`},[J(()=>e)],2)))),this.loading?(L(),R(`div`,{key:0,class:Y(`${n}-base-select-menu__loading`)},[(L(),z(Hb,{clsPrefix:n,strokeWidth:20},null,8,[`clsPrefix`]))],2)):(L(),R(I,{key:1},[this.empty?(L(),R(`div`,{key:1,class:Y(`${n}-base-select-menu__empty`),"data-empty":!0},[J(()=>p_(e.empty,()=>[this.mergedRenderEmpty?.()||(L(),z(lg,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size},null,8,[`theme`,`themeOverrides`,`size`]))]))],2)):(L(),z(ky,Fa({key:0,ref:`scrollbarRef`,theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},this.scrollbarProps),{default:()=>t?(L(),z(hy,{key:1,ref:`virtualListRef`,class:Y(`${n}-virtual-list`),items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:e})=>e.isGroup?(L(),z(dx,{key:e.key,clsPrefix:n,tmNode:e},null,8,[`clsPrefix`,`tmNode`])):e.ignored?null:(L(),z(gx,{clsPrefix:n,key:e.key,tmNode:e},null,8,[`clsPrefix`,`tmNode`]))},1032,[`class`,`items`,`itemSize`,`paddingTop`,`paddingBottom`,`onResize`,`onScroll`])):(L(),R(`div`,{key:4,class:Y(`${n}-base-select-menu-option-wrapper`),style:k({paddingTop:this.padding.top,paddingBottom:this.padding.bottom})},[J(()=>this.flattenedNodes.map(e=>e.isGroup?(L(),z(dx,{key:e.key,clsPrefix:n,tmNode:e},null,8,[`clsPrefix`,`tmNode`])):(L(),z(gx,{clsPrefix:n,key:e.key,tmNode:e},null,8,[`clsPrefix`,`tmNode`]))))],6))},1040,[`theme`,`themeOverrides`,`scrollable`,`container`,`content`,`onScroll`]))],64)),J(()=>h_(e.action,e=>e&&[(L(),R(`div`,{class:Y(`${n}-base-select-menu__action`),"data-action":!0,key:`action`},[J(()=>e)],2)),(L(),z(lx,{onFocus:this.onTabOut,key:`focus-detector`},null,8,[`onFocus`]))]))],46,nS)}});function iS(e){return e.type===`group`}function aS(e){return e.type===`ignored`}function oS(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function sS(e,t){return{getIsGroup:iS,getIgnored:aS,getKey(t){return iS(t)?t.name||t.key||`key-required`:t[e]},getChildren(e){return e[t]}}}function cS(e,t,n,r){if(!t)return e;function i(e){if(!Array.isArray(e))return[];let a=[];for(let o of e)if(iS(o)){let e=i(o[r]);e.length&&a.push(Object.assign({},o,{[r]:e}))}else if(aS(o))continue;else t(n,o)&&a.push(o);return a}return i(e)}function lS(e,t,n){let r=new Map;return e.forEach(e=>{iS(e)?e[n].forEach(e=>{r.set(e[t],e)}):r.set(e[t],e)}),r}var uS=0,dS=``,fS=``,pS=``,mS=``,hS=A(`0px`);function gS(e){if(typeof document>`u`)return;let t=document.documentElement,n,r=!1,i=()=>{t.style.marginRight=dS,t.style.overflow=fS,t.style.overflowX=pS,t.style.overflowY=mS,hS.value=`0px`};Ir(()=>{n=Un(e,e=>{if(e){if(!uS){let e=window.innerWidth-t.offsetWidth;e>0&&(dS=t.style.marginRight,t.style.marginRight=`${e}px`,hS.value=`${e}px`),fS=t.style.overflow,pS=t.style.overflowX,mS=t.style.overflowY,t.style.overflow=`hidden`,t.style.overflowX=`hidden`,t.style.overflowY=`hidden`}r=!0,uS++}else uS--,uS||i(),r=!1},{immediate:!0})}),zr(()=>{n?.(),r&&=(uS--,uS||i(),!1)})}var{cubicBezierEaseInOut:_S}=Im;function vS({duration:e=`.2s`,delay:t=`.1s`}={}){return[U(`&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to`,{opacity:1}),U(`&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from`,`\n opacity: 0!important;\n margin-left: 0!important;\n margin-right: 0!important;\n `),U(`&.fade-in-width-expand-transition-leave-active`,`\n overflow: hidden;\n transition:\n opacity ${e} ${_S},\n max-width ${e} ${_S} ${t},\n margin-left ${e} ${_S} ${t},\n margin-right ${e} ${_S} ${t};\n `),U(`&.fade-in-width-expand-transition-enter-active`,`\n overflow: hidden;\n transition:\n opacity ${e} ${_S} ${t},\n max-width ${e} ${_S},\n margin-left ${e} ${_S},\n margin-right ${e} ${_S};\n `)]}var yS=W(`base-wave`,`\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n border-radius: inherit;\n`),bS=F({name:`BaseWave`,props:{clsPrefix:{type:String,required:!0}},setup(e){Km(`-base-wave`,yS,M(e,`clsPrefix`));let t=A(null),n=A(!1),r=null;return zr(()=>{r!==null&&window.clearTimeout(r)}),{active:n,selfRef:t,play(){r!==null&&(window.clearTimeout(r),n.value=!1,r=null),Tn(()=>{t.value?.offsetHeight,n.value=!0,r=window.setTimeout(()=>{n.value=!1,r=null},1e3)})}}},render(){let{clsPrefix:e}=this;return L(),R(`div`,{ref:`selfRef`,"aria-hidden":!0,class:Y([`${e}-base-wave`,this.active&&`${e}-base-wave--active`])},null,2)}}),xS={paddingTiny:`0 6px`,paddingSmall:`0 10px`,paddingMedium:`0 14px`,paddingLarge:`0 18px`,paddingRoundTiny:`0 10px`,paddingRoundSmall:`0 14px`,paddingRoundMedium:`0 18px`,paddingRoundLarge:`0 22px`,iconMarginTiny:`6px`,iconMarginSmall:`6px`,iconMarginMedium:`6px`,iconMarginLarge:`6px`,iconSizeTiny:`14px`,iconSizeSmall:`18px`,iconSizeMedium:`18px`,iconSizeLarge:`20px`,rippleDuration:`.6s`};function SS(e){let{heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadius:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,textColor2:d,textColor3:f,primaryColorHover:p,primaryColorPressed:m,borderColor:h,primaryColor:g,baseColor:_,infoColor:v,infoColorHover:y,infoColorPressed:b,successColor:x,successColorHover:S,successColorPressed:C,warningColor:w,warningColorHover:T,warningColorPressed:E,errorColor:D,errorColorHover:O,errorColorPressed:ee,fontWeight:te,buttonColor2:ne,buttonColor2Hover:re,buttonColor2Pressed:ie,fontWeightStrong:ae}=e;return{...xS,heightTiny:t,heightSmall:n,heightMedium:r,heightLarge:i,borderRadiusTiny:a,borderRadiusSmall:a,borderRadiusMedium:a,borderRadiusLarge:a,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:l,opacityDisabled:u,colorOpacitySecondary:`0.16`,colorOpacitySecondaryHover:`0.22`,colorOpacitySecondaryPressed:`0.28`,colorSecondary:ne,colorSecondaryHover:re,colorSecondaryPressed:ie,colorTertiary:ne,colorTertiaryHover:re,colorTertiaryPressed:ie,colorQuaternary:`#0000`,colorQuaternaryHover:re,colorQuaternaryPressed:ie,color:`#0000`,colorHover:`#0000`,colorPressed:`#0000`,colorFocus:`#0000`,colorDisabled:`#0000`,textColor:d,textColorTertiary:f,textColorHover:p,textColorPressed:m,textColorFocus:p,textColorDisabled:d,textColorText:d,textColorTextHover:p,textColorTextPressed:m,textColorTextFocus:p,textColorTextDisabled:d,textColorGhost:d,textColorGhostHover:p,textColorGhostPressed:m,textColorGhostFocus:p,textColorGhostDisabled:d,border:`1px solid ${h}`,borderHover:`1px solid ${p}`,borderPressed:`1px solid ${m}`,borderFocus:`1px solid ${p}`,borderDisabled:`1px solid ${h}`,rippleColor:g,colorPrimary:g,colorHoverPrimary:p,colorPressedPrimary:m,colorFocusPrimary:p,colorDisabledPrimary:g,textColorPrimary:_,textColorHoverPrimary:_,textColorPressedPrimary:_,textColorFocusPrimary:_,textColorDisabledPrimary:_,textColorTextPrimary:g,textColorTextHoverPrimary:p,textColorTextPressedPrimary:m,textColorTextFocusPrimary:p,textColorTextDisabledPrimary:d,textColorGhostPrimary:g,textColorGhostHoverPrimary:p,textColorGhostPressedPrimary:m,textColorGhostFocusPrimary:p,textColorGhostDisabledPrimary:g,borderPrimary:`1px solid ${g}`,borderHoverPrimary:`1px solid ${p}`,borderPressedPrimary:`1px solid ${m}`,borderFocusPrimary:`1px solid ${p}`,borderDisabledPrimary:`1px solid ${g}`,rippleColorPrimary:g,colorInfo:v,colorHoverInfo:y,colorPressedInfo:b,colorFocusInfo:y,colorDisabledInfo:v,textColorInfo:_,textColorHoverInfo:_,textColorPressedInfo:_,textColorFocusInfo:_,textColorDisabledInfo:_,textColorTextInfo:v,textColorTextHoverInfo:y,textColorTextPressedInfo:b,textColorTextFocusInfo:y,textColorTextDisabledInfo:d,textColorGhostInfo:v,textColorGhostHoverInfo:y,textColorGhostPressedInfo:b,textColorGhostFocusInfo:y,textColorGhostDisabledInfo:v,borderInfo:`1px solid ${v}`,borderHoverInfo:`1px solid ${y}`,borderPressedInfo:`1px solid ${b}`,borderFocusInfo:`1px solid ${y}`,borderDisabledInfo:`1px solid ${v}`,rippleColorInfo:v,colorSuccess:x,colorHoverSuccess:S,colorPressedSuccess:C,colorFocusSuccess:S,colorDisabledSuccess:x,textColorSuccess:_,textColorHoverSuccess:_,textColorPressedSuccess:_,textColorFocusSuccess:_,textColorDisabledSuccess:_,textColorTextSuccess:x,textColorTextHoverSuccess:S,textColorTextPressedSuccess:C,textColorTextFocusSuccess:S,textColorTextDisabledSuccess:d,textColorGhostSuccess:x,textColorGhostHoverSuccess:S,textColorGhostPressedSuccess:C,textColorGhostFocusSuccess:S,textColorGhostDisabledSuccess:x,borderSuccess:`1px solid ${x}`,borderHoverSuccess:`1px solid ${S}`,borderPressedSuccess:`1px solid ${C}`,borderFocusSuccess:`1px solid ${S}`,borderDisabledSuccess:`1px solid ${x}`,rippleColorSuccess:x,colorWarning:w,colorHoverWarning:T,colorPressedWarning:E,colorFocusWarning:T,colorDisabledWarning:w,textColorWarning:_,textColorHoverWarning:_,textColorPressedWarning:_,textColorFocusWarning:_,textColorDisabledWarning:_,textColorTextWarning:w,textColorTextHoverWarning:T,textColorTextPressedWarning:E,textColorTextFocusWarning:T,textColorTextDisabledWarning:d,textColorGhostWarning:w,textColorGhostHoverWarning:T,textColorGhostPressedWarning:E,textColorGhostFocusWarning:T,textColorGhostDisabledWarning:w,borderWarning:`1px solid ${w}`,borderHoverWarning:`1px solid ${T}`,borderPressedWarning:`1px solid ${E}`,borderFocusWarning:`1px solid ${T}`,borderDisabledWarning:`1px solid ${w}`,rippleColorWarning:w,colorError:D,colorHoverError:O,colorPressedError:ee,colorFocusError:O,colorDisabledError:D,textColorError:_,textColorHoverError:_,textColorPressedError:_,textColorFocusError:_,textColorDisabledError:_,textColorTextError:D,textColorTextHoverError:O,textColorTextPressedError:ee,textColorTextFocusError:O,textColorTextDisabledError:d,textColorGhostError:D,textColorGhostHoverError:O,textColorGhostPressedError:ee,textColorGhostFocusError:O,textColorGhostDisabledError:D,borderError:`1px solid ${D}`,borderHoverError:`1px solid ${O}`,borderPressedError:`1px solid ${ee}`,borderFocusError:`1px solid ${O}`,borderDisabledError:`1px solid ${D}`,rippleColorError:D,waveOpacity:`0.6`,fontWeight:te,fontWeightStrong:ae}}var CS={name:`Button`,common:Jh,self:SS};function wS(e){return Fh(e,[255,255,255,.16])}function TS(e){return Fh(e,[0,0,0,.12])}var ES=Mm(`n-button-group`),DS=U([W(`button`,`\n margin: 0;\n font-weight: var(--n-font-weight);\n line-height: 1;\n font-family: inherit;\n padding: var(--n-padding);\n height: var(--n-height);\n font-size: var(--n-font-size);\n border-radius: var(--n-border-radius);\n color: var(--n-text-color);\n background-color: var(--n-color);\n width: var(--n-width);\n white-space: nowrap;\n outline: none;\n position: relative;\n z-index: auto;\n border: none;\n display: inline-flex;\n flex-wrap: nowrap;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n user-select: none;\n -webkit-user-select: none;\n text-align: center;\n cursor: pointer;\n text-decoration: none;\n transition:\n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n `,[K(`color`,[G(`border`,{borderColor:`var(--n-border-color)`}),K(`disabled`,[G(`border`,{borderColor:`var(--n-border-color-disabled)`})]),hc(`disabled`,[U(`&:focus`,[G(`state-border`,{borderColor:`var(--n-border-color-focus)`})]),U(`&:hover`,[G(`state-border`,{borderColor:`var(--n-border-color-hover)`})]),U(`&:active`,[G(`state-border`,{borderColor:`var(--n-border-color-pressed)`})]),K(`pressed`,[G(`state-border`,{borderColor:`var(--n-border-color-pressed)`})])])]),K(`disabled`,{backgroundColor:`var(--n-color-disabled)`,color:`var(--n-text-color-disabled)`},[G(`border`,{border:`var(--n-border-disabled)`})]),hc(`disabled`,[U(`&:focus`,{backgroundColor:`var(--n-color-focus)`,color:`var(--n-text-color-focus)`},[G(`state-border`,{border:`var(--n-border-focus)`})]),U(`&:hover`,{backgroundColor:`var(--n-color-hover)`,color:`var(--n-text-color-hover)`},[G(`state-border`,{border:`var(--n-border-hover)`})]),U(`&:active`,{backgroundColor:`var(--n-color-pressed)`,color:`var(--n-text-color-pressed)`},[G(`state-border`,{border:`var(--n-border-pressed)`})]),K(`pressed`,{backgroundColor:`var(--n-color-pressed)`,color:`var(--n-text-color-pressed)`},[G(`state-border`,{border:`var(--n-border-pressed)`})])]),K(`loading`,`cursor: wait;`),W(`base-wave`,`\n pointer-events: none;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n animation-iteration-count: 1;\n animation-duration: var(--n-ripple-duration);\n animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out);\n `,[K(`active`,{zIndex:1,animationName:`button-wave-spread, button-wave-opacity`})]),Wb&&`MozBoxSizing`in document.createElement(`div`).style?U(`&::moz-focus-inner`,{border:0}):null,G(`border, state-border`,`\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n border-radius: inherit;\n transition: border-color .3s var(--n-bezier);\n pointer-events: none;\n `),G(`border`,`\n border: var(--n-border);\n `),G(`state-border`,`\n border: var(--n-border);\n border-color: #0000;\n z-index: 1;\n `),G(`icon`,`\n margin: var(--n-icon-margin);\n margin-left: 0;\n height: var(--n-icon-size);\n width: var(--n-icon-size);\n max-width: var(--n-icon-size);\n font-size: var(--n-icon-size);\n position: relative;\n flex-shrink: 0;\n `,[W(`icon-slot`,`\n height: var(--n-icon-size);\n width: var(--n-icon-size);\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n `,[Ab({top:`50%`,originalTransform:`translateY(-50%)`})]),vS()]),G(`content`,`\n display: flex;\n align-items: center;\n flex-wrap: nowrap;\n min-width: 0;\n `,[U(`~`,[G(`icon`,{margin:`var(--n-icon-margin)`,marginRight:0})])]),K(`block`,`\n display: flex;\n width: 100%;\n `),K(`dashed`,[G(`border, state-border`,{borderStyle:`dashed !important`})]),K(`disabled`,{cursor:`not-allowed`,opacity:`var(--n-opacity-disabled)`})]),U(`@keyframes button-wave-spread`,{from:{boxShadow:`0 0 0.5px 0 var(--n-ripple-color)`},to:{boxShadow:`0 0 0.5px 4.5px var(--n-ripple-color)`}}),U(`@keyframes button-wave-opacity`,{from:{opacity:`var(--n-wave-opacity)`},to:{opacity:0}})]),OS=F({name:`Button`,props:{...Q.props,color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:`button`},type:{type:String,default:`default`},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:`left`},attrType:{type:String,default:`button`},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!Kb},spinProps:Object},slots:Object,setup(e){let t=A(null),n=A(null),r=A(!1),i=Ng(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),a=P(ES,{}),{inlineThemeDisabled:o,mergedClsPrefixRef:s,mergedRtlRef:c,mergedComponentPropsRef:l}=Pm(e),{mergedSizeRef:u}=wb({},{defaultSize:`medium`,mergedSize:t=>{let{size:n}=e;if(n)return n;let{size:r}=a;if(r)return r;let{mergedSize:i}=t||{};return i?i.value:l?.value?.Button?.size||`medium`}}),d=H(()=>e.focusable&&!e.disabled),f=n=>{d.value||n.preventDefault(),!e.nativeFocusBehavior&&(n.preventDefault(),!e.disabled&&d.value&&t.value?.focus({preventScroll:!0}))},p=t=>{if(!e.disabled&&!e.loading){let{onClick:r}=e;r&&$(r,t),e.text||n.value?.play()}},m=t=>{if(t.key===`Enter`){if(!e.keyboard)return;r.value=!1}},h=t=>{if(t.key===`Enter`){if(!e.keyboard||e.loading){t.preventDefault();return}r.value=!0}},g=()=>{r.value=!1},_=Q(`Button`,`-button`,DS,CS,e,s),v=v_(`Button`,c,s),y=H(()=>{let{common:{cubicBezierEaseInOut:t,cubicBezierEaseOut:n},self:r}=_.value,{rippleDuration:i,opacityDisabled:a,fontWeight:o,fontWeightStrong:s}=r,c=u.value,{dashed:l,type:d,ghost:f,text:p,color:m,round:h,circle:g,textColor:v,secondary:y,tertiary:b,quaternary:x,strong:S}=e,C={"--n-font-weight":S?s:o},w={"--n-color":`initial`,"--n-color-hover":`initial`,"--n-color-pressed":`initial`,"--n-color-focus":`initial`,"--n-color-disabled":`initial`,"--n-ripple-color":`initial`,"--n-text-color":`initial`,"--n-text-color-hover":`initial`,"--n-text-color-pressed":`initial`,"--n-text-color-focus":`initial`,"--n-text-color-disabled":`initial`},T=d===`tertiary`,E=d==="default",D=T?`default`:d;if(p){let e=v||m;w={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":`#0000`,"--n-text-color":e||r[q(`textColorText`,D)],"--n-text-color-hover":e?wS(e):r[q(`textColorTextHover`,D)],"--n-text-color-pressed":e?TS(e):r[q(`textColorTextPressed`,D)],"--n-text-color-focus":e?wS(e):r[q(`textColorTextHover`,D)],"--n-text-color-disabled":e||r[q(`textColorTextDisabled`,D)]}}else if(f||l){let e=v||m;w={"--n-color":`#0000`,"--n-color-hover":`#0000`,"--n-color-pressed":`#0000`,"--n-color-focus":`#0000`,"--n-color-disabled":`#0000`,"--n-ripple-color":m||r[q(`rippleColor`,D)],"--n-text-color":e||r[q(`textColorGhost`,D)],"--n-text-color-hover":e?wS(e):r[q(`textColorGhostHover`,D)],"--n-text-color-pressed":e?TS(e):r[q(`textColorGhostPressed`,D)],"--n-text-color-focus":e?wS(e):r[q(`textColorGhostHover`,D)],"--n-text-color-disabled":e||r[q(`textColorGhostDisabled`,D)]}}else if(y){let e=E?r.textColor:T?r.textColorTertiary:r[q(`color`,D)],t=m||e,n=d!=="default"&&d!==`tertiary`;w={"--n-color":n?X(t,{alpha:Number(r.colorOpacitySecondary)}):r.colorSecondary,"--n-color-hover":n?X(t,{alpha:Number(r.colorOpacitySecondaryHover)}):r.colorSecondaryHover,"--n-color-pressed":n?X(t,{alpha:Number(r.colorOpacitySecondaryPressed)}):r.colorSecondaryPressed,"--n-color-focus":n?X(t,{alpha:Number(r.colorOpacitySecondaryHover)}):r.colorSecondaryHover,"--n-color-disabled":r.colorSecondary,"--n-ripple-color":`#0000`,"--n-text-color":t,"--n-text-color-hover":t,"--n-text-color-pressed":t,"--n-text-color-focus":t,"--n-text-color-disabled":t}}else if(b||x){let e=E?r.textColor:T?r.textColorTertiary:r[q(`color`,D)],t=m||e;b?(w[`--n-color`]=r.colorTertiary,w[`--n-color-hover`]=r.colorTertiaryHover,w[`--n-color-pressed`]=r.colorTertiaryPressed,w[`--n-color-focus`]=r.colorSecondaryHover,w[`--n-color-disabled`]=r.colorTertiary):(w[`--n-color`]=r.colorQuaternary,w[`--n-color-hover`]=r.colorQuaternaryHover,w[`--n-color-pressed`]=r.colorQuaternaryPressed,w[`--n-color-focus`]=r.colorQuaternaryHover,w[`--n-color-disabled`]=r.colorQuaternary),w[`--n-ripple-color`]=`#0000`,w[`--n-text-color`]=t,w[`--n-text-color-hover`]=t,w[`--n-text-color-pressed`]=t,w[`--n-text-color-focus`]=t,w[`--n-text-color-disabled`]=t}else w={"--n-color":m||r[q(`color`,D)],"--n-color-hover":m?wS(m):r[q(`colorHover`,D)],"--n-color-pressed":m?TS(m):r[q(`colorPressed`,D)],"--n-color-focus":m?wS(m):r[q(`colorFocus`,D)],"--n-color-disabled":m||r[q(`colorDisabled`,D)],"--n-ripple-color":m||r[q(`rippleColor`,D)],"--n-text-color":v||(m?r.textColorPrimary:T?r.textColorTertiary:r[q(`textColor`,D)]),"--n-text-color-hover":v||(m?r.textColorHoverPrimary:r[q(`textColorHover`,D)]),"--n-text-color-pressed":v||(m?r.textColorPressedPrimary:r[q(`textColorPressed`,D)]),"--n-text-color-focus":v||(m?r.textColorFocusPrimary:r[q(`textColorFocus`,D)]),"--n-text-color-disabled":v||(m?r.textColorDisabledPrimary:r[q(`textColorDisabled`,D)])};let O={"--n-border":`initial`,"--n-border-hover":`initial`,"--n-border-pressed":`initial`,"--n-border-focus":`initial`,"--n-border-disabled":`initial`};O=p?{"--n-border":`none`,"--n-border-hover":`none`,"--n-border-pressed":`none`,"--n-border-focus":`none`,"--n-border-disabled":`none`}:{"--n-border":r[q(`border`,D)],"--n-border-hover":r[q(`borderHover`,D)],"--n-border-pressed":r[q(`borderPressed`,D)],"--n-border-focus":r[q(`borderFocus`,D)],"--n-border-disabled":r[q(`borderDisabled`,D)]};let{[q(`height`,c)]:ee,[q(`fontSize`,c)]:te,[q(`padding`,c)]:ne,[q(`paddingRound`,c)]:re,[q(`iconSize`,c)]:ie,[q(`borderRadius`,c)]:ae,[q(`iconMargin`,c)]:oe,waveOpacity:se}=r,ce={"--n-width":g&&!p?ee:`initial`,"--n-height":p?`initial`:ee,"--n-font-size":te,"--n-padding":g||p?`initial`:h?re:ne,"--n-icon-size":ie,"--n-icon-margin":oe,"--n-border-radius":p?`initial`:g||h?ee:ae};return{"--n-bezier":t,"--n-bezier-ease-out":n,"--n-ripple-duration":i,"--n-opacity-disabled":a,"--n-wave-opacity":se,...C,...w,...O,...ce}}),b=o?tg(`button`,H(()=>{let t=``,{dashed:n,type:r,ghost:i,text:a,color:o,round:s,circle:c,textColor:l,secondary:d,tertiary:f,quaternary:p,strong:m}=e;n&&(t+=`a`),i&&(t+=`b`),a&&(t+=`c`),s&&(t+=`d`),c&&(t+=`e`),d&&(t+=`f`),f&&(t+=`g`),p&&(t+=`h`),m&&(t+=`i`),o&&(t+=`j${Ky(o)}`),l&&(t+=`k${Ky(l)}`);let{value:h}=u;return t+=`l${h[0]}`,t+=`m${r[0]}`,t}),y,e):void 0;return{selfElRef:t,waveElRef:n,mergedClsPrefix:s,mergedFocusable:d,mergedSize:u,showBorder:i,enterPressed:r,rtlEnabled:v,handleMousedown:f,handleKeydown:h,handleBlur:g,handleKeyup:m,handleClick:p,customColorCssVars:H(()=>{let{color:t}=e;if(!t)return null;let n=wS(t);return{"--n-border-color":t,"--n-border-color-hover":n,"--n-border-color-pressed":TS(t),"--n-border-color-focus":n,"--n-border-color-disabled":t}}),cssVars:o?void 0:y,themeClass:b?.themeClass,onRender:b?.onRender}},render(){let{mergedClsPrefix:e,tag:t,onRender:n}=this;n?.();let r=h_(this.$slots.default,t=>t&&(L(),R(`span`,{class:Y(`${e}-button__content`)},[J(()=>t)],2)));return L(),z(t,{ref:`selfElRef`,class:Y([this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`]),tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:k(this.cssVars),disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},{default:N(()=>[J(()=>this.iconPlacement===`right`&&r),V(db,{width:!0},{default:()=>h_(this.$slots.icon,t=>(this.loading||this.renderIcon||t)&&(L(),R(`span`,{class:Y(`${e}-button__icon`),style:k({margin:__(this.$slots.default)?`0`:``})},[V(Db,null,{default:()=>this.loading?(L(),z(Hb,Fa({clsPrefix:e,key:`loading`,class:`${e}-icon-slot`,strokeWidth:20},this.spinProps),null,16,[`clsPrefix`,`class`])):(L(),R(`div`,{key:`icon`,class:Y(`${e}-icon-slot`),role:`none`},[this.renderIcon?(L(),R(I,{key:0},[J(()=>this.renderIcon())],64)):(L(),R(I,{key:1},[J(()=>t)],64))],2))},1024)],6)))},1024),J(()=>this.iconPlacement===`left`&&r),this.text?J(()=>null):(L(),z(bS,{key:0,ref:`waveElRef`,clsPrefix:e},null,8,[`clsPrefix`])),this.showBorder?(L(),R(`div`,{key:2,"aria-hidden":!0,class:Y(`${e}-button__border`),style:k(this.customColorCssVars)},null,6)):J(()=>null),this.showBorder?(L(),R(`div`,{key:4,"aria-hidden":!0,class:Y(`${e}-button__state-border`),style:k(this.customColorCssVars)},null,6)):J(()=>null)]),_:2},1032,[`class`,`tabindex`,`type`,`style`,`disabled`,`onClick`,`onBlur`,`onMousedown`,`onKeyup`,`onKeydown`])}}),kS=`0!important`,AS=`-1px!important`;function jS(e){return K(`${e}-type`,[U(`& +`,[W(`button`,{},[K(`${e}-type`,[G(`border`,{borderLeftWidth:kS}),G(`state-border`,{left:AS})])])])])}function MS(e){return K(`${e}-type`,[U(`& +`,[W(`button`,[K(`${e}-type`,[G(`border`,{borderTopWidth:kS}),G(`state-border`,{top:AS})])])])])}var NS=W(`button-group`,`\n flex-wrap: nowrap;\n display: inline-flex;\n position: relative;\n`,[hc(`vertical`,{flexDirection:`row`},[hc(`rtl`,[W(`button`,[U(`&:first-child:not(:last-child)`,`\n margin-right: ${kS};\n border-top-right-radius: ${kS};\n border-bottom-right-radius: ${kS};\n `),U(`&:last-child:not(:first-child)`,`\n margin-left: ${kS};\n border-top-left-radius: ${kS};\n border-bottom-left-radius: ${kS};\n `),U(`&:not(:first-child):not(:last-child)`,`\n margin-left: ${kS};\n margin-right: ${kS};\n border-radius: ${kS};\n `),jS(`default`),K(`ghost`,[jS(`primary`),jS(`info`),jS(`success`),jS(`warning`),jS(`error`)])])])]),K(`vertical`,{flexDirection:`column`},[W(`button`,[U(`&:first-child:not(:last-child)`,`\n margin-bottom: ${kS};\n margin-left: ${kS};\n margin-right: ${kS};\n border-bottom-left-radius: ${kS};\n border-bottom-right-radius: ${kS};\n `),U(`&:last-child:not(:first-child)`,`\n margin-top: ${kS};\n margin-left: ${kS};\n margin-right: ${kS};\n border-top-left-radius: ${kS};\n border-top-right-radius: ${kS};\n `),U(`&:not(:first-child):not(:last-child)`,`\n margin: ${kS};\n border-radius: ${kS};\n `),MS(`default`),K(`ghost`,[MS(`primary`),MS(`info`),MS(`success`),MS(`warning`),MS(`error`)])])])]),PS=F({name:`ButtonGroup`,props:{size:String,vertical:Boolean},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n}=Pm(e);return Km(`-button-group`,NS,t),zn(ES,e),{rtlEnabled:v_(`ButtonGroup`,n,t),mergedClsPrefix:t}},render(){let{mergedClsPrefix:e}=this;return L(),R(`div`,{class:Y([`${e}-button-group`,this.rtlEnabled&&`${e}-button-group--rtl`,this.vertical&&`${e}-button-group--vertical`]),role:`group`},[J(()=>this.$slots.default?.())],2)}}),FS=F({name:`ChevronLeft`,render(){return(()=>{let e=Jm(`dfe229c2639b2082`);return e[0]||=B(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[B(`path`,{d:`M10.3536 3.14645C10.5488 3.34171 10.5488 3.65829 10.3536 3.85355L6.20711 8L10.3536 12.1464C10.5488 12.3417 10.5488 12.6583 10.3536 12.8536C10.1583 13.0488 9.84171 13.0488 9.64645 12.8536L5.14645 8.35355C4.95118 8.15829 4.95118 7.84171 5.14645 7.64645L9.64645 3.14645C9.84171 2.95118 10.1583 2.95118 10.3536 3.14645Z`,fill:`currentColor`})],-1)})()}}),IS=F({name:`ChevronRight`,render(){return(()=>{let e=Jm(`6ab04425f4fcb756`);return e[0]||=B(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[B(`path`,{d:`M5.64645 3.14645C5.45118 3.34171 5.45118 3.65829 5.64645 3.85355L9.79289 8L5.64645 12.1464C5.45118 12.3417 5.45118 12.6583 5.64645 12.8536C5.84171 13.0488 6.15829 13.0488 6.35355 12.8536L10.8536 8.35355C11.0488 8.15829 11.0488 7.84171 10.8536 7.64645L6.35355 3.14645C6.15829 2.95118 5.84171 2.95118 5.64645 3.14645Z`,fill:`currentColor`})],-1)})()}}),LS={paddingSmall:`12px 16px 12px`,paddingMedium:`19px 24px 20px`,paddingLarge:`23px 32px 24px`,paddingHuge:`27px 40px 28px`,titleFontSizeSmall:`16px`,titleFontSizeMedium:`18px`,titleFontSizeLarge:`18px`,titleFontSizeHuge:`18px`,closeIconSize:`18px`,closeSize:`22px`};function RS(e){let{primaryColor:t,borderRadius:n,lineHeight:r,fontSize:i,cardColor:a,textColor2:o,textColor1:s,dividerColor:c,fontWeightStrong:l,closeIconColor:u,closeIconColorHover:d,closeIconColorPressed:f,closeColorHover:p,closeColorPressed:m,modalColor:h,boxShadow1:g,popoverColor:_,actionColor:v}=e;return{...LS,lineHeight:r,color:a,colorModal:h,colorPopover:_,colorTarget:t,colorEmbedded:v,colorEmbeddedModal:v,colorEmbeddedPopover:v,textColor:o,titleTextColor:s,borderColor:c,actionColor:v,titleFontWeight:l,closeColorHover:p,closeColorPressed:m,closeBorderRadius:n,closeIconColor:u,closeIconColorHover:d,closeIconColorPressed:f,fontSizeSmall:i,fontSizeMedium:i,fontSizeLarge:i,fontSizeHuge:i,boxShadow:g,borderRadius:n}}var zS={name:`Card`,common:Jh,self:RS},BS=W(`card-content`,`\n flex: 1;\n min-width: 0;\n box-sizing: border-box;\n padding: 0 var(--n-padding-left) var(--n-padding-bottom) var(--n-padding-left);\n font-size: var(--n-font-size);\n`),VS=U([W(`card`,`\n font-size: var(--n-font-size);\n line-height: var(--n-line-height);\n display: flex;\n flex-direction: column;\n width: 100%;\n box-sizing: border-box;\n position: relative;\n border-radius: var(--n-border-radius);\n background-color: var(--n-color);\n color: var(--n-text-color);\n word-break: break-word;\n transition: \n color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n `,[vc({background:`var(--n-color-modal)`}),K(`hoverable`,[U(`&:hover`,`box-shadow: var(--n-box-shadow);`)]),K(`content-segmented`,[U(`>`,[W(`card-content`,`\n padding-top: var(--n-padding-bottom);\n `),G(`content-scrollbar`,[U(`>`,[W(`scrollbar-container`,[U(`>`,[W(`card-content`,`\n padding-top: var(--n-padding-bottom);\n `)])])])])])]),K(`content-soft-segmented`,[U(`>`,[W(`card-content`,`\n margin: 0 var(--n-padding-left);\n padding: var(--n-padding-bottom) 0;\n `),G(`content-scrollbar`,[U(`>`,[W(`scrollbar-container`,[U(`>`,[W(`card-content`,`\n margin: 0 var(--n-padding-left);\n padding: var(--n-padding-bottom) 0;\n `)])])])])])]),K(`footer-segmented`,[U(`>`,[G(`footer`,`\n padding-top: var(--n-padding-bottom);\n `)])]),K(`footer-soft-segmented`,[U(`>`,[G(`footer`,`\n padding: var(--n-padding-bottom) 0;\n margin: 0 var(--n-padding-left);\n `)])]),U(`>`,[W(`card-header`,`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n font-size: var(--n-title-font-size);\n padding:\n var(--n-padding-top)\n var(--n-padding-left)\n var(--n-padding-bottom)\n var(--n-padding-left);\n `,[G(`main`,`\n font-weight: var(--n-title-font-weight);\n transition: color .3s var(--n-bezier);\n flex: 1;\n min-width: 0;\n color: var(--n-title-text-color);\n `),G(`extra`,`\n display: flex;\n align-items: center;\n font-size: var(--n-font-size);\n font-weight: 400;\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n `),G(`close`,`\n margin: 0 0 0 8px;\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n `)]),G(`action`,`\n box-sizing: border-box;\n transition:\n background-color .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n background-clip: padding-box;\n background-color: var(--n-action-color);\n `),BS,W(`card-content`,[U(`&:first-child`,`\n padding-top: var(--n-padding-bottom);\n `)]),G(`content-scrollbar`,`\n display: flex;\n flex-direction: column;\n `,[U(`>`,[W(`scrollbar-container`,[U(`>`,[BS])])]),U(`&:first-child >`,[W(`scrollbar-container`,[U(`>`,[W(`card-content`,`\n padding-top: var(--n-padding-bottom);\n `)])])])]),G(`footer`,`\n box-sizing: border-box;\n padding: 0 var(--n-padding-left) var(--n-padding-bottom) var(--n-padding-left);\n font-size: var(--n-font-size);\n `,[U(`&:first-child`,`\n padding-top: var(--n-padding-bottom);\n `)]),G(`action`,`\n background-color: var(--n-action-color);\n padding: var(--n-padding-bottom) var(--n-padding-left);\n border-bottom-left-radius: var(--n-border-radius);\n border-bottom-right-radius: var(--n-border-radius);\n `)]),W(`card-cover`,`\n overflow: hidden;\n width: 100%;\n border-radius: var(--n-border-radius) var(--n-border-radius) 0 0;\n `,[U(`img`,`\n display: block;\n width: 100%;\n `)]),K(`bordered`,`\n border: 1px solid var(--n-border-color);\n `,[U(`&:target`,`border-color: var(--n-color-target);`)]),K(`action-segmented`,[U(`>`,[G(`action`,[U(`&:not(:first-child)`,`\n border-top: 1px solid var(--n-border-color);\n `)])])]),K(`content-segmented, content-soft-segmented`,[U(`>`,[W(`card-content`,`\n transition: border-color 0.3s var(--n-bezier);\n `,[U(`&:not(:first-child)`,`\n border-top: 1px solid var(--n-border-color);\n `)]),G(`content-scrollbar`,`\n transition: border-color 0.3s var(--n-bezier);\n `,[U(`&:not(:first-child)`,`\n border-top: 1px solid var(--n-border-color);\n `)])])]),K(`footer-segmented, footer-soft-segmented`,[U(`>`,[G(`footer`,`\n transition: border-color 0.3s var(--n-bezier);\n `,[U(`&:not(:first-child)`,`\n border-top: 1px solid var(--n-border-color);\n `)])])]),K(`embedded`,`\n background-color: var(--n-color-embedded);\n `)]),gc(W(`card`,`\n background: var(--n-color-modal);\n `,[K(`embedded`,`\n background-color: var(--n-color-embedded-modal);\n `)])),_c(W(`card`,`\n background: var(--n-color-popover);\n `,[K(`embedded`,`\n background-color: var(--n-color-embedded-popover);\n `)]))]),HS={title:[String,Function],contentClass:String,contentStyle:[Object,String],contentScrollable:Boolean,headerClass:String,headerStyle:[Object,String],headerExtraClass:String,headerExtraStyle:[Object,String],footerClass:String,footerStyle:[Object,String],embedded:Boolean,segmented:{type:[Boolean,Object],default:!1},size:String,bordered:{type:Boolean,default:!0},closable:Boolean,hoverable:Boolean,role:String,onClose:[Function,Array],tag:{type:String,default:`div`},cover:Function,content:[String,Function],footer:Function,action:Function,headerExtra:Function,closeFocusable:Boolean},US=jm(HS),WS=F({name:`Card`,props:{...Q.props,...HS},slots:Object,setup(e){let t=()=>{let{onClose:t}=e;t&&$(t)},{inlineThemeDisabled:n,mergedClsPrefixRef:r,mergedRtlRef:i,mergedComponentPropsRef:a}=Pm(e),o=Q(`Card`,`-card`,VS,zS,e,r),s=v_(`Card`,i,r),c=H(()=>e.size||a?.value?.Card?.size||`medium`),l=H(()=>{let e=c.value,{self:{color:t,colorModal:n,colorTarget:r,textColor:i,titleTextColor:a,titleFontWeight:s,borderColor:l,actionColor:u,borderRadius:d,lineHeight:f,closeIconColor:p,closeIconColorHover:m,closeIconColorPressed:h,closeColorHover:g,closeColorPressed:_,closeBorderRadius:v,closeIconSize:y,closeSize:b,boxShadow:x,colorPopover:S,colorEmbedded:C,colorEmbeddedModal:w,colorEmbeddedPopover:T,[q(`padding`,e)]:E,[q(`fontSize`,e)]:D,[q(`titleFontSize`,e)]:O},common:{cubicBezierEaseInOut:ee}}=o.value,{top:te,left:ne,bottom:re}=sh(E);return{"--n-bezier":ee,"--n-border-radius":d,"--n-color":t,"--n-color-modal":n,"--n-color-popover":S,"--n-color-embedded":C,"--n-color-embedded-modal":w,"--n-color-embedded-popover":T,"--n-color-target":r,"--n-text-color":i,"--n-line-height":f,"--n-action-color":u,"--n-title-text-color":a,"--n-title-font-weight":s,"--n-close-icon-color":p,"--n-close-icon-color-hover":m,"--n-close-icon-color-pressed":h,"--n-close-color-hover":g,"--n-close-color-pressed":_,"--n-border-color":l,"--n-box-shadow":x,"--n-padding-top":te,"--n-padding-bottom":re,"--n-padding-left":ne,"--n-font-size":D,"--n-title-font-size":O,"--n-close-size":b,"--n-close-icon-size":y,"--n-close-border-radius":v}}),u=n?tg(`card`,H(()=>c.value[0]),l,e):void 0;return{rtlEnabled:s,mergedClsPrefix:r,mergedTheme:o,handleCloseClick:t,cssVars:n?void 0:l,themeClass:u?.themeClass,onRender:u?.onRender}},render(){let{segmented:e,bordered:t,hoverable:n,mergedClsPrefix:r,rtlEnabled:i,onRender:a,embedded:o,tag:s,$slots:c}=this;return a?.(),L(),z(s,{class:Y([`${r}-card`,this.themeClass,o&&`${r}-card--embedded`,{[`${r}-card--rtl`]:i,[`${r}-card--content-scrollable`]:this.contentScrollable,[`${r}-card--content${typeof e!=`boolean`&&e.content===`soft`?`-soft`:``}-segmented`]:e===!0||e!==!1&&e.content,[`${r}-card--footer${typeof e!=`boolean`&&e.footer===`soft`?`-soft`:``}-segmented`]:e===!0||e!==!1&&e.footer,[`${r}-card--action-segmented`]:e===!0||e!==!1&&e.action,[`${r}-card--bordered`]:t,[`${r}-card--hoverable`]:n}]),style:k(this.cssVars),role:this.role},{default:N(()=>[J(()=>h_(c.cover,e=>{let t=this.cover?f_([this.cover()]):e;return t&&(L(),R(`div`,{class:Y(`${r}-card-cover`),role:`none`},[J(()=>t)],2))})),J(()=>h_(c.header,e=>{let{title:t}=this,n=t?f_(typeof t==`function`?[t()]:[t]):e;return n||this.closable?(L(),R(`div`,{key:1,class:Y([`${r}-card-header`,this.headerClass]),style:k(this.headerStyle),role:`heading`},[B(`div`,{class:Y(`${r}-card-header__main`),role:`heading`},[J(()=>n)],2),J(()=>h_(c[`header-extra`],e=>{let t=this.headerExtra?f_([this.headerExtra()]):e;return t&&(L(),R(`div`,{class:Y([`${r}-card-header__extra`,this.headerExtraClass]),style:k(this.headerExtraStyle)},[J(()=>t)],6))})),J(()=>this.closable&&(L(),z(Xy,{clsPrefix:r,class:Y(`${r}-card-header__close`),onClick:this.handleCloseClick,focusable:this.closeFocusable,absolute:!0},null,8,[`clsPrefix`,`class`,`onClick`,`focusable`])))],6)):null})),J(()=>h_(c.default,e=>{let{content:t}=this,n=t?f_(typeof t==`function`?[t()]:[t]):e;return n?this.contentScrollable?(L(),z(ky,{key:2,class:Y(`${r}-card__content-scrollbar`),contentClass:[`${r}-card-content`,this.contentClass],contentStyle:this.contentStyle},{default:()=>n},1032,[`class`,`contentClass`,`contentStyle`])):(L(),R(`div`,{key:3,class:Y([`${r}-card-content`,this.contentClass]),style:k(this.contentStyle),role:`none`},[J(()=>n)],6)):null})),J(()=>h_(c.footer,e=>{let t=this.footer?f_([this.footer()]):e;return t&&(L(),R(`div`,{class:Y([`${r}-card__footer`,this.footerClass]),style:k(this.footerStyle),role:`none`},[J(()=>t)],6))})),J(()=>h_(c.action,e=>{let t=this.action?f_([this.action()]):e;return t&&(L(),R(`div`,{class:Y(`${r}-card__action`),role:`none`},[J(()=>t)],2))}))]),_:2},1032,[`class`,`style`,`role`])}});function GS(e){let{borderRadius:t,textColor2:n,textColorDisabled:r,inputColor:i,inputColorDisabled:a,primaryColor:o,primaryColorHover:s,warningColor:c,warningColorHover:l,errorColor:u,errorColorHover:d,borderColor:f,iconColor:p,iconColorDisabled:m,clearColor:h,clearColorHover:g,clearColorPressed:_,placeholderColor:v,placeholderColorDisabled:y,fontSizeTiny:b,fontSizeSmall:x,fontSizeMedium:S,fontSizeLarge:C,heightTiny:w,heightSmall:T,heightMedium:E,heightLarge:D,fontWeight:O}=e;return{...ab,fontSizeTiny:b,fontSizeSmall:x,fontSizeMedium:S,fontSizeLarge:C,heightTiny:w,heightSmall:T,heightMedium:E,heightLarge:D,borderRadius:t,fontWeight:O,textColor:n,textColorDisabled:r,placeholderColor:v,placeholderColorDisabled:y,color:i,colorDisabled:a,colorActive:i,border:`1px solid ${f}`,borderHover:`1px solid ${s}`,borderActive:`1px solid ${o}`,borderFocus:`1px solid ${s}`,boxShadowHover:`none`,boxShadowActive:`0 0 0 2px ${X(o,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${X(o,{alpha:.2})}`,caretColor:o,arrowColor:p,arrowColorDisabled:m,loadingColor:o,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${l}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${l}`,boxShadowHoverWarning:`none`,boxShadowActiveWarning:`0 0 0 2px ${X(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${X(c,{alpha:.2})}`,colorActiveWarning:i,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${d}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${d}`,boxShadowHoverError:`none`,boxShadowActiveError:`0 0 0 2px ${X(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${X(u,{alpha:.2})}`,colorActiveError:i,caretColorError:u,clearColor:h,clearColorHover:g,clearColorPressed:_}}var KS=rg({name:`InternalSelection`,common:Jh,peers:{Popover:hg},self:GS}),qS=new WeakSet;function JS(e){qS.add(e)}function YS(e){return!qS.has(e)}var XS=U([W(`base-selection`,`\n --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);\n --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);\n position: relative;\n z-index: auto;\n box-shadow: none;\n width: 100%;\n max-width: 100%;\n display: inline-block;\n vertical-align: bottom;\n border-radius: var(--n-border-radius);\n min-height: var(--n-height);\n line-height: 1.5;\n font-size: var(--n-font-size);\n `,[W(`base-loading`,`\n color: var(--n-loading-color);\n `),W(`base-selection-tags`,`min-height: var(--n-height);`),G(`border, state-border`,`\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n pointer-events: none;\n border: var(--n-border);\n border-radius: inherit;\n transition:\n box-shadow .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n `),G(`state-border`,`\n z-index: 1;\n border-color: #0000;\n `),W(`base-suffix`,`\n cursor: pointer;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n right: 10px;\n `,[G(`arrow`,`\n font-size: var(--n-arrow-size);\n color: var(--n-arrow-color);\n transition: color .3s var(--n-bezier);\n `)]),W(`base-selection-overlay`,`\n display: flex;\n align-items: center;\n white-space: nowrap;\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n padding: var(--n-padding-single);\n transition: color .3s var(--n-bezier);\n `,[G(`wrapper`,`\n flex-basis: 0;\n flex-grow: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n `)]),W(`base-selection-placeholder`,`\n color: var(--n-placeholder-color);\n `,[G(`inner`,`\n max-width: 100%;\n overflow: hidden;\n `)]),W(`base-selection-tags`,`\n cursor: pointer;\n outline: none;\n box-sizing: border-box;\n position: relative;\n z-index: auto;\n display: flex;\n padding: var(--n-padding-multiple);\n flex-wrap: wrap;\n align-items: center;\n width: 100%;\n vertical-align: bottom;\n background-color: var(--n-color);\n border-radius: inherit;\n transition:\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n `),W(`base-selection-label`,`\n height: var(--n-height);\n display: inline-flex;\n width: 100%;\n vertical-align: bottom;\n cursor: pointer;\n outline: none;\n z-index: auto;\n box-sizing: border-box;\n position: relative;\n transition:\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier);\n border-radius: inherit;\n background-color: var(--n-color);\n align-items: center;\n `,[W(`base-selection-input`,`\n font-size: inherit;\n line-height: inherit;\n outline: none;\n cursor: pointer;\n box-sizing: border-box;\n border:none;\n width: 100%;\n padding: var(--n-padding-single);\n background-color: #0000;\n color: var(--n-text-color);\n transition: color .3s var(--n-bezier);\n caret-color: var(--n-caret-color);\n `,[G(`content`,`\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap; \n `)]),G(`render-label`,`\n color: var(--n-text-color);\n `)]),hc(`disabled`,[U(`&:hover`,[G(`state-border`,`\n box-shadow: var(--n-box-shadow-hover);\n border: var(--n-border-hover);\n `)]),K(`focus`,[G(`state-border`,`\n box-shadow: var(--n-box-shadow-focus);\n border: var(--n-border-focus);\n `)]),K(`active`,[G(`state-border`,`\n box-shadow: var(--n-box-shadow-active);\n border: var(--n-border-active);\n `),W(`base-selection-label`,`background-color: var(--n-color-active);`),W(`base-selection-tags`,`background-color: var(--n-color-active);`)])]),K(`disabled`,`cursor: not-allowed;`,[G(`arrow`,`\n color: var(--n-arrow-color-disabled);\n `),W(`base-selection-label`,`\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n `,[W(`base-selection-input`,`\n cursor: not-allowed;\n color: var(--n-text-color-disabled);\n `),G(`render-label`,`\n color: var(--n-text-color-disabled);\n `)]),W(`base-selection-tags`,`\n cursor: not-allowed;\n background-color: var(--n-color-disabled);\n `),W(`base-selection-placeholder`,`\n cursor: not-allowed;\n color: var(--n-placeholder-color-disabled);\n `)]),W(`base-selection-input-tag`,`\n height: calc(var(--n-height) - 6px);\n line-height: calc(var(--n-height) - 6px);\n outline: none;\n display: none;\n position: relative;\n margin-bottom: 3px;\n max-width: 100%;\n vertical-align: bottom;\n `,[G(`input`,`\n font-size: inherit;\n font-family: inherit;\n min-width: 1px;\n padding: 0;\n background-color: #0000;\n outline: none;\n border: none;\n max-width: 100%;\n overflow: hidden;\n width: 1em;\n line-height: inherit;\n cursor: pointer;\n color: var(--n-text-color);\n caret-color: var(--n-caret-color);\n `),G(`mirror`,`\n position: absolute;\n left: 0;\n top: 0;\n white-space: pre;\n visibility: hidden;\n user-select: none;\n -webkit-user-select: none;\n opacity: 0;\n `)]),[`warning`,`error`].map(e=>K(`${e}-status`,[G(`state-border`,`border: var(--n-border-${e});`),hc(`disabled`,[U(`&:hover`,[G(`state-border`,`\n box-shadow: var(--n-box-shadow-hover-${e});\n border: var(--n-border-hover-${e});\n `)]),K(`active`,[G(`state-border`,`\n box-shadow: var(--n-box-shadow-active-${e});\n border: var(--n-border-active-${e});\n `),W(`base-selection-label`,`background-color: var(--n-color-active-${e});`),W(`base-selection-tags`,`background-color: var(--n-color-active-${e});`)]),K(`focus`,[G(`state-border`,`\n box-shadow: var(--n-box-shadow-focus-${e});\n border: var(--n-border-focus-${e});\n `)])])]))]),W(`base-selection-popover`,`\n margin-bottom: -3px;\n display: flex;\n flex-wrap: wrap;\n margin-right: -8px;\n `),W(`base-selection-tag-wrapper`,`\n max-width: 100%;\n display: inline-flex;\n padding: 0 7px 3px 0;\n `,[U(`&:last-child`,`padding-right: 0;`),W(`tag`,`\n font-size: 14px;\n max-width: 100%;\n `,[G(`content`,`\n line-height: 1.25;\n text-overflow: ellipsis;\n overflow: hidden;\n `)])])]),ZS=[`disabled`,`value`,`autofocus`,`onBlur`,`onFocus`,`onKeydown`,`onInput`,`onCompositionstart`,`onCompositionend`],QS=[`tabindex`],$S=[`title`],eC=[`value`,`readonly`,`disabled`,`autofocus`,`onFocus`,`onBlur`,`onInput`,`onCompositionstart`,`onCompositionend`],tC=[`tabindex`],nC=[`onClick`,`onMouseenter`,`onMouseleave`,`onKeydown`,`onFocusin`,`onFocusout`,`onMousedown`],rC=F({name:`InternalSelection`,props:{...Q.props,clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:``},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:`medium`},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n}=Pm(e),r=v_(`InternalSelection`,n,t),i=A(null),a=A(null),o=A(null),s=A(null),c=A(null),l=A(null),u=A(null),d=A(null),f=A(null),p=A(null),m=A(!1),h=A(!1),g=A(!1),_=Q(`InternalSelection`,`-internal-selection`,XS,KS,e,M(e,`clsPrefix`)),v=H(()=>e.clearable&&!e.disabled&&(g.value||e.active)),y=H(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):ux(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),b=H(()=>{let t=e.selectedOption;if(t)return t[e.labelField]}),x=H(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function S(){let{value:t}=i;if(t){let{value:n}=a;n&&(n.style.width=`${t.offsetWidth}px`,e.maxTagCount!==`responsive`&&f.value?.sync({showAllItemsBeforeCalculate:!1}))}}function C(){let{value:e}=p;e&&(e.style.display=`none`)}function w(){let{value:e}=p;e&&(e.style.display=`inline-block`)}Un(M(e,`active`),e=>{e||C()}),Un(M(e,`pattern`),()=>{e.multiple&&Tn(S)});function T(t){let{onFocus:n}=e;n&&n(t)}function E(t){let{onBlur:n}=e;n&&n(t)}function D(t){let{onDeleteOption:n}=e;n&&n(t)}function O(t){let{onClear:n}=e;n&&n(t)}function ee(t){let{onPatternInput:n}=e;n&&n(t)}function te(e){(!e.relatedTarget||!o.value?.contains(e.relatedTarget))&&T(e)}function ne(e){o.value?.contains(e.relatedTarget)||E(e)}function re(e){O(e)}function ie(){g.value=!0}function ae(){g.value=!1}function oe(t){!e.active||!e.filterable||t.target!==a.value&&t.preventDefault()}function se(e){D(e)}let ce=A(!1);function le(t){if(t.key===`Backspace`&&!ce.value&&!e.pattern.length){let{selectedOptions:t}=e;t?.length&&se(t[t.length-1])}}let ue=null;function k(t){let{value:n}=i;n&&(n.textContent=t.target.value,S()),e.ignoreComposition&&ce.value?ue=t:ee(t)}function de(){ce.value=!0}function fe(){ce.value=!1,e.ignoreComposition&&ee(ue),ue=null}function pe(t){h.value=!0,e.onPatternFocus?.(t)}function me(t){h.value=!1,e.onPatternBlur?.(t)}function he(){if(e.filterable)h.value=!1,l.value?.blur(),a.value?.blur();else if(e.multiple){let{value:e}=s;e?.blur()}else{let{value:e}=c;e?.blur()}}function ge(){e.filterable?(h.value=!1,l.value?.focus()):e.multiple?s.value?.focus():c.value?.focus()}function _e(){let{value:e}=a;e&&(w(),e.focus())}function ve(){let{value:e}=a;e&&e.blur()}function ye(e){let{value:t}=u;t&&t.setTextContent(`+${e}`)}function be(){let{value:e}=d;return e}function xe(){return a.value}let Se=null;function Ce(){Se!==null&&window.clearTimeout(Se)}function we(){e.active||(Ce(),Se=window.setTimeout(()=>{x.value&&(m.value=!0)},100))}function Te(){Ce()}function Ee(e){e||(Ce(),m.value=!1)}Un(x,e=>{e||(m.value=!1)}),Ir(()=>{Hn(()=>{let t=l.value;t&&(e.disabled?t.removeAttribute(`tabindex`):t.tabIndex=h.value?-1:0)})}),cx(o,e.onResize);let{inlineThemeDisabled:De}=e,Oe=H(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{fontWeight:r,borderRadius:i,color:a,placeholderColor:o,textColor:s,paddingSingle:c,paddingMultiple:l,caretColor:u,colorDisabled:d,textColorDisabled:f,placeholderColorDisabled:p,colorActive:m,boxShadowFocus:h,boxShadowActive:g,boxShadowHover:v,border:y,borderFocus:b,borderHover:x,borderActive:S,arrowColor:C,arrowColorDisabled:w,loadingColor:T,colorActiveWarning:E,boxShadowFocusWarning:D,boxShadowActiveWarning:O,boxShadowHoverWarning:ee,borderWarning:te,borderFocusWarning:ne,borderHoverWarning:re,borderActiveWarning:ie,colorActiveError:ae,boxShadowFocusError:oe,boxShadowActiveError:se,boxShadowHoverError:ce,borderError:le,borderFocusError:ue,borderHoverError:k,borderActiveError:de,clearColor:fe,clearColorHover:pe,clearColorPressed:me,clearSize:he,arrowSize:ge,[q(`height`,t)]:_e,[q(`fontSize`,t)]:ve}}=_.value,ye=sh(c),be=sh(l);return{"--n-bezier":n,"--n-border":y,"--n-border-active":S,"--n-border-focus":b,"--n-border-hover":x,"--n-border-radius":i,"--n-box-shadow-active":g,"--n-box-shadow-focus":h,"--n-box-shadow-hover":v,"--n-caret-color":u,"--n-color":a,"--n-color-active":m,"--n-color-disabled":d,"--n-font-size":ve,"--n-height":_e,"--n-padding-single-top":ye.top,"--n-padding-multiple-top":be.top,"--n-padding-single-right":ye.right,"--n-padding-multiple-right":be.right,"--n-padding-single-left":ye.left,"--n-padding-multiple-left":be.left,"--n-padding-single-bottom":ye.bottom,"--n-padding-multiple-bottom":be.bottom,"--n-placeholder-color":o,"--n-placeholder-color-disabled":p,"--n-text-color":s,"--n-text-color-disabled":f,"--n-arrow-color":C,"--n-arrow-color-disabled":w,"--n-loading-color":T,"--n-color-active-warning":E,"--n-box-shadow-focus-warning":D,"--n-box-shadow-active-warning":O,"--n-box-shadow-hover-warning":ee,"--n-border-warning":te,"--n-border-focus-warning":ne,"--n-border-hover-warning":re,"--n-border-active-warning":ie,"--n-color-active-error":ae,"--n-box-shadow-focus-error":oe,"--n-box-shadow-active-error":se,"--n-box-shadow-hover-error":ce,"--n-border-error":le,"--n-border-focus-error":ue,"--n-border-hover-error":k,"--n-border-active-error":de,"--n-clear-size":he,"--n-clear-color":fe,"--n-clear-color-hover":pe,"--n-clear-color-pressed":me,"--n-arrow-size":ge,"--n-font-weight":r}}),ke=De?tg(`internal-selection`,H(()=>e.size[0]),Oe,e):void 0;return{mergedTheme:_,mergedClearable:v,mergedClsPrefix:t,rtlEnabled:r,patternInputFocused:h,filterablePlaceholder:y,label:b,selected:x,showTagsPanel:m,isComposing:ce,counterRef:u,counterWrapperRef:d,patternInputMirrorRef:i,patternInputRef:a,selfRef:o,multipleElRef:s,singleElRef:c,patternInputWrapperRef:l,overflowRef:f,inputTagElRef:p,handleMouseDown:oe,handleFocusin:te,handleClear:re,handleMouseEnter:ie,handleMouseLeave:ae,handleDeleteOption:se,handlePatternKeyDown:le,handlePatternInputInput:k,handlePatternInputBlur:me,handlePatternInputFocus:pe,handleMouseEnterCounter:we,handleMouseLeaveCounter:Te,handleFocusout:ne,handleCompositionEnd:fe,handleCompositionStart:de,onPopoverUpdateShow:Ee,focus:ge,focusInput:_e,blur:he,blurInput:ve,updateCounter:ye,getCounter:be,getTail:xe,renderLabel:e.renderLabel,cssVars:De?void 0:Oe,themeClass:ke?.themeClass,onRender:ke?.onRender}},render(){let{status:e,multiple:t,size:n,disabled:r,filterable:i,maxTagCount:a,bordered:o,clsPrefix:s,ellipsisTagPopoverProps:c,onRender:l,renderTag:u,renderLabel:d}=this;l?.();let f=a===`responsive`,p=typeof a==`number`,m=f||p,h=(L(),z(x_,null,{default:()=>(L(),z(Ub,{clsPrefix:s,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>this.$slots.arrow?.()},1032,[`clsPrefix`,`loading`,`showArrow`,`showClear`,`onClear`]))},1024)),g;if(t){let{labelField:e}=this,t=t=>(L(),R(`div`,{class:Y(`${s}-base-selection-tag-wrapper`),key:t.value},[u?(L(),R(I,{key:0},[J(()=>u({option:t,handleClose:()=>{this.handleDeleteOption(t)}}))],64)):(L(),z(ib,{key:1,size:n,closable:!t.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(t)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>d?d(t,!0):ux(t[e],t,!0)},1032,[`size`,`closable`,`disabled`,`onClose`]))],2)),o=()=>(p?this.selectedOptions.slice(0,a):this.selectedOptions).map(t),l=i?(L(),R(`div`,{class:Y(`${s}-base-selection-input-tag`),ref:`inputTagElRef`,key:`__input-tag__`},[B(`input`,Fa(this.inputProps,{ref:`patternInputRef`,tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${s}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd}),null,16,ZS),B(`span`,{ref:`patternInputMirrorRef`,class:Y(`${s}-base-selection-input-tag__mirror`)},[J(()=>this.pattern)],2)],2)):null,_=f?()=>(L(),R(`div`,{class:Y(`${s}-base-selection-tag-wrapper`),ref:`counterWrapperRef`},[(L(),z(ib,{size:n,ref:`counterRef`,onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r},null,8,[`size`,`onMouseenter`,`onMouseleave`,`disabled`]))],2)):void 0,v;if(p){let e=this.selectedOptions.length-a;e>0&&(v=(t=>(L(),R(`div`,{class:Y(`${s}-base-selection-tag-wrapper`),key:`__counter__`},[(L(),z(ib,{size:n,ref:`counterRef`,onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${e}`},1032,[`size`,`onMouseenter`,`disabled`]))],2)))(v))}let y=f?i?(L(),z(vy,{key:3,ref:`overflowRef`,updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:`100%`,display:`flex`,overflow:`hidden`}},{default:o,counter:_,tail:()=>l},1032,[`updateCounter`,`getCounter`,`getTail`])):(L(),z(vy,{key:4,ref:`overflowRef`,updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:`100%`,display:`flex`,overflow:`hidden`}},{default:o,counter:_},1032,[`updateCounter`,`getCounter`])):p&&v?o().concat(v):o(),b=m?()=>(L(),R(`div`,{class:Y(`${s}-base-selection-popover`)},[f?(L(),R(I,{key:0},[J(()=>o())],64)):(L(),R(I,{key:1},[J(()=>this.selectedOptions.map(t))],64))],2)):void 0,x=m?{show:this.showTagsPanel,trigger:`hover`,overlap:!0,placement:`top`,width:`trigger`,onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover,...c}:null,S=!this.selected&&(!this.active||!this.pattern&&!this.isComposing)?(L(),R(`div`,{key:5,class:Y(`${s}-base-selection-placeholder ${s}-base-selection-overlay`)},[B(`div`,{class:Y(`${s}-base-selection-placeholder__inner`)},[J(()=>this.placeholder)],2)],2)):null,C=i?(L(),R(`div`,{key:6,ref:`patternInputWrapperRef`,class:Y(`${s}-base-selection-tags`)},[J(()=>y),f?J(()=>null):(L(),R(I,{key:1},[J(()=>l)],64)),J(()=>h)],2)):(L(),R(`div`,{key:7,ref:`multipleElRef`,class:Y(`${s}-base-selection-tags`),tabindex:r?void 0:0},[J(()=>y),J(()=>h)],10,QS));g=(e=>(L(),R(I,{key:8},[m?(L(),z(Wy,Fa({key:0},x,{scrollable:!0,style:`max-height: calc(var(--v-target-height) * 6.6);`}),{trigger:()=>C,default:b},1040)):(L(),R(I,{key:1},[J(()=>C)],64)),J(()=>S)],64)))(g)}else if(i){let e=this.pattern||this.isComposing,t=this.active?!e:!this.selected,n=!this.active&&this.selected;g=(e=>(L(),R(`div`,{key:9,ref:`patternInputWrapperRef`,class:Y(`${s}-base-selection-label`),title:this.patternInputFocused?void 0:xb(this.label)},[B(`input`,Fa(this.inputProps,{ref:`patternInputRef`,class:`${s}-base-selection-input`,value:this.active?this.pattern:``,placeholder:``,readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd}),null,16,eC),n?(L(),R(`div`,{class:Y(`${s}-base-selection-label__render-label ${s}-base-selection-overlay`),key:`input`},[B(`div`,{class:Y(`${s}-base-selection-overlay__wrapper`)},[u?(L(),R(I,{key:0},[J(()=>u({option:this.selectedOption,handleClose:()=>{}}))],64)):(L(),R(I,{key:1},[d?(L(),R(I,{key:0},[J(()=>d(this.selectedOption,!0))],64)):(L(),R(I,{key:1},[J(()=>ux(this.label,this.selectedOption,!0))],64))],64))],2)],2)):J(()=>null),t?(L(),R(`div`,{class:Y(`${s}-base-selection-placeholder ${s}-base-selection-overlay`),key:`placeholder`},[B(`div`,{class:Y(`${s}-base-selection-overlay__wrapper`)},[J(()=>this.filterablePlaceholder)],2)],2)):J(()=>null),J(()=>h)],10,$S)))(g)}else g=(e=>(L(),R(`div`,{key:10,ref:`singleElRef`,class:Y(`${s}-base-selection-label`),tabindex:this.disabled?void 0:0},[this.label===void 0?(L(),R(`div`,{class:Y(`${s}-base-selection-placeholder ${s}-base-selection-overlay`),key:`placeholder`},[B(`div`,{class:Y(`${s}-base-selection-placeholder__inner`)},[J(()=>this.placeholder)],2)],2)):(L(),R(`div`,{class:Y(`${s}-base-selection-input`),title:xb(this.label),key:`input`},[B(`div`,{class:Y(`${s}-base-selection-input__content`)},[u?(L(),R(I,{key:0},[J(()=>u({option:this.selectedOption,handleClose:()=>{}}))],64)):(L(),R(I,{key:1},[d?(L(),R(I,{key:0},[J(()=>d(this.selectedOption,!0))],64)):(L(),R(I,{key:1},[J(()=>ux(this.label,this.selectedOption,!0))],64))],64))],2)],10,[`title`])),J(()=>h)],10,tC)))(g);return L(),R(`div`,{ref:`selfRef`,class:Y([`${s}-base-selection`,this.rtlEnabled&&`${s}-base-selection--rtl`,this.themeClass,e&&`${s}-base-selection--${e}-status`,{[`${s}-base-selection--active`]:this.active,[`${s}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${s}-base-selection--disabled`]:this.disabled,[`${s}-base-selection--multiple`]:this.multiple,[`${s}-base-selection--focus`]:this.focused}]),style:k(this.cssVars),onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},[J(()=>g),o?(L(),R(`div`,{key:0,class:Y(`${s}-base-selection__border`)},null,2)):J(()=>null),o?(L(),R(`div`,{key:2,class:Y(`${s}-base-selection__state-border`)},null,2)):J(()=>null)],46,nC)}});function iC(e){let{fontWeight:t,textColor1:n,textColor2:r,textColorDisabled:i,dividerColor:a,fontSize:o}=e;return{titleFontSize:o,titleFontWeight:t,dividerColor:a,titleTextColor:n,titleTextColorDisabled:i,fontSize:o,textColor:r,arrowColor:r,arrowColorDisabled:i,itemMargin:`16px 0 0 0`,titlePadding:`16px 0 0 0`}}var aC={name:`Collapse`,common:Jh,self:iC},oC=W(`collapse`,`width: 100%;`,[W(`collapse-item`,`\n font-size: var(--n-font-size);\n color: var(--n-text-color);\n transition:\n color .3s var(--n-bezier),\n border-color .3s var(--n-bezier);\n margin: var(--n-item-margin);\n `,[K(`disabled`,[G(`header`,`cursor: not-allowed;`,[G(`header-main`,`\n color: var(--n-title-text-color-disabled);\n `),W(`collapse-item-arrow`,`\n color: var(--n-arrow-color-disabled);\n `)])]),W(`collapse-item`,`margin-left: 32px;`),U(`&:first-child`,`margin-top: 0;`),U(`&:first-child >`,[G(`header`,`padding-top: 0;`)]),K(`left-arrow-placement`,[G(`header`,[W(`collapse-item-arrow`,`margin-right: 4px;`)])]),K(`right-arrow-placement`,[G(`header`,[W(`collapse-item-arrow`,`margin-left: 4px;`)])]),G(`content-wrapper`,[G(`content-inner`,`padding-top: 16px;`),_b({duration:`0.15s`})]),K(`active`,[G(`header`,[K(`active`,[W(`collapse-item-arrow`,`transform: rotate(90deg);`)])])]),U(`&:not(:first-child)`,`border-top: 1px solid var(--n-divider-color);`),hc(`disabled`,[K(`trigger-area-main`,[G(`header`,[G(`header-main`,`cursor: pointer;`),W(`collapse-item-arrow`,`cursor: default;`)])]),K(`trigger-area-arrow`,[G(`header`,[W(`collapse-item-arrow`,`cursor: pointer;`)])]),K(`trigger-area-extra`,[G(`header`,[G(`header-extra`,`cursor: pointer;`)])])]),G(`header`,`\n font-size: var(--n-title-font-size);\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n transition: color .3s var(--n-bezier);\n position: relative;\n padding: var(--n-title-padding);\n color: var(--n-title-text-color);\n `,[G(`header-main`,`\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n font-weight: var(--n-title-font-weight);\n transition: color .3s var(--n-bezier);\n flex: 1;\n color: var(--n-title-text-color);\n `),G(`header-extra`,`\n display: flex;\n align-items: center;\n transition: color .3s var(--n-bezier);\n color: var(--n-text-color);\n `),W(`collapse-item-arrow`,`\n display: flex;\n transition:\n transform .15s var(--n-bezier),\n color .3s var(--n-bezier);\n font-size: 18px;\n color: var(--n-arrow-color);\n `)])])]),sC={...Q.props,defaultExpandedNames:{type:[Array,String],default:null},expandedNames:[Array,String],arrowPlacement:{type:String,default:`left`},accordion:Boolean,displayDirective:{type:String,default:`if`},triggerAreas:{type:Array,default:()=>[`main`,`extra`,`arrow`]},onItemHeaderClick:[Function,Array],"onUpdate:expandedNames":[Function,Array],onUpdateExpandedNames:[Function,Array],onExpandedNamesChange:{type:[Function,Array],validator:()=>!0,default:void 0}},cC=Mm(`n-collapse`),lC=F({name:`Collapse`,props:sC,slots:Object,setup(e,{slots:t}){let{mergedClsPrefixRef:n,inlineThemeDisabled:r,mergedRtlRef:i}=Pm(e),a=A(e.defaultExpandedNames),o=Yg(H(()=>e.expandedNames),a),s=Q(`Collapse`,`-collapse`,oC,aC,e,n);function c(t){let{"onUpdate:expandedNames":n,onUpdateExpandedNames:r,onExpandedNamesChange:i}=e;r&&$(r,t),n&&$(n,t),i&&$(i,t),a.value=t}function l(t){let{onItemHeaderClick:n}=e;n&&$(n,t)}function u(t,n,r){let{accordion:i}=e,{value:a}=o;if(i)t?(c([n]),l({name:n,expanded:!0,event:r})):(c([]),l({name:n,expanded:!1,event:r}));else if(!Array.isArray(a))c([n]),l({name:n,expanded:!0,event:r});else{let e=a.slice(),t=e.findIndex(e=>n===e);~t?(e.splice(t,1),c(e),l({name:n,expanded:!1,event:r})):(e.push(n),c(e),l({name:n,expanded:!0,event:r}))}}zn(cC,{props:e,mergedClsPrefixRef:n,expandedNamesRef:o,slots:t,toggleItem:u});let d=v_(`Collapse`,i,n),f=H(()=>{let{common:{cubicBezierEaseInOut:e},self:{titleFontWeight:t,dividerColor:n,titlePadding:r,titleTextColor:i,titleTextColorDisabled:a,textColor:o,arrowColor:c,fontSize:l,titleFontSize:u,arrowColorDisabled:d,itemMargin:f}}=s.value;return{"--n-font-size":l,"--n-bezier":e,"--n-text-color":o,"--n-divider-color":n,"--n-title-padding":r,"--n-title-font-size":u,"--n-title-text-color":i,"--n-title-text-color-disabled":a,"--n-title-font-weight":t,"--n-arrow-color":c,"--n-arrow-color-disabled":d,"--n-item-margin":f}}),p=r?tg(`collapse`,void 0,f,e):void 0;return{rtlEnabled:d,mergedTheme:s,mergedClsPrefix:n,cssVars:r?void 0:f,themeClass:p?.themeClass,onRender:p?.onRender}},render(){return this.onRender?.(),L(),R(`div`,{class:Y([`${this.mergedClsPrefix}-collapse`,this.rtlEnabled&&`${this.mergedClsPrefix}-collapse--rtl`,this.themeClass]),style:k(this.cssVars)},[J(()=>this.$slots.default?.())],6)}}),uC=F({name:`CollapseItemContent`,props:{displayDirective:{type:String,required:!0},show:Boolean,clsPrefix:{type:String,required:!0}},setup(e){return{onceTrue:Mg(M(e,`show`))}},render(){return L(),z(db,null,{_:1,default:Zm(()=>{let{show:e,displayDirective:t,onceTrue:n,clsPrefix:r}=this,i=t===`show`&&n,a=(L(),R(`div`,{class:Y(`${r}-collapse-item__content-wrapper`)},[B(`div`,{class:Y(`${r}-collapse-item__content-inner`)},[J(()=>this.$slots.default?.())],2)],2));return i?Ln(a,[[Lo,e]]):e?a:null})})}}),dC=[`onClick`],fC=[`onClick`],pC=F({name:`CollapseItem`,props:{title:String,name:[String,Number],disabled:Boolean,displayDirective:String},setup(e){let{mergedRtlRef:t}=Pm(e),n=Hh(),r=Ng(()=>e.name??n),i=P(cC);i||Am(`collapse-item`,"`n-collapse-item` must be placed inside `n-collapse`.");let{expandedNamesRef:a,props:o,mergedClsPrefixRef:s,slots:c}=i,l=H(()=>{let{value:e}=a;if(Array.isArray(e)){let{value:t}=r;return!~e.findIndex(e=>e===t)}if(e){let{value:t}=r;return t!==e}return!0});return{rtlEnabled:v_(`Collapse`,t,s),collapseSlots:c,randomName:n,mergedClsPrefix:s,collapsed:l,triggerAreas:M(o,`triggerAreas`),mergedDisplayDirective:H(()=>{let{displayDirective:t}=e;return t||o.displayDirective}),arrowPlacement:H(()=>o.arrowPlacement),handleClick(t){let n=`main`;rh(t,`arrow`)&&(n=`arrow`),rh(t,`extra`)&&(n=`extra`),o.triggerAreas.includes(n)&&i&&!e.disabled&&i.toggleItem(l.value,r.value,t)}}},render(){let{collapseSlots:e,$slots:t,arrowPlacement:n,collapsed:r,mergedDisplayDirective:i,mergedClsPrefix:a,disabled:o,triggerAreas:s}=this,c=m_(t.header,{collapsed:r},()=>[this.title]),l=t[`header-extra`]||e[`header-extra`],u=t.arrow||e.arrow;return L(),R(`div`,{class:Y([`${a}-collapse-item`,`${a}-collapse-item--${n}-arrow-placement`,o&&`${a}-collapse-item--disabled`,!r&&`${a}-collapse-item--active`,s.map(e=>`${a}-collapse-item--trigger-area-${e}`)])},[B(`div`,{class:Y([`${a}-collapse-item__header`,!r&&`${a}-collapse-item__header--active`])},[B(`div`,{class:Y(`${a}-collapse-item__header-main`),onClick:this.handleClick},[J(()=>n===`right`&&c),(L(),R(`div`,{class:Y(`${a}-collapse-item-arrow`),key:+!this.rtlEnabled,"data-arrow":!0},[J(()=>m_(u,{collapsed:r},()=>[(L(),z(og,{clsPrefix:a},{default:()=>this.rtlEnabled?(L(),z(FS,{key:1})):(L(),z(IS,{key:2}))},1032,[`clsPrefix`]))]))],2)),J(()=>n===`left`&&c)],10,fC),J(()=>g_(l,{collapsed:r},e=>(L(),R(`div`,{class:Y(`${a}-collapse-item__header-extra`),onClick:this.handleClick,"data-extra":!0},[J(()=>e)],10,dC))))],2),(L(),z(uC,{clsPrefix:a,displayDirective:i,show:!r},Qm(t),1032,[`clsPrefix`,`displayDirective`,`show`]))],2)}}),mC=F({name:`ConfigProvider`,alias:[`App`],props:{abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:String,locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:`div`},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,styleMountTarget:Object,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(km(`config-provider`,"`as` is deprecated, please use `tag` instead."),!0),default:void 0}},setup(e){let t=P(Nm,null),n=H(()=>{let{theme:n}=e;if(n===null)return;let r=t?.mergedThemeRef.value;return n===void 0?r:r===void 0?n:Object.assign({},r,n)}),r=H(()=>{let{themeOverrides:n}=e;if(n!==null){if(n===void 0)return t?.mergedThemeOverridesRef.value;{let e=t?.mergedThemeOverridesRef.value;return e===void 0?n:Om({},e,n)}}}),i=Ng(()=>{let{namespace:n}=e;return n===void 0?t?.mergedNamespaceRef.value:n}),a=Ng(()=>{let{bordered:n}=e;return n===void 0?t?.mergedBorderedRef.value:n}),o=H(()=>{let{icons:n}=e;return n===void 0?t?.mergedIconsRef.value:n}),s=H(()=>{let{componentOptions:n}=e;return n===void 0?t?.mergedComponentPropsRef.value:n}),c=H(()=>{let{clsPrefix:n}=e;return n===void 0?t?t.mergedClsPrefixRef.value:`n`:n}),l=H(()=>{let{rtl:n}=e;if(n===void 0)return t?.mergedRtlRef.value;let r={};for(let e of n)r[e.name]=qt(e),e.peers?.forEach(e=>{e.name in r||(r[e.name]=qt(e))});return r}),u=H(()=>e.breakpoints||t?.mergedBreakpointsRef.value),d=e.inlineThemeDisabled||t?.inlineThemeDisabled,f=e.preflightStyleDisabled||t?.preflightStyleDisabled,p=e.styleMountTarget||t?.styleMountTarget;return zn(Nm,{mergedThemeHashRef:H(()=>{let{value:e}=n,{value:t}=r,i=t&&Object.keys(t).length!==0,a=e?.name;return a?i?`${a}-${Qs(JSON.stringify(r.value))}`:a:i?Qs(JSON.stringify(r.value)):``}),mergedBreakpointsRef:u,mergedRtlRef:l,mergedIconsRef:o,mergedComponentPropsRef:s,mergedBorderedRef:a,mergedNamespaceRef:i,mergedClsPrefixRef:c,mergedLocaleRef:H(()=>{let{locale:n}=e;if(n!==null)return n===void 0?t?.mergedLocaleRef.value:n}),mergedDateLocaleRef:H(()=>{let{dateLocale:n}=e;if(n!==null)return n===void 0?t?.mergedDateLocaleRef.value:n}),mergedHljsRef:H(()=>{let{hljs:n}=e;return n===void 0?t?.mergedHljsRef.value:n}),mergedKatexRef:H(()=>{let{katex:n}=e;return n===void 0?t?.mergedKatexRef.value:n}),mergedThemeRef:n,mergedThemeOverridesRef:r,inlineThemeDisabled:d||!1,preflightStyleDisabled:f||!1,styleMountTarget:p}),{mergedClsPrefix:c,mergedBordered:a,mergedNamespace:i,mergedTheme:n,mergedThemeOverrides:r}},render(){return this.abstract?this.$slots.default?.():ro(this.as||this.tag,{class:`${this.mergedClsPrefix||`n`}-config-provider`},this.$slots.default?.())}});function hC(e){return t=>{e.value=t?t.$el:null}}function gC(e,t=[],n){let r={};return Object.getOwnPropertyNames(e).forEach(n=>{t.includes(n)||(r[n]=e[n])}),Object.assign(r,n)}function _C(e){let{boxShadow2:t}=e;return{menuBoxShadow:t}}var vC=rg({name:`Select`,common:Jh,peers:{InternalSelection:KS,InternalSelectMenu:fg},self:_C}),yC=U([W(`select`,`\n z-index: auto;\n outline: none;\n width: 100%;\n position: relative;\n font-weight: var(--n-font-weight);\n `),W(`select-menu`,`\n margin: 4px 0;\n box-shadow: var(--n-menu-box-shadow);\n `,[yx({originalTransition:`background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)`})])]),bC=F({name:`Select`,props:{...Q.props,to:n_.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearCreatedOptionsOnClear:{type:Boolean,default:!0},clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:`bottom-start`},widthMode:{type:String,default:`trigger`},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},childrenField:{type:String,default:`children`},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:`show`},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},scrollbarProps:Object,onChange:[Function,Array],items:Array},slots:Object,setup(e){let{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:i,mergedComponentPropsRef:a}=Pm(e),o=Q(`Select`,`-select`,yC,vC,e,t),s=A(e.defaultValue),c=Yg(M(e,`value`),s),l=A(!1),u=A(``),d=Zg(e,[`items`,`options`]),f=A([]),p=A([]),m=H(()=>p.value.concat(f.value).concat(d.value)),h=H(()=>{let{filter:t}=e;if(t)return t;let{labelField:n,valueField:r}=e;return(e,t)=>{if(!t)return!1;let i=t[n];if(typeof i==`string`)return oS(e,i);let a=t[r];return typeof a==`string`?oS(e,a):typeof a==`number`&&oS(e,String(a))}}),g=H(()=>{if(e.remote)return d.value;{let{value:t}=m,{value:n}=u;return!n.length||!e.filterable?t:cS(t,h.value,n,e.childrenField)}}),_=H(()=>{let{valueField:t,childrenField:n}=e,r=sS(t,n);return tS(g.value,r)}),v=H(()=>lS(m.value,e.valueField,e.childrenField)),y=A(!1),b=Yg(M(e,`show`),y),x=A(null),S=A(null),C=A(null),{localeRef:w}=ng(`Select`),T=H(()=>e.placeholder??w.value.placeholder),E=[],D=A(new Map),O=H(()=>{let{fallbackOption:t}=e;if(t===void 0){let{labelField:t,valueField:n}=e;return e=>({[t]:String(e),[n]:e})}return t===!1?!1:e=>Object.assign(t(e),{value:e})});function ee(t){let n=e.remote,{value:r}=D,{value:i}=v,{value:a}=O,o=[];return t.forEach(e=>{if(i.has(e))o.push(i.get(e));else if(n&&r.has(e))o.push(r.get(e));else if(a){let t=a(e);t&&o.push(t)}}),o}let te=H(()=>{if(e.multiple){let{value:e}=c;return Array.isArray(e)?ee(e):[]}return null}),ne=H(()=>{let{value:t}=c;return!e.multiple&&!Array.isArray(t)?t===null?null:ee([t])[0]||null:null}),re=wb(e,{mergedSize:t=>{let{size:n}=e;if(n)return n;let{mergedSize:r}=t||{};return r?.value?r.value:a?.value?.Select?.size||`medium`}}),{mergedSizeRef:ie,mergedDisabledRef:ae,mergedStatusRef:oe}=re;function se(t,n){let{onChange:r,"onUpdate:value":i,onUpdateValue:a}=e,{nTriggerFormChange:o,nTriggerFormInput:c}=re;r&&$(r,t,n),a&&$(a,t,n),i&&$(i,t,n),s.value=t,o(),c()}function ce(t){let{onBlur:n}=e,{nTriggerFormBlur:r}=re;n&&$(n,t),r()}function le(){let{onClear:t}=e;t&&$(t)}function ue(t){let{onFocus:n,showOnFocus:r}=e,{nTriggerFormFocus:i}=re;n&&$(n,t),i(),r&&me()}function k(t){let{onSearch:n}=e;n&&$(n,t)}function de(t){let{onScroll:n}=e;n&&$(n,t)}function fe(){let{remote:t,multiple:n}=e;if(t){let{value:t}=D;if(n){let{valueField:n}=e;te.value?.forEach(e=>{t.set(e[n],e)})}else{let n=ne.value;n&&t.set(n[e.valueField],n)}}}function pe(t){let{onUpdateShow:n,"onUpdate:show":r}=e;n&&$(n,t),r&&$(r,t),y.value=t}function me(){ae.value||(pe(!0),y.value=!0,e.filterable&&Le())}function he(){pe(!1)}function ge(){u.value=``,p.value=E}let _e=A(!1);function ve(){e.filterable&&(_e.value=!0)}function ye(){e.filterable&&(_e.value=!1,b.value||ge())}function be(){ae.value||(b.value?e.filterable?Le():he():me())}function xe(e){C.value?.selfRef?.contains(e.relatedTarget)||(l.value=!1,ce(e),he())}function Se(e){ue(e),l.value=!0}function Ce(){l.value=!0}function we(e){x.value?.$el.contains(e.relatedTarget)||(l.value=!1,ce(e),he())}function Te(){x.value?.focus(),he()}function Ee(e){b.value&&(x.value?.$el.contains(ih(e))||he())}function De(t){if(!Array.isArray(t))return[];if(O.value)return Array.from(t);{let{remote:n}=e,{value:r}=v;if(n){let{value:e}=D;return t.filter(t=>r.has(t)||e.has(t))}return t.filter(e=>r.has(e))}}function Oe(e){ke(e.rawNode)}function ke(t){if(ae.value)return;let{tag:n,remote:r,clearFilterAfterSelect:i,valueField:a}=e;if(n&&!r){let{value:e}=p,t=e[0]||null;if(t){let e=f.value;e.length?e.push(t):f.value=[t],p.value=E}}if(r&&D.value.set(t[a],t),e.multiple){let e=De(c.value),o=e.findIndex(e=>e===t[a]);if(~o){if(e.splice(o,1),n&&!r){let e=Ae(t[a]);~e&&(f.value.splice(e,1),i&&(u.value=``))}}else e.push(t[a]),i&&(u.value=``);se(e,ee(e))}else{if(n&&!r){let e=Ae(t[a]);~e?f.value=[f.value[e]]:f.value=E}Ie(),he(),se(t[a],t)}}function Ae(t){return f.value.findIndex(n=>n[e.valueField]===t)}function je(t){b.value||me();let{value:n}=t.target;u.value=n;let{tag:r,remote:i}=e;if(k(n),r&&!i){if(!n){p.value=E;return}let{onCreate:t}=e,r=t?t(n):{[e.labelField]:n,[e.valueField]:n},{valueField:i,labelField:a}=e;d.value.some(e=>e[i]===r[i]||e[a]===r[a])||f.value.some(e=>e[i]===r[i]||e[a]===r[a])?p.value=E:p.value=[r]}}function Me(t){t.stopPropagation();let{multiple:n,tag:r,remote:i,clearCreatedOptionsOnClear:a}=e;!n&&e.filterable&&he(),r&&!i&&a&&(f.value=E),le(),n?se([],[]):se(null,null)}function Ne(e){!rh(e,`action`)&&!rh(e,`empty`)&&!rh(e,`header`)&&e.preventDefault()}function Pe(e){de(e)}function Fe(t){if(!e.keyboard){t.preventDefault();return}switch(t.key){case` `:if(e.filterable)break;t.preventDefault();case`Enter`:if(!x.value?.isComposing){if(b.value){let t=C.value?.getPendingTmNode();t?Oe(t):e.filterable||(he(),Ie())}else if(me(),e.tag&&_e.value){let t=p.value[0];if(t){let n=t[e.valueField],{value:r}=c;e.multiple&&Array.isArray(r)&&r.includes(n)||ke(t)}}}t.preventDefault();break;case`ArrowUp`:if(t.preventDefault(),e.loading)return;b.value&&C.value?.prev();break;case`ArrowDown`:if(t.preventDefault(),e.loading)return;b.value?C.value?.next():me();break;case`Escape`:b.value&&(JS(t),he()),x.value?.focus()}}function Ie(){x.value?.focus()}function Le(){x.value?.focusInput()}function Re(){b.value&&S.value?.syncPosition()}fe(),Un(M(e,`options`),fe);let ze={focus:()=>{x.value?.focus()},focusInput:()=>{x.value?.focusInput()},blur:()=>{x.value?.blur()},blurInput:()=>{x.value?.blurInput()}},Be=H(()=>{let{self:{menuBoxShadow:e}}=o.value;return{"--n-menu-box-shadow":e}}),Ve=i?tg(`select`,void 0,Be,e):void 0;return{...ze,mergedStatus:oe,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:_,isMounted:Xg(),triggerRef:x,menuRef:C,pattern:u,uncontrolledShow:y,mergedShow:b,adjustedTo:n_(e),uncontrolledValue:s,mergedValue:c,followerRef:S,localizedPlaceholder:T,selectedOption:ne,selectedOptions:te,mergedSize:ie,mergedDisabled:ae,focused:l,activeWithoutMenuOpen:_e,inlineThemeDisabled:i,onTriggerInputFocus:ve,onTriggerInputBlur:ye,handleTriggerOrMenuResize:Re,handleMenuFocus:Ce,handleMenuBlur:we,handleMenuTabOut:Te,handleTriggerClick:be,handleToggle:Oe,handleDeleteOption:ke,handlePatternInput:je,handleClear:Me,handleTriggerBlur:xe,handleTriggerFocus:Se,handleKeydown:Fe,handleMenuAfterLeave:ge,handleMenuClickOutside:Ee,handleMenuScroll:Pe,handleMenuKeydown:Fe,handleMenuMousedown:Ne,mergedTheme:o,cssVars:i?void 0:Be,themeClass:Ve?.themeClass,onRender:Ve?.onRender}},render(){return L(),R(`div`,{class:Y(`${this.mergedClsPrefix}-select`)},[V(P_,null,{_:1,default:Zm(()=>[(L(),z(F_,null,{_:1,default:Zm(()=>(L(),z(rC,{ref:`triggerRef`,inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{_:1,arrow:Zm(()=>[this.$slots.arrow?.()])},8,`inlineThemeDisabled.status.inputProps.clsPrefix.showArrow.maxTagCount.ellipsisTagPopoverProps.bordered.active.pattern.placeholder.selectedOption.selectedOptions.multiple.renderTag.renderLabel.filterable.clearable.disabled.size.theme.labelField.valueField.themeOverrides.loading.focused.onClick.onDeleteOption.onPatternInput.onClear.onBlur.onFocus.onKeydown.onPatternBlur.onPatternFocus.onResize.ignoreComposition`.split(`.`))))})),(L(),z(lv,{ref:`followerRef`,show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===n_.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?`target`:void 0,minWidth:`target`,placement:this.placement},{_:1,default:Zm(()=>(L(),z(yo,{name:`fade-in-scale-up-transition`,appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{_:1,default:Zm(()=>this.mergedShow||this.displayDirective===`show`?(this.onRender?.(),Ln((L(),z(rS,Fa(this.menuProps,{ref:`menuRef`,onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,this.menuProps?.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[this.menuProps?.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange,scrollbarProps:this.scrollbarProps}),{_:1,empty:Zm(()=>[this.$slots.empty?.()]),header:Zm(()=>[this.$slots.header?.()]),action:Zm(()=>[this.$slots.action?.()])},16,`onResize.inlineThemeDisabled.virtualScroll.class.clsPrefix.labelField.valueField.nodeProps.theme.themeOverrides.treeMate.multiple.size.renderOption.renderLabel.value.style.onToggle.onScroll.onFocus.onBlur.onKeydown.onTabOut.onMousedown.show.showCheckmark.resetMenuOnOptionsChange.scrollbarProps`.split(`.`))),this.displayDirective===`show`?[[Lo,this.mergedShow],[z_,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[z_,this.handleMenuClickOutside,void 0,{capture:!0}]])):null)},8,[`appear`,`onAfterLeave`])))},8,[`show`,`to`,`teleportDisabled`,`containerClass`,`width`,`placement`]))])})],2)}}),xC={padding:`4px 0`,optionIconSizeSmall:`14px`,optionIconSizeMedium:`16px`,optionIconSizeLarge:`16px`,optionIconSizeHuge:`18px`,optionSuffixWidthSmall:`14px`,optionSuffixWidthMedium:`14px`,optionSuffixWidthLarge:`16px`,optionSuffixWidthHuge:`16px`,optionIconSuffixWidthSmall:`32px`,optionIconSuffixWidthMedium:`32px`,optionIconSuffixWidthLarge:`36px`,optionIconSuffixWidthHuge:`36px`,optionPrefixWidthSmall:`14px`,optionPrefixWidthMedium:`14px`,optionPrefixWidthLarge:`16px`,optionPrefixWidthHuge:`16px`,optionIconPrefixWidthSmall:`36px`,optionIconPrefixWidthMedium:`36px`,optionIconPrefixWidthLarge:`40px`,optionIconPrefixWidthHuge:`40px`};function SC(e){let{primaryColor:t,textColor2:n,dividerColor:r,hoverColor:i,popoverColor:a,invertedColor:o,borderRadius:s,fontSizeSmall:c,fontSizeMedium:l,fontSizeLarge:u,fontSizeHuge:d,heightSmall:f,heightMedium:p,heightLarge:m,heightHuge:h,textColor3:g,opacityDisabled:_}=e;return{...xC,optionHeightSmall:f,optionHeightMedium:p,optionHeightLarge:m,optionHeightHuge:h,borderRadius:s,fontSizeSmall:c,fontSizeMedium:l,fontSizeLarge:u,fontSizeHuge:d,optionTextColor:n,optionTextColorHover:n,optionTextColorActive:t,optionTextColorChildActive:t,color:a,dividerColor:r,suffixColor:n,prefixColor:n,optionColorHover:i,optionColorActive:X(t,{alpha:.1}),groupHeaderTextColor:g,optionTextColorInverted:`#BBB`,optionTextColorHoverInverted:`#FFF`,optionTextColorActiveInverted:`#FFF`,optionTextColorChildActiveInverted:`#FFF`,colorInverted:o,dividerColorInverted:`#BBB`,suffixColorInverted:`#BBB`,prefixColorInverted:`#BBB`,optionColorHoverInverted:t,optionColorActiveInverted:t,groupHeaderTextColorInverted:`#AAA`,optionOpacityDisabled:_}}var CC=rg({name:`Dropdown`,common:Jh,peers:{Popover:hg},self:SC}),wC={padding:`8px 14px`};function TC(e){let{borderRadius:t,boxShadow2:n,baseColor:r}=e;return{...wC,borderRadius:t,boxShadow:n,color:Fh(r,`rgba(0, 0, 0, .85)`),textColor:r}}var EC=rg({name:`Tooltip`,common:Jh,peers:{Popover:hg},self:TC});function DC(e,t=`default`,n=[]){let r=e.$slots[t];return r===void 0?n:r()}var OC=F({name:`Tooltip`,props:{...Uy,...Q.props},slots:Object,__popover__:!0,setup(e){let{mergedClsPrefixRef:t}=Pm(e),n=Q(`Tooltip`,`-tooltip`,void 0,EC,e,t),r=A(null);return{syncPosition(){r.value.syncPosition()},setShow(e){r.value.setShow(e)},popoverRef:r,mergedTheme:n,popoverThemeOverrides:H(()=>n.value.self)}},render(){let{mergedTheme:e,internalExtraClass:t}=this;return ro(Wy,{...this.$props,theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat(`tooltip`),ref:`popoverRef`},this.$slots)}});function kC(e){let{textColorBase:t,opacity1:n,opacity2:r,opacity3:i,opacity4:a,opacity5:o}=e;return{color:t,opacity1Depth:n,opacity2Depth:r,opacity3Depth:i,opacity4Depth:a,opacity5Depth:o}}var AC={name:`Icon`,common:Jh,self:kC},jC=W(`icon`,`\n height: 1em;\n width: 1em;\n line-height: 1em;\n text-align: center;\n display: inline-block;\n position: relative;\n fill: currentColor;\n`,[K(`color-transition`,{transition:`color .3s var(--n-bezier)`}),K(`depth`,{color:`var(--n-color)`},[U(`svg`,{opacity:`var(--n-opacity)`,transition:`opacity .3s var(--n-bezier)`})]),U(`svg`,{height:`1em`,width:`1em`})]),MC=F({_n_icon__:!0,name:`Icon`,inheritAttrs:!1,props:{...Q.props,depth:[String,Number],size:[Number,String],color:String,component:[Object,Function]},setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n}=Pm(e),r=Q(`Icon`,`-icon`,jC,AC,e,t),i=H(()=>{let{depth:t}=e,{common:{cubicBezierEaseInOut:n},self:i}=r.value;if(t!==void 0){let{color:e,[`opacity${t}Depth`]:r}=i;return{"--n-bezier":n,"--n-color":e,"--n-opacity":r}}return{"--n-bezier":n,"--n-color":``,"--n-opacity":``}}),a=n?tg(`icon`,H(()=>`${e.depth||`d`}`),i,e):void 0;return{mergedClsPrefix:t,mergedStyle:H(()=>{let{size:t,color:n}=e;return{fontSize:l_(t),color:n}}),cssVars:n?void 0:i,themeClass:a?.themeClass,onRender:a?.onRender}},render(){let{$parent:e,depth:t,mergedClsPrefix:n,component:r,onRender:i,themeClass:a}=this;return e?.$options?._n_icon__&&km(`icon`,"don\'t wrap `n-icon` inside `n-icon`"),i?.(),ro(`i`,Fa(this.$attrs,{role:`img`,class:[`${n}-icon`,a,{[`${n}-icon--depth`]:t,[`${n}-icon--color-transition`]:t!==void 0}],style:[this.cssVars,this.mergedStyle]}),r?ro(r):this.$slots.default?.())}}),NC=Mm(`n-dropdown-menu`),PC=Mm(`n-dropdown`),FC=Mm(`n-dropdown-option`),IC=F({name:`DropdownDivider`,props:{clsPrefix:{type:String,required:!0}},render(){return L(),R(`div`,{class:Y(`${this.clsPrefix}-dropdown-divider`)},null,2)}});function LC(e,t){return e.type===`submenu`||e.type===void 0&&e[t]!==void 0}function RC(e){return e.type===`group`}function zC(e){return e.type===`divider`}function BC(e){return e.type===`render`}function VC(e,t,n){if(!t)return e;let r=A(e.value),i=null;return Un(e,e=>{i!==null&&window.clearTimeout(i),e===!0?n&&!n.value?r.value=!0:i=window.setTimeout(()=>{r.value=!0},t):r.value=!1}),r}var HC=F({name:`DropdownOption`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:`right-start`},props:Object,scrollable:Boolean},setup(e){let t=P(PC),{hoverKeyRef:n,keyboardKeyRef:r,lastToggledSubmenuKeyRef:i,pendingKeyPathRef:a,activeKeyPathRef:o,animatedRef:s,mergedShowRef:c,renderLabelRef:l,renderIconRef:u,labelFieldRef:d,childrenFieldRef:f,renderOptionRef:p,nodePropsRef:m,menuPropsRef:h}=t,g=P(FC,null),_=P(NC),v=P(Sg),y=H(()=>e.tmNode.rawNode),b=H(()=>{let{value:t}=f;return LC(e.tmNode.rawNode,t)}),x=H(()=>{let{disabled:t}=e.tmNode;return t}),S=VC(H(()=>{if(!b.value)return!1;let{key:t,disabled:o}=e.tmNode;if(o)return!1;let{value:s}=n,{value:c}=r,{value:l}=i,{value:u}=a;return s===null?c===null?l!==null&&u.includes(t):u.includes(t)&&u[u.length-1]!==t:u.includes(t)}),300,H(()=>r.value===null&&!s.value)),C=H(()=>!!g?.enteringSubmenuRef.value),w=A(!1);zn(FC,{enteringSubmenuRef:w});function T(){w.value=!0}function E(){w.value=!1}function D(){let{parentKey:t,tmNode:a}=e;a.disabled||c.value&&(i.value=t,r.value=null,n.value=a.key)}function O(){let{tmNode:t}=e;t.disabled||c.value&&n.value!==t.key&&D()}function ee(t){if(e.tmNode.disabled||!c.value)return;let{relatedTarget:r}=t;r&&!rh({target:r},`dropdownOption`)&&!rh({target:r},`scrollbarRail`)&&(n.value=null)}function te(){let{value:n}=b,{tmNode:r}=e;c.value&&!n&&!r.disabled&&(t.doSelect(r.key,r.rawNode),t.doUpdateShow(!1))}return{labelField:d,renderLabel:l,renderIcon:u,siblingHasIcon:_.showIconRef,siblingHasSubmenu:_.hasSubmenuRef,menuProps:h,popoverBody:v,animated:s,mergedShowSubmenu:H(()=>S.value&&!C.value),rawNode:y,hasSubmenu:b,pending:Ng(()=>{let{value:t}=a,{key:n}=e.tmNode;return t.includes(n)}),childActive:Ng(()=>{let{value:t}=o,{key:n}=e.tmNode,r=t.findIndex(e=>n===e);return r!==-1&&r<t.length-1}),active:Ng(()=>{let{value:t}=o,{key:n}=e.tmNode,r=t.findIndex(e=>n===e);return r!==-1&&r===t.length-1}),mergedDisabled:x,renderOption:p,nodeProps:m,handleClick:te,handleMouseMove:O,handleMouseEnter:D,handleMouseLeave:ee,handleSubmenuBeforeEnter:T,handleSubmenuAfterEnter:E}},render(){let{animated:e,rawNode:t,mergedShowSubmenu:n,clsPrefix:r,siblingHasIcon:i,siblingHasSubmenu:a,renderLabel:o,renderIcon:s,renderOption:c,nodeProps:l,props:u,scrollable:d}=this,f=null;if(n){let e=this.menuProps?.(t,t.children);f=(t=>(L(),z(KC,Fa({key:1},e,{clsPrefix:r,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}),null,16,[`clsPrefix`,`scrollable`,`tmNodes`,`parentKey`])))(f)}let p={class:[`${r}-dropdown-option-body`,this.pending&&`${r}-dropdown-option-body--pending`,this.active&&`${r}-dropdown-option-body--active`,this.childActive&&`${r}-dropdown-option-body--child-active`,this.mergedDisabled&&`${r}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},m=l?.(t),h=(L(),R(`div`,Fa({class:[`${r}-dropdown-option`,m?.class],"data-dropdown-option":!0},m),[J(()=>ro(`div`,Fa(p,u),[(L(),R(`div`,{class:Y([`${r}-dropdown-option-body__prefix`,i&&`${r}-dropdown-option-body__prefix--show-icon`])},[J(()=>[s?s(t):ux(t.icon)])],2)),(L(),R(`div`,{"data-dropdown-option":!0,class:Y(`${r}-dropdown-option-body__label`)},[o?(L(),R(I,{key:0},[J(()=>o(t))],64)):(L(),R(I,{key:1},[J(()=>ux(t[this.labelField]??t.title))],64))],2)),(L(),R(`div`,{"data-dropdown-option":!0,class:Y([`${r}-dropdown-option-body__suffix`,a&&`${r}-dropdown-option-body__suffix--has-submenu`])},[this.hasSubmenu?(L(),z(MC,{key:0},{_:1,default:Zm(()=>(L(),z(IS)))})):J(()=>null)],2))])),this.hasSubmenu?(L(),z(P_,{key:0},{default:()=>[(L(),z(F_,null,{default:()=>(L(),R(`div`,{class:Y(`${r}-dropdown-offset-container`)},[(L(),z(lv,{show:this.mergedShowSubmenu,placement:this.placement,to:d&&this.popoverBody||void 0,teleportDisabled:!d},{default:()=>(L(),R(`div`,{class:Y(`${r}-dropdown-menu-wrapper`)},[e?(L(),z(yo,{key:0,onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:`fade-in-scale-up-transition`,appear:!0},{default:()=>f},1032,[`onBeforeEnter`,`onAfterEnter`])):(L(),R(I,{key:1},[J(()=>f)],64))],2))},1032,[`show`,`placement`,`to`,`teleportDisabled`]))],2))},1024))]},1024)):J(()=>null)],16));return c?c({node:h,option:t}):h}}),UC=F({name:`DropdownGroupHeader`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){let{showIconRef:e,hasSubmenuRef:t}=P(NC),{renderLabelRef:n,labelFieldRef:r,nodePropsRef:i,renderOptionRef:a}=P(PC);return{labelField:r,showIcon:e,hasSubmenu:t,renderLabel:n,nodeProps:i,renderOption:a}},render(){let{clsPrefix:e,hasSubmenu:t,showIcon:n,nodeProps:r,renderLabel:i,renderOption:a}=this,{rawNode:o}=this.tmNode,s=(L(),R(`div`,Fa({class:`${e}-dropdown-option`},r?.(o)),[B(`div`,{class:Y(`${e}-dropdown-option-body ${e}-dropdown-option-body--group`)},[B(`div`,{"data-dropdown-option":!0,class:Y([`${e}-dropdown-option-body__prefix`,n&&`${e}-dropdown-option-body__prefix--show-icon`])},[J(()=>ux(o.icon))],2),B(`div`,{class:Y(`${e}-dropdown-option-body__label`),"data-dropdown-option":!0},[i?(L(),R(I,{key:0},[J(()=>i(o))],64)):(L(),R(I,{key:1},[J(()=>ux(o.title??o[this.labelField]))],64))],2),B(`div`,{class:Y([`${e}-dropdown-option-body__suffix`,t&&`${e}-dropdown-option-body__suffix--has-submenu`]),"data-dropdown-option":!0},null,2)],2)],16));return a?a({node:s,option:o}):s}}),WC=F({name:`NDropdownGroup`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){let{tmNode:e,parentKey:t,clsPrefix:n}=this,{children:r}=e;return L(),R(I,null,[(L(),z(UC,{clsPrefix:n,tmNode:e,key:e.key},null,8,[`clsPrefix`,`tmNode`])),J(()=>r?.map(e=>{let{rawNode:r}=e;return r.show===!1?null:zC(r)?ro(IC,{clsPrefix:n,key:e.key}):e.isGroup?(km(`dropdown`,"`group` node is not allowed to be put in `group` node."),null):(L(),z(HC,{clsPrefix:n,tmNode:e,parentKey:t,key:e.key},null,8,[`clsPrefix`,`tmNode`,`parentKey`]))}))],64)}}),GC=F({name:`DropdownRenderOption`,props:{tmNode:{type:Object,required:!0}},render(){let{rawNode:{render:e,props:t}}=this.tmNode;return ro(`div`,t,[e?.()])}}),KC=F({name:`DropdownMenu`,props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){let{renderIconRef:t,childrenFieldRef:n}=P(PC);zn(NC,{showIconRef:H(()=>{let n=t.value;return e.tmNodes.some(e=>{if(e.isGroup)return e.children?.some(({rawNode:e})=>n?n(e):e.icon);let{rawNode:t}=e;return n?n(t):t.icon})}),hasSubmenuRef:H(()=>{let{value:t}=n;return e.tmNodes.some(e=>{if(e.isGroup)return e.children?.some(({rawNode:e})=>LC(e,t));let{rawNode:n}=e;return LC(n,t)})})});let r=A(null);return zn(yg,null),zn(vg,null),zn(Sg,r),{bodyRef:r}},render(){let{parentKey:e,clsPrefix:t,scrollable:n}=this,r=this.tmNodes.map(r=>{let{rawNode:i}=r;return i.show===!1?null:BC(i)?(L(),z(GC,{tmNode:r,key:r.key},null,8,[`tmNode`])):zC(i)?(L(),z(IC,{clsPrefix:t,key:r.key},null,8,[`clsPrefix`])):RC(i)?(L(),z(WC,{clsPrefix:t,tmNode:r,parentKey:e,key:r.key},null,8,[`clsPrefix`,`tmNode`,`parentKey`])):(L(),z(HC,{clsPrefix:t,tmNode:r,parentKey:e,key:r.key,props:i.props,scrollable:n},null,8,[`clsPrefix`,`tmNode`,`parentKey`,`props`,`scrollable`]))});return L(),R(`div`,{class:Y([`${t}-dropdown-menu`,n&&`${t}-dropdown-menu--scrollable`]),ref:`bodyRef`},[n?(L(),z(Ay,{key:0,contentClass:`${t}-dropdown-menu__content`},{default:()=>r},1032,[`contentClass`])):(L(),R(I,{key:1},[J(()=>r)],64)),this.showArrow?(L(),R(I,{key:2},[J(()=>Ly({clsPrefix:t,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}))],64)):J(()=>null)],2)}}),qC=W(`dropdown-menu`,`\n transform-origin: var(--v-transform-origin);\n background-color: var(--n-color);\n border-radius: var(--n-border-radius);\n box-shadow: var(--n-box-shadow);\n position: relative;\n transition:\n background-color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier);\n`,[yx(),W(`dropdown-option`,`\n position: relative;\n `,[U(`a`,`\n text-decoration: none;\n color: inherit;\n outline: none;\n `,[U(`&::before`,`\n content: "";\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n `)]),W(`dropdown-option-body`,`\n display: flex;\n cursor: pointer;\n position: relative;\n height: var(--n-option-height);\n line-height: var(--n-option-height);\n font-size: var(--n-font-size);\n color: var(--n-option-text-color);\n transition: color .3s var(--n-bezier);\n `,[U(`&::before`,`\n content: "";\n position: absolute;\n top: 0;\n bottom: 0;\n left: 4px;\n right: 4px;\n transition: background-color .3s var(--n-bezier);\n border-radius: var(--n-border-radius);\n `),hc(`disabled`,[K(`pending`,`\n color: var(--n-option-text-color-hover);\n `,[G(`prefix, suffix`,`\n color: var(--n-option-text-color-hover);\n `),U(`&::before`,`background-color: var(--n-option-color-hover);`)]),K(`active`,`\n color: var(--n-option-text-color-active);\n `,[G(`prefix, suffix`,`\n color: var(--n-option-text-color-active);\n `),U(`&::before`,`background-color: var(--n-option-color-active);`)]),K(`child-active`,`\n color: var(--n-option-text-color-child-active);\n `,[G(`prefix, suffix`,`\n color: var(--n-option-text-color-child-active);\n `)])]),K(`disabled`,`\n cursor: not-allowed;\n opacity: var(--n-option-opacity-disabled);\n `),K(`group`,`\n font-size: calc(var(--n-font-size) - 1px);\n color: var(--n-group-header-text-color);\n `,[G(`prefix`,`\n width: calc(var(--n-option-prefix-width) / 2);\n `,[K(`show-icon`,`\n width: calc(var(--n-option-icon-prefix-width) / 2);\n `)])]),G(`prefix`,`\n width: var(--n-option-prefix-width);\n display: flex;\n justify-content: center;\n align-items: center;\n color: var(--n-prefix-color);\n transition: color .3s var(--n-bezier);\n z-index: 1;\n `,[K(`show-icon`,`\n width: var(--n-option-icon-prefix-width);\n `),W(`icon`,`\n font-size: var(--n-option-icon-size);\n `)]),G(`label`,`\n white-space: nowrap;\n flex: 1;\n z-index: 1;\n `),G(`suffix`,`\n box-sizing: border-box;\n flex-grow: 0;\n flex-shrink: 0;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n min-width: var(--n-option-suffix-width);\n padding: 0 8px;\n transition: color .3s var(--n-bezier);\n color: var(--n-suffix-color);\n z-index: 1;\n `,[K(`has-submenu`,`\n width: var(--n-option-icon-suffix-width);\n `),W(`icon`,`\n font-size: var(--n-option-icon-size);\n `)]),W(`dropdown-menu`,`pointer-events: all;`)]),W(`dropdown-offset-container`,`\n pointer-events: none;\n position: absolute;\n left: 0;\n right: 0;\n top: -4px;\n bottom: -4px;\n `)]),W(`dropdown-divider`,`\n transition: background-color .3s var(--n-bezier);\n background-color: var(--n-divider-color);\n height: 1px;\n margin: 4px 0;\n `),W(`dropdown-menu-wrapper`,`\n transform-origin: var(--v-transform-origin);\n width: fit-content;\n `),U(`>`,[W(`scrollbar`,`\n height: inherit;\n max-height: inherit;\n `)]),hc(`scrollable`,`\n padding: var(--n-padding);\n `),K(`scrollable`,[G(`content`,`\n padding: var(--n-padding);\n `)])]),JC={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:String,inverted:Boolean,placement:{type:String,default:`bottom`},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:`label`},keyField:{type:String,default:`key`},childrenField:{type:String,default:`children`},value:[String,Number]},YC=Object.keys(Uy),XC=F({name:`Dropdown`,inheritAttrs:!1,props:{...Uy,...JC,...Q.props},setup(e){let t=A(!1),n=Yg(M(e,`show`),t),r=H(()=>{let{keyField:t,childrenField:n}=e;return tS(e.options,{getKey(e){return e[t]},getDisabled(e){return e.disabled===!0},getIgnored(e){return e.type===`divider`||e.type===`render`},getChildren(e){return e[n]}})}),i=H(()=>r.value.treeNodes),a=A(null),o=A(null),s=A(null),c=H(()=>a.value??o.value??s.value??null),l=H(()=>r.value.getPath(c.value).keyPath),u=H(()=>r.value.getPath(e.value).keyPath),d=Ng(()=>e.keyboard&&n.value);e_({keydown:{ArrowUp:{prevent:!0,handler:C},ArrowRight:{prevent:!0,handler:S},ArrowDown:{prevent:!0,handler:w},ArrowLeft:{prevent:!0,handler:x},Enter:{prevent:!0,handler:T},Escape:b}},d);let{mergedClsPrefixRef:f,inlineThemeDisabled:p,mergedComponentPropsRef:m}=Pm(e),h=H(()=>e.size||m?.value?.Dropdown?.size||`medium`),g=Q(`Dropdown`,`-dropdown`,qC,CC,e,f);zn(PC,{labelFieldRef:M(e,`labelField`),childrenFieldRef:M(e,`childrenField`),renderLabelRef:M(e,`renderLabel`),renderIconRef:M(e,`renderIcon`),hoverKeyRef:a,keyboardKeyRef:o,lastToggledSubmenuKeyRef:s,pendingKeyPathRef:l,activeKeyPathRef:u,animatedRef:M(e,`animated`),mergedShowRef:n,nodePropsRef:M(e,`nodeProps`),renderOptionRef:M(e,`renderOption`),menuPropsRef:M(e,`menuProps`),doSelect:_,doUpdateShow:v}),Un(n,t=>{!e.animated&&!t&&y()});function _(t,n){let{onSelect:r}=e;r&&$(r,t,n)}function v(n){let{"onUpdate:show":r,onUpdateShow:i}=e;r&&$(r,n),i&&$(i,n),t.value=n}function y(){a.value=null,o.value=null,s.value=null}function b(){v(!1)}function x(){D(`left`)}function S(){D(`right`)}function C(){D(`up`)}function w(){D(`down`)}function T(){let e=E();e?.isLeaf&&n.value&&(_(e.key,e.rawNode),v(!1))}function E(){let{value:e}=r,{value:t}=c;return!e||t===null?null:e.getNode(t)??null}function D(e){let{value:t}=c,{value:{getFirstAvailableNode:n}}=r,i=null;if(t===null){let e=n();e!==null&&(i=e.key)}else{let t=E();if(t){let n;switch(e){case`down`:n=t.getNext();break;case`up`:n=t.getPrev();break;case`right`:n=t.getChild();break;case`left`:n=t.getParent()}n&&(i=n.key)}}i!==null&&(a.value=null,o.value=i)}let O=H(()=>{let{inverted:t}=e,n=h.value,{common:{cubicBezierEaseInOut:r},self:i}=g.value,{padding:a,dividerColor:o,borderRadius:s,optionOpacityDisabled:c,[q(`optionIconSuffixWidth`,n)]:l,[q(`optionSuffixWidth`,n)]:u,[q(`optionIconPrefixWidth`,n)]:d,[q(`optionPrefixWidth`,n)]:f,[q(`fontSize`,n)]:p,[q(`optionHeight`,n)]:m,[q(`optionIconSize`,n)]:_}=i,v={"--n-bezier":r,"--n-font-size":p,"--n-padding":a,"--n-border-radius":s,"--n-option-height":m,"--n-option-prefix-width":f,"--n-option-icon-prefix-width":d,"--n-option-suffix-width":u,"--n-option-icon-suffix-width":l,"--n-option-icon-size":_,"--n-divider-color":o,"--n-option-opacity-disabled":c};return t?(v[`--n-color`]=i.colorInverted,v[`--n-option-color-hover`]=i.optionColorHoverInverted,v[`--n-option-color-active`]=i.optionColorActiveInverted,v[`--n-option-text-color`]=i.optionTextColorInverted,v[`--n-option-text-color-hover`]=i.optionTextColorHoverInverted,v[`--n-option-text-color-active`]=i.optionTextColorActiveInverted,v[`--n-option-text-color-child-active`]=i.optionTextColorChildActiveInverted,v[`--n-prefix-color`]=i.prefixColorInverted,v[`--n-suffix-color`]=i.suffixColorInverted,v[`--n-group-header-text-color`]=i.groupHeaderTextColorInverted):(v[`--n-color`]=i.color,v[`--n-option-color-hover`]=i.optionColorHover,v[`--n-option-color-active`]=i.optionColorActive,v[`--n-option-text-color`]=i.optionTextColor,v[`--n-option-text-color-hover`]=i.optionTextColorHover,v[`--n-option-text-color-active`]=i.optionTextColorActive,v[`--n-option-text-color-child-active`]=i.optionTextColorChildActive,v[`--n-prefix-color`]=i.prefixColor,v[`--n-suffix-color`]=i.suffixColor,v[`--n-group-header-text-color`]=i.groupHeaderTextColor),v}),ee=p?tg(`dropdown`,H(()=>`${h.value[0]}${e.inverted?`i`:``}`),O,e):void 0;return{mergedClsPrefix:f,mergedTheme:g,mergedSize:h,tmNodes:i,mergedShow:n,handleAfterLeave:()=>{e.animated&&y()},doUpdateShow:v,cssVars:p?void 0:O,themeClass:ee?.themeClass,onRender:ee?.onRender}},render(){let e=(e,t,n,r,i)=>{let{mergedClsPrefix:a,menuProps:o}=this;this.onRender?.();let s=o?.(void 0,this.tmNodes.map(e=>e.rawNode))||{},c={ref:hC(t),class:[e,`${a}-dropdown`,`${a}-dropdown--${this.mergedSize}-size`,this.themeClass],clsPrefix:a,tmNodes:this.tmNodes,style:[...n,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:r,onMouseleave:i};return ro(KC,Fa(this.$attrs,c,s))},{mergedTheme:t}=this,n={show:this.mergedShow,theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:e,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return L(),z(Wy,o_(this.$props,YC,n),{_:1,trigger:Zm(()=>this.$slots.default?.())},16)}}),ZC=F({name:`ArrowDown`,render(){return(()=>{let e=Jm(`bd1a1948a64f963c`);return e[0]||=B(`svg`,{viewBox:`0 0 28 28`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},[B(`g`,{stroke:`none`,"stroke-width":`1`,"fill-rule":`evenodd`},[B(`g`,{"fill-rule":`nonzero`},[B(`path`,{d:`M23.7916,15.2664 C24.0788,14.9679 24.0696,14.4931 23.7711,14.206 C23.4726,13.9188 22.9978,13.928 22.7106,14.2265 L14.7511,22.5007 L14.7511,3.74792 C14.7511,3.33371 14.4153,2.99792 14.0011,2.99792 C13.5869,2.99792 13.2511,3.33371 13.2511,3.74793 L13.2511,22.4998 L5.29259,14.2265 C5.00543,13.928 4.53064,13.9188 4.23213,14.206 C3.93361,14.4931 3.9244,14.9679 4.21157,15.2664 L13.2809,24.6944 C13.6743,25.1034 14.3289,25.1034 14.7223,24.6944 L23.7916,15.2664 Z`})])])],-1)})()}}),QC=Mm(`n-dialog-provider`),$C=Mm(`n-dialog-api`),ew=Mm(`n-dialog-reactive-list`);function tw(){let e=P($C,null);return e===null&&Am(`use-dialog`,`No outer <n-dialog-provider /> founded.`),e}var nw={titleFontSize:`18px`,padding:`16px 28px 20px 28px`,iconSize:`28px`,actionSpace:`12px`,contentMargin:`8px 0 16px 0`,iconMargin:`0 4px 0 0`,iconMarginIconTop:`4px 0 8px 0`,closeSize:`22px`,closeIconSize:`18px`,closeMargin:`20px 26px 0 0`,closeMarginIconTop:`10px 16px 0 0`};function rw(e){let{textColor1:t,textColor2:n,modalColor:r,closeIconColor:i,closeIconColorHover:a,closeIconColorPressed:o,closeColorHover:s,closeColorPressed:c,infoColor:l,successColor:u,warningColor:d,errorColor:f,primaryColor:p,dividerColor:m,borderRadius:h,fontWeightStrong:g,lineHeight:_,fontSize:v}=e;return{...nw,fontSize:v,lineHeight:_,border:`1px solid ${m}`,titleTextColor:t,textColor:n,color:r,closeColorHover:s,closeColorPressed:c,closeIconColor:i,closeIconColorHover:a,closeIconColorPressed:o,closeBorderRadius:h,iconColor:p,iconColorInfo:l,iconColorSuccess:u,iconColorWarning:d,iconColorError:f,borderRadius:h,titleFontWeight:g}}var iw=rg({name:`Dialog`,common:Jh,peers:{Button:CS},self:rw}),aw={icon:Function,type:{type:String,default:`default`},title:[String,Function],closable:{type:Boolean,default:!0},negativeText:String,positiveText:String,positiveButtonProps:Object,negativeButtonProps:Object,content:[String,Function],action:Function,showIcon:{type:Boolean,default:!0},loading:Boolean,bordered:Boolean,iconPlacement:String,titleClass:[String,Array],titleStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],actionClass:[String,Array],actionStyle:[String,Object],onPositiveClick:Function,onNegativeClick:Function,onClose:Function,closeFocusable:Boolean},ow=jm(aw),sw=U([W(`dialog`,`\n --n-icon-margin: var(--n-icon-margin-top) var(--n-icon-margin-right) var(--n-icon-margin-bottom) var(--n-icon-margin-left);\n word-break: break-word;\n line-height: var(--n-line-height);\n position: relative;\n background: var(--n-color);\n color: var(--n-text-color);\n box-sizing: border-box;\n margin: auto;\n border-radius: var(--n-border-radius);\n padding: var(--n-padding);\n transition: \n border-color .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n `,[G(`icon`,`\n color: var(--n-icon-color);\n `),K(`bordered`,`\n border: var(--n-border);\n `),K(`icon-top`,[G(`close`,`\n margin: var(--n-close-margin);\n `),G(`icon`,`\n margin: var(--n-icon-margin);\n `),G(`content`,`\n text-align: center;\n `),G(`title`,`\n justify-content: center;\n `),G(`action`,`\n justify-content: center;\n `)]),K(`icon-left`,[G(`icon`,`\n margin: var(--n-icon-margin);\n `),K(`closable`,[G(`title`,`\n padding-right: calc(var(--n-close-size) + 6px);\n `)])]),G(`close`,`\n position: absolute;\n right: 0;\n top: 0;\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n z-index: 1;\n `),G(`content`,`\n font-size: var(--n-font-size);\n margin: var(--n-content-margin);\n position: relative;\n word-break: break-word;\n `,[K(`last`,`margin-bottom: 0;`)]),G(`action`,`\n display: flex;\n justify-content: flex-end;\n `,[U(`> *:not(:last-child)`,`\n margin-right: var(--n-action-space);\n `)]),G(`icon`,`\n font-size: var(--n-icon-size);\n transition: color .3s var(--n-bezier);\n `),G(`title`,`\n transition: color .3s var(--n-bezier);\n display: flex;\n align-items: center;\n font-size: var(--n-title-font-size);\n font-weight: var(--n-title-font-weight);\n color: var(--n-title-text-color);\n `),W(`dialog-icon-container`,`\n display: flex;\n justify-content: center;\n `)]),gc(W(`dialog`,`\n width: 446px;\n max-width: calc(100vw - 32px);\n `)),W(`dialog`,[vc(`\n width: 446px;\n max-width: calc(100vw - 32px);\n `)])]),cw={default:()=>(L(),z(cb)),info:()=>(L(),z(cb)),success:()=>(L(),z(lb)),warning:()=>(L(),z(ub)),error:()=>(L(),z(sb))},lw=F({name:`Dialog`,alias:[`NimbusConfirmCard`,`Confirm`],props:{...Q.props,...aw},slots:Object,setup(e){let{mergedComponentPropsRef:t,mergedClsPrefixRef:n,inlineThemeDisabled:r,mergedRtlRef:i}=Pm(e),a=v_(`Dialog`,i,n),o=H(()=>{let{iconPlacement:n}=e;return n||t?.value?.Dialog?.iconPlacement||`left`});function s(t){let{onPositiveClick:n}=e;n&&n(t)}function c(t){let{onNegativeClick:n}=e;n&&n(t)}function l(){let{onClose:t}=e;t&&t()}let u=Q(`Dialog`,`-dialog`,sw,iw,e,n),d=H(()=>{let{type:t}=e,n=o.value,{common:{cubicBezierEaseInOut:r},self:{fontSize:i,lineHeight:a,border:s,titleTextColor:c,textColor:l,color:d,closeBorderRadius:f,closeColorHover:p,closeColorPressed:m,closeIconColor:h,closeIconColorHover:g,closeIconColorPressed:_,closeIconSize:v,borderRadius:y,titleFontWeight:b,titleFontSize:x,padding:S,iconSize:C,actionSpace:w,contentMargin:T,closeSize:E,[n===`top`?`iconMarginIconTop`:`iconMargin`]:D,[n===`top`?`closeMarginIconTop`:`closeMargin`]:O,[q(`iconColor`,t)]:ee}}=u.value,te=sh(D);return{"--n-font-size":i,"--n-icon-color":ee,"--n-bezier":r,"--n-close-margin":O,"--n-icon-margin-top":te.top,"--n-icon-margin-right":te.right,"--n-icon-margin-bottom":te.bottom,"--n-icon-margin-left":te.left,"--n-icon-size":C,"--n-close-size":E,"--n-close-icon-size":v,"--n-close-border-radius":f,"--n-close-color-hover":p,"--n-close-color-pressed":m,"--n-close-icon-color":h,"--n-close-icon-color-hover":g,"--n-close-icon-color-pressed":_,"--n-color":d,"--n-text-color":l,"--n-border-radius":y,"--n-padding":S,"--n-line-height":a,"--n-border":s,"--n-content-margin":T,"--n-title-font-size":x,"--n-title-font-weight":b,"--n-title-text-color":c,"--n-action-space":w}}),f=r?tg(`dialog`,H(()=>`${e.type[0]}${o.value[0]}`),d,e):void 0;return{mergedClsPrefix:n,rtlEnabled:a,mergedIconPlacement:o,mergedTheme:u,handlePositiveClick:s,handleNegativeClick:c,handleCloseClick:l,cssVars:r?void 0:d,themeClass:f?.themeClass,onRender:f?.onRender}},render(){let{bordered:e,mergedIconPlacement:t,cssVars:n,closable:r,showIcon:i,title:a,content:o,action:s,negativeText:c,positiveText:l,positiveButtonProps:u,negativeButtonProps:d,handlePositiveClick:f,handleNegativeClick:p,mergedTheme:m,loading:h,type:g,mergedClsPrefix:_}=this;this.onRender?.();let v=i?(L(),z(og,{key:1,clsPrefix:_,class:Y(`${_}-dialog__icon`)},{default:()=>h_(this.$slots.icon,e=>e||(this.icon?ux(this.icon):cw[this.type]()))},1032,[`clsPrefix`,`class`])):null,y=h_(this.$slots.action,e=>e||l||c||s?(L(),R(`div`,{key:2,class:Y([`${_}-dialog__action`,this.actionClass]),style:k(this.actionStyle)},[J(()=>e||(s?[ux(s)]:[this.negativeText&&(L(),z(OS,Fa({key:3,theme:m.peers.Button,themeOverrides:m.peerOverrides.Button,ghost:!0,size:`small`,onClick:p},d),{default:()=>ux(this.negativeText)},1040,[`theme`,`themeOverrides`,`onClick`])),this.positiveText&&(L(),z(OS,Fa({key:4,theme:m.peers.Button,themeOverrides:m.peerOverrides.Button,size:`small`,type:g==="default"?`primary`:g,disabled:h,loading:h,onClick:f},u),{default:()=>ux(this.positiveText)},1040,[`theme`,`themeOverrides`,`type`,`disabled`,`loading`,`onClick`]))]))],6)):null);return L(),R(`div`,{class:Y([`${_}-dialog`,this.themeClass,this.closable&&`${_}-dialog--closable`,`${_}-dialog--icon-${t}`,e&&`${_}-dialog--bordered`,this.rtlEnabled&&`${_}-dialog--rtl`]),style:k(n),role:`dialog`},[r?(L(),R(I,{key:0},[J(()=>h_(this.$slots.close,e=>{let t=[`${_}-dialog__close`,this.rtlEnabled&&`${_}-dialog--rtl`];return e?(L(),R(`div`,{key:5,class:Y(t)},[J(()=>e)],2)):(L(),z(Xy,{key:6,focusable:this.closeFocusable,clsPrefix:_,class:Y(t),onClick:this.handleCloseClick},null,8,[`focusable`,`clsPrefix`,`class`,`onClick`]))}))],64)):J(()=>null),i&&t===`top`?(L(),R(`div`,{key:2,class:Y(`${_}-dialog-icon-container`)},[J(()=>v)],2)):J(()=>null),B(`div`,{class:Y([`${_}-dialog__title`,this.titleClass]),style:k(this.titleStyle)},[i&&t===`left`?(L(),R(I,{key:0},[J(()=>v)],64)):J(()=>null),J(()=>p_(this.$slots.header,()=>[ux(a)]))],6),B(`div`,{class:Y([`${_}-dialog__content`,y?``:`${_}-dialog__content--last`,this.contentClass]),style:k(this.contentStyle)},[J(()=>p_(this.$slots.default,()=>[ux(o)]))],6),J(()=>y)],6)}});function uw(e){let{modalColor:t,textColor2:n,boxShadow3:r}=e;return{color:t,textColor:n,boxShadow:r}}var dw=rg({name:`Modal`,common:Jh,peers:{Scrollbar:Zh,Dialog:iw,Card:zS},self:uw}),fw=`n-draggable`;function pw(e,t){let n,r=A(null),i=A(null),a=H(()=>e.value!==!1),o=H(()=>a.value?fw:``),s=H(()=>{let t=e.value;return t===!0||t===!1||!t||t.bounds!==`none`});function c(e){let a=e.querySelector(`.${fw}`);if(!a||!o.value)return;let c=0,l=0,u=0,d=0,f=0,p=0,m,h=null,g=null;function _(t){t.preventDefault(),m=t;let{x:n,y:a,right:o,bottom:s}=e.getBoundingClientRect();if(l=n,d=a,c=window.innerWidth-o,u=window.innerHeight-s,r.value!==null&&i.value!==null)p=r.value,f=i.value;else{let{left:t,top:n}=e.style;f=+n.slice(0,-2),p=+t.slice(0,-2)}}function v(){g&&=(r.value=g.x,i.value=g.y,null),h=null}function y(e){if(!m)return;let{clientX:t,clientY:n}=m,r=e.clientX-t,i=e.clientY-n;s.value&&(r>c?r=c:-r>l&&(r=-l),i>u?i=u:-i>d&&(i=-d)),g={x:r+p,y:i+f},h||=requestAnimationFrame(v)}function b(){m=void 0,h&&=(cancelAnimationFrame(h),null),g&&=(r.value=g.x,i.value=g.y,null),Tn(()=>{t.onEnd(e)})}Ag(`mousedown`,a,_),Ag(`mousemove`,window,y),Ag(`mouseup`,window,b),n=()=>{h&&cancelAnimationFrame(h),jg(`mousedown`,a,_),jg(`mousemove`,window,y),jg(`mouseup`,window,b)}}function l(){n&&=(n(),void 0),r.value=null,i.value=null}return Br(l),{stopDrag:l,startDrag:c,draggableRef:a,draggableClassRef:o,dragX:r,dragY:i}}var mw=A(!1);function hw(){mw.value=!0}function gw(){mw.value=!1}var _w=0;function vw(){return Wb&&(Fr(()=>{_w||(window.addEventListener(`compositionstart`,hw),window.addEventListener(`compositionend`,gw)),_w++}),zr(()=>{_w<=1?(window.removeEventListener(`compositionstart`,hw),window.removeEventListener(`compositionend`,gw),_w=0):_w--})),mw}var yw={...HS,...aw},bw=jm(yw),xw=F({name:`ModalBody`,inheritAttrs:!1,slots:Object,props:{show:{type:Boolean,required:!0},preset:String,displayDirective:{type:String,required:!0},trapFocus:{type:Boolean,default:!0},autoFocus:{type:Boolean,default:!0},blockScroll:Boolean,draggable:{type:[Boolean,Object],default:!1},maskHidden:Boolean,...yw,onClickoutside:Function,onBeforeLeave:{type:Function,required:!0},onAfterLeave:{type:Function,required:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0},onClose:{type:Function,required:!0},onAfterEnter:Function,onEsc:Function},setup(e){let t=A(null),n=A(null),r=A(e.show),i=A(null),a=A(null),o=P(xg),s=null;Un(M(e,`show`),e=>{e&&(s=o.getMousePosition())},{immediate:!0});let{stopDrag:c,startDrag:l,draggableRef:u,draggableClassRef:d,dragX:f,dragY:p}=pw(M(e,`draggable`),{onEnd:e=>{_(e)}}),m=H(()=>he([e.titleClass,d.value])),h=H(()=>he([e.headerClass,d.value]));Un(M(e,`show`),e=>{e&&(r.value=!0)}),gS(H(()=>e.blockScroll&&r.value));function g(){if(o.transformOriginRef.value===`center`)return``;let{value:e}=i,{value:t}=a;return e===null||t===null?``:n.value?`${e}px ${t+n.value.containerScrollTop}px`:``}function _(e){if(o.transformOriginRef.value===`center`||!s||!n.value)return;let t=n.value.containerScrollTop,{offsetLeft:r,offsetTop:c}=e,l=s.y,u=s.x;i.value=-(r-u),a.value=-(c-l-t),e.style.transformOrigin=g()}function v(e){Tn(()=>{_(e)})}function y(t){t.style.transformOrigin=g(),e.onBeforeLeave()}function b(t){let n=t;u.value&&l(n),e.onAfterEnter&&e.onAfterEnter(n)}function x(){r.value=!1,i.value=null,a.value=null,c(),e.onAfterLeave()}function S(){let{onClose:t}=e;t&&t()}function C(){e.onNegativeClick()}function w(){e.onPositiveClick()}let T=A(null);return Un(T,e=>{e&&Tn(()=>{let n=e.el;n&&t.value!==n&&(t.value=n)})}),zn(yg,t),zn(vg,null),zn(Sg,null),{mergedTheme:o.mergedThemeRef,appear:o.appearRef,isMounted:o.isMountedRef,mergedClsPrefix:o.mergedClsPrefixRef,bodyRef:t,scrollbarRef:n,draggableClass:d,displayed:r,childNodeRef:T,cardHeaderClass:h,dialogTitleClass:m,handlePositiveClick:w,handleNegativeClick:C,handleCloseClick:S,handleAfterEnter:b,handleAfterLeave:x,handleBeforeLeave:y,handleEnter:v,dragX:f,dragY:p}},render(){let{$slots:e,$attrs:t,handleEnter:n,handleAfterEnter:r,handleAfterLeave:i,handleBeforeLeave:a,preset:o,mergedClsPrefix:s,dragX:c,dragY:l}=this,u={...t};c!==null&&l!==null&&(u.style=k([u.style,{left:`${c}px`,top:`${l}px`}]));let d=null;if(!o){if(d=a_(`default`,e.default,{draggableClass:this.draggableClass}),!d){km(`modal`,`default slot is empty`);return}d=Oa(d),d.props=Fa({class:`${s}-modal`},u,d.props||{})}return this.displayDirective===`show`||this.displayed||this.show?Ln((L(),R(`div`,{key:1,role:`none`,class:Y([`${s}-modal-body-wrapper`,this.maskHidden&&`${s}-modal-body-wrapper--mask-hidden`])},[(L(),z(ky,{ref:`scrollbarRef`,theme:this.mergedTheme.peers.Scrollbar,themeOverrides:this.mergedTheme.peerOverrides.Scrollbar,contentClass:`${s}-modal-scroll-content`},{default:()=>(L(),z(Ty,{disabled:!this.trapFocus||this.maskHidden,active:this.show,onEsc:this.onEsc,autoFocus:this.autoFocus},{default:()=>(L(),z(yo,{name:`fade-in-scale-up-transition`,appear:this.appear??this.isMounted,onEnter:n,onAfterEnter:r,onAfterLeave:i,onBeforeLeave:a},{default:()=>{let t=[[Lo,this.show]],{onClickoutside:n}=this;return n&&t.push([z_,this.onClickoutside,void 0,{capture:!0}]),Ln(this.preset===`confirm`||this.preset===`dialog`?(L(),z(lw,Fa({key:2},u,{class:[`${s}-modal`,u.class],ref:`bodyRef`,theme:this.mergedTheme.peers.Dialog,themeOverrides:this.mergedTheme.peerOverrides.Dialog},o_(this.$props,ow),{titleClass:this.dialogTitleClass,"aria-modal":`true`}),Qm(e),1040,[`class`,`theme`,`themeOverrides`,`titleClass`])):this.preset===`card`?(L(),z(WS,Fa({key:3},u,{ref:`bodyRef`,class:[`${s}-modal`,u.class],theme:this.mergedTheme.peers.Card,themeOverrides:this.mergedTheme.peerOverrides.Card},o_(this.$props,US),{headerClass:this.cardHeaderClass,"aria-modal":`true`,role:`dialog`}),Qm(e),1040,[`class`,`theme`,`themeOverrides`,`headerClass`])):this.childNodeRef=d,t)}},1032,[`appear`,`onEnter`,`onAfterEnter`,`onAfterLeave`,`onBeforeLeave`]))},1032,[`disabled`,`active`,`onEsc`,`autoFocus`]))},1032,[`theme`,`themeOverrides`,`contentClass`]))],2)),[[Lo,this.displayDirective===`if`||this.displayed||this.show]]):null}}),Sw=U([W(`modal-container`,`\n position: fixed;\n left: 0;\n top: 0;\n height: 0;\n width: 0;\n display: flex;\n `),W(`modal-mask`,`\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background-color: rgba(0, 0, 0, .4);\n `,[C_({enterDuration:`.25s`,leaveDuration:`.25s`,enterCubicBezier:`var(--n-bezier-ease-out)`,leaveCubicBezier:`var(--n-bezier-ease-out)`})]),W(`modal-body-wrapper`,`\n position: fixed;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n overflow: visible;\n `,[W(`modal-scroll-content`,`\n min-height: 100%;\n display: flex;\n position: relative;\n `),K(`mask-hidden`,`pointer-events: none;`,[W(`modal-scroll-content`,[U(`> *`,`\n pointer-events: all;\n `)])])]),W(`modal`,`\n position: relative;\n align-self: center;\n color: var(--n-text-color);\n margin: auto;\n box-shadow: var(--n-box-shadow);\n `,[yx({duration:`.25s`,enterScale:`.5`}),U(`.${fw}`,`\n cursor: move;\n user-select: none;\n `)])]),Cw=[`onClick`],ww=F({name:`Modal`,inheritAttrs:!1,props:{...Q.props,show:Boolean,showMask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},preset:String,to:[String,Object],displayDirective:{type:String,default:`if`},transformOrigin:{type:String,default:`mouse`},zIndex:Number,autoFocus:{type:Boolean,default:!0},trapFocus:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},blockScroll:{type:Boolean,default:!0},...yw,draggable:[Boolean,Object],onEsc:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onAfterEnter:Function,onBeforeLeave:Function,onAfterLeave:Function,onClose:Function,onPositiveClick:Function,onNegativeClick:Function,onMaskClick:Function,internalDialog:Boolean,internalModal:Boolean,internalAppear:{type:Boolean,default:void 0},overlayStyle:[String,Object],onBeforeHide:Function,onAfterHide:Function,onHide:Function,unstableShowMask:{type:Boolean,default:void 0}},slots:Object,setup(e){let t=A(null),{mergedClsPrefixRef:n,namespaceRef:r,inlineThemeDisabled:i}=Pm(e),a=Q(`Modal`,`-modal`,Sw,dw,e,n),o=Jg(64),s=Ug(),c=Xg(),l=e.internalDialog?P(QC,null):null,u=e.internalModal?P(bg,null):null,d=vw();function f(t){let{onUpdateShow:n,"onUpdate:show":r,onHide:i}=e;n&&$(n,t),r&&$(r,t),i&&!t&&i(t)}function p(){let{onClose:t}=e;t?Promise.resolve(t()).then(e=>{e!==!1&&f(!1)}):f(!1)}function m(){let{onPositiveClick:t}=e;t?Promise.resolve(t()).then(e=>{e!==!1&&f(!1)}):f(!1)}function h(){let{onNegativeClick:t}=e;t?Promise.resolve(t()).then(e=>{e!==!1&&f(!1)}):f(!1)}function g(){let{onBeforeLeave:t,onBeforeHide:n}=e;t&&$(t),n&&n()}function _(){let{onAfterLeave:t,onAfterHide:n}=e;t&&$(t),n&&n()}function v(n){let{onMaskClick:r}=e;r&&r(n),e.maskClosable&&t.value?.contains(ih(n))&&f(!1)}function y(t){e.onEsc?.(),e.show&&e.closeOnEsc&&YS(t)&&(d.value||f(!1))}zn(xg,{getMousePosition:()=>{let e=l||u;if(e){let{clickedRef:t,clickedPositionRef:n}=e;if(t.value&&n.value)return n.value}return o.value?s.value:null},mergedClsPrefixRef:n,mergedThemeRef:a,isMountedRef:c,appearRef:M(e,`internalAppear`),transformOriginRef:M(e,`transformOrigin`)});let b=H(()=>{let{common:{cubicBezierEaseOut:e},self:{boxShadow:t,color:n,textColor:r}}=a.value;return{"--n-bezier-ease-out":e,"--n-box-shadow":t,"--n-color":n,"--n-text-color":r}}),x=i?tg(`theme-class`,void 0,b,e):void 0;return{mergedClsPrefix:n,namespace:r,isMounted:c,containerRef:t,presetProps:H(()=>gC(o_(e,bw),[`onClose`,`onNegativeClick`,`onPositiveClick`])),handleEsc:y,handleAfterLeave:_,handleClickoutside:v,handleBeforeLeave:g,doUpdateShow:f,handleNegativeClick:h,handlePositiveClick:m,handleCloseClick:p,cssVars:i?void 0:b,themeClass:x?.themeClass,onRender:x?.onRender}},render(){let{mergedClsPrefix:e}=this;return L(),z(X_,{to:this.to,show:this.show},{default:()=>{this.onRender?.();let{showMask:t}=this;return Ln((L(),R(`div`,{role:`none`,ref:`containerRef`,class:Y([`${e}-modal-container`,this.themeClass,this.namespace]),style:k(this.cssVars)},[t?(L(),z(yo,{name:`fade-in-transition`,key:`mask`,appear:this.internalAppear??this.isMounted},{default:()=>this.show?(L(),R(`div`,{key:1,"aria-hidden":!0,class:Y(`${e}-modal-mask`),onClick:this.handleClickoutside},null,10,Cw)):null},1032,[`appear`])):J(()=>null),(L(),z(xw,Fa({style:this.overlayStyle},this.$attrs,{ref:`bodyWrapper`,displayDirective:this.displayDirective,show:this.show,preset:this.preset,autoFocus:this.autoFocus,trapFocus:this.trapFocus,draggable:this.draggable,blockScroll:this.blockScroll,maskHidden:!t},this.presetProps,{onEsc:this.handleEsc,onClose:this.handleCloseClick,onNegativeClick:this.handleNegativeClick,onPositiveClick:this.handlePositiveClick,onBeforeLeave:this.handleBeforeLeave,onAfterEnter:this.onAfterEnter,onAfterLeave:this.handleAfterLeave,onClickoutside:t?void 0:this.handleClickoutside}),Qm(this.$slots),1040,[`style`,`displayDirective`,`show`,`preset`,`autoFocus`,`trapFocus`,`draggable`,`blockScroll`,`maskHidden`,`onEsc`,`onClose`,`onNegativeClick`,`onPositiveClick`,`onBeforeLeave`,`onAfterEnter`,`onAfterLeave`,`onClickoutside`]))],6)),[[U_,{zIndex:this.zIndex,enabled:this.show}]])}},1032,[`to`,`show`])}}),Tw=F({name:`DialogEnvironment`,props:{...aw,onAfterEnter:Function,onAfterLeave:Function,transformOrigin:String,blockScroll:{type:Boolean,default:!0},closeOnEsc:{type:Boolean,default:!0},onEsc:Function,autoFocus:{type:Boolean,default:!0},internalStyle:[String,Object],maskClosable:{type:Boolean,default:!0},zIndex:Number,onPositiveClick:Function,onNegativeClick:Function,onClose:Function,onMaskClick:Function,draggable:[Boolean,Object],internalKey:{type:String,required:!0},to:[String,Object],onInternalAfterLeave:{type:Function,required:!0}},setup(e){let t=A(!0);function n(){let{onInternalAfterLeave:t,internalKey:n,onAfterLeave:r}=e;t&&t(n),r&&r()}function r(t){let{onPositiveClick:n}=e;n?Promise.resolve(n(t)).then(e=>{e!==!1&&c()}):c()}function i(t){let{onNegativeClick:n}=e;n?Promise.resolve(n(t)).then(e=>{e!==!1&&c()}):c()}function a(){let{onClose:t}=e;t?Promise.resolve(t()).then(e=>{e!==!1&&c()}):c()}function o(t){let{onMaskClick:n,maskClosable:r}=e;n&&(n(t),r&&c())}function s(){let{onEsc:t}=e;t&&t()}function c(){t.value=!1}function l(e){t.value=e}return{show:t,hide:c,handleUpdateShow:l,handleAfterLeave:n,handleCloseClick:a,handleNegativeClick:i,handlePositiveClick:r,handleMaskClick:o,handleEsc:s}},render(){let{handlePositiveClick:e,handleUpdateShow:t,handleNegativeClick:n,handleCloseClick:r,handleAfterLeave:i,handleMaskClick:a,handleEsc:o,to:s,zIndex:c,maskClosable:l,show:u}=this;return L(),z(ww,{show:u,onUpdateShow:t,onMaskClick:a,onEsc:o,to:s,zIndex:c,maskClosable:l,onAfterEnter:this.onAfterEnter,onAfterLeave:i,closeOnEsc:this.closeOnEsc,blockScroll:this.blockScroll,autoFocus:this.autoFocus,transformOrigin:this.transformOrigin,draggable:this.draggable,internalAppear:!0,internalDialog:!0},{default:({draggableClass:t})=>(L(),z(lw,o_(this.$props,ow,{titleClass:he([this.titleClass,t]),style:this.internalStyle,onClose:r,onNegativeClick:n,onPositiveClick:e}),null,16))},1032,[`show`,`onUpdateShow`,`onMaskClick`,`onEsc`,`to`,`zIndex`,`maskClosable`,`onAfterEnter`,`onAfterLeave`,`closeOnEsc`,`blockScroll`,`autoFocus`,`transformOrigin`,`draggable`])}}),Ew=F({name:`DialogProvider`,props:{injectionKey:String,to:[String,Object]},setup(){let e=A([]),t={};function n(n={}){let r=Hh(),i=Rt({...n,key:r,destroy:()=>{t[`n-dialog-${r}`]?.hide()}});return e.value.push(i),i}let r=[`info`,`success`,`warning`,`error`].map(e=>t=>n({...t,type:e}));function i(t){let{value:n}=e;n.splice(n.findIndex(e=>e.key===t),1)}function a(){Object.values(t).forEach(e=>{e?.hide()})}let o={create:n,destroyAll:a,info:r[0],success:r[1],warning:r[2],error:r[3]};return zn($C,o),zn(QC,{clickedRef:Jg(64),clickedPositionRef:Ug()}),zn(ew,e),{...o,dialogList:e,dialogInstRefs:t,handleAfterLeave:i}},render(){return ro(I,null,[this.dialogList.map(e=>ro(Tw,gC(e,[`destroy`,`style`],{internalStyle:e.style,to:this.to,ref:t=>{t===null?delete this.dialogInstRefs[`n-dialog-${e.key}`]:this.dialogInstRefs[`n-dialog-${e.key}`]=t},internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave}))),this.$slots.default?.()])}}),Dw={margin:`0 0 8px 0`,padding:`10px 20px`,maxWidth:`720px`,minWidth:`420px`,iconMargin:`0 10px 0 0`,closeMargin:`0 0 0 10px`,closeSize:`20px`,closeIconSize:`16px`,iconSize:`20px`,fontSize:`14px`};function Ow(e){let{textColor2:t,closeIconColor:n,closeIconColorHover:r,closeIconColorPressed:i,infoColor:a,successColor:o,errorColor:s,warningColor:c,popoverColor:l,boxShadow2:u,primaryColor:d,lineHeight:f,borderRadius:p,closeColorHover:m,closeColorPressed:h}=e;return{...Dw,closeBorderRadius:p,textColor:t,textColorInfo:t,textColorSuccess:t,textColorError:t,textColorWarning:t,textColorLoading:t,color:l,colorInfo:l,colorSuccess:l,colorError:l,colorWarning:l,colorLoading:l,boxShadow:u,boxShadowInfo:u,boxShadowSuccess:u,boxShadowError:u,boxShadowWarning:u,boxShadowLoading:u,iconColor:t,iconColorInfo:a,iconColorSuccess:o,iconColorWarning:c,iconColorError:s,iconColorLoading:d,closeColorHover:m,closeColorPressed:h,closeIconColor:n,closeIconColorHover:r,closeIconColorPressed:i,closeColorHoverInfo:m,closeColorPressedInfo:h,closeIconColorInfo:n,closeIconColorHoverInfo:r,closeIconColorPressedInfo:i,closeColorHoverSuccess:m,closeColorPressedSuccess:h,closeIconColorSuccess:n,closeIconColorHoverSuccess:r,closeIconColorPressedSuccess:i,closeColorHoverError:m,closeColorPressedError:h,closeIconColorError:n,closeIconColorHoverError:r,closeIconColorPressedError:i,closeColorHoverWarning:m,closeColorPressedWarning:h,closeIconColorWarning:n,closeIconColorHoverWarning:r,closeIconColorPressedWarning:i,closeColorHoverLoading:m,closeColorPressedLoading:h,closeIconColorLoading:n,closeIconColorHoverLoading:r,closeIconColorPressedLoading:i,loadingColor:d,lineHeight:f,borderRadius:p,border:`0`}}var kw={name:`Message`,common:Jh,self:Ow},Aw=Mm(`n-message-api`),jw=Mm(`n-message-provider`),Mw={icon:Function,type:{type:String,default:`info`},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,spinProps:Object,onClose:Function,onMouseenter:Function,onMouseleave:Function},Nw=U([W(`message-wrapper`,`\n margin: var(--n-margin);\n z-index: 0;\n transform-origin: top center;\n display: flex;\n `,[_b({overflow:`visible`,originalTransition:`transform .3s var(--n-bezier)`,enterToProps:{transform:`scale(1)`},leaveToProps:{transform:`scale(0.85)`}})]),W(`message`,`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n transition:\n color .3s var(--n-bezier),\n box-shadow .3s var(--n-bezier),\n background-color .3s var(--n-bezier),\n opacity .3s var(--n-bezier),\n transform .3s var(--n-bezier),\n margin-bottom .3s var(--n-bezier);\n padding: var(--n-padding);\n border-radius: var(--n-border-radius);\n border: var(--n-border);\n flex-wrap: nowrap;\n overflow: hidden;\n max-width: var(--n-max-width);\n color: var(--n-text-color);\n background-color: var(--n-color);\n box-shadow: var(--n-box-shadow);\n `,[G(`content`,`\n display: inline-block;\n line-height: var(--n-line-height);\n font-size: var(--n-font-size);\n `),G(`icon`,`\n position: relative;\n margin: var(--n-icon-margin);\n height: var(--n-icon-size);\n width: var(--n-icon-size);\n font-size: var(--n-icon-size);\n flex-shrink: 0;\n `,[[`default`,`info`,`success`,`warning`,`error`,`loading`].map(e=>K(`${e}-type`,[U(`> *`,`\n color: var(--n-icon-color-${e});\n transition: color .3s var(--n-bezier);\n `)])),U(`> *`,`\n position: absolute;\n left: 0;\n top: 0;\n right: 0;\n bottom: 0;\n `,[Ab()])]),G(`close`,`\n margin: var(--n-close-margin);\n transition:\n background-color .3s var(--n-bezier),\n color .3s var(--n-bezier);\n flex-shrink: 0;\n `,[U(`&:hover`,`\n color: var(--n-close-icon-color-hover);\n `),U(`&:active`,`\n color: var(--n-close-icon-color-pressed);\n `)])]),W(`message-container`,`\n z-index: 6000;\n position: fixed;\n height: 0;\n overflow: visible;\n display: flex;\n flex-direction: column;\n align-items: center;\n `,[K(`top`,`\n top: 12px;\n left: 0;\n right: 0;\n `),K(`top-left`,`\n top: 12px;\n left: 12px;\n right: 0;\n align-items: flex-start;\n `),K(`top-right`,`\n top: 12px;\n left: 0;\n right: 12px;\n align-items: flex-end;\n `),K(`bottom`,`\n bottom: 4px;\n left: 0;\n right: 0;\n justify-content: flex-end;\n `),K(`bottom-left`,`\n bottom: 4px;\n left: 12px;\n right: 0;\n justify-content: flex-end;\n align-items: flex-start;\n `),K(`bottom-right`,`\n bottom: 4px;\n left: 0;\n right: 12px;\n justify-content: flex-end;\n align-items: flex-end;\n `)])]),Pw=[`onMouseenter`,`onMouseleave`],Fw={info:()=>(L(),z(cb)),success:()=>(L(),z(lb)),warning:()=>(L(),z(ub)),error:()=>(L(),z(sb)),default:()=>null},Iw=F({name:`Message`,props:{...Mw,render:Function},setup(e){let{inlineThemeDisabled:t,mergedRtlRef:n}=Pm(e),{props:r,mergedClsPrefixRef:i}=P(jw),a=v_(`Message`,n,i),o=Q(`Message`,`-message`,Nw,kw,r,i),s=H(()=>{let{type:t}=e,{common:{cubicBezierEaseInOut:n},self:{padding:r,margin:i,maxWidth:a,iconMargin:s,closeMargin:c,closeSize:l,iconSize:u,fontSize:d,lineHeight:f,borderRadius:p,border:m,iconColorInfo:h,iconColorSuccess:g,iconColorWarning:_,iconColorError:v,iconColorLoading:y,closeIconSize:b,closeBorderRadius:x,[q(`textColor`,t)]:S,[q(`boxShadow`,t)]:C,[q(`color`,t)]:w,[q(`closeColorHover`,t)]:T,[q(`closeColorPressed`,t)]:E,[q(`closeIconColor`,t)]:D,[q(`closeIconColorPressed`,t)]:O,[q(`closeIconColorHover`,t)]:ee}}=o.value;return{"--n-bezier":n,"--n-margin":i,"--n-padding":r,"--n-max-width":a,"--n-font-size":d,"--n-icon-margin":s,"--n-icon-size":u,"--n-close-icon-size":b,"--n-close-border-radius":x,"--n-close-size":l,"--n-close-margin":c,"--n-text-color":S,"--n-color":w,"--n-box-shadow":C,"--n-icon-color-info":h,"--n-icon-color-success":g,"--n-icon-color-warning":_,"--n-icon-color-error":v,"--n-icon-color-loading":y,"--n-close-color-hover":T,"--n-close-color-pressed":E,"--n-close-icon-color":D,"--n-close-icon-color-pressed":O,"--n-close-icon-color-hover":ee,"--n-line-height":f,"--n-border-radius":p,"--n-border":m}}),c=t?tg(`message`,H(()=>e.type[0]),s,{}):void 0;return{mergedClsPrefix:i,rtlEnabled:a,messageProviderProps:r,handleClose(){e.onClose?.()},cssVars:t?void 0:s,themeClass:c?.themeClass,onRender:c?.onRender,placement:r.placement}},render(){let{render:e,type:t,closable:n,content:r,mergedClsPrefix:i,cssVars:a,themeClass:o,onRender:s,icon:c,handleClose:l,showIcon:u}=this;s?.();let d=e||Lw(c,t,i,this.spinProps);return L(),R(`div`,{class:Y([`${i}-message-wrapper`,o]),onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:k([{alignItems:this.placement.startsWith(`top`)?`flex-start`:`flex-end`},a])},[e?(L(),R(I,{key:0},[J(()=>e(this.$props))],64)):(L(),R(`div`,{key:1,class:Y([`${i}-message ${i}-message--${t}-type`,this.rtlEnabled&&`${i}-message--rtl`])},[d&&u?(L(),R(`div`,{key:0,class:Y(`${i}-message__icon ${i}-message__icon--${t}-type`)},[V(Db,null,{default:()=>d},1024)],2)):J(()=>null),B(`div`,{class:Y(`${i}-message__content`)},[J(()=>ux(r))],2),n?(L(),z(Xy,{key:2,clsPrefix:i,class:Y(`${i}-message__close`),onClick:l,absolute:!0},null,8,[`clsPrefix`,`class`,`onClick`])):J(()=>null)],2))],46,Pw)}});function Lw(e,t,n,r){if(typeof e==`function`)return e();{let e=t===`loading`?(L(),z(Hb,Fa({key:1,clsPrefix:n,strokeWidth:24,scale:.85},r),null,16,[`clsPrefix`])):Fw[t]();return e?(L(),z(og,{clsPrefix:n,key:t},{default:()=>e},1032,[`clsPrefix`])):null}}var Rw=F({name:`MessageEnvironment`,props:{...Mw,duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function},setup(e){let t=null,n=A(!0);Ir(()=>{r()});function r(){let{duration:n}=e;n&&(t=window.setTimeout(o,n))}function i(e){e.currentTarget===e.target&&t!==null&&(window.clearTimeout(t),t=null)}function a(e){e.currentTarget===e.target&&r()}function o(){let{onHide:r}=e;n.value=!1,t&&=(window.clearTimeout(t),null),r&&r()}function s(){let{onClose:t}=e;t&&t(),o()}function c(){let{onAfterLeave:t,onInternalAfterLeave:n,onAfterHide:r,internalKey:i}=e;t&&t(),n&&n(i),r&&r()}function l(){o()}return{show:n,hide:o,handleClose:s,handleAfterLeave:c,handleMouseleave:a,handleMouseenter:i,deactivate:l}},render(){return L(),z(db,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{_:1,default:Zm(()=>[this.show?(L(),z(Iw,{key:1,content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,spinProps:this.spinProps,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0},null,8,[`content`,`type`,`icon`,`showIcon`,`closable`,`spinProps`,`onClose`,`onMouseenter`,`onMouseleave`])):null])},8,[`onAfterLeave`,`onLeave`])}}),zw=F({name:`MessageProvider`,props:{...Q.props,to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:`top`},closable:Boolean,containerClass:String,containerStyle:[String,Object]},setup(e){let{mergedClsPrefixRef:t}=Pm(e),n=A([]),r=A({}),i={create(e,t){return a(e,{type:`default`,...t})},info(e,t){return a(e,{...t,type:`info`})},success(e,t){return a(e,{...t,type:`success`})},warning(e,t){return a(e,{...t,type:`warning`})},error(e,t){return a(e,{...t,type:`error`})},loading(e,t){return a(e,{...t,type:`loading`})},destroyAll:s};zn(jw,{props:e,mergedClsPrefixRef:t}),zn(Aw,i);function a(t,i){let a=Hh(),o=Rt({...i,content:t,key:a,destroy:()=>{r.value[a]?.hide()}}),{max:s}=e;return s&&n.value.length>=s&&n.value.shift(),n.value.push(o),o}function o(e){n.value.splice(n.value.findIndex(t=>t.key===e),1),delete r.value[e]}function s(){Object.values(r.value).forEach(e=>{e.hide()})}return Object.assign({mergedClsPrefix:t,messageRefs:r,messageList:n,handleAfterLeave:o},i)},render(){return L(),R(I,null,[J(()=>this.$slots.default?.()),this.messageList.length?(L(),z(ir,{key:0,to:this.to??`body`},[B(`div`,{class:Y([`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass]),key:`message-container`,style:k(this.containerStyle)},[J(()=>this.messageList.map(e=>(L(),z(Rw,Fa({ref:t=>{t&&(this.messageRefs[e.key]=t)},internalKey:e.key,onInternalAfterLeave:this.handleAfterLeave},gC(e,[`destroy`],void 0),{duration:e.duration===void 0?this.duration:e.duration,keepAliveOnHover:e.keepAliveOnHover===void 0?this.keepAliveOnHover:e.keepAliveOnHover,closable:e.closable===void 0?this.closable:e.closable}),null,16,[`internalKey`,`onInternalAfterLeave`,`duration`,`keepAliveOnHover`,`closable`]))))],6)],8,[`to`])):J(()=>null)],64)}});function Bw(){let e=P(Aw,null);return e===null&&Am(`use-message`,"No outer <n-message-provider /> founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),e}var Vw={actionMargin:`0 0 0 20px`,actionMarginRtl:`0 20px 0 0`},Hw=F({name:`Add`,render(){return(()=>{let e=Jm(`b30130fbba5c5b23`);return e[0]||=B(`svg`,{width:`512`,height:`512`,viewBox:`0 0 512 512`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[B(`path`,{d:`M256 112V400M400 256H112`,stroke:`currentColor`,"stroke-width":`32`,"stroke-linecap":`round`,"stroke-linejoin":`round`})],-1)})()}}),Uw=F({name:`ArrowUp`,render(){return(()=>{let e=Jm(`eaa4b54c8a7c2c8`);return e[0]||=B(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`},[B(`g`,{fill:`none`},[B(`path`,{d:`M3.13 9.163a.5.5 0 1 0 .74.674L9.5 3.67V17.5a.5.5 0 0 0 1 0V3.672l5.63 6.165a.5.5 0 0 0 .738-.674l-6.315-6.916a.746.746 0 0 0-.632-.24a.746.746 0 0 0-.476.24L3.131 9.163z`,fill:`currentColor`})])],-1)})()}}),Ww=F({name:`Remove`,render(){return(()=>{let e=Jm(`a77472467b8adb0a`);return e[0]||=B(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 512 512`},[B(`line`,{x1:`400`,y1:`256`,x2:`112`,y2:`256`,style:`\n fill: none;\n stroke: currentColor;\n stroke-linecap: round;\n stroke-linejoin: round;\n stroke-width: 32px;\n `})],-1)})()}});function Gw(){return Vw}var Kw=rg({name:`DynamicInput`,common:Jh,peers:{Input:Jb,Button:CS},self:Gw}),qw=Mm(`n-dynamic-input`),Jw=F({name:`DynamicInputInputPreset`,props:{clsPrefix:{type:String,required:!0},value:{type:String,default:``},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(){let{mergedThemeRef:e,placeholderRef:t}=P(qw);return{mergedTheme:e,placeholder:t}},render(){let{mergedTheme:e,placeholder:t,value:n,clsPrefix:r,onUpdateValue:i,disabled:a}=this;return L(),R(`div`,{class:Y(`${r}-dynamic-input-preset-input`)},[(L(),z(sx,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:n,placeholder:t,onUpdateValue:i,disabled:a},null,8,[`theme`,`theme-overrides`,`value`,`placeholder`,`onUpdateValue`,`disabled`]))],2)}}),Yw=F({name:`DynamicInputPairPreset`,props:{clsPrefix:{type:String,required:!0},value:{type:Object,default:()=>({key:``,value:``})},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(e){let{mergedThemeRef:t,keyPlaceholderRef:n,valuePlaceholderRef:r}=P(qw);return{mergedTheme:t,keyPlaceholder:n,valuePlaceholder:r,handleKeyInput(t){e.onUpdateValue({key:t,value:e.value.value})},handleValueInput(t){e.onUpdateValue({key:e.value.key,value:t})}}},render(){let{mergedTheme:e,keyPlaceholder:t,valuePlaceholder:n,value:r,clsPrefix:i,disabled:a}=this;return L(),R(`div`,{class:Y(`${i}-dynamic-input-preset-pair`)},[(L(),z(sx,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.key,class:Y(`${i}-dynamic-input-pair-input`),placeholder:t,onUpdateValue:this.handleKeyInput,disabled:a},null,8,[`theme`,`theme-overrides`,`value`,`class`,`placeholder`,`onUpdateValue`,`disabled`])),(L(),z(sx,{theme:e.peers.Input,"theme-overrides":e.peerOverrides.Input,value:r.value,class:Y(`${i}-dynamic-input-pair-input`),placeholder:n,onUpdateValue:this.handleValueInput,disabled:a},null,8,[`theme`,`theme-overrides`,`value`,`class`,`placeholder`,`onUpdateValue`,`disabled`]))],2)}}),Xw=W(`dynamic-input`,{width:`100%`},[W(`dynamic-input-item`,`\n margin-bottom: 10px;\n display: flex;\n flex-wrap: nowrap;\n `,[W(`dynamic-input-preset-input`,{flex:1,alignItems:`center`}),W(`dynamic-input-preset-pair`,`\n flex: 1;\n display: flex;\n align-items: center;\n `,[W(`dynamic-input-pair-input`,[U(`&:first-child`,{"margin-right":`12px`})])]),G(`action`,`\n align-self: flex-start;\n display: flex;\n justify-content: flex-end;\n flex-shrink: 0;\n flex-grow: 0;\n margin: var(--action-margin);\n `,[K(`icon`,{cursor:`pointer`})]),U(`&:last-child`,{marginBottom:0})]),W(`form-item`,`\n padding-top: 0 !important;\n margin-right: 0 !important;\n `,[W(`form-item-blank`,{paddingTop:`0 !important`})])]),Zw=[`data-key`],Qw=new WeakMap,$w=F({name:`DynamicInput`,props:{...Q.props,max:Number,min:{type:Number,default:0},value:Array,defaultValue:{type:Array,default:()=>[]},preset:{type:String,default:`input`},keyField:String,itemClass:String,itemStyle:[String,Object],keyPlaceholder:{type:String,default:``},valuePlaceholder:{type:String,default:``},placeholder:{type:String,default:``},disabled:Boolean,showSortButton:Boolean,createButtonProps:Object,onCreate:Function,onRemove:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClear:Function,onInput:[Function,Array]},setup(e,{slots:t}){let{mergedComponentPropsRef:n,mergedClsPrefixRef:r,mergedRtlRef:i,inlineThemeDisabled:a}=Pm(),o=P(Cb,null),s=A(e.defaultValue),c=Yg(M(e,`value`),s),l=Q(`DynamicInput`,`-dynamic-input`,Xw,Kw,e,r),u=H(()=>{let{value:t}=c;if(Array.isArray(t)){let{max:n}=e;return n!==void 0&&t.length>=n}return!1}),d=H(()=>{let{value:t}=c;return!Array.isArray(t)||t.length<=e.min}),f=H(()=>n?.value?.DynamicInput?.buttonSize);function p(t){let{onInput:n,"onUpdate:value":r,onUpdateValue:i}=e;n&&$(n,t),r&&$(r,t),i&&$(i,t),s.value=t}function m(e,t){if(typeof e!=`object`||!e)return t;let n=Gt(e)?Kt(e):e,r=Qw.get(n);return r===void 0&&Qw.set(n,r=Hh()),r}function h(e,t){let{value:n}=c,r=Array.from(n??[]),i=r[e];if(r[e]=t,i&&t&&typeof i==`object`&&typeof t==`object`){let e=Gt(i)?Kt(i):i,n=Gt(t)?Kt(t):t,r=Qw.get(e);r!==void 0&&Qw.set(n,r)}p(r)}function g(){_(-1)}function _(n){let{value:r}=c,{onCreate:i}=e,a=Array.from(r??[]);if(i)a.splice(n+1,0,i(n+1)),p(a);else if(t.default)a.splice(n+1,0,null),p(a);else switch(e.preset){case`input`:a.splice(n+1,0,``),p(a);break;case`pair`:a.splice(n+1,0,{key:``,value:``}),p(a)}}function v(t){let{value:n}=c;if(!Array.isArray(n))return;let{min:r}=e;if(n.length<=r)return;let{onRemove:i}=e;i&&i(t);let a=Array.from(n);a.splice(t,1),p(a)}function y(e,t,n){if(t<0||n<0||t>=e.length||n>=e.length||t===n)return;let r=e[t];e[t]=e[n],e[n]=r}function b(e,t){let{value:n}=c;if(!Array.isArray(n))return;let r=Array.from(n);e===`up`&&y(r,t,t-1),e===`down`&&y(r,t,t+1),p(r)}zn(qw,{mergedThemeRef:l,keyPlaceholderRef:M(e,`keyPlaceholder`),valuePlaceholderRef:M(e,`valuePlaceholder`),placeholderRef:M(e,`placeholder`)});let x=v_(`DynamicInput`,i,r),S=H(()=>{let{self:{actionMargin:e,actionMarginRtl:t}}=l.value;return{"--action-margin":e,"--action-margin-rtl":t}}),C=a?tg(`dynamic-input`,void 0,S,e):void 0;return{locale:ng(`DynamicInput`).localeRef,rtlEnabled:x,buttonSize:f,mergedClsPrefix:r,NFormItem:o,uncontrolledValue:s,mergedValue:c,insertionDisabled:u,removeDisabled:d,handleCreateClick:g,ensureKey:m,handleValueChange:h,remove:v,move:b,createItem:_,mergedTheme:l,cssVars:a?void 0:S,themeClass:C?.themeClass,onRender:C?.onRender}},render(){let{$slots:e,itemClass:t,buttonSize:n,mergedClsPrefix:r,mergedValue:i,locale:a,mergedTheme:o,keyField:s,itemStyle:c,preset:l,showSortButton:u,NFormItem:d,ensureKey:f,handleValueChange:p,remove:m,createItem:h,move:g,onRender:_,disabled:v}=this;return _?.(),L(),R(`div`,{class:Y([`${r}-dynamic-input`,this.rtlEnabled&&`${r}-dynamic-input--rtl`,this.themeClass]),style:k(this.cssVars)},[!Array.isArray(i)||i.length===0?(L(),z(OS,Fa({key:0,block:!0,ghost:!0,dashed:!0,size:n},this.createButtonProps,{disabled:this.insertionDisabled||v,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,onClick:this.handleCreateClick}),{default:()=>p_(e[`create-button-default`],()=>[a.create]),icon:()=>p_(e[`create-button-icon`],()=>[(L(),z(og,{clsPrefix:r},{default:()=>(L(),z(Hw))},1032,[`clsPrefix`]))])},1040,[`size`,`disabled`,`theme`,`themeOverrides`,`onClick`])):(L(),R(I,{key:1},[J(()=>i.map((a,_)=>(L(),R(`div`,{key:s?a[s]:f(a,_),"data-key":s?a[s]:f(a,_),class:Y([`${r}-dynamic-input-item`,t]),style:k(c)},[J(()=>m_(e.default,{value:i[_],index:_},()=>[l===`input`?(L(),z(Jw,{key:1,disabled:v,clsPrefix:r,value:i[_],parentPath:d?d.path.value:void 0,path:d?.path.value?`${d.path.value}[${_}]`:void 0,onUpdateValue:e=>{p(_,e)}},null,8,[`disabled`,`clsPrefix`,`value`,`parentPath`,`path`,`onUpdateValue`])):l===`pair`?(L(),z(Yw,{key:2,disabled:v,clsPrefix:r,value:i[_],parentPath:d?d.path.value:void 0,path:d?.path.value?`${d.path.value}[${_}]`:void 0,onUpdateValue:e=>{p(_,e)}},null,8,[`disabled`,`clsPrefix`,`value`,`parentPath`,`path`,`onUpdateValue`])):null])),J(()=>m_(e.action,{value:i[_],index:_,create:h,remove:m,move:g},()=>[(L(),R(`div`,{class:Y(`${r}-dynamic-input-item__action`)},[(L(),z(PS,{size:n},{default:()=>[(L(),z(OS,{disabled:this.removeDisabled||v,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,circle:!0,onClick:()=>{m(_)}},{icon:()=>(L(),z(og,{clsPrefix:r},{default:()=>(L(),z(Ww))},1032,[`clsPrefix`]))},1032,[`disabled`,`theme`,`themeOverrides`,`onClick`])),(L(),z(OS,{disabled:this.insertionDisabled||v,circle:!0,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,onClick:()=>{h(_)}},{icon:()=>(L(),z(og,{clsPrefix:r},{default:()=>(L(),z(Hw))},1032,[`clsPrefix`]))},1032,[`disabled`,`theme`,`themeOverrides`,`onClick`])),u?(L(),z(OS,{key:3,disabled:_===0||v,circle:!0,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,onClick:()=>{g(`up`,_)}},{icon:()=>(L(),z(og,{clsPrefix:r},{default:()=>(L(),z(Uw))},1032,[`clsPrefix`]))},1032,[`disabled`,`theme`,`themeOverrides`,`onClick`])):null,u?(L(),z(OS,{key:4,disabled:_===i.length-1||v,circle:!0,theme:o.peers.Button,themeOverrides:o.peerOverrides.Button,onClick:()=>{g(`down`,_)}},{icon:()=>(L(),z(og,{clsPrefix:r},{default:()=>(L(),z(ZC))},1032,[`clsPrefix`]))},1032,[`disabled`,`theme`,`themeOverrides`,`onClick`])):null]},1032,[`size`]))],2))]))],14,Zw))))],64))],6)}}),eT={gapSmall:`4px 8px`,gapMedium:`8px 12px`,gapLarge:`12px 16px`};function tT(){return eT}var nT={name:`Space`,self:tT},rT;function iT(){if(!Wb)return!0;if(rT===void 0){let e=document.createElement(`div`);e.style.display=`flex`,e.style.flexDirection=`column`,e.style.rowGap=`1px`,e.appendChild(document.createElement(`div`)),e.appendChild(document.createElement(`div`)),document.body.appendChild(e);let t=e.scrollHeight===1;return document.body.removeChild(e),rT=t}return rT}var aT=F({name:`Space`,props:{...Q.props,align:String,justify:{type:String,default:`start`},inline:Boolean,vertical:Boolean,reverse:Boolean,size:[String,Number,Array],wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n,mergedComponentPropsRef:r}=Pm(e),i=H(()=>e.size??r?.value?.Space?.size??`medium`),a=Q(`Space`,`-space`,void 0,nT,e,t),o=v_(`Space`,n,t);return{useGap:iT(),rtlEnabled:o,mergedClsPrefix:t,margin:H(()=>{let e=i.value;if(Array.isArray(e))return{horizontal:e[0],vertical:e[1]};if(typeof e==`number`)return{horizontal:e,vertical:e};let{self:{[q(`gap`,e)]:t}}=a.value,{row:n,col:r}=ch(t);return{horizontal:ah(r),vertical:ah(n)}})}},render(){let{vertical:e,reverse:t,align:n,inline:r,justify:i,itemClass:a,itemStyle:o,margin:s,wrap:c,mergedClsPrefix:l,rtlEnabled:u,useGap:d,wrapItem:f,internalUseGap:p}=this,m=r_(DC(this),!1);if(!m.length)return null;let h=`${s.horizontal}px`,g=`${s.horizontal/2}px`,_=`${s.vertical}px`,v=`${s.vertical/2}px`,y=m.length-1,b=i.startsWith(`space-`);return L(),R(`div`,{role:`none`,class:Y([`${l}-space`,u&&`${l}-space--rtl`]),style:k({display:r?`inline-flex`:`flex`,flexDirection:e&&!t?`column`:e&&t?`column-reverse`:!e&&t?`row-reverse`:`row`,justifyContent:[`start`,`end`].includes(i)?`flex-${i}`:i,flexWrap:!c||e?`nowrap`:`wrap`,marginTop:d||e?``:`-${v}`,marginBottom:d||e?``:`-${v}`,alignItems:n,gap:d?`${s.vertical}px ${s.horizontal}px`:``})},[!f&&(d||p)?(L(),R(I,{key:0},[J(()=>m)],64)):(L(),R(I,{key:1},[J(()=>m.map((t,n)=>t.type===ma?t:(L(),R(`div`,{key:1,role:`none`,class:Y(a),style:k([o,{maxWidth:`100%`},d?``:e?{marginBottom:n===y?``:_}:u?{marginLeft:b?i===`space-between`&&n===y?``:g:n===y?``:h,marginRight:b?i===`space-between`&&n===0?``:g:``,paddingTop:v,paddingBottom:v}:{marginRight:b?i===`space-between`&&n===y?``:g:n===y?``:h,marginLeft:b?i===`space-between`&&n===0?``:g:``,paddingTop:v,paddingBottom:v}])},[J(()=>t)],6))))],64))],6)}}),oT={feedbackPadding:`4px 0 0 2px`,feedbackHeightSmall:`24px`,feedbackHeightMedium:`24px`,feedbackHeightLarge:`26px`,feedbackFontSizeSmall:`13px`,feedbackFontSizeMedium:`14px`,feedbackFontSizeLarge:`14px`,labelFontSizeLeftSmall:`14px`,labelFontSizeLeftMedium:`14px`,labelFontSizeLeftLarge:`15px`,labelFontSizeTopSmall:`13px`,labelFontSizeTopMedium:`14px`,labelFontSizeTopLarge:`14px`,labelHeightSmall:`24px`,labelHeightMedium:`26px`,labelHeightLarge:`28px`,labelPaddingVertical:`0 0 6px 2px`,labelPaddingHorizontal:`0 12px 0 0`,labelTextAlignVertical:`left`,labelTextAlignHorizontal:`right`,labelFontWeight:`400`};function sT(e){let{heightSmall:t,heightMedium:n,heightLarge:r,textColor1:i,errorColor:a,warningColor:o,lineHeight:s,textColor3:c}=e;return{...oT,blankHeightSmall:t,blankHeightMedium:n,blankHeightLarge:r,lineHeight:s,labelTextColor:i,asteriskColor:a,feedbackTextColorError:a,feedbackTextColorWarning:o,feedbackTextColor:c}}var cT={name:`Form`,common:Jh,self:sT};function lT(e){let{textColor2:t,textColor3:n,fontSize:r,fontWeight:i}=e;return{labelFontSize:r,labelFontWeight:i,valueFontWeight:i,valueFontSize:`24px`,labelTextColor:n,valuePrefixTextColor:t,valueSuffixTextColor:t,valueTextColor:t}}var uT={name:`Statistic`,common:Jh,self:lT},dT=Mm(`n-form`),fT=Mm(`n-form-item-insts`),pT=W(`form`,[K(`inline`,`\n width: 100%;\n display: inline-flex;\n align-items: flex-start;\n align-content: space-around;\n `,[W(`form-item`,{width:`auto`,marginRight:`18px`},[U(`&:last-child`,{marginRight:0})])])]),mT=[`onSubmit`],hT={...Q.props,inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:`top`},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object},gT=()=>!0;function _T(e){return e===void 0?{paths:null,shouldRuleBeApplied:gT}:typeof e==`function`?{paths:null,shouldRuleBeApplied:e}:Array.isArray(e)?{paths:e,shouldRuleBeApplied:gT}:e}var vT=F({name:`Form`,props:hT,setup(e){let{mergedClsPrefixRef:t}=Pm(e);Q(`Form`,`-form`,pT,cT,e,t);let n={},r=A(void 0),i=e=>{let t=r.value;(t===void 0||e>=t)&&(r.value=e)};function a(){for(let e of jm(n)){let t=n[e];for(let e of t)e.invalidateLabelWidth?.()}}async function o(e,t){let{paths:r,shouldRuleBeApplied:i}=_T(t);return await new Promise((t,a)=>{let o=[];for(let e of jm(n)){if(r!==null&&!r.includes(e))continue;let t=n[e];for(let e of t)e.path&&o.push(e.internalValidate(null,i))}Promise.all(o).then(n=>{let r=n.some(e=>!e.valid),i=[],o=[];n.forEach(e=>{e.errors?.length&&i.push(e.errors),e.warnings?.length&&o.push(e.warnings)}),e&&e(i.length?i:void 0,{warnings:o.length?o:void 0}),r?a(i.length?i:void 0):t({warnings:o.length?o:void 0})})})}function s(){for(let e of jm(n)){let t=n[e];for(let e of t)e.restoreValidation()}}return zn(dT,{props:e,maxChildLabelWidthRef:r,deriveMaxChildLabelWidth:i}),zn(fT,{formItems:n}),Object.assign({validate:o,restoreValidation:s,invalidateLabelWidth:a},{mergedClsPrefix:t})},render(){let{mergedClsPrefix:e}=this;return L(),R(`form`,{class:Y([`${e}-form`,this.inline&&`${e}-form--inline`]),onSubmit:this.onSubmit},[J(()=>this.$slots.default?.())],42,mT)}}),{cubicBezierEaseInOut:yT}=Im;function bT({name:e=`fade-down`,fromOffset:t=`-4px`,enterDuration:n=`.3s`,leaveDuration:r=`.3s`,enterCubicBezier:i=yT,leaveCubicBezier:a=yT}={}){return[U(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0,transform:`translateY(${t})`}),U(`&.${e}-transition-enter-to, &.${e}-transition-leave-from`,{opacity:1,transform:`translateY(0)`}),U(`&.${e}-transition-leave-active`,{transition:`opacity ${r} ${a}, transform ${r} ${a}`}),U(`&.${e}-transition-enter-active`,{transition:`opacity ${n} ${i}, transform ${n} ${i}`})]}var xT=W(`form-item`,`\n display: grid;\n line-height: var(--n-line-height);\n`,[W(`form-item-label`,`\n grid-area: label;\n align-items: center;\n line-height: 1.25;\n text-align: var(--n-label-text-align);\n font-size: var(--n-label-font-size);\n min-height: var(--n-label-height);\n padding: var(--n-label-padding);\n color: var(--n-label-text-color);\n transition: color .3s var(--n-bezier);\n box-sizing: border-box;\n font-weight: var(--n-label-font-weight);\n `,[G(`asterisk`,`\n white-space: nowrap;\n user-select: none;\n -webkit-user-select: none;\n color: var(--n-asterisk-color);\n transition: color .3s var(--n-bezier);\n `),G(`asterisk-placeholder`,`\n grid-area: mark;\n user-select: none;\n -webkit-user-select: none;\n visibility: hidden; \n `)]),W(`form-item-blank`,`\n grid-area: blank;\n min-height: var(--n-blank-height);\n `),K(`auto-label-width`,[W(`form-item-label`,`white-space: nowrap;`)]),K(`left-labelled`,`\n grid-template-areas:\n "label blank"\n "label feedback";\n grid-template-columns: auto minmax(0, 1fr);\n grid-template-rows: auto 1fr;\n align-items: flex-start;\n `,[W(`form-item-label`,`\n display: grid;\n grid-template-columns: 1fr auto;\n min-height: var(--n-blank-height);\n height: auto;\n box-sizing: border-box;\n flex-shrink: 0;\n flex-grow: 0;\n `,[K(`reverse-columns-space`,`\n grid-template-columns: auto 1fr;\n `),K(`left-mark`,`\n grid-template-areas:\n "mark text"\n ". text";\n `),K(`right-mark`,`\n grid-template-areas: \n "text mark"\n "text .";\n `),K(`right-hanging-mark`,`\n grid-template-areas: \n "text mark"\n "text .";\n `),G(`text`,`\n grid-area: text; \n `),G(`asterisk`,`\n grid-area: mark; \n align-self: end;\n `)])]),K(`top-labelled`,`\n grid-template-areas:\n "label"\n "blank"\n "feedback";\n grid-template-rows: minmax(var(--n-label-height), auto) 1fr;\n grid-template-columns: minmax(0, 100%);\n `,[K(`no-label`,`\n grid-template-areas:\n "blank"\n "feedback";\n grid-template-rows: 1fr;\n `),W(`form-item-label`,`\n display: flex;\n align-items: flex-start;\n justify-content: var(--n-label-text-align);\n `)]),W(`form-item-blank`,`\n box-sizing: border-box;\n display: flex;\n align-items: center;\n position: relative;\n `),W(`form-item-feedback-wrapper`,`\n grid-area: feedback;\n box-sizing: border-box;\n min-height: var(--n-feedback-height);\n font-size: var(--n-feedback-font-size);\n line-height: 1.25;\n transform-origin: top left;\n `,[U(`&:not(:empty)`,`\n padding: var(--n-feedback-padding);\n `),W(`form-item-feedback`,{transition:`color .3s var(--n-bezier)`,color:`var(--n-feedback-text-color)`},[K(`warning`,{color:`var(--n-feedback-text-color-warning)`}),K(`error`,{color:`var(--n-feedback-text-color-error)`}),bT({fromOffset:`-3px`,enterDuration:`.3s`,leaveDuration:`.2s`})])])]);function ST(e){let t=P(dT,null),{mergedComponentPropsRef:n}=Pm(e);return{mergedSize:H(()=>e.size===void 0?t?.props.size===void 0?n?.value?.Form?.size||`medium`:t.props.size:e.size)}}function CT(e){let t=P(dT,null),n=H(()=>{let{labelPlacement:n}=e;return n===void 0?t?.props.labelPlacement?t.props.labelPlacement:`top`:n}),r=H(()=>n.value===`left`&&(e.labelWidth===`auto`||t?.props.labelWidth===`auto`)),i=H(()=>{if(n.value===`top`)return;let{labelWidth:i}=e;if(i!==void 0&&i!==`auto`)return l_(i);if(r.value){let e=t?.maxChildLabelWidthRef.value;return e===void 0?void 0:l_(e)}if(t?.props.labelWidth!==void 0)return l_(t.props.labelWidth)}),a=H(()=>{let{labelAlign:n}=e;if(n)return n;if(t?.props.labelAlign)return t.props.labelAlign}),o=H(()=>[e.labelProps?.style,e.labelStyle,{width:i.value}]),s=H(()=>{let{showRequireMark:n}=e;return n===void 0?t?.props.showRequireMark:n}),c=H(()=>{let{requireMarkPlacement:n}=e;return n===void 0?t?.props.requireMarkPlacement||`right`:n}),l=A(!1),u=A(!1);return{validationErrored:l,validationWarned:u,mergedLabelStyle:o,mergedLabelPlacement:n,mergedLabelAlign:a,mergedShowRequireMark:s,mergedRequireMarkPlacement:c,mergedValidationStatus:H(()=>{let{validationStatus:t}=e;if(t!==void 0)return t;if(l.value)return`error`;if(u.value)return`warning`}),mergedShowFeedback:H(()=>{let{showFeedback:n}=e;return n===void 0?t?.props.showFeedback===void 0||t.props.showFeedback:n}),mergedShowLabel:H(()=>{let{showLabel:n}=e;return n===void 0?t?.props.showLabel===void 0||t.props.showLabel:n}),isAutoLabelWidth:r}}function wT(e){let t=P(dT,null),n=H(()=>{let{rulePath:t}=e;if(t!==void 0)return t;let{path:n}=e;if(n!==void 0)return n}),r=H(()=>{let r=[],{rule:i}=e;if(i!==void 0&&(Array.isArray(i)?r.push(...i):r.push(i)),t){let{rules:e}=t.props,{value:i}=n;if(e!==void 0&&i!==void 0){let t=qd(e,i);t!==void 0&&(Array.isArray(t)?r.push(...t):r.push(t))}}return r}),i=H(()=>r.value.some(e=>e.required));return{mergedRules:r,mergedRequired:H(()=>i.value||e.required)}}function TT(){return TT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},TT.apply(this,arguments)}function ET(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,OT(e,t)}function DT(e){return DT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},DT(e)}function OT(e,t){return OT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},OT(e,t)}function kT(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function AT(e,t,n){return AT=kT()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&OT(i,n.prototype),i},AT.apply(null,arguments)}function jT(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function MT(e){var t=typeof Map==`function`?new Map:void 0;return MT=function(e){if(e===null||!jT(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return AT(e,arguments,DT(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),OT(n,e)},MT(e)}var NT=/%[sdj%]/g,PT=function(){};function FT(e){if(!e||!e.length)return null;var t={};return e.forEach(function(e){var n=e.field;t[n]=t[n]||[],t[n].push(e)}),t}function IT(e){var t=[...arguments].slice(1),n=0,r=t.length;return typeof e==`function`?e.apply(null,t):typeof e==`string`?e.replace(NT,function(e){if(e===`%%`)return`%`;if(n>=r)return e;switch(e){case`%s`:return String(t[n++]);case`%d`:return Number(t[n++]);case`%j`:try{return JSON.stringify(t[n++])}catch{return`[Circular]`}default:return e}}):e}function LT(e){return e===`string`||e===`url`||e===`hex`||e===`email`||e===`date`||e===`pattern`}function RT(e,t){return!!(e==null||t===`array`&&Array.isArray(e)&&!e.length||LT(t)&&typeof e==`string`&&!e)}function zT(e,t,n){var r=[],i=0,a=e.length;function o(e){r.push.apply(r,e||[]),i++,i===a&&n(r)}e.forEach(function(e){t(e,o)})}function BT(e,t,n){var r=0,i=e.length;function a(o){if(o&&o.length){n(o);return}var s=r;r+=1,s<i?t(e[s],a):n([])}a([])}function VT(e){var t=[];return Object.keys(e).forEach(function(n){t.push.apply(t,e[n]||[])}),t}var HT=function(e){ET(t,e);function t(t,n){var r=e.call(this,`Async Validation Error`)||this;return r.errors=t,r.fields=n,r}return t}(MT(Error));function UT(e,t,n,r,i){if(t.first){var a=new Promise(function(t,a){BT(VT(e),n,function(e){return r(e),e.length?a(new HT(e,FT(e))):t(i)})});return a.catch(function(e){return e}),a}var o=t.firstFields===!0?Object.keys(e):t.firstFields||[],s=Object.keys(e),c=s.length,l=0,u=[],d=new Promise(function(t,a){var d=function(e){if(u.push.apply(u,e),l++,l===c)return r(u),u.length?a(new HT(u,FT(u))):t(i)};s.length||(r(u),t(i)),s.forEach(function(t){var r=e[t];o.indexOf(t)===-1?zT(r,n,d):BT(r,n,d)})});return d.catch(function(e){return e}),d}function WT(e){return!!(e&&e.message!==void 0)}function GT(e,t){for(var n=e,r=0;r<t.length;r++){if(n==null)return n;n=n[t[r]]}return n}function KT(e,t){return function(n){var r=e.fullFields?GT(t,e.fullFields):t[n.field||e.fullField];return WT(n)?(n.field=n.field||e.fullField,n.fieldValue=r,n):{message:typeof n==`function`?n():n,fieldValue:r,field:n.field||e.fullField}}}function qT(e,t){if(t){for(var n in t)if(t.hasOwnProperty(n)){var r=t[n];e[n]=typeof r==`object`&&typeof e[n]==`object`?TT({},e[n],r):r}}return e}var JT=function(e,t,n,r,i,a){e.required&&(!n.hasOwnProperty(e.field)||RT(t,a||e.type))&&r.push(IT(i.messages.required,e.fullField))},YT=function(e,t,n,r,i){(/^\\s+$/.test(t)||t===``)&&r.push(IT(i.messages.whitespace,e.fullField))},XT,ZT=(function(){if(XT)return XT;var e=`[a-fA-F\\\\d:]`,t=function(t){return t&&t.includeBoundaries?`(?:(?<=\\\\s|^)(?=`+e+`)|(?<=`+e+`)(?=\\\\s|$))`:``},n=`(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)(?:\\\\.(?:25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]\\\\d|\\\\d)){3}`,r=`[a-fA-F\\\\d]{1,4}`,i=(`\n(?:\n(?:`+r+`:){7}(?:`+r+`|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:`+r+`:){6}(?:`+n+`|:`+r+`|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:`+r+`:){5}(?::`+n+`|(?::`+r+`){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:`+r+`:){4}(?:(?::`+r+`){0,1}:`+n+`|(?::`+r+`){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:`+r+`:){3}(?:(?::`+r+`){0,2}:`+n+`|(?::`+r+`){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:`+r+`:){2}(?:(?::`+r+`){0,3}:`+n+`|(?::`+r+`){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:`+r+`:){1}(?:(?::`+r+`){0,4}:`+n+`|(?::`+r+`){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::`+r+`){0,5}:`+n+`|(?::`+r+`){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n`).replace(/\\s*\\/\\/.*$/gm,``).replace(/\\n/g,``).trim(),a=RegExp(`(?:^`+n+`$)|(?:^`+i+`$)`),o=RegExp(`^`+n+`$`),s=RegExp(`^`+i+`$`),c=function(e){return e&&e.exact?a:RegExp(`(?:`+t(e)+n+t(e)+`)|(?:`+t(e)+i+t(e)+`)`,`g`)};c.v4=function(e){return e&&e.exact?o:RegExp(``+t(e)+n+t(e),`g`)},c.v6=function(e){return e&&e.exact?s:RegExp(``+t(e)+i+t(e),`g`)};var l=`(?:(?:[a-z]+:)?//)`,u=`(?:\\\\S+(?::\\\\S*)?@)?`,d=c.v4().source,f=c.v6().source,p=`(?:`+l+`|www\\\\.)`+u+`(?:localhost|`+d+`|`+f+`|(?:(?:[a-z\\\\u00a1-\\\\uffff0-9][-_]*)*[a-z\\\\u00a1-\\\\uffff0-9]+)(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff0-9]-*)*[a-z\\\\u00a1-\\\\uffff0-9]+)*(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff]{2,})))(?::\\\\d{2,5})?(?:[/?#][^\\\\s"]*)?`;return XT=RegExp(`(?:^`+p+`$)`,`i`),XT}),QT={email:/^(([^<>()\\[\\]\\\\.,;:\\s@"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+\\.)+[a-zA-Z\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},$T={integer:function(e){return $T.number(e)&&parseInt(e,10)===e},float:function(e){return $T.number(e)&&!$T.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch{return!1}},date:function(e){return typeof e.getTime==`function`&&typeof e.getMonth==`function`&&typeof e.getYear==`function`&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&typeof e==`number`},object:function(e){return typeof e==`object`&&!$T.array(e)},method:function(e){return typeof e==`function`},email:function(e){return typeof e==`string`&&e.length<=320&&!!e.match(QT.email)},url:function(e){return typeof e==`string`&&e.length<=2048&&!!e.match(ZT())},hex:function(e){return typeof e==`string`&&!!e.match(QT.hex)}},eE=function(e,t,n,r,i){if(e.required&&t===void 0){JT(e,t,n,r,i);return}var a=[`integer`,`float`,`array`,`regexp`,`object`,`method`,`email`,`number`,`date`,`url`,`hex`],o=e.type;a.indexOf(o)>-1?$T[o](t)||r.push(IT(i.messages.types[o],e.fullField,e.type)):o&&typeof t!==e.type&&r.push(IT(i.messages.types[o],e.fullField,e.type))},tE=function(e,t,n,r,i){var a=typeof e.len==`number`,o=typeof e.min==`number`,s=typeof e.max==`number`,c=/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,l=t,u=null,d=typeof t==`number`,f=typeof t==`string`,p=Array.isArray(t);if(d?u=`number`:f?u=`string`:p&&(u=`array`),!u)return!1;p&&(l=t.length),f&&(l=t.replace(c,`_`).length),a?l!==e.len&&r.push(IT(i.messages[u].len,e.fullField,e.len)):o&&!s&&l<e.min?r.push(IT(i.messages[u].min,e.fullField,e.min)):s&&!o&&l>e.max?r.push(IT(i.messages[u].max,e.fullField,e.max)):o&&s&&(l<e.min||l>e.max)&&r.push(IT(i.messages[u].range,e.fullField,e.min,e.max))},nE=`enum`,rE={required:JT,whitespace:YT,type:eE,range:tE,enum:function(e,t,n,r,i){e[nE]=Array.isArray(e[nE])?e[nE]:[],e[nE].indexOf(t)===-1&&r.push(IT(i.messages[nE],e.fullField,e[nE].join(`, `)))},pattern:function(e,t,n,r,i){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(IT(i.messages.pattern.mismatch,e.fullField,t,e.pattern))):typeof e.pattern==`string`&&(new RegExp(e.pattern).test(t)||r.push(IT(i.messages.pattern.mismatch,e.fullField,t,e.pattern))))}},iE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t,`string`)&&!e.required)return n();rE.required(e,t,r,a,i,`string`),RT(t,`string`)||(rE.type(e,t,r,a,i),rE.range(e,t,r,a,i),rE.pattern(e,t,r,a,i),e.whitespace===!0&&rE.whitespace(e,t,r,a,i))}n(a)},aE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t)&&!e.required)return n();rE.required(e,t,r,a,i),t!==void 0&&rE.type(e,t,r,a,i)}n(a)},oE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t===``&&(t=void 0),RT(t)&&!e.required)return n();rE.required(e,t,r,a,i),t!==void 0&&(rE.type(e,t,r,a,i),rE.range(e,t,r,a,i))}n(a)},sE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t)&&!e.required)return n();rE.required(e,t,r,a,i),t!==void 0&&rE.type(e,t,r,a,i)}n(a)},cE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t)&&!e.required)return n();rE.required(e,t,r,a,i),RT(t)||rE.type(e,t,r,a,i)}n(a)},lE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t)&&!e.required)return n();rE.required(e,t,r,a,i),t!==void 0&&(rE.type(e,t,r,a,i),rE.range(e,t,r,a,i))}n(a)},uE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t)&&!e.required)return n();rE.required(e,t,r,a,i),t!==void 0&&(rE.type(e,t,r,a,i),rE.range(e,t,r,a,i))}n(a)},dE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(t==null&&!e.required)return n();rE.required(e,t,r,a,i,`array`),t!=null&&(rE.type(e,t,r,a,i),rE.range(e,t,r,a,i))}n(a)},fE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t)&&!e.required)return n();rE.required(e,t,r,a,i),t!==void 0&&rE.type(e,t,r,a,i)}n(a)},pE=`enum`,mE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t)&&!e.required)return n();rE.required(e,t,r,a,i),t!==void 0&&rE[pE](e,t,r,a,i)}n(a)},hE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t,`string`)&&!e.required)return n();rE.required(e,t,r,a,i),RT(t,`string`)||rE.pattern(e,t,r,a,i)}n(a)},gE=function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t,`date`)&&!e.required)return n();if(rE.required(e,t,r,a,i),!RT(t,`date`)){var o=t instanceof Date?t:new Date(t);rE.type(e,o,r,a,i),o&&rE.range(e,o.getTime(),r,a,i)}}n(a)},_E=function(e,t,n,r,i){var a=[],o=Array.isArray(t)?`array`:typeof t;rE.required(e,t,r,a,i,o),n(a)},vE=function(e,t,n,r,i){var a=e.type,o=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t,a)&&!e.required)return n();rE.required(e,t,r,o,i,a),RT(t,a)||rE.type(e,t,r,o,i)}n(o)},yE={string:iE,method:aE,number:oE,boolean:sE,regexp:cE,integer:lE,float:uE,array:dE,object:fE,enum:mE,pattern:hE,date:gE,url:vE,hex:vE,email:vE,required:_E,any:function(e,t,n,r,i){var a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(RT(t)&&!e.required)return n();rE.required(e,t,r,a,i)}n(a)}};function bE(){return{default:`Validation error on field %s`,required:`%s is required`,enum:`%s must be one of %s`,whitespace:`%s cannot be empty`,date:{format:`%s date %s is invalid for format %s`,parse:`%s date could not be parsed, %s is invalid `,invalid:`%s date %s is invalid`},types:{string:`%s is not a %s`,method:`%s is not a %s (function)`,array:`%s is not an %s`,object:`%s is not an %s`,number:`%s is not a %s`,date:`%s is not a %s`,boolean:`%s is not a %s`,integer:`%s is not an %s`,float:`%s is not a %s`,regexp:`%s is not a valid %s`,email:`%s is not a valid %s`,url:`%s is not a valid %s`,hex:`%s is not a valid %s`},string:{len:`%s must be exactly %s characters`,min:`%s must be at least %s characters`,max:`%s cannot be longer than %s characters`,range:`%s must be between %s and %s characters`},number:{len:`%s must equal %s`,min:`%s cannot be less than %s`,max:`%s cannot be greater than %s`,range:`%s must be between %s and %s`},array:{len:`%s must be exactly %s in length`,min:`%s cannot be less than %s in length`,max:`%s cannot be greater than %s in length`,range:`%s must be between %s and %s in length`},pattern:{mismatch:`%s value %s does not match pattern %s`},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var xE=bE(),SE=function(){function e(e){this.rules=null,this._messages=xE,this.define(e)}var t=e.prototype;return t.define=function(e){var t=this;if(!e)throw Error(`Cannot configure a schema with no rules`);if(typeof e!=`object`||Array.isArray(e))throw Error(`Rules must be an object`);this.rules={},Object.keys(e).forEach(function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]})},t.messages=function(e){return e&&(this._messages=qT(bE(),e)),this._messages},t.validate=function(t,n,r){var i=this;n===void 0&&(n={}),r===void 0&&(r=function(){});var a=t,o=n,s=r;if(typeof o==`function`&&(s=o,o={}),!this.rules||Object.keys(this.rules).length===0)return s&&s(null,a),Promise.resolve(a);function c(e){var t=[],n={};function r(e){if(Array.isArray(e)){var n;t=(n=t).concat.apply(n,e)}else t.push(e)}for(var i=0;i<e.length;i++)r(e[i]);t.length?(n=FT(t),s(t,n)):s(null,a)}if(o.messages){var l=this.messages();l===xE&&(l=bE()),qT(l,o.messages),o.messages=l}else o.messages=this.messages();var u={};(o.keys||Object.keys(this.rules)).forEach(function(e){var n=i.rules[e],r=a[e];n.forEach(function(n){var o=n;typeof o.transform==`function`&&(a===t&&(a=TT({},a)),r=a[e]=o.transform(r)),o=typeof o==`function`?{validator:o}:TT({},o),o.validator=i.getValidationMethod(o),o.validator&&(o.field=e,o.fullField=o.fullField||e,o.type=i.getType(o),u[e]=u[e]||[],u[e].push({rule:o,value:r,source:a,field:e}))})});var d={};return UT(u,o,function(t,n){var r=t.rule,i=(r.type===`object`||r.type===`array`)&&(typeof r.fields==`object`||typeof r.defaultField==`object`);i&&=r.required||!r.required&&t.value,r.field=t.field;function s(e,t){return TT({},t,{fullField:r.fullField+`.`+e,fullFields:r.fullFields?[].concat(r.fullFields,[e]):[e]})}function c(c){c===void 0&&(c=[]);var l=Array.isArray(c)?c:[c];!o.suppressWarning&&l.length&&e.warning(`async-validator:`,l),l.length&&r.message!==void 0&&(l=[].concat(r.message));var u=l.map(KT(r,a));if(o.first&&u.length)return d[r.field]=1,n(u);if(!i)n(u);else{if(r.required&&!t.value)return r.message===void 0?o.error&&(u=[o.error(r,IT(o.messages.required,r.field))]):u=[].concat(r.message).map(KT(r,a)),n(u);var f={};r.defaultField&&Object.keys(t.value).map(function(e){f[e]=r.defaultField}),f=TT({},f,t.rule.fields);var p={};Object.keys(f).forEach(function(e){var t=f[e];p[e]=(Array.isArray(t)?t:[t]).map(s.bind(null,e))});var m=new e(p);m.messages(o.messages),t.rule.options&&(t.rule.options.messages=o.messages,t.rule.options.error=o.error),m.validate(t.value,t.rule.options||o,function(e){var t=[];u&&u.length&&t.push.apply(t,u),e&&e.length&&t.push.apply(t,e),n(t.length?t:null)})}}var l;if(r.asyncValidator)l=r.asyncValidator(r,t.value,c,t.source,o);else if(r.validator){try{l=r.validator(r,t.value,c,t.source,o)}catch(e){console.error==null||console.error(e),o.suppressValidatorError||setTimeout(function(){throw e},0),c(e.message)}l===!0?c():l===!1?c(typeof r.message==`function`?r.message(r.fullField||r.field):r.message||(r.fullField||r.field)+` fails`):l instanceof Array?c(l):l instanceof Error&&c(l.message)}l&&l.then&&l.then(function(){return c()},function(e){return c(e)})},function(e){c(e)},a)},t.getType=function(e){if(e.type===void 0&&e.pattern instanceof RegExp&&(e.type=`pattern`),typeof e.validator!=`function`&&e.type&&!yE.hasOwnProperty(e.type))throw Error(IT(`Unknown rule type %s`,e.type));return e.type||`string`},t.getValidationMethod=function(e){if(typeof e.validator==`function`)return e.validator;var t=Object.keys(e),n=t.indexOf(`message`);return n!==-1&&t.splice(n,1),t.length===1&&t[0]===`required`?yE.required:yE[this.getType(e)]||void 0},e}();SE.register=function(e,t){if(typeof t!=`function`)throw Error(`Cannot register a validator by type, validator is not a function`);yE[e]=t},SE.warning=PT,SE.messages=xE,SE.validators=yE;var CE={...Q.props,label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object,contentClass:String,contentStyle:[String,Object]};jm(CE);function wE(e,t){return(...n)=>{try{let r=e(...n);return!t&&(typeof r==`boolean`||r instanceof Error||Array.isArray(r))||r?.then?r:(r===void 0||km(`form-item/validate`,`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use ${t?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(e){km(`form-item/validate`,"An error is catched in the validation, so the validation won\'t be done. Your callback in `validate` method of `n-form` or `n-form-item` won\'t be called in this validation."),console.error(e);return}}}var TE=F({name:`FormItem`,props:CE,slots:Object,setup(e){bb(fT,`formItems`,M(e,`path`));let{mergedClsPrefixRef:t,inlineThemeDisabled:n}=Pm(e),r=P(dT,null),i=ST(e),a=CT(e),{validationErrored:o,validationWarned:s}=a,{mergedRequired:c,mergedRules:l}=wT(e),{mergedSize:u}=i,{mergedLabelPlacement:d,mergedLabelAlign:f,mergedRequireMarkPlacement:p}=a,m=A([]),h=A(Hh()),g=A(null),_=r?M(r.props,`disabled`):A(!1),v=Q(`Form`,`-form-item`,xT,cT,e,t);Un(M(e,`path`),()=>{e.ignorePathChange||b()});function y(){if(!a.isAutoLabelWidth.value)return;let e=g.value;if(e!==null){let t=e.style.whiteSpace;e.style.whiteSpace=`nowrap`,e.style.width=``,r?.deriveMaxChildLabelWidth(Number(getComputedStyle(e).width.slice(0,-2))),e.style.whiteSpace=t}}function b(){m.value=[],o.value=!1,s.value=!1,e.feedback&&(h.value=Hh())}let x=async(t=null,n=()=>!0,i={suppressWarning:!0})=>{let{path:a}=e;i?i.first||(i.first=e.first):i={};let{value:c}=l,u=r?qd(r.props.model,a||``):void 0,d={},f={},p=(t?c.filter(e=>Array.isArray(e.trigger)?e.trigger.includes(t):e.trigger===t):c).filter(n).map((e,t)=>{let n=Object.assign({},e);if(n.validator&&=wE(n.validator,!1),n.asyncValidator&&=wE(n.asyncValidator,!0),n.renderMessage){let e=`__renderMessage__${t}`;f[e]=n.message,n.message=e,d[e]=n.renderMessage}return n}),h=p.filter(e=>e.level!==`warning`),g=p.filter(e=>e.level===`warning`),_={valid:!0,errors:void 0,warnings:void 0};if(!p.length)return _;let v=a??`__n_no_path__`,y=new SE({[v]:h}),x=new SE({[v]:g}),{validateMessages:S}=r?.props||{};S&&(y.messages(S),x.messages(S));let C=e=>{m.value=e.map(e=>{let t=e?.message||``;return{key:t,render:()=>t.startsWith(`__renderMessage__`)?d[t]():t}}),e.forEach(e=>{e.message?.startsWith(`__renderMessage__`)&&(e.message=f[e.message])})};if(h.length){let e=await new Promise(e=>{y.validate({[v]:u},i,e)});e?.length&&(_.valid=!1,_.errors=e,C(e))}if(g.length&&!_.errors){let e=await new Promise(e=>{x.validate({[v]:u},i,e)});e?.length&&(C(e),_.warnings=e)}return!_.errors&&!_.warnings?b():(o.value=!!_.errors,s.value=!!_.warnings),_};function S(){x(`blur`)}function C(){x(`change`)}function w(){x(`focus`)}function T(){x(`input`)}async function E(e,t){let n,r,i,a;return typeof e==`string`?(n=e,r=t):typeof e==`object`&&e&&(n=e.trigger,r=e.callback,i=e.shouldRuleBeApplied,a=e.options),await new Promise((e,t)=>{x(n,i,a).then(({valid:n,errors:i,warnings:a})=>{n?(r&&r(void 0,{warnings:a}),e({warnings:a})):(r&&r(i,{warnings:a}),t(i))})})}zn(Cb,{path:M(e,`path`),disabled:_,mergedSize:i.mergedSize,mergedValidationStatus:a.mergedValidationStatus,restoreValidation:b,handleContentBlur:S,handleContentChange:C,handleContentFocus:w,handleContentInput:T});let D={validate:E,restoreValidation:b,internalValidate:x,invalidateLabelWidth:y};Ir(y);let O=H(()=>{let{value:e}=u,{value:t}=d,n=t===`top`?`vertical`:`horizontal`,{common:{cubicBezierEaseInOut:r},self:{labelTextColor:i,asteriskColor:a,lineHeight:o,feedbackTextColor:s,feedbackTextColorWarning:c,feedbackTextColorError:l,feedbackPadding:p,labelFontWeight:m,[q(`labelHeight`,e)]:h,[q(`blankHeight`,e)]:g,[q(`feedbackFontSize`,e)]:_,[q(`feedbackHeight`,e)]:y,[q(`labelPadding`,n)]:b,[q(`labelTextAlign`,n)]:x,[q(q(`labelFontSize`,t),e)]:S}}=v.value,C=f.value??x;return t===`top`&&(C=C===`right`?`flex-end`:`flex-start`),{"--n-bezier":r,"--n-line-height":o,"--n-blank-height":g,"--n-label-font-size":S,"--n-label-text-align":C,"--n-label-height":h,"--n-label-padding":b,"--n-label-font-weight":m,"--n-asterisk-color":a,"--n-label-text-color":i,"--n-feedback-padding":p,"--n-feedback-font-size":_,"--n-feedback-height":y,"--n-feedback-text-color":s,"--n-feedback-text-color-warning":c,"--n-feedback-text-color-error":l}}),ee=n?tg(`form-item`,H(()=>`${u.value[0]}${d.value[0]}${f.value?.[0]||``}`),O,e):void 0;return{labelElementRef:g,mergedClsPrefix:t,mergedRequired:c,feedbackId:h,renderExplains:m,reverseColSpace:H(()=>d.value===`left`&&p.value===`left`&&f.value===`left`),...a,...i,...D,cssVars:n?void 0:O,themeClass:ee?.themeClass,onRender:ee?.onRender}},render(){let{$slots:e,mergedClsPrefix:t,mergedShowLabel:n,mergedShowRequireMark:r,mergedRequireMarkPlacement:i,onRender:a}=this,o=r===void 0?this.mergedRequired:r;a?.();let s=()=>{let e=this.$slots.label?this.$slots.label():this.label;if(!e)return null;let n=(L(),R(`span`,{class:Y(`${t}-form-item-label__text`)},[J(()=>e)],2)),r=o?(L(),R(`span`,{key:1,class:Y(`${t}-form-item-label__asterisk`)},[J(i===`left`?()=>`*\\xA0`:()=>`\\xA0*`)],2)):i===`right-hanging`&&(L(),R(`span`,{key:2,class:Y(`${t}-form-item-label__asterisk-placeholder`)},`\\xA0*`,2)),{labelProps:a}=this;return L(),R(`label`,Fa(a,{class:[a?.class,`${t}-form-item-label`,`${t}-form-item-label--${i}-mark`,this.reverseColSpace&&`${t}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:`labelElementRef`}),[i===`left`?(L(),R(I,{key:0},[J(()=>[r,n])],64)):(L(),R(I,{key:1},[J(()=>[n,r])],64))],16)};return L(),R(`div`,{class:Y([`${t}-form-item`,this.themeClass,`${t}-form-item--${this.mergedSize}-size`,`${t}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${t}-form-item--auto-label-width`,!n&&`${t}-form-item--no-label`]),style:k(this.cssVars)},[J(()=>n&&s()),B(`div`,{class:Y([`${t}-form-item-blank`,this.contentClass,this.mergedValidationStatus&&`${t}-form-item-blank--${this.mergedValidationStatus}`]),style:k(this.contentStyle)},[J(()=>e.default?.())],6),this.mergedShowFeedback?(L(),R(`div`,{key:this.feedbackId,style:k(this.feedbackStyle),class:Y([`${t}-form-item-feedback-wrapper`,this.feedbackClass])},[V(yo,{name:`fade-down-transition`,mode:`out-in`},{default:()=>{let{mergedValidationStatus:n}=this;return h_(e.feedback,e=>{let{feedback:r}=this,i=e||r?(L(),R(`div`,{key:`__feedback__`,class:Y(`${t}-form-item-feedback__line`)},[J(()=>e||r)],2)):this.renderExplains.length?this.renderExplains?.map(({key:e,render:n})=>(L(),R(`div`,{key:e,class:Y(`${t}-form-item-feedback__line`)},[J(()=>n())],2))):null;return i?n===`warning`?(L(),R(`div`,{key:`controlled-warning`,class:Y(`${t}-form-item-feedback ${t}-form-item-feedback--warning`)},[J(()=>i)],2)):n===`error`?(L(),R(`div`,{key:`controlled-error`,class:Y(`${t}-form-item-feedback ${t}-form-item-feedback--error`)},[J(()=>i)],2)):n===`success`?(L(),R(`div`,{key:`controlled-success`,class:Y(`${t}-form-item-feedback ${t}-form-item-feedback--success`)},[J(()=>i)],2)):(L(),R(`div`,{key:`controlled-default`,class:Y(`${t}-form-item-feedback`)},[J(()=>i)],2)):null})}},1024)],6)):J(()=>null)],6)}}),EE=W(`statistic`,[G(`label`,`\n font-weight: var(--n-label-font-weight);\n transition: .3s color var(--n-bezier);\n font-size: var(--n-label-font-size);\n color: var(--n-label-text-color);\n `),W(`statistic-value`,`\n margin-top: 4px;\n font-weight: var(--n-value-font-weight);\n `,[G(`prefix`,`\n margin: 0 4px 0 0;\n font-size: var(--n-value-font-size);\n transition: .3s color var(--n-bezier);\n color: var(--n-value-prefix-text-color);\n `,[W(`icon`,{verticalAlign:`-0.125em`})]),G(`content`,`\n font-size: var(--n-value-font-size);\n transition: .3s color var(--n-bezier);\n color: var(--n-value-text-color);\n `),G(`suffix`,`\n margin: 0 0 0 4px;\n font-size: var(--n-value-font-size);\n transition: .3s color var(--n-bezier);\n color: var(--n-value-suffix-text-color);\n `,[W(`icon`,{verticalAlign:`-0.125em`})])])]),DE=F({name:`Statistic`,props:{...Q.props,tabularNums:Boolean,label:String,value:[String,Number]},slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=Pm(e),i=Q(`Statistic`,`-statistic`,EE,uT,e,t),a=v_(`Statistic`,r,t),o=H(()=>{let{self:{labelFontWeight:e,valueFontSize:t,valueFontWeight:n,valuePrefixTextColor:r,labelTextColor:a,valueSuffixTextColor:o,valueTextColor:s,labelFontSize:c},common:{cubicBezierEaseInOut:l}}=i.value;return{"--n-bezier":l,"--n-label-font-size":c,"--n-label-font-weight":e,"--n-label-text-color":a,"--n-value-font-weight":n,"--n-value-font-size":t,"--n-value-prefix-text-color":r,"--n-value-suffix-text-color":o,"--n-value-text-color":s}}),s=n?tg(`statistic`,void 0,o,e):void 0;return{rtlEnabled:a,mergedClsPrefix:t,cssVars:n?void 0:o,themeClass:s?.themeClass,onRender:s?.onRender}},render(){let{mergedClsPrefix:e,$slots:{default:t,label:n,prefix:r,suffix:i}}=this;return this.onRender?.(),L(),R(`div`,{class:Y([`${e}-statistic`,this.themeClass,this.rtlEnabled&&`${e}-statistic--rtl`]),style:k(this.cssVars)},[J(()=>h_(n,t=>(L(),R(`div`,{class:Y(`${e}-statistic__label`)},[J(()=>this.label||t)],2)))),B(`div`,{class:Y(`${e}-statistic-value`),style:k({fontVariantNumeric:this.tabularNums?`tabular-nums`:``})},[J(()=>h_(r,t=>t&&(L(),R(`span`,{class:Y(`${e}-statistic-value__prefix`)},[J(()=>t)],2)))),this.value===void 0?(L(),R(I,{key:1},[J(()=>h_(t,t=>t&&(L(),R(`span`,{class:Y(`${e}-statistic-value__content`)},[J(()=>t)],2))))],64)):(L(),R(`span`,{key:0,class:Y(`${e}-statistic-value__content`)},[J(()=>this.value)],2)),J(()=>h_(i,t=>t&&(L(),R(`span`,{class:Y(`${e}-statistic-value__suffix`)},[J(()=>t)],2))))],6)],6)}}),OE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},kE=F({name:`AlertCircleOutline`,render:function(e,t){return L(),R(`svg`,OE,t[0]||=[B(`path`,{d:`M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192z`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`},null,-1),B(`path`,{d:`M250.26 166.05L256 288l5.73-121.95a5.74 5.74 0 0 0-5.79-6h0a5.74 5.74 0 0 0-5.68 6z`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),B(`path`,{d:`M256 367.91a20 20 0 1 1 20-20a20 20 0 0 1-20 20z`,fill:`currentColor`},null,-1)])}}),AE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},jE=F({name:`CheckmarkCircleOutline`,render:function(e,t){return L(),R(`svg`,AE,t[0]||=[B(`path`,{d:`M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192z`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`},null,-1),B(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M352 176L217.6 336L160 272`},null,-1)])}}),ME={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},NE=F({name:`CopyOutline`,render:function(e,t){return L(),R(`svg`,ME,t[0]||=[B(`rect`,{x:`128`,y:`128`,width:`336`,height:`336`,rx:`57`,ry:`57`,fill:`none`,stroke:`currentColor`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),B(`path`,{d:`M383.5 128l.5-24a56.16 56.16 0 0 0-56-56H112a64.19 64.19 0 0 0-64 64v216a56.16 56.16 0 0 0 56 56h24`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1)])}}),PE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},FE=F({name:`GitBranchOutline`,render:function(e,t){return L(),R(`svg`,PE,t[0]||=[Aa(`<circle cx="160" cy="96" r="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></circle><circle cx="160" cy="416" r="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></circle><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32" d="M160 368V144"></path><circle cx="352" cy="160" r="48" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></circle><path d="M352 208c0 128-192 48-192 160" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"></path>`,5)])}}),IE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},LE=F({name:`KeyOutline`,render:function(e,t){return L(),R(`svg`,IE,t[0]||=[B(`path`,{d:`M218.1 167.17c0 13 0 25.6 4.1 37.4c-43.1 50.6-156.9 184.3-167.5 194.5a20.17 20.17 0 0 0-6.7 15c0 8.5 5.2 16.7 9.6 21.3c6.6 6.9 34.8 33 40 28c15.4-15 18.5-19 24.8-25.2c9.5-9.3-1-28.3 2.3-36s6.8-9.2 12.5-10.4s15.8 2.9 23.7 3c8.3.1 12.8-3.4 19-9.2c5-4.6 8.6-8.9 8.7-15.6c.2-9-12.8-20.9-3.1-30.4s23.7 6.2 34 5s22.8-15.5 24.1-21.6s-11.7-21.8-9.7-30.7c.7-3 6.8-10 11.4-11s25 6.9 29.6 5.9c5.6-1.2 12.1-7.1 17.4-10.4c15.5 6.7 29.6 9.4 47.7 9.4c68.5 0 124-53.4 124-119.2S408.5 48 340 48s-121.9 53.37-121.9 119.17zM400 144a32 32 0 1 1-32-32a32 32 0 0 1 32 32z`,fill:`none`,stroke:`currentColor`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1)])}}),RE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},zE=F({name:`LinkOutline`,render:function(e,t){return L(),R(`svg`,RE,t[0]||=[B(`path`,{d:`M208 352h-64a96 96 0 0 1 0-192h64`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`36`},null,-1),B(`path`,{d:`M304 160h64a96 96 0 0 1 0 192h-64`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`36`},null,-1),B(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`36`,d:`M163.29 256h187.42`},null,-1)])}}),BE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},VE=F({name:`LockClosedOutline`,render:function(e,t){return L(),R(`svg`,BE,t[0]||=[B(`path`,{d:`M336 208v-95a80 80 0 0 0-160 0v95`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),B(`rect`,{x:`96`,y:`208`,width:`320`,height:`272`,rx:`48`,ry:`48`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1)])}}),HE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},UE=F({name:`LogOutOutline`,render:function(e,t){return L(),R(`svg`,HE,t[0]||=[B(`path`,{d:`M304 336v40a40 40 0 0 1-40 40H104a40 40 0 0 1-40-40V136a40 40 0 0 1 40-40h152c22.09 0 48 17.91 48 40v40`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),B(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M368 336l80-80l-80-80`},null,-1),B(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M176 256h256`},null,-1)])}}),WE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},GE=F({name:`PersonCircleOutline`,render:function(e,t){return L(),R(`svg`,WE,t[0]||=[B(`path`,{d:`M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48zm126.42 327.25a4 4 0 0 1-6.14-.32a124.27 124.27 0 0 0-32.35-29.59C321.37 329 289.11 320 256 320s-65.37 9-90.83 25.34a124.24 124.24 0 0 0-32.35 29.58a4 4 0 0 1-6.14.32A175.32 175.32 0 0 1 80 259c-1.63-97.31 78.22-178.76 175.57-179S432 158.81 432 256a175.32 175.32 0 0 1-46.68 119.25z`,fill:`currentColor`},null,-1),B(`path`,{d:`M256 144c-19.72 0-37.55 7.39-50.22 20.82s-19 32-17.57 51.93C191.11 256 221.52 288 256 288s64.83-32 67.79-71.24c1.48-19.74-4.8-38.14-17.68-51.82C293.39 151.44 275.59 144 256 144z`,fill:`currentColor`},null,-1)])}}),KE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},qE=F({name:`SaveOutline`,render:function(e,t){return L(),R(`svg`,KE,t[0]||=[B(`path`,{d:`M380.93 57.37A32 32 0 0 0 358.3 48H94.22A46.21 46.21 0 0 0 48 94.22v323.56A46.21 46.21 0 0 0 94.22 464h323.56A46.36 46.36 0 0 0 464 417.78V153.7a32 32 0 0 0-9.37-22.63zM256 416a64 64 0 1 1 64-64a63.92 63.92 0 0 1-64 64zm48-224H112a16 16 0 0 1-16-16v-64a16 16 0 0 1 16-16h192a16 16 0 0 1 16 16v64a16 16 0 0 1-16 16z`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1)])}}),JE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},YE=F({name:`ServerOutline`,render:function(e,t){return L(),R(`svg`,JE,t[0]||=[B(`ellipse`,{cx:`256`,cy:`128`,rx:`192`,ry:`80`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-miterlimit":`10`,"stroke-width":`32`},null,-1),B(`path`,{d:`M448 214c0 44.18-86 80-192 80S64 258.18 64 214`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-miterlimit":`10`,"stroke-width":`32`},null,-1),B(`path`,{d:`M448 300c0 44.18-86 80-192 80S64 344.18 64 300`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-miterlimit":`10`,"stroke-width":`32`},null,-1),B(`path`,{d:`M64 127.24v257.52C64 428.52 150 464 256 464s192-35.48 192-79.24V127.24`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-miterlimit":`10`,"stroke-width":`32`},null,-1)])}}),XE={xmlns:`http://www.w3.org/2000/svg`,"xmlns:xlink":`http://www.w3.org/1999/xlink`,viewBox:`0 0 512 512`},ZE=F({name:`SettingsOutline`,render:function(e,t){return L(),R(`svg`,XE,t[0]||=[B(`path`,{d:`M262.29 192.31a64 64 0 1 0 57.4 57.4a64.13 64.13 0 0 0-57.4-57.4zM416.39 256a154.34 154.34 0 0 1-1.53 20.79l45.21 35.46a10.81 10.81 0 0 1 2.45 13.75l-42.77 74a10.81 10.81 0 0 1-13.14 4.59l-44.9-18.08a16.11 16.11 0 0 0-15.17 1.75A164.48 164.48 0 0 1 325 400.8a15.94 15.94 0 0 0-8.82 12.14l-6.73 47.89a11.08 11.08 0 0 1-10.68 9.17h-85.54a11.11 11.11 0 0 1-10.69-8.87l-6.72-47.82a16.07 16.07 0 0 0-9-12.22a155.3 155.3 0 0 1-21.46-12.57a16 16 0 0 0-15.11-1.71l-44.89 18.07a10.81 10.81 0 0 1-13.14-4.58l-42.77-74a10.8 10.8 0 0 1 2.45-13.75l38.21-30a16.05 16.05 0 0 0 6-14.08c-.36-4.17-.58-8.33-.58-12.5s.21-8.27.58-12.35a16 16 0 0 0-6.07-13.94l-38.19-30A10.81 10.81 0 0 1 49.48 186l42.77-74a10.81 10.81 0 0 1 13.14-4.59l44.9 18.08a16.11 16.11 0 0 0 15.17-1.75A164.48 164.48 0 0 1 187 111.2a15.94 15.94 0 0 0 8.82-12.14l6.73-47.89A11.08 11.08 0 0 1 213.23 42h85.54a11.11 11.11 0 0 1 10.69 8.87l6.72 47.82a16.07 16.07 0 0 0 9 12.22a155.3 155.3 0 0 1 21.46 12.57a16 16 0 0 0 15.11 1.71l44.89-18.07a10.81 10.81 0 0 1 13.14 4.58l42.77 74a10.8 10.8 0 0 1-2.45 13.75l-38.21 30a16.05 16.05 0 0 0-6.05 14.08c.33 4.14.55 8.3.55 12.47z`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1)])}});function QE(){let e=new Uint8Array(16);return crypto.getRandomValues(e),`sk-${Array.from(e,e=>e.toString(16).padStart(2,`0`)).join(``)}`}async function $E(e,t){let n=await fetch(`/admin/api${e}`,{...t,headers:{"content-type":`application/json`,...t?.headers}}),r=await n.json().catch(()=>null);if(!n.ok){let e=r?.error?.message??`HTTP ${n.status}`;throw Error(e)}return r}function eD(){return $E(`/config`)}function tD(){return $E(`/config/check`,{method:`POST`})}function nD(e){return $E(`/config`,{method:`PUT`,body:JSON.stringify(e)})}function rD(e,t,n){return $E(`/test`,{method:`POST`,body:JSON.stringify({provider:e,model:t,base_url:n?.base_url??``,api_key:n?.api_key??``})})}function iD(e,t){return $E(`/fetch-models`,{method:`POST`,body:JSON.stringify({provider:e,base_url:t?.base_url??``,api_key:t?.api_key??``})})}function aD(){return $E(`/auth-status`)}function oD(e){return $E(`/login`,{method:`POST`,body:JSON.stringify({password:e})})}function sD(){return $E(`/logout`,{method:`POST`})}function cD(e){let t=Rt({state:`checking`,configPath:`config.json`,password:``,error:``,busy:!1,async checkAuth(){try{let n=await aD();t.configPath=n.configPath,n.loggedIn?(t.state=`ok`,await e()):n.passwordConfigured?t.state=`need-login`:t.state=`need-password`}catch{t.state=`need-login`}},async submit(){t.busy=!0,t.error=``;try{await oD(t.password),t.password=``,await t.checkAuth()}catch(e){t.error=e.message}finally{t.busy=!1}},async signOut(){try{await sD()}catch{}t.state=`need-login`}});return t}var lD=Symbol(`auth`);function uD(){let e=P(lD);if(!e)throw Error(`auth store \u672A provide\uFF08\u9700\u5728 App.vue setup \u4E2D createAuth + provide\uFF09`);return e}async function dD(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function fD(e){return e.length<=6?`****`:`${e.slice(0,3)}****${e.slice(-3)}`}function pD(e){let t=new Date(e);if(Number.isNaN(t.getTime()))return e;let n=e=>String(e).padStart(2,`0`);return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function mD(e){return e?e.startsWith(`provider:`)?`providers`:e.startsWith(`alias:`)?`aliases`:e===`default_model`?`basic`:e===`keys`?`keys`:null:null}function hD(e,t){let n=A({port:8787,host:`127.0.0.1`,timeout_seconds:60,access_log:!0}),r=A(``),i=A([]),a=A(``),o=A(!1),s=A(``),c=A(``),l=A([]),u=A([]),d=A(!0),f=A(!1),p=A(``),m=A(!1),h=A(null),g=H(()=>new Set((h.value??[]).filter(e=>e.target?.startsWith(`provider:`)).map(e=>e.target.slice(9)))),_=H(()=>new Set((h.value??[]).filter(e=>e.target?.startsWith(`alias:`)).map(e=>e.target.slice(6)))),v=H(()=>(h.value??[]).some(e=>e.target===`default_model`)),y=H(()=>u.value.map(e=>({label:e.name,value:e.name}))),b=H(()=>y.value),x=H(()=>`${window.location.protocol===`https:`?`https`:`http`}://${window.location.hostname}:${n.value.port}/v1`),S=A({}),C=A({}),w=0;function T(){return`row-${++w}`}async function E(){d.value=!0,p.value=``;try{let e=await eD();n.value={port:e.port,host:e.host,timeout_seconds:e.timeout_seconds,access_log:e.access_log},r.value=e.default_model,i.value=[...e.keys],l.value=Object.entries(e.providers).map(([e,t])=>({_id:T(),name:e,base_url:t.base_url,api_key:t.api_key,models:[...t.models]})),u.value=Object.entries(e.aliases).map(([e,t])=>({_id:T(),name:e,targets:Array.isArray(t)?[...t]:[t]}))}catch(e){p.value=e.message}finally{d.value=!1}}function D(){l.value.push({_id:T(),name:``,base_url:``,api_key:``,models:[]})}function O(){u.value.push({_id:T(),name:``,targets:[]})}async function ee(){await dD(x.value)?e.success(`API \u5730\u5740\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F`):e.error(`\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u590D\u5236`)}async function te(){let t=a.value.trim();if(!t){e.warning(`\u8BF7\u5148\u586B\u5199\u5BC6\u94A5\u540D\u79F0`);return}if(i.value.some(e=>e.name===t)){e.warning(`\u540D\u79F0 "${t}" \u5DF2\u5B58\u5728`);return}let n={name:t,key:QE(),created_at:new Date().toISOString()};i.value.push(n),a.value=``,await ue({successMsg:`\u5DF2\u751F\u6210\u5BC6\u94A5 ${t} \u5E76\u4FDD\u5B58`}),i.value.includes(n)&&(s.value=n.name,c.value=n.key,o.value=!0)}async function ne(){await dD(c.value)?e.success(`\u5B8C\u6574\u5BC6\u94A5\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F`):e.error(`\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u590D\u5236`)}async function re(t){await dD(t)?e.success(`\u5B8C\u6574\u5BC6\u94A5\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F`):e.error(`\u590D\u5236\u5931\u8D25\uFF0C\u8BF7\u624B\u52A8\u9009\u62E9\u590D\u5236`)}async function ie(e){let n=i.value[e];t.warning({title:`\u786E\u8BA4\u5220\u9664`,content:`\u786E\u8BA4\u5220\u9664\u5BC6\u94A5\u300C${n.name}\u300D\u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002`,positiveText:`\u5220\u9664`,negativeText:`\u53D6\u6D88`,async onPositiveClick(){i.value.splice(e,1),await ue({successMsg:`\u5DF2\u5220\u9664\u5BC6\u94A5 ${n.name} \u5E76\u4FDD\u5B58`})}})}function ae(e,n){t.warning({title:`\u786E\u8BA4\u5220\u9664`,content:`\u786E\u8BA4\u5220\u9664 provider\u300C${e}\u300D\u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002`,positiveText:`\u5220\u9664`,negativeText:`\u53D6\u6D88`,async onPositiveClick(){await n()}})}function oe(e,n){t.warning({title:`\u786E\u8BA4\u5220\u9664`,content:`\u786E\u8BA4\u5220\u9664\u522B\u540D\u300C${e}\u300D\u5417\uFF1F\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002`,positiveText:`\u5220\u9664`,negativeText:`\u53D6\u6D88`,async onPositiveClick(){await n()}})}async function se(t){let n=t.models[0];if(!n){e.warning(`\u8BE5 provider \u8FD8\u6CA1\u6709\u6A21\u578B\uFF0C\u5148\u6DFB\u52A0\u6A21\u578B`);return}S.value[t.name]={testing:!0,result:``,ok:!1};try{let e=await rD(t.name,n,{base_url:t.base_url,api_key:t.api_key});S.value[t.name]={testing:!1,ok:e.ok,result:e.ok?`\u8FDE\u63A5\u6210\u529F\uFF08${e.ms}ms\uFF0C\u6A21\u578B ${n}\uFF09`:`\u5931\u8D25\uFF1A${e.error??`HTTP ${e.status}`}`}}catch(e){S.value[t.name]={testing:!1,ok:!1,result:e.message}}}async function ce(t){if(!t.base_url.trim()){e.warning(`\u8BF7\u5148\u586B\u5199 base_url\uFF08\u7559\u7A7A\u65E0\u6CD5\u62C9\u53D6\uFF09`);return}C.value[t.name]={fetching:!0,result:``,ok:!1};try{let e=await iD(t.name,{base_url:t.base_url,api_key:t.api_key});if(!e.ok||!e.models){C.value[t.name]={fetching:!1,ok:!1,result:`\u62C9\u53D6\u5931\u8D25\uFF1A${e.error??`HTTP ${e.status}`}`};return}let n=new Set(t.models),r=0;for(let i of e.models)n.has(i)||(n.add(i),t.models.push(i),r++);C.value[t.name]={fetching:!1,ok:!0,result:r>0?`\u5DF2\u62C9\u53D6\u5E76\u65B0\u589E ${r} \u4E2A\u6A21\u578B\uFF08\u5171 ${t.models.length}\uFF09`:`\u65E0\u65B0\u589E\uFF08${t.models.length} \u4E2A\u6A21\u578B\u5747\u5DF2\u5B58\u5728\uFF09`}}catch(e){C.value[t.name]={fetching:!1,ok:!1,result:e.message}}}function le(){let e={};for(let t of l.value){if(!t.name)throw Error(`provider \u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A`);e[t.name]={base_url:t.base_url,api_key:t.api_key,models:t.models}}let t={};for(let e of u.value){if(!e.name)throw Error(`\u522B\u540D\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A`);t[e.name]=e.targets}return{...n.value,default_model:r.value,keys:i.value,providers:e,aliases:t}}async function ue(t){f.value=!0;try{await nD(le()),t?.successMsg&&e.success(t.successMsg),h.value=null}catch(n){t?.silent||e.error(`\u4FDD\u5B58\u5931\u8D25\uFF1A${n.message}`)}finally{f.value=!1}}let k=null;function de(e){k&&clearTimeout(k),k=setTimeout(()=>{k=null,ue(e)},400)}async function fe(t){f.value=!0;try{await nD(le()),t?.successMsg&&e.success(t.successMsg),h.value=null}catch(t){e.error(`\u4FDD\u5B58\u5931\u8D25\uFF1A${t.message}`)}finally{f.value=!1}}async function pe(){m.value=!0;try{let t=await tD();h.value=t.issues;let n=t.issues.filter(e=>e.level===`error`);return n.length===0?t.issues.length===0?e.success(`\u914D\u7F6E\u5B8C\u5168\u6B63\u786E`):e.success(`\u672A\u53D1\u73B0\u9519\u8BEF\uFF08\u4EC5\u6709\u63D0\u793A\u9879\uFF09`):e.error(`\u53D1\u73B0 ${n.length} \u4E2A\u9519\u8BEF\uFF0C\u5DF2\u5728\u9875\u9762\u4E2D\u6807\u7EA2`),n}catch(t){return e.error(`\u68C0\u67E5\u5931\u8D25\uFF1A${t.message}`),[]}finally{m.value=!1}}return{startup:n,defaultModel:r,keys:i,newKeyName:a,showNewKeyModal:o,pendingKeyName:s,pendingKeyValue:c,providers:l,aliases:u,loading:d,saving:f,loadError:p,checking:m,checkIssues:h,erroredProviders:g,erroredAliases:_,defaultModelError:v,aliasOptions:y,defaultModelOptions:b,apiBaseUrl:x,testStates:S,fetchStates:C,load:E,addProvider:D,addAlias:O,copyApiBaseUrl:ee,addKey:te,copyPendingKey:ne,copyKey:re,removeKey:ie,removeProviderConfirm:ae,removeAliasConfirm:oe,onTest:se,onFetchModels:ce,autoSave:ue,scheduleAutoSave:de,saveSection:fe,runCheck:pe}}var gD=Symbol(`config-store`);function _D(){let e=Rt(hD(Bw(),tw()));return zn(gD,e),e}function vD(){let e=P(gD);if(!e)throw Error(`config store \u672A provide\uFF08\u9700\u5728 App.vue setup \u4E2D\u8C03\u7528 provideConfigStore\uFF09`);return e}var yD={class:`auth-screen`},bD={class:`auth-panel`},xD={class:`auth-icon warn`},SD={class:`inline-code`},CD={class:`auth-icon`},wD=F({__name:`AuthCards`,setup(e){let t=uD();return(e,n)=>(L(),R(`div`,yD,[B(`div`,bD,[n[11]||=Aa(`<div class="auth-brand"><div class="auth-logo"><svg viewBox="0 0 256 256" width="40" height="40" xmlns="http://www.w3.org/2000/svg" aria-label="Model Gate logo"><defs><linearGradient id="mg-g" x1="32" y1="32" x2="224" y2="224" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#6366F1"></stop><stop offset="0.55" stop-color="#8B5CF6"></stop><stop offset="1" stop-color="#D946EF"></stop></linearGradient><linearGradient id="mg-g2" x1="64" y1="64" x2="192" y2="192" gradientUnits="userSpaceOnUse"><stop offset="0" stop-color="#A5B4FC"></stop><stop offset="1" stop-color="#E879F9"></stop></linearGradient></defs><rect x="16" y="16" width="224" height="224" rx="56" fill="url(#mg-g)"></rect><g stroke="#ffffff" stroke-width="14" stroke-linecap="round" fill="none" opacity="0.95"><path d="M78 184 L78 96 Q78 70 104 70 L152 70 Q178 70 178 96 L178 184"></path></g><g fill="#ffffff"><path d="M70 104 L120 118" stroke="#ffffff" stroke-width="9" stroke-linecap="round" opacity="0.9"></path><path d="M186 104 L136 118" stroke="#ffffff" stroke-width="9" stroke-linecap="round" opacity="0.9"></path><path d="M128 92 L156 124 L128 156 L100 124 Z" fill="url(#mg-g2)"></path><circle cx="128" cy="124" r="9" fill="#ffffff"></circle></g><path d="M128 156 L128 192" stroke="#ffffff" stroke-width="11" stroke-linecap="round" opacity="0.9"></path></svg></div><h1 class="auth-title">Model Gate</h1><p class="auth-subtitle">OpenAI \u517C\u5BB9 API \u7F51\u5173 \xB7 \u7BA1\u7406\u9762\u677F</p></div>`,1),j(t).state===`need-password`?(L(),z(j(WS),{key:0,class:`auth-card`,bordered:!1},{default:N(()=>[B(`div`,xD,[V(j(MC),{size:28},{default:N(()=>[V(j(kE))]),_:1})]),V(j(yb),{type:`warning`,class:`auth-alert`},{default:N(()=>[n[1]||=ka(` \u5C1A\u672A\u914D\u7F6E\u7BA1\u7406\u5BC6\u7801\u3002\u975E\u672C\u673A\u8BBF\u95EE\u7BA1\u7406\u754C\u9762\u9700\u8981\u5BC6\u7801\u4FDD\u62A4\uFF0C\u8BF7\u5148\u5728\u914D\u7F6E\u6587\u4EF6 `,-1),B(`code`,SD,Se(j(t).configPath),1),n[2]||=ka(` \u4E2D\u8BBE\u7F6E `,-1),n[3]||=B(`code`,{class:`inline-code`},`admin_password`,-1),n[4]||=ka(` \u5B57\u6BB5 \uFF08\u652F\u6301 `,-1),n[5]||=B(`code`,{class:`inline-code`},"${ENV_VAR}",-1),n[6]||=ka(` \u73AF\u5883\u53D8\u91CF\u5F15\u7528\uFF09\uFF0C\u4FDD\u5B58\u540E\u70ED\u52A0\u8F7D\u751F\u6548\uFF0C\u518D\u5237\u65B0\u672C\u9875\u767B\u5F55\u3002 `,-1)]),_:1}),V(j(OS),{type:`primary`,block:``,class:`auth-btn`,onClick:j(t).checkAuth},{default:N(()=>[...n[7]||=[ka(`\u5237\u65B0`,-1)]]),_:1},8,[`onClick`])]),_:1})):j(t).state===`need-login`?(L(),z(j(WS),{key:1,class:`auth-card`,bordered:!1},{default:N(()=>[B(`div`,CD,[V(j(MC),{size:28},{default:N(()=>[V(j(VE))]),_:1})]),n[9]||=B(`h2`,{class:`auth-card-title`},`\u767B\u5F55\u7BA1\u7406\u9762\u677F`,-1),n[10]||=B(`p`,{class:`auth-card-desc`},`\u8BF7\u8F93\u5165\u914D\u7F6E\u6587\u4EF6\u4E2D\u8BBE\u7F6E\u7684 admin_password`,-1),V(j(vT),{onSubmit:ws(j(t).submit,[`prevent`])},{default:N(()=>[V(j(TE),{label:`\u7BA1\u7406\u5BC6\u7801`,"show-label":!1},{default:N(()=>[V(j(sx),{value:j(t).password,"onUpdate:value":n[0]||=e=>j(t).password=e,type:`password`,size:`large`,placeholder:`\u8BF7\u8F93\u5165 admin_password`,class:`auth-input`,onKeyup:Es(j(t).submit,[`enter`])},null,8,[`value`,`onKeyup`])]),_:1}),j(t).error?(L(),z(j(yb),{key:0,type:`error`,class:`auth-alert`},{default:N(()=>[ka(Se(j(t).error),1)]),_:1})):ja(``,!0),V(j(OS),{type:`primary`,block:``,size:`large`,class:`auth-btn`,loading:j(t).busy,onClick:j(t).submit},{default:N(()=>[...n[8]||=[ka(`\u767B\u5F55`,-1)]]),_:1},8,[`loading`,`onClick`])]),_:1},8,[`onSubmit`])]),_:1})):ja(``,!0)])]))}}),TD={class:`section-nav`},ED=[`onClick`],DD={key:0,class:`nav-count`},OD=F({__name:`SectionNav`,props:{sections:{},active:{}},emits:[`update:active`],setup(e,{emit:t}){let n=t;return(t,r)=>(L(),R(`aside`,TD,[(L(!0),R(I,null,Zr(e.sections,t=>(L(),R(`button`,{key:t.key,type:`button`,class:he({active:e.active===t.key}),onClick:e=>n(`update:active`,t.key)},[V(j(MC),{size:16},{default:N(()=>[(L(),z(Jr(t.icon)))]),_:2},1024),B(`span`,null,Se(t.label),1),t.count?(L(),R(`span`,DD,Se(t.count),1)):ja(``,!0)],10,ED))),128))]))}}),kD={class:`check-summary`},AD={key:2},jD={key:3},MD={key:4},ND={key:0,class:`check-list`},PD={class:`check-msg`},FD=F({__name:`CheckResultBox`,props:{issues:{}},setup(e){return(t,n)=>e.issues===null?ja(``,!0):(L(),R(`div`,{key:0,class:he([`check-result`,{"has-error":e.issues.some(e=>e.level===`error`)}])},[B(`div`,kD,[e.issues.some(e=>e.level===`error`)?(L(),z(j(MC),{key:0,size:18},{default:N(()=>[V(j(kE))]),_:1})):(L(),z(j(MC),{key:1,size:18},{default:N(()=>[V(j(jE))]),_:1})),e.issues.some(e=>e.level===`error`)?(L(),R(`span`,AD,` \u53D1\u73B0 `+Se(e.issues.filter(e=>e.level===`error`).length)+` \u4E2A\u9519\u8BEF\u3001`+Se(e.issues.filter(e=>e.level===`warning`).length)+` \u4E2A\u63D0\u793A\uFF0C\u5DF2\u5728\u4E0B\u65B9\u6807\u7EA2 `,1)):e.issues.length===0?(L(),R(`span`,jD,`\u914D\u7F6E\u5B8C\u5168\u6B63\u786E`)):(L(),R(`span`,MD,`\u672A\u53D1\u73B0\u9519\u8BEF\uFF08`+Se(e.issues.length)+` \u4E2A\u63D0\u793A\u9879\uFF09`,1))]),e.issues.length?(L(),R(`ul`,ND,[(L(!0),R(I,null,Zr(e.issues,(e,t)=>(L(),R(`li`,{key:t,class:he(e.level)},[V(j(ib),{type:e.level===`error`?`error`:`warning`,size:`small`,round:``},{default:N(()=>[ka(Se(e.level===`error`?`\u9519\u8BEF`:`\u63D0\u793A`),1)]),_:2},1032,[`type`]),B(`span`,PD,Se(e.message),1)],2))),128))])):ja(``,!0)],2))}}),ID={class:`card-title`},LD={class:`api-url-row`},RD={class:`api-url`},zD=F({__name:`AccessSection`,setup(e){let t=vD();return(e,n)=>(L(),z(j(WS),{size:`small`,class:`soft-card`},{header:N(()=>[B(`span`,ID,[V(j(MC),{size:16},{default:N(()=>[V(j(zE))]),_:1}),n[0]||=ka(` \u63A5\u5165\u4FE1\u606F\uFF08\u914D\u5230 coding agent \u7528\uFF09`,-1)])]),default:N(()=>[B(`div`,LD,[B(`code`,RD,Se(j(t).apiBaseUrl),1),V(j(OS),{size:`small`,type:`primary`,onClick:j(t).copyApiBaseUrl},{icon:N(()=>[V(j(MC),null,{default:N(()=>[V(j(NE))]),_:1})]),default:N(()=>[n[1]||=ka(` \u590D\u5236 API \u5730\u5740 `,-1)]),_:1},8,[`onClick`])]),n[2]||=B(`div`,{style:{"margin-top":`8px`,color:`#999`,"font-size":`12px`}},` OpenAI \u517C\u5BB9 Base URL\uFF1BAPI Key \u5728\u4E0B\u65B9\u300C\u4E0B\u6E38\u5BC6\u94A5\u300D\u70B9\u590D\u5236\uFF1Bmodel \u586B\u522B\u540D\uFF08\u672A\u6307\u5B9A\u65F6\u7528 default_model\uFF09\u3002 `,-1)]),_:1}))}}),BD={class:`card-title`},VD=F({__name:`BasicSection`,setup(e){let t=vD();function n(){t.scheduleAutoSave({successMsg:`\u57FA\u672C\u8BBE\u7F6E\u5DF2\u4FDD\u5B58`})}return(e,r)=>{let i=Kr(`n-icon`);return L(),z(j(WS),{size:`small`,class:`soft-card`},{header:N(()=>[B(`span`,BD,[V(i,{size:16},{default:N(()=>[V(j(ZE))]),_:1}),r[1]||=ka(` \u57FA\u672C\u8BBE\u7F6E`,-1)])]),default:N(()=>[V(j(aT),{size:`large`},{default:N(()=>[V(j(DE),{label:`\u7AEF\u53E3`,value:j(t).startup.port},null,8,[`value`]),V(j(DE),{label:`\u76D1\u542C\u5730\u5740`,value:j(t).startup.host},null,8,[`value`]),V(j(DE),{label:`\u8D85\u65F6\uFF08\u79D2\uFF09`,value:j(t).startup.timeout_seconds},null,8,[`value`]),V(j(DE),{label:`access.log`,value:j(t).startup.access_log?`\u5F00`:`\u5173`},null,8,[`value`])]),_:1}),r[2]||=B(`div`,{style:{"margin-top":`12px`,color:`#999`,"font-size":`12px`}},` \u4EE5\u4E0A\u4E3A\u542F\u52A8\u53C2\u6570\uFF0C\u53EA\u8BFB\u5C55\u793A\uFF1B\u4FEE\u6539\u9700\u7F16\u8F91 config.json \u540E\u91CD\u542F\u670D\u52A1\u3002 `,-1),V(j(TE),{label:`\u9ED8\u8BA4\u6A21\u578B\uFF08agent \u672A\u6307\u5B9A model \u65F6\u4F7F\u7528\uFF09`,style:{"margin-top":`12px`}},{default:N(()=>[B(`div`,{class:he({"field-error":j(t).defaultModelError}),style:{width:`100%`}},[V(j(bC),{value:j(t).defaultModel,"onUpdate:value":[r[0]||=e=>j(t).defaultModel=e,n],options:j(t).defaultModelOptions,placeholder:`\u9009\u62E9\u4E00\u4E2A\u522B\u540D`,style:{width:`100%`}},null,8,[`value`,`options`])],2)]),_:1})]),_:1})}}}),HD={class:`card-title`},UD={class:`key-top`},WD={style:{color:`#666`,"font-size":`12px`,"word-break":`break-all`},class:`key-value`},GD={class:`key-bottom`},KD={style:{color:`#999`,"font-size":`12px`,"white-space":`nowrap`}},qD={key:0,style:{color:`#999`,"font-size":`12px`}},JD={style:{background:`#f5f5f5`,border:`1px dashed #c4b5fd`,"border-radius":`8px`,padding:`12px`,"font-size":`13px`,"word-break":`break-all`,"user-select":`all`,"margin-bottom":`16px`}},YD={style:{color:`#4f46e5`}},XD=F({__name:`KeysSection`,setup(e){let t=vD();return(e,n)=>(L(),R(I,null,[V(j(WS),{size:`small`,class:`soft-card`},{header:N(()=>[B(`span`,HD,[V(j(MC),{size:16},{default:N(()=>[V(j(LE))]),_:1}),n[3]||=ka(` \u4E0B\u6E38\u5BC6\u94A5\uFF08keys\uFF0Cagent \u8FDE\u5165\u7F51\u5173\u7528\uFF09`,-1)])]),default:N(()=>[V(j(aT),{style:{"margin-bottom":`12px`},class:`key-add-row`},{default:N(()=>[V(j(sx),{value:j(t).newKeyName,"onUpdate:value":n[0]||=e=>j(t).newKeyName=e,placeholder:`\u5BC6\u94A5\u540D\u79F0\uFF0C\u5982 Claude / Cursor`,style:{width:`260px`},onKeyup:Es(j(t).addKey,[`enter`])},null,8,[`value`,`onKeyup`]),V(j(OS),{type:`primary`,onClick:j(t).addKey},{icon:N(()=>[V(j(MC),null,{default:N(()=>[V(j(qE))]),_:1})]),default:N(()=>[n[4]||=ka(` \u6DFB\u52A0\u5BC6\u94A5 `,-1)]),_:1},8,[`onClick`])]),_:1}),V(j(aT),{vertical:``},{default:N(()=>[(L(!0),R(I,null,Zr(j(t).keys,(e,r)=>(L(),R(`div`,{key:e.name,class:`key-row`},[B(`div`,UD,[V(j(ib),{type:`primary`,size:`small`,style:{width:`110px`,"justify-content":`center`},class:`key-name`},{default:N(()=>[ka(Se(e.name),1)]),_:2},1024),B(`code`,WD,Se(j(fD)(e.key)),1)]),B(`div`,GD,[B(`span`,KD,Se(j(pD)(e.created_at)),1),V(j(OS),{size:`tiny`,onClick:n=>j(t).copyKey(e.key)},{default:N(()=>[...n[5]||=[ka(`\u590D\u5236`,-1)]]),_:1},8,[`onClick`]),V(j(OS),{size:`tiny`,type:`error`,quaternary:``,onClick:e=>j(t).removeKey(r)},{default:N(()=>[...n[6]||=[ka(`\u5220\u9664`,-1)]]),_:1},8,[`onClick`])])]))),128)),j(t).keys.length===0?(L(),R(`div`,qD,`\u8FD8\u6CA1\u6709\u5BC6\u94A5\uFF0C\u586B\u540D\u79F0\u6DFB\u52A0\u4E00\u4E2A\uFF08\u5BC6\u94A5\u81EA\u52A8\u751F\u6210\uFF09`)):ja(``,!0)]),_:1})]),_:1}),V(j(ww),{show:j(t).showNewKeyModal,"onUpdate:show":n[2]||=e=>j(t).showNewKeyModal=e,preset:`card`,style:{width:`520px`,borderRadius:`14px`},"mask-closable":!1,"close-on-esc":!1,title:`\u5BC6\u94A5\u300C${j(t).pendingKeyName}\u300D\u5DF2\u751F\u6210`},{default:N(()=>[n[9]||=B(`p`,{style:{margin:`0 0 12px`,color:`#666`,"font-size":`13px`}},` \u8BF7\u7ACB\u5373\u590D\u5236\u5E76\u59A5\u5584\u4FDD\u5B58\u3002\u6B64\u5B8C\u6574\u5BC6\u94A5\u4EC5\u5728\u672C\u6B21\u5C55\u793A\uFF0C\u5173\u95ED\u540E\u9875\u9762\u53EA\u663E\u793A\u63A9\u7801\uFF0C\u65E0\u6CD5\u518D\u67E5\u770B\u3002 `,-1),B(`div`,JD,[B(`code`,YD,Se(j(t).pendingKeyValue),1)]),V(j(aT),{justify:`end`},{default:N(()=>[V(j(OS),{onClick:n[1]||=e=>j(t).showNewKeyModal=!1},{default:N(()=>[...n[7]||=[ka(`\u5173\u95ED`,-1)]]),_:1}),V(j(OS),{type:`primary`,onClick:j(t).copyPendingKey},{icon:N(()=>[V(j(MC),null,{default:N(()=>[V(j(qE))]),_:1})]),default:N(()=>[n[8]||=ka(` \u590D\u5236\u5BC6\u94A5 `,-1)]),_:1},8,[`onClick`])]),_:1})]),_:1},8,[`show`,`title`])],64))}}),ZD={key:0,class:`item-card-title`},QD={class:`item-card-body`},$D=F({__name:`ItemCard`,props:{title:{},error:{type:Boolean},removeTooltip:{}},emits:[`remove`],setup(e,{emit:t}){let n=t;return(t,r)=>(L(),R(`div`,{class:he({"item-card":!0,"field-error":!!e.error})},[V(j(OC),{trigger:`hover`},{trigger:N(()=>[V(j(OS),{size:`tiny`,type:`error`,quaternary:``,circle:``,class:`item-card-del`,onClick:r[0]||=e=>n(`remove`)},{default:N(()=>[...r[1]||=[ka(` \u2715 `,-1)]]),_:1})]),default:N(()=>[ka(` `+Se(e.removeTooltip??`\u5220\u9664`),1)]),_:1}),e.title?(L(),R(`div`,ZD,Se(e.title),1)):ja(``,!0),B(`div`,QD,[Qr(t.$slots,`default`)])],2))}}),eO={class:`card-title`},tO={style:{"font-weight":`600`}},nO={key:0,style:{"font-weight":`400`,color:`#666`}},rO={style:{display:`flex`,"align-items":`baseline`,gap:`12px`},class:`provider-name-row`},iO={style:{width:`160px`,"flex-shrink":`0`}},aO={style:{flex:`1`,"min-width":`0`},class:`provider-base-url`},oO={style:{display:`flex`,"align-items":`center`,gap:`12px`}},sO={style:{flex:`1`,"min-width":`0`}},cO={style:{"flex-shrink":`0`}},lO={key:0,style:{"font-size":`12px`}},uO={style:{display:`inline-flex`,"align-items":`center`,gap:`8px`}},dO={key:1,style:{"font-size":`12px`}},fO=F({__name:`ProvidersSection`,setup(e){let t=vD(),n=A(JSON.parse(JSON.stringify(t.providers))),r=A(n.value.map(e=>e._id)),i=0;function a(){return`row-${++i}`}function o(){let e=a();n.value.push({_id:e,name:``,base_url:``,api_key:``,models:[]}),r.value.push(e)}Un(()=>t.providers,e=>{e.length&&n.value.length===0&&(n.value=JSON.parse(JSON.stringify(e)),r.value=n.value.map(e=>e._id))},{deep:!1});function s(e){let r=n.value[e].name||`#${e+1}`;t.removeProviderConfirm(r,async()=>{n.value.splice(e,1),await c()})}async function c(){t.providers=JSON.parse(JSON.stringify(n.value)),await t.saveSection({successMsg:`\u63D0\u4F9B\u5546\u5DF2\u4FDD\u5B58`}),n.value=JSON.parse(JSON.stringify(t.providers))}return(e,i)=>(L(),z(j(WS),{size:`small`,class:`soft-card`},{header:N(()=>[B(`span`,eO,[V(j(MC),{size:16},{default:N(()=>[V(j(YE))]),_:1}),i[1]||=ka(` \u63D0\u4F9B\u5546\uFF08providers\uFF09`,-1)])]),default:N(()=>[V(j(aT),{vertical:``},{default:N(()=>[V(j(lC),{"expanded-names":r.value,"onUpdate:expandedNames":i[0]||=e=>r.value=e},{default:N(()=>[(L(!0),R(I,null,Zr(n.value,(e,n)=>(L(),z(j(pC),{key:e._id,name:e._id,"arrow-placement":`left`},{header:N(()=>[B(`span`,tO,[ka(` provider #`+Se(n+1)+` `,1),e.name?(L(),R(`span`,nO,`\uFF08`+Se(e.name)+`\uFF09`,1)):ja(``,!0)])]),default:N(()=>[V($D,{error:j(t).erroredProviders.has(e.name),"remove-tooltip":`\u5220\u9664\u8BE5\u63D0\u4F9B\u5546`,onRemove:e=>s(n)},{default:N(()=>[B(`div`,rO,[B(`div`,iO,[V(j(TE),{label:`\u540D\u79F0`,style:{"margin-bottom":`0`}},{default:N(()=>[V(j(sx),{value:e.name,"onUpdate:value":t=>e.name=t,placeholder:`\u5982 deepseek`},null,8,[`value`,`onUpdate:value`])]),_:2},1024)]),B(`div`,aO,[V(j(TE),{label:`base_url`,style:{"margin-bottom":`0`}},{default:N(()=>[V(j(sx),{value:e.base_url,"onUpdate:value":t=>e.base_url=t,placeholder:`https://api.deepseek.com/v1`,style:{width:`100%`}},null,8,[`value`,`onUpdate:value`])]),_:2},1024)])]),B(`div`,oO,[B(`div`,sO,[V(j(TE),{label:`api_key\uFF08\u7559\u7A7A\u4FDD\u6301\u539F\u503C\uFF0C\u586B\u65B0\u503C\u8986\u76D6\uFF09`,style:{"margin-bottom":`0`}},{default:N(()=>[V(j(sx),{value:e.api_key,"onUpdate:value":t=>e.api_key=t,type:`password`,"show-password-on":`click`,placeholder:`\u7559\u7A7A\u4FDD\u6301\u539F\u503C\uFF0C\u586B\u65B0\u503C\u8986\u76D6`,style:{width:`100%`}},null,8,[`value`,`onUpdate:value`])]),_:2},1024)]),B(`div`,cO,[V(j(OS),{size:`small`,loading:j(t).testStates[e.name]?.testing,type:j(t).testStates[e.name]?.ok?`success`:`default`,onClick:n=>j(t).onTest(e)},{default:N(()=>[...i[2]||=[ka(` \u6D4B\u8BD5\u8FDE\u63A5 `,-1)]]),_:1},8,[`loading`,`type`,`onClick`])])]),j(t).testStates[e.name]?.result?(L(),R(`div`,lO,[V(j(ib),{type:j(t).testStates[e.name]?.ok?`success`:`error`,size:`small`},{default:N(()=>[ka(Se(j(t).testStates[e.name]?.result),1)]),_:2},1032,[`type`])])):ja(``,!0),V(j(TE),{style:{"margin-bottom":`0`}},{label:N(()=>[B(`span`,uO,[i[4]||=ka(` \u6A21\u578B\u5217\u8868 `,-1),V(j(OS),{size:`tiny`,type:`primary`,secondary:``,loading:j(t).fetchStates[e.name]?.fetching,onClick:n=>j(t).onFetchModels(e)},{default:N(()=>[...i[3]||=[ka(` \u62C9\u53D6\u6A21\u578B `,-1)]]),_:1},8,[`loading`,`onClick`])])]),default:N(()=>[V(j($w),{value:e.models,"onUpdate:value":t=>e.models=t,"show-sort-button":!0,placeholder:`\u6A21\u578B id\uFF0C\u5982 deepseek-chat`,style:{width:`100%`}},{"create-button-default":N(()=>[...i[5]||=[ka(` \u6DFB\u52A0\u6A21\u578B `,-1)]]),_:1},8,[`value`,`onUpdate:value`])]),_:2},1024),j(t).fetchStates[e.name]?.result?(L(),R(`div`,dO,[V(j(ib),{type:j(t).fetchStates[e.name]?.ok?`success`:`error`,size:`small`},{default:N(()=>[ka(Se(j(t).fetchStates[e.name]?.result),1)]),_:2},1032,[`type`])])):ja(``,!0)]),_:2},1032,[`error`,`onRemove`])]),_:2},1032,[`name`]))),128))]),_:1},8,[`expanded-names`]),V(j(aT),{justify:`space-between`},{default:N(()=>[V(j(OS),{size:`small`,onClick:o},{default:N(()=>[...i[6]||=[ka(`+ \u6DFB\u52A0 provider`,-1)]]),_:1}),V(j(OS),{type:`primary`,loading:j(t).saving,onClick:c},{icon:N(()=>[V(j(MC),null,{default:N(()=>[V(j(qE))]),_:1})]),default:N(()=>[i[7]||=ka(` \u4FDD\u5B58 `,-1)]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1}))}}),pO={class:`card-title`},mO={style:{"font-weight":`600`}},hO={key:0,style:{"font-weight":`400`,color:`#666`}},gO={style:{display:`inline-flex`,"align-items":`center`,gap:`8px`}},_O={style:{flex:`1 1 0`,"min-width":`0`}},vO=F({__name:`AliasesSection`,setup(e){let t=vD(),n=H(()=>(t.providers.length?t.providers:i.value).filter(e=>e.name&&e.models.length).map(e=>({type:`group`,label:e.name,children:e.models.filter(Boolean).map(t=>({label:`${e.name}:${t}`,value:`${e.name}:${t}`}))})));function r(e,t){let r=new Set(e.targets.filter((e,n)=>n!==t&&e));return n.value.map(e=>({...e,children:e.children.map(e=>({...e,disabled:r.has(e.value)}))}))}let i=A(JSON.parse(JSON.stringify(t.aliases))),a=A(i.value.map(e=>e._id)),o=0;function s(){return`row-${++o}`}function c(){let e=s();i.value.push({_id:e,name:``,targets:[]}),a.value.push(e)}Un(()=>t.aliases,e=>{e.length&&i.value.length===0&&(i.value=JSON.parse(JSON.stringify(e)),a.value=i.value.map(e=>e._id))},{deep:!1});function l(e){let n=i.value[e].name||`#${e+1}`;t.removeAliasConfirm(n,async()=>{i.value.splice(e,1),await u()})}async function u(){let e=i.value.map(e=>({...e,targets:e.targets.filter(e=>/^[^:]+:.+$/.test(e))}));t.aliases=JSON.parse(JSON.stringify(e)),await t.saveSection({successMsg:`\u6A21\u578B\u522B\u540D\u5DF2\u4FDD\u5B58`}),i.value=JSON.parse(JSON.stringify(t.aliases))}return(e,n)=>{let o=Kr(`n-tag`);return L(),z(j(WS),{size:`small`,class:`soft-card alias-card`},{header:N(()=>[B(`span`,pO,[V(j(MC),{size:16},{default:N(()=>[V(j(FE))]),_:1}),n[1]||=ka(` \u6A21\u578B\u522B\u540D\uFF08aliases\uFF0Cagent \u53EA\u8BA4\u522B\u540D\uFF09`,-1)])]),default:N(()=>[V(j(aT),{vertical:``},{default:N(()=>[V(j(lC),{"expanded-names":a.value,"onUpdate:expandedNames":n[0]||=e=>a.value=e},{default:N(()=>[(L(!0),R(I,null,Zr(i.value,(e,i)=>(L(),z(j(pC),{key:e._id,name:e._id,"arrow-placement":`left`},{header:N(()=>[B(`span`,mO,[ka(` alias #`+Se(i+1)+` `,1),e.name?(L(),R(`span`,hO,`\uFF08`+Se(e.name)+`\uFF09`,1)):ja(``,!0)])]),default:N(()=>[V($D,{title:`alias #${i+1}${e.name?`\uFF08${e.name}\uFF09`:``}`,error:j(t).erroredAliases.has(e.name),"remove-tooltip":`\u5220\u9664\u8BE5\u522B\u540D`,onRemove:e=>l(i)},{default:N(()=>[V(j(TE),{label:`\u522B\u540D`,style:{"margin-bottom":`0`}},{default:N(()=>[V(j(sx),{value:e.name,"onUpdate:value":t=>e.name=t,placeholder:`\u5982 fast`,style:{width:`160px`}},null,8,[`value`,`onUpdate:value`])]),_:2},1024),V(j(TE),{style:{"margin-bottom":`0`}},{label:N(()=>[B(`span`,gO,[n[3]||=ka(` \u76EE\u6807\u6A21\u578B `,-1),V(o,{size:`tiny`,bordered:!1,type:`default`},{default:N(()=>[...n[2]||=[ka(`\u987A\u5E8F\u5373 failover \u4F18\u5148\u7EA7`,-1)]]),_:1})])]),default:N(()=>[V(j($w),{value:e.targets,"onUpdate:value":t=>e.targets=t,"on-create":()=>null,"show-sort-button":!0,placeholder:`\u9009\u62E9\u63D0\u4F9B\u5546\u4E0B\u7684\u6A21\u578B`,style:{width:`100%`}},{default:N(({index:t})=>[B(`div`,_O,[V(j(bC),{value:e.targets[t],"onUpdate:value":n=>e.targets[t]=n,options:r(e,t),placeholder:`\u9009\u62E9\u63D0\u4F9B\u5546\u4E0B\u7684\u6A21\u578B`,class:`alias-target-select`,style:{width:`100%`}},null,8,[`value`,`onUpdate:value`,`options`])])]),"create-button-default":N(()=>[...n[4]||=[ka(` \u6DFB\u52A0\u76EE\u6807 `,-1)]]),_:2},1032,[`value`,`onUpdate:value`])]),_:2},1024)]),_:2},1032,[`title`,`error`,`onRemove`])]),_:2},1032,[`name`]))),128))]),_:1},8,[`expanded-names`]),V(j(aT),{justify:`space-between`},{default:N(()=>[V(j(OS),{size:`small`,onClick:c},{default:N(()=>[...n[5]||=[ka(`+ \u6DFB\u52A0\u522B\u540D`,-1)]]),_:1}),V(j(OS),{type:`primary`,loading:j(t).saving,onClick:u},{icon:N(()=>[V(j(MC),null,{default:N(()=>[V(j(qE))]),_:1})]),default:N(()=>[n[6]||=ka(` \u4FDD\u5B58 `,-1)]),_:1},8,[`loading`])]),_:1})]),_:1})]),_:1})}}}),yO={key:1,class:`editor-content`},bO={class:`hero-header`},xO={style:{display:`flex`,"align-items":`center`,gap:`10px`}},SO={key:1,class:`section-layout`},CO={class:`section-body`},wO=`<svg viewBox="0 0 256 256" width="38" height="38" xmlns="http://www.w3.org/2000/svg" aria-label="Model Gate logo">\n <defs>\n <linearGradient id="mg-g" x1="32" y1="32" x2="224" y2="224" gradientUnits="userSpaceOnUse">\n <stop offset="0" stop-color="#6366F1"/><stop offset="0.55" stop-color="#8B5CF6"/><stop offset="1" stop-color="#D946EF"/>\n </linearGradient>\n <linearGradient id="mg-g2" x1="64" y1="64" x2="192" y2="192" gradientUnits="userSpaceOnUse">\n <stop offset="0" stop-color="#A5B4FC"/><stop offset="1" stop-color="#E879F9"/>\n </linearGradient>\n </defs>\n <rect x="16" y="16" width="224" height="224" rx="56" fill="url(#mg-g)"/>\n <g stroke="#ffffff" stroke-width="14" stroke-linecap="round" fill="none" opacity="0.95">\n <path d="M78 184 L78 96 Q78 70 104 70 L152 70 Q178 70 178 96 L178 184"/>\n </g>\n <g fill="#ffffff">\n <path d="M70 104 L120 118" stroke="#ffffff" stroke-width="9" stroke-linecap="round" opacity="0.9"/>\n <path d="M186 104 L136 118" stroke="#ffffff" stroke-width="9" stroke-linecap="round" opacity="0.9"/>\n <path d="M128 92 L156 124 L128 156 L100 124 Z" fill="url(#mg-g2)"/>\n <circle cx="128" cy="124" r="9" fill="#ffffff"/>\n </g>\n <path d="M128 156 L128 192" stroke="#ffffff" stroke-width="11" stroke-linecap="round" opacity="0.9"/>\n</svg>`,TO=F({__name:`App`,setup(e){let t=_D(),n=cD(t.load);zn(lD,n),Ir(n.checkAuth);let r=[{label:`\u767B\u51FA`,key:`logout`,icon:()=>ro(MC,null,{default:()=>ro(UE)})}];function i(e){e===`logout`&&n.signOut()}let a=[`access`,`basic`,`keys`,`providers`,`aliases`];function o(){let e=location.hash.replace(/^#/,``);return a.includes(e)?e:`access`}let s=A(o());Un(s,e=>{let t=`#${e}`;location.hash!==t&&history.replaceState(null,``,t)});function c(){let e=o();e!==s.value&&(s.value=e)}Ir(()=>window.addEventListener(`hashchange`,c)),Br(()=>window.removeEventListener(`hashchange`,c));let l=H(()=>[{key:`access`,label:`\u63A5\u5165\u4FE1\u606F`,icon:qt(zE)},{key:`basic`,label:`\u57FA\u672C\u8BBE\u7F6E`,icon:qt(ZE)},{key:`keys`,label:`\u4E0B\u6E38\u5BC6\u94A5`,icon:qt(LE),count:t.keys.length},{key:`providers`,label:`\u63D0\u4F9B\u5546`,icon:qt(YE),count:t.providers.length},{key:`aliases`,label:`\u6A21\u578B\u522B\u540D`,icon:qt(FE),count:t.aliases.length}]);async function u(){let e=await t.runCheck();if(e.length>0){let t=mD(e[0]?.target);t&&(s.value=t)}}return(e,a)=>(L(),R(`div`,{class:he([`page-wrap`,(j(n).state===`need-password`||j(n).state===`need-login`)&&`page-wrap--auth`])},[j(n).state===`need-password`||j(n).state===`need-login`?(L(),z(wD,{key:0})):j(n).state===`ok`?(L(),R(`div`,yO,[B(`div`,bO,[B(`div`,{class:`hero-left`},[B(`div`,{class:`hero-logo`,innerHTML:wO}),a[1]||=B(`div`,null,[B(`h2`,{style:{margin:`0`}},`Model Gate \u914D\u7F6E`),B(`p`,{style:{margin:`2px 0 0`,"font-size":`12px`,opacity:`0.85`}},` config.json \u662F\u552F\u4E00\u771F\u76F8\u6E90 \xB7 \u6539\u52A8\u5373\u65F6\u4FDD\u5B58 + \u70ED\u52A0\u8F7D\u751F\u6548 `)],-1)]),B(`div`,xO,[V(j(OS),{size:`small`,loading:j(t).checking,class:`check-config-btn`,onClick:u},{icon:N(()=>[V(j(MC),null,{default:N(()=>[V(j(jE))]),_:1})]),default:N(()=>[a[2]||=ka(` \u68C0\u67E5\u914D\u7F6E\u6B63\u786E\u6027 `,-1)]),_:1},8,[`loading`]),V(j(XC),{trigger:`click`,placement:`bottom-end`,options:r,onSelect:i},{default:N(()=>[V(j(OS),{quaternary:``,circle:``,size:`small`,"aria-label":`\u7528\u6237\u83DC\u5355`},{default:N(()=>[V(j(MC),{color:`#ffffff`,size:22},{default:N(()=>[V(j(GE))]),_:1})]),_:1})]),_:1})])]),j(t).loadError?(L(),z(j(yb),{key:0,type:`error`,title:`\u52A0\u8F7D\u914D\u7F6E\u5931\u8D25`,style:{"margin-bottom":`16px`}},{default:N(()=>[ka(Se(j(t).loadError),1)]),_:1})):ja(``,!0),V(FD,{issues:j(t).checkIssues},null,8,[`issues`]),j(t).loadError?ja(``,!0):(L(),R(`div`,SO,[V(OD,{active:s.value,"onUpdate:active":a[0]||=e=>s.value=e,sections:l.value},null,8,[`active`,`sections`]),B(`div`,CO,[Ln(B(`div`,null,[V(zD)],512),[[Lo,s.value===`access`]]),Ln(B(`div`,null,[V(VD)],512),[[Lo,s.value===`basic`]]),Ln(B(`div`,null,[V(XD)],512),[[Lo,s.value===`keys`]]),Ln(B(`div`,null,[V(fO)],512),[[Lo,s.value===`providers`]]),Ln(B(`div`,null,[V(vO)],512),[[Lo,s.value===`aliases`]])])]))])):ja(``,!0)],2))}}),EO={class:`app-bg`};As(F({__name:`AppRoot`,setup(e){let t={common:{primaryColor:`#6366f1`,primaryColorHover:`#818cf8`,primaryColorPressed:`#4f46e5`,primaryColorSuppl:`#6366f1`,borderRadius:`8px`,borderRadiusSmall:`6px`},Card:{borderRadius:`12px`},Button:{borderRadiusMedium:`8px`}};return(e,n)=>(L(),R(`div`,EO,[V(j(mC),{"theme-overrides":t},{default:N(()=>[V(j(zw),null,{default:N(()=>[V(j(Ew),null,{default:N(()=>[V(TO)]),_:1})]),_:1})]),_:1})]))}})).mount(`#app`);',
|
|
1994
|
+
"index.html": `<!DOCTYPE html>\r
|
|
1995
|
+
<html lang="zh-CN">\r
|
|
1996
|
+
<head>\r
|
|
1997
|
+
<meta charset="UTF-8" />\r
|
|
1998
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />\r
|
|
1999
|
+
<link rel="icon" type="image/svg+xml" href="/admin/logo.svg" />\r
|
|
2000
|
+
<title>model-gate \u914D\u7F6E</title>\r
|
|
2001
|
+
<script type="module" crossorigin src="/admin/assets/index-DVBoJLle.js"></script>
|
|
2002
|
+
<link rel="stylesheet" crossorigin href="/admin/assets/index-D4FpNvr-.css">
|
|
2003
|
+
</head>\r
|
|
2004
|
+
<body>\r
|
|
2005
|
+
<div id="app"></div>\r\r
|
|
2006
|
+
</body>\r
|
|
2007
|
+
</html>\r
|
|
2008
|
+
`,
|
|
2009
|
+
"logo.svg": `<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="model-gate logo">
|
|
2010
|
+
<defs>
|
|
2011
|
+
<linearGradient id="mg-g" x1="32" y1="32" x2="224" y2="224" gradientUnits="userSpaceOnUse">
|
|
2012
|
+
<stop offset="0" stop-color="#6366F1"/>
|
|
2013
|
+
<stop offset="0.55" stop-color="#8B5CF6"/>
|
|
2014
|
+
<stop offset="1" stop-color="#D946EF"/>
|
|
2015
|
+
</linearGradient>
|
|
2016
|
+
<linearGradient id="mg-g2" x1="64" y1="64" x2="192" y2="192" gradientUnits="userSpaceOnUse">
|
|
2017
|
+
<stop offset="0" stop-color="#A5B4FC"/>
|
|
2018
|
+
<stop offset="1" stop-color="#E879F9"/>
|
|
2019
|
+
</linearGradient>
|
|
2020
|
+
</defs>
|
|
2021
|
+
|
|
2022
|
+
<!-- \u5706\u89D2\u5E95\u677F -->
|
|
2023
|
+
<rect x="16" y="16" width="224" height="224" rx="56" fill="url(#mg-g)"/>
|
|
2024
|
+
|
|
2025
|
+
<!-- \u7F51\u5173\u62F1\u95E8\uFF1A\u4E24\u4FA7\u7ACB\u67F1 + \u9876\u90E8\u6A2A\u6881\uFF0C\u8C61\u5F81 gate -->
|
|
2026
|
+
<g stroke="white" stroke-width="14" stroke-linecap="round" fill="none" opacity="0.95">
|
|
2027
|
+
<path d="M78 184 L78 96 Q78 70 104 70 L152 70 Q178 70 178 96 L178 184"/>
|
|
2028
|
+
</g>
|
|
2029
|
+
|
|
2030
|
+
<!-- \u95E8\u5185\u7684\u6A21\u578B\u8282\u70B9\uFF1A\u4E00\u4E2A\u83F1\u5F62\u4EE3\u8868\u6A21\u578B/\u8282\u70B9\uFF0C\u5DE6\u53F3\u4E24\u6761\u8F93\u5165\u8FDE\u7EBF\u4EE3\u8868\u591A\u4E0A\u6E38\u6C47\u805A -->
|
|
2031
|
+
<g fill="white">
|
|
2032
|
+
<!-- \u8F93\u5165\u8FDE\u7EBF -->
|
|
2033
|
+
<path d="M70 104 L120 118" stroke="white" stroke-width="9" stroke-linecap="round" opacity="0.9"/>
|
|
2034
|
+
<path d="M186 104 L136 118" stroke="white" stroke-width="9" stroke-linecap="round" opacity="0.9"/>
|
|
2035
|
+
<!-- \u4E2D\u5FC3\u6A21\u578B\u8282\u70B9\uFF08\u83F1\u5F62 + \u5185\u6838\uFF09 -->
|
|
2036
|
+
<path d="M128 92 L156 124 L128 156 L100 124 Z" fill="url(#mg-g2)"/>
|
|
2037
|
+
<circle cx="128" cy="124" r="9" fill="white"/>
|
|
2038
|
+
</g>
|
|
2039
|
+
|
|
2040
|
+
<!-- \u51FA\u53E3\uFF1A\u4E0B\u65B9\u7EDF\u4E00\u901A\u9053\uFF0C\u8C61\u5F81 OpenAI \u517C\u5BB9\u51FA\u53E3 -->
|
|
2041
|
+
<path d="M128 156 L128 192" stroke="white" stroke-width="11" stroke-linecap="round" opacity="0.9"/>
|
|
2042
|
+
</svg>
|
|
2043
|
+
`
|
|
2044
|
+
};
|
|
2045
|
+
|
|
2046
|
+
// src/admin.ts
|
|
2047
|
+
var SESSION_COOKIE = "mg_admin_session";
|
|
2048
|
+
var SESSION_TTL_MS = 24 * 60 * 60 * 1000;
|
|
2049
|
+
var MAX_LOGIN_FAILS = 5;
|
|
2050
|
+
var LOGIN_LOCK_MS = 60 * 1000;
|
|
2051
|
+
var loginFails = new Map;
|
|
2052
|
+
function isLoopbackAddress(addr) {
|
|
2053
|
+
const a = addr.replace(/^::ffff:/, "");
|
|
2054
|
+
return a === "127.0.0.1" || a === "::1";
|
|
2055
|
+
}
|
|
2056
|
+
function b64url(buf) {
|
|
2057
|
+
return buf.toString("base64").replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
2058
|
+
}
|
|
2059
|
+
function b64urlDecode(s) {
|
|
2060
|
+
const pad = s.length % 4 === 0 ? "" : "=".repeat(4 - s.length % 4);
|
|
2061
|
+
return Buffer.from(s.replace(/-/g, "+").replace(/_/g, "/") + pad, "base64");
|
|
2062
|
+
}
|
|
2063
|
+
function sessionSecret(password) {
|
|
2064
|
+
return createHmac("sha256", "mg-admin-session-v1").update(password).digest("hex");
|
|
2065
|
+
}
|
|
2066
|
+
function signSession(exp, password) {
|
|
2067
|
+
const payload = b64url(Buffer.from(JSON.stringify({ exp })));
|
|
2068
|
+
const sig = b64url(createHmac("sha256", sessionSecret(password)).update(payload).digest());
|
|
2069
|
+
return `${payload}.${sig}`;
|
|
2070
|
+
}
|
|
2071
|
+
function verifySession(token, password) {
|
|
2072
|
+
if (!token)
|
|
2073
|
+
return false;
|
|
2074
|
+
const dot = token.indexOf(".");
|
|
2075
|
+
if (dot <= 0)
|
|
2076
|
+
return false;
|
|
2077
|
+
const payload = token.slice(0, dot);
|
|
2078
|
+
const sig = token.slice(dot + 1);
|
|
2079
|
+
const expected = b64url(createHmac("sha256", sessionSecret(password)).update(payload).digest());
|
|
2080
|
+
const a = Buffer.from(sig);
|
|
2081
|
+
const b = Buffer.from(expected);
|
|
2082
|
+
if (a.length !== b.length || !timingSafeEqual(a, b))
|
|
2083
|
+
return false;
|
|
2084
|
+
try {
|
|
2085
|
+
const obj = JSON.parse(b64urlDecode(payload).toString("utf-8"));
|
|
2086
|
+
return typeof obj.exp === "number" && obj.exp > Date.now();
|
|
2087
|
+
} catch {
|
|
2088
|
+
return false;
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
function parseCookies(header) {
|
|
2092
|
+
const out = {};
|
|
2093
|
+
for (const part of header.split(";")) {
|
|
2094
|
+
const eq = part.indexOf("=");
|
|
2095
|
+
if (eq > 0)
|
|
2096
|
+
out[part.slice(0, eq).trim()] = part.slice(eq + 1).trim();
|
|
2097
|
+
}
|
|
2098
|
+
return out;
|
|
2099
|
+
}
|
|
2100
|
+
function safeEqual(a, b) {
|
|
2101
|
+
const ab = Buffer.from(a);
|
|
2102
|
+
const bb = Buffer.from(b);
|
|
2103
|
+
return ab.length === bb.length && timingSafeEqual(ab, bb);
|
|
2104
|
+
}
|
|
2105
|
+
function clientIp(c) {
|
|
2106
|
+
const server = c.env;
|
|
2107
|
+
return server?.requestIP ? server.requestIP(c.req.raw)?.address ?? null : null;
|
|
2108
|
+
}
|
|
2109
|
+
async function authGuard(getConfig, c, next) {
|
|
2110
|
+
const ip = clientIp(c);
|
|
2111
|
+
if (!ip || isLoopbackAddress(ip))
|
|
2112
|
+
return next();
|
|
2113
|
+
const path = c.req.path;
|
|
2114
|
+
const isPublic = path === "/admin" || path.startsWith("/admin/assets/") || /^\/admin\/api\/(auth-status|login|logout)$/.test(path);
|
|
2115
|
+
if (isPublic)
|
|
2116
|
+
return next();
|
|
2117
|
+
const cfg = getConfig();
|
|
2118
|
+
const token = parseCookies(c.req.header("cookie") ?? "")[SESSION_COOKIE];
|
|
2119
|
+
if (verifySession(token, cfg.admin_password))
|
|
2120
|
+
return next();
|
|
2121
|
+
return c.json({ error: { message: "\u9700\u8981\u767B\u5F55", type: "unauthorized", code: "auth_required" } }, 401);
|
|
2122
|
+
}
|
|
2123
|
+
function clearSessionCookie() {
|
|
2124
|
+
return `${SESSION_COOKIE}=; HttpOnly; SameSite=Lax; Path=/admin; Max-Age=0`;
|
|
2125
|
+
}
|
|
2126
|
+
function readRaw(path) {
|
|
2127
|
+
try {
|
|
2128
|
+
return JSON.parse(readFileSync2(path, "utf-8"));
|
|
2129
|
+
} catch {
|
|
2130
|
+
return null;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
function resolveApiKey(draftVal, rawCur) {
|
|
2134
|
+
if (draftVal === "" && typeof rawCur === "string")
|
|
2135
|
+
return rawCur;
|
|
2136
|
+
return draftVal;
|
|
2137
|
+
}
|
|
2138
|
+
function atomicWrite(path, content) {
|
|
2139
|
+
const tmp = `${path}.tmp`;
|
|
2140
|
+
writeFileSync(tmp, content, "utf-8");
|
|
2141
|
+
renameSync(tmp, path);
|
|
2142
|
+
}
|
|
2143
|
+
var MIME = {
|
|
2144
|
+
".html": "text/html; charset=utf-8",
|
|
2145
|
+
".js": "application/javascript; charset=utf-8",
|
|
2146
|
+
".css": "text/css; charset=utf-8",
|
|
2147
|
+
".svg": "image/svg+xml",
|
|
2148
|
+
".png": "image/png",
|
|
2149
|
+
".ico": "image/x-icon"
|
|
2150
|
+
};
|
|
2151
|
+
async function serveSpa(c, dist, rel) {
|
|
2152
|
+
const safe = rel.split("/").filter((s) => s && s !== "..").join("/");
|
|
2153
|
+
const key = safe || "index.html";
|
|
2154
|
+
const embedded = adminAssets[key];
|
|
2155
|
+
if (embedded !== undefined) {
|
|
2156
|
+
const ext = key.slice(key.lastIndexOf("."));
|
|
2157
|
+
return new Response(embedded, { headers: { "content-type": MIME[ext] ?? "application/octet-stream" } });
|
|
2158
|
+
}
|
|
2159
|
+
const filePath = safe ? resolve(dist, safe) : resolve(dist, "index.html");
|
|
2160
|
+
if (!filePath.startsWith(`${dist}/`))
|
|
2161
|
+
return c.text("forbidden", 403);
|
|
2162
|
+
let f = Bun.file(filePath);
|
|
2163
|
+
if (await f.exists())
|
|
2164
|
+
return new Response(f);
|
|
2165
|
+
const fallback = adminAssets["index.html"];
|
|
2166
|
+
if (fallback !== undefined)
|
|
2167
|
+
return new Response(fallback, { headers: { "content-type": "text/html; charset=utf-8" } });
|
|
2168
|
+
f = Bun.file(resolve(dist, "index.html"));
|
|
2169
|
+
if (await f.exists())
|
|
2170
|
+
return new Response(f, { headers: { "content-type": "text/html" } });
|
|
2171
|
+
return c.text("admin UI \u672A\u6784\u5EFA\uFF1A\u5148\u8FD0\u884C bun run build:admin \u6216 bun run embed:admin", 404);
|
|
2172
|
+
}
|
|
2173
|
+
function createAdminApp(getConfig, configPath, opts) {
|
|
2174
|
+
const admin = new Hono2;
|
|
2175
|
+
admin.use("*", (c, next) => authGuard(getConfig, c, next));
|
|
2176
|
+
admin.get("/api/auth-status", (c) => {
|
|
2177
|
+
const cfg = getConfig();
|
|
2178
|
+
const token = parseCookies(c.req.header("cookie") ?? "")[SESSION_COOKIE];
|
|
2179
|
+
const loggedIn = verifySession(token, cfg.admin_password);
|
|
2180
|
+
return c.json({
|
|
2181
|
+
passwordConfigured: cfg.admin_password !== "",
|
|
2182
|
+
configPath: configPath ?? "config.json",
|
|
2183
|
+
loggedIn
|
|
2184
|
+
});
|
|
2185
|
+
});
|
|
2186
|
+
admin.post("/api/login", async (c) => {
|
|
2187
|
+
const cfg = getConfig();
|
|
2188
|
+
if (!cfg.admin_password) {
|
|
2189
|
+
return c.json({ error: { message: "\u672A\u914D\u7F6E admin_password\uFF0C\u8BF7\u5148\u5728\u914D\u7F6E\u6587\u4EF6\u4E2D\u8BBE\u7F6E", type: "invalid_request_error", code: "no_admin_password" } }, 400);
|
|
2190
|
+
}
|
|
2191
|
+
const ip = clientIp(c);
|
|
2192
|
+
if (ip) {
|
|
2193
|
+
const rec = loginFails.get(ip);
|
|
2194
|
+
if (rec && rec.lockedUntil > Date.now()) {
|
|
2195
|
+
return c.json({ error: { message: "\u767B\u5F55\u5931\u8D25\u6B21\u6570\u8FC7\u591A\uFF0C\u8BF7\u7A0D\u540E\u518D\u8BD5", type: "rate_limited", code: "login_locked" } }, 429);
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
let body;
|
|
2199
|
+
try {
|
|
2200
|
+
body = await c.req.json();
|
|
2201
|
+
} catch {
|
|
2202
|
+
return c.json({ error: { message: "\u8BF7\u6C42\u4F53\u5FC5\u987B\u662F\u5408\u6CD5 JSON", type: "invalid_request_error" } }, 400);
|
|
2203
|
+
}
|
|
2204
|
+
const { password } = body ?? {};
|
|
2205
|
+
if (typeof password !== "string" || !safeEqual(password, cfg.admin_password)) {
|
|
2206
|
+
if (ip) {
|
|
2207
|
+
const cur = loginFails.get(ip) ?? { fails: 0, lockedUntil: 0 };
|
|
2208
|
+
const fails = cur.fails + 1;
|
|
2209
|
+
loginFails.set(ip, { fails, lockedUntil: fails >= MAX_LOGIN_FAILS ? Date.now() + LOGIN_LOCK_MS : 0 });
|
|
2210
|
+
}
|
|
2211
|
+
return c.json({ error: { message: "\u5BC6\u7801\u9519\u8BEF", type: "unauthorized", code: "invalid_password" } }, 401);
|
|
2212
|
+
}
|
|
2213
|
+
if (ip)
|
|
2214
|
+
loginFails.delete(ip);
|
|
2215
|
+
const token = signSession(Date.now() + SESSION_TTL_MS, cfg.admin_password);
|
|
2216
|
+
return c.json({ ok: true }, {
|
|
2217
|
+
status: 200,
|
|
2218
|
+
headers: {
|
|
2219
|
+
"set-cookie": `${SESSION_COOKIE}=${token}; HttpOnly; SameSite=Lax; Path=/admin; Max-Age=${SESSION_TTL_MS / 1000}`
|
|
2220
|
+
}
|
|
2221
|
+
});
|
|
2222
|
+
});
|
|
2223
|
+
admin.post("/api/logout", (c) => {
|
|
2224
|
+
return c.json({ ok: true }, { status: 200, headers: { "set-cookie": clearSessionCookie() } });
|
|
2225
|
+
});
|
|
2226
|
+
admin.get("/api/config", (c) => {
|
|
2227
|
+
const cfg = getConfig();
|
|
2228
|
+
const { admin_password, ...rest } = cfg;
|
|
2229
|
+
return c.json({
|
|
2230
|
+
...rest,
|
|
2231
|
+
keys: cfg.keys,
|
|
2232
|
+
providers: Object.fromEntries(Object.entries(cfg.providers).map(([name, p]) => [name, { ...p, api_key: p.api_key_raw }]))
|
|
2233
|
+
});
|
|
2234
|
+
});
|
|
2235
|
+
admin.put("/api/config", async (c) => {
|
|
2236
|
+
if (!configPath) {
|
|
2237
|
+
return c.json({ error: { message: "\u672A\u914D\u7F6E config \u6587\u4EF6\u8DEF\u5F84\uFF0C\u65E0\u6CD5\u4FDD\u5B58", type: "server_error", code: "no_config_path" } }, 500);
|
|
2238
|
+
}
|
|
2239
|
+
let draft;
|
|
2240
|
+
try {
|
|
2241
|
+
draft = await c.req.json();
|
|
2242
|
+
} catch {
|
|
2243
|
+
return c.json({ error: { message: "\u8BF7\u6C42\u4F53\u5FC5\u987B\u662F\u5408\u6CD5 JSON", type: "invalid_request_error", code: "invalid_json" } }, 400);
|
|
2244
|
+
}
|
|
2245
|
+
if (typeof draft !== "object" || draft === null) {
|
|
2246
|
+
return c.json({ error: { message: "\u8BF7\u6C42\u4F53\u5FC5\u987B\u662F JSON \u5BF9\u8C61", type: "invalid_request_error", code: "invalid_json" } }, 400);
|
|
2247
|
+
}
|
|
2248
|
+
const d = draft;
|
|
2249
|
+
const raw2 = readRaw(configPath);
|
|
2250
|
+
if (typeof d.providers === "object" && d.providers !== null) {
|
|
2251
|
+
const providers = { ...d.providers };
|
|
2252
|
+
for (const [name, p] of Object.entries(providers)) {
|
|
2253
|
+
if (typeof p === "object" && p !== null) {
|
|
2254
|
+
const rawCur = raw2?.providers?.[name] && (raw2?.providers)[name].api_key;
|
|
2255
|
+
providers[name] = {
|
|
2256
|
+
...p,
|
|
2257
|
+
api_key: resolveApiKey(p.api_key, rawCur)
|
|
2258
|
+
};
|
|
2259
|
+
}
|
|
2260
|
+
}
|
|
2261
|
+
d.providers = providers;
|
|
2262
|
+
}
|
|
2263
|
+
let validated;
|
|
2264
|
+
try {
|
|
2265
|
+
validated = validateConfig(d);
|
|
2266
|
+
} catch (e) {
|
|
2267
|
+
return c.json({ error: { message: e.message, type: "invalid_request_error", code: "config_invalid" } }, 400);
|
|
2268
|
+
}
|
|
2269
|
+
const providersForWrite = {};
|
|
2270
|
+
for (const name of Object.keys(validated.providers)) {
|
|
2271
|
+
const draftProvider = d.providers?.[name];
|
|
2272
|
+
const draftApiKey = typeof draftProvider === "object" && draftProvider !== null ? draftProvider.api_key : undefined;
|
|
2273
|
+
providersForWrite[name] = typeof draftApiKey === "string" ? { ...validated.providers[name], api_key: draftApiKey } : validated.providers[name];
|
|
2274
|
+
}
|
|
2275
|
+
const configForWrite = {
|
|
2276
|
+
...validated,
|
|
2277
|
+
providers: providersForWrite,
|
|
2278
|
+
admin_password: typeof raw2?.admin_password === "string" ? raw2.admin_password : validated.admin_password
|
|
2279
|
+
};
|
|
2280
|
+
try {
|
|
2281
|
+
atomicWrite(configPath, `${JSON.stringify(configForWrite, null, 2)}
|
|
2282
|
+
`);
|
|
2283
|
+
} catch (e) {
|
|
2284
|
+
return c.json({ error: { message: `\u5199\u5165\u914D\u7F6E\u5931\u8D25: ${e.message}`, type: "server_error", code: "write_failed" } }, 500);
|
|
2285
|
+
}
|
|
2286
|
+
return c.json({ ok: true });
|
|
2287
|
+
});
|
|
2288
|
+
admin.post("/api/config/check", (c) => {
|
|
2289
|
+
const cfg = getConfig();
|
|
2290
|
+
const issues = checkConfig(cfg);
|
|
2291
|
+
return c.json({ ok: true, issues });
|
|
2292
|
+
});
|
|
2293
|
+
admin.post("/api/test", async (c) => {
|
|
2294
|
+
let body;
|
|
2295
|
+
try {
|
|
2296
|
+
body = await c.req.json();
|
|
2297
|
+
} catch {
|
|
2298
|
+
return c.json({ error: { message: "\u8BF7\u6C42\u4F53\u5FC5\u987B\u662F\u5408\u6CD5 JSON", type: "invalid_request_error" } }, 400);
|
|
2299
|
+
}
|
|
2300
|
+
const { provider, model, base_url: draftBaseUrl, api_key: draftApiKey } = body ?? {};
|
|
2301
|
+
if (typeof provider !== "string" || !provider) {
|
|
2302
|
+
return c.json({ error: { message: "provider \u5FC5\u586B", type: "invalid_request_error" } }, 400);
|
|
2303
|
+
}
|
|
2304
|
+
if (typeof model !== "string" || !model) {
|
|
2305
|
+
return c.json({ error: { message: "model \u5FC5\u586B", type: "invalid_request_error" } }, 400);
|
|
2306
|
+
}
|
|
2307
|
+
const cfg = getConfig();
|
|
2308
|
+
const saved = cfg.providers[provider];
|
|
2309
|
+
const baseUrl = typeof draftBaseUrl === "string" && draftBaseUrl.trim() ? draftBaseUrl.trim() : saved?.base_url;
|
|
2310
|
+
if (!baseUrl) {
|
|
2311
|
+
return c.json({ error: { message: saved ? `provider ${provider} \u672A\u914D\u7F6E base_url` : `\u672A\u77E5 provider: ${provider}\uFF08\u672A\u4FDD\u5B58\u5219\u9700\u5728\u8868\u5355\u4E2D\u586B\u5199 base_url\uFF09`, type: "invalid_request_error" } }, 400);
|
|
2312
|
+
}
|
|
2313
|
+
const apiKey = typeof draftApiKey === "string" && draftApiKey.trim() ? draftApiKey.trim() : saved?.api_key ?? "";
|
|
2314
|
+
const start = Date.now();
|
|
2315
|
+
try {
|
|
2316
|
+
const res = await fetch(`${baseUrl}/chat/completions`, {
|
|
2317
|
+
method: "POST",
|
|
2318
|
+
headers: { "content-type": "application/json", authorization: `Bearer ${apiKey}` },
|
|
2319
|
+
body: JSON.stringify({ model, messages: [{ role: "user", content: "ping" }], max_tokens: 1 }),
|
|
2320
|
+
signal: AbortSignal.timeout(15000)
|
|
2321
|
+
});
|
|
2322
|
+
const ms = Date.now() - start;
|
|
2323
|
+
if (!res.ok) {
|
|
2324
|
+
const text = await res.text().catch(() => "");
|
|
2325
|
+
return c.json({ ok: false, status: res.status, error: text.slice(0, 500), ms });
|
|
2326
|
+
}
|
|
2327
|
+
return c.json({ ok: true, ms });
|
|
2328
|
+
} catch (e) {
|
|
2329
|
+
return c.json({ ok: false, status: null, error: e.message, ms: Date.now() - start });
|
|
2330
|
+
}
|
|
2331
|
+
});
|
|
2332
|
+
admin.post("/api/fetch-models", async (c) => {
|
|
2333
|
+
let body;
|
|
2334
|
+
try {
|
|
2335
|
+
body = await c.req.json();
|
|
2336
|
+
} catch {
|
|
2337
|
+
return c.json({ error: { message: "\u8BF7\u6C42\u4F53\u5FC5\u987B\u662F\u5408\u6CD5 JSON", type: "invalid_request_error" } }, 400);
|
|
2338
|
+
}
|
|
2339
|
+
const { provider, base_url: draftBaseUrl, api_key: draftApiKey } = body ?? {};
|
|
2340
|
+
if (typeof provider !== "string" || !provider) {
|
|
2341
|
+
return c.json({ error: { message: "provider \u5FC5\u586B", type: "invalid_request_error" } }, 400);
|
|
2342
|
+
}
|
|
2343
|
+
const cfg = getConfig();
|
|
2344
|
+
const saved = cfg.providers[provider];
|
|
2345
|
+
const baseUrl = typeof draftBaseUrl === "string" && draftBaseUrl.trim() ? draftBaseUrl.trim() : saved?.base_url;
|
|
2346
|
+
if (!baseUrl) {
|
|
2347
|
+
return c.json({ error: { message: saved ? `provider ${provider} \u672A\u914D\u7F6E base_url` : `\u672A\u77E5 provider: ${provider}\uFF08\u672A\u4FDD\u5B58\u5219\u9700\u5728\u8868\u5355\u4E2D\u586B\u5199 base_url\uFF09`, type: "invalid_request_error" } }, 400);
|
|
2348
|
+
}
|
|
2349
|
+
const apiKey = typeof draftApiKey === "string" && draftApiKey.trim() ? draftApiKey.trim() : saved?.api_key ?? "";
|
|
2350
|
+
const start = Date.now();
|
|
2351
|
+
try {
|
|
2352
|
+
const res = await fetch(`${baseUrl}/models`, {
|
|
2353
|
+
method: "GET",
|
|
2354
|
+
headers: apiKey ? { authorization: `Bearer ${apiKey}` } : {},
|
|
2355
|
+
signal: AbortSignal.timeout(15000)
|
|
2356
|
+
});
|
|
2357
|
+
const ms = Date.now() - start;
|
|
2358
|
+
if (!res.ok) {
|
|
2359
|
+
const text = await res.text().catch(() => "");
|
|
2360
|
+
return c.json({ ok: false, status: res.status, error: text.slice(0, 500), ms });
|
|
2361
|
+
}
|
|
2362
|
+
const j = await res.json().catch(() => null);
|
|
2363
|
+
const arr = j?.data;
|
|
2364
|
+
if (!Array.isArray(arr)) {
|
|
2365
|
+
return c.json({ ok: false, status: res.status, error: "\u4E0A\u6E38 /models \u54CD\u5E94\u7F3A\u5C11 data \u6570\u7EC4\uFF08\u975E OpenAI \u517C\u5BB9\u683C\u5F0F\uFF09", ms });
|
|
2366
|
+
}
|
|
2367
|
+
const models = arr.map((m) => typeof m === "string" ? m : m?.id).filter((id) => typeof id === "string" && id.length > 0);
|
|
2368
|
+
if (models.length === 0) {
|
|
2369
|
+
return c.json({ ok: false, status: res.status, error: "\u4E0A\u6E38 /models \u672A\u8FD4\u56DE\u4EFB\u4F55\u6A21\u578B id", ms });
|
|
2370
|
+
}
|
|
2371
|
+
return c.json({ ok: true, ms, models });
|
|
2372
|
+
} catch (e) {
|
|
2373
|
+
return c.json({ ok: false, status: null, error: e.message, ms: Date.now() - start });
|
|
2374
|
+
}
|
|
2375
|
+
});
|
|
2376
|
+
if (opts?.includeStatic !== false) {
|
|
2377
|
+
const DIST = resolve(import.meta.dir, "../admin/dist");
|
|
2378
|
+
admin.get("/", async (c) => serveSpa(c, DIST, ""));
|
|
2379
|
+
admin.get("/*", async (c) => {
|
|
2380
|
+
const rel = c.req.path.replace(/^\/admin\//, "");
|
|
2381
|
+
if (rel.startsWith("api/")) {
|
|
2382
|
+
return c.json({ error: { message: "\u63A5\u53E3\u4E0D\u5B58\u5728", type: "invalid_request_error" } }, 404);
|
|
2383
|
+
}
|
|
2384
|
+
return serveSpa(c, DIST, rel);
|
|
2385
|
+
});
|
|
2386
|
+
}
|
|
2387
|
+
return admin;
|
|
2388
|
+
}
|
|
2389
|
+
|
|
2390
|
+
// src/app.ts
|
|
2391
|
+
function createApp(getConfig, opts) {
|
|
2392
|
+
const app = new Hono2;
|
|
2393
|
+
app.use("*", async (c, next) => {
|
|
2394
|
+
const start = Date.now();
|
|
2395
|
+
await next();
|
|
2396
|
+
const rec = c.get("access") ?? {
|
|
2397
|
+
ts: "",
|
|
2398
|
+
method: c.req.method,
|
|
2399
|
+
path: c.req.path,
|
|
2400
|
+
status: 0,
|
|
2401
|
+
ms: 0
|
|
2402
|
+
};
|
|
2403
|
+
const finish = () => {
|
|
2404
|
+
applyUsageBox(rec);
|
|
2405
|
+
rec.ts = new Date().toISOString();
|
|
2406
|
+
rec.status = c.res.status;
|
|
2407
|
+
rec.ms = Date.now() - start;
|
|
2408
|
+
writeAccessLog(rec);
|
|
2409
|
+
consoleSummary(rec);
|
|
2410
|
+
};
|
|
2411
|
+
if (rec.stream === true && c.res.body) {
|
|
2412
|
+
const [client, probe] = c.res.body.tee();
|
|
2413
|
+
c.res = new Response(client, { status: c.res.status, headers: c.res.headers });
|
|
2414
|
+
(async () => {
|
|
2415
|
+
const reader = probe.getReader();
|
|
2416
|
+
try {
|
|
2417
|
+
while (true) {
|
|
2418
|
+
const { done } = await reader.read();
|
|
2419
|
+
if (done)
|
|
2420
|
+
break;
|
|
2421
|
+
}
|
|
2422
|
+
} catch {}
|
|
2423
|
+
finish();
|
|
2424
|
+
})();
|
|
2425
|
+
return;
|
|
2426
|
+
} else {
|
|
2427
|
+
finish();
|
|
2428
|
+
}
|
|
2429
|
+
});
|
|
2430
|
+
app.use("/v1/*", async (c, next) => {
|
|
2431
|
+
const auth = c.req.header("authorization") ?? "";
|
|
2432
|
+
const key = auth.startsWith("Bearer ") ? auth.slice(7).trim() : "";
|
|
2433
|
+
const cfg = getConfig();
|
|
2434
|
+
if (cfg.keys.length === 0) {
|
|
2435
|
+
return c.json({
|
|
2436
|
+
error: {
|
|
2437
|
+
message: "\u7F51\u5173\u5C1A\u672A\u5B8C\u6210\u914D\u7F6E\uFF1A\u8BF7\u8BBF\u95EE /admin \u6DFB\u52A0\u81F3\u5C11\u4E00\u4E2A\u4E0B\u6E38\u5BC6\u94A5\uFF08keys\uFF09\u540E\u518D\u53D1\u8D77\u8BF7\u6C42",
|
|
2438
|
+
type: "service_unavailable",
|
|
2439
|
+
code: "not_configured"
|
|
2440
|
+
}
|
|
2441
|
+
}, 503);
|
|
2442
|
+
}
|
|
2443
|
+
if (!cfg.keys.some((k) => k.key === key)) {
|
|
2444
|
+
return c.json({
|
|
2445
|
+
error: {
|
|
2446
|
+
message: "\u65E0\u6548\u6216\u7F3A\u5931\u7684 API key\uFF08Authorization: Bearer <key>\uFF09",
|
|
2447
|
+
type: "invalid_request_error",
|
|
2448
|
+
code: "invalid_api_key"
|
|
2449
|
+
}
|
|
2450
|
+
}, 401);
|
|
2451
|
+
}
|
|
2452
|
+
c.set("access", {
|
|
2453
|
+
ts: new Date().toISOString(),
|
|
2454
|
+
method: c.req.method,
|
|
2455
|
+
path: c.req.path,
|
|
2456
|
+
status: 0,
|
|
2457
|
+
ms: 0,
|
|
2458
|
+
key
|
|
2459
|
+
});
|
|
2460
|
+
await next();
|
|
2461
|
+
});
|
|
2462
|
+
app.get("/health", (c) => c.json({ status: "ok" }));
|
|
2463
|
+
app.get("/v1/models", (c) => {
|
|
2464
|
+
const data = Object.keys(getConfig().aliases).map((id) => ({
|
|
2465
|
+
id,
|
|
2466
|
+
object: "model",
|
|
2467
|
+
created: Math.floor(Date.now() / 1000),
|
|
2468
|
+
owned_by: "model-gate"
|
|
2469
|
+
}));
|
|
2470
|
+
return c.json({ object: "list", data });
|
|
2471
|
+
});
|
|
2472
|
+
app.post("/v1/chat/completions", async (c) => {
|
|
2473
|
+
let body;
|
|
2474
|
+
try {
|
|
2475
|
+
body = await c.req.json();
|
|
2476
|
+
} catch {
|
|
2477
|
+
return c.json({ error: { message: "\u8BF7\u6C42\u4F53\u5FC5\u987B\u662F\u5408\u6CD5 JSON", type: "invalid_request_error", code: "invalid_json" } }, 400);
|
|
2478
|
+
}
|
|
2479
|
+
if (typeof body !== "object" || body === null) {
|
|
2480
|
+
return c.json({ error: { message: "\u8BF7\u6C42\u4F53\u5FC5\u987B\u662F JSON \u5BF9\u8C61", type: "invalid_request_error", code: "invalid_json" } }, 400);
|
|
2481
|
+
}
|
|
2482
|
+
const reqBody = body;
|
|
2483
|
+
const cfg = getConfig();
|
|
2484
|
+
const alias = typeof reqBody.model === "string" && reqBody.model.length > 0 ? reqBody.model : cfg.default_model;
|
|
2485
|
+
if (!cfg.aliases[alias]) {
|
|
2486
|
+
return c.json({
|
|
2487
|
+
error: {
|
|
2488
|
+
message: `\u672A\u77E5\u6A21\u578B "${alias}"\uFF0C\u53EF\u7528\u522B\u540D: ${Object.keys(cfg.aliases).join(", ")}`,
|
|
2489
|
+
type: "invalid_request_error",
|
|
2490
|
+
code: "model_not_found"
|
|
2491
|
+
}
|
|
2492
|
+
}, 400);
|
|
2493
|
+
}
|
|
2494
|
+
const rec = c.get("access");
|
|
2495
|
+
if (rec) {
|
|
2496
|
+
rec.alias = alias;
|
|
2497
|
+
rec.stream = reqBody.stream === true;
|
|
2498
|
+
}
|
|
2499
|
+
const { res, realModel, usageBox } = await chatWithFailover(cfg, alias, reqBody);
|
|
2500
|
+
if (rec) {
|
|
2501
|
+
rec.realModel = realModel;
|
|
2502
|
+
setUsageBox(rec, usageBox);
|
|
2503
|
+
}
|
|
2504
|
+
return res;
|
|
2505
|
+
});
|
|
2506
|
+
app.all("/v1/*", (c) => c.json({ error: { message: "\u8BE5\u7AEF\u70B9\u5C1A\u672A\u5B9E\u73B0", type: "invalid_request_error", code: "not_implemented" } }, 501));
|
|
2507
|
+
app.route("/admin", createAdminApp(getConfig, opts?.configPath, { includeStatic: opts?.includeAdminStatic ?? true }));
|
|
2508
|
+
return app;
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2511
|
+
// src/index.ts
|
|
2512
|
+
function argValue(name) {
|
|
2513
|
+
const i = process.argv.indexOf(name);
|
|
2514
|
+
return i >= 0 ? process.argv[i + 1] : undefined;
|
|
2515
|
+
}
|
|
2516
|
+
function localIPv4Addresses() {
|
|
2517
|
+
const out = [];
|
|
2518
|
+
for (const infos of Object.values(networkInterfaces())) {
|
|
2519
|
+
for (const info of infos ?? []) {
|
|
2520
|
+
if (info.family === "IPv4" && !info.internal)
|
|
2521
|
+
out.push(info.address);
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
return out;
|
|
2525
|
+
}
|
|
2526
|
+
var configPath = argValue("--config") ?? argValue("-c") ?? process.env.MODEL_GATE_CONFIG ?? "config.json";
|
|
2527
|
+
var cfg;
|
|
2528
|
+
try {
|
|
2529
|
+
cfg = loadConfig(configPath, "boot");
|
|
2530
|
+
} catch (e) {
|
|
2531
|
+
console.error(`[model-gate] ${e instanceof ConfigError ? e.message : e.message}`);
|
|
2532
|
+
process.exit(1);
|
|
2533
|
+
}
|
|
2534
|
+
configureLogging(cfg.access_log);
|
|
2535
|
+
var lastMtime = statSync(configPath).mtimeMs;
|
|
2536
|
+
setInterval(() => {
|
|
2537
|
+
let mtime;
|
|
2538
|
+
try {
|
|
2539
|
+
mtime = statSync(configPath).mtimeMs;
|
|
2540
|
+
} catch {
|
|
2541
|
+
return;
|
|
2542
|
+
}
|
|
2543
|
+
if (mtime === lastMtime)
|
|
2544
|
+
return;
|
|
2545
|
+
lastMtime = mtime;
|
|
2546
|
+
try {
|
|
2547
|
+
const next = loadConfig(configPath, "boot");
|
|
2548
|
+
cfg = next;
|
|
2549
|
+
configureLogging(next.access_log);
|
|
2550
|
+
console.log(`[model-gate] \u914D\u7F6E\u5DF2\u70ED\u52A0\u8F7D: ${configPath}\uFF08\u9ED8\u8BA4\u6A21\u578B=${Object.keys(next.aliases).length > 0 ? next.default_model : "(\u672A\u914D\u7F6E)"}\uFF0C\u522B\u540D=${Object.keys(next.aliases).join(", ") || "(\u672A\u914D\u7F6E)"}\uFF09`);
|
|
2551
|
+
} catch (e) {
|
|
2552
|
+
console.error(`[model-gate] \u914D\u7F6E\u91CD\u8F7D\u5931\u8D25\uFF0C\u4FDD\u7559\u5F53\u524D\u914D\u7F6E: ${e instanceof ConfigError ? e.message : e.message}`);
|
|
2553
|
+
}
|
|
2554
|
+
}, 1000);
|
|
2555
|
+
var includeAdminStatic = process.env.MODEL_GATE_DEV !== "1";
|
|
2556
|
+
var app = createApp(() => cfg, { configPath, includeAdminStatic });
|
|
2557
|
+
var server = Bun.serve({
|
|
2558
|
+
hostname: cfg.host,
|
|
2559
|
+
port: cfg.port,
|
|
2560
|
+
fetch: (req, server2) => app.fetch(req, server2)
|
|
2561
|
+
});
|
|
2562
|
+
function shutdown(signal) {
|
|
2563
|
+
console.log(`[model-gate] \u6536\u5230 ${signal}\uFF0C\u6B63\u5728\u5173\u95ED...`);
|
|
2564
|
+
server.stop(true);
|
|
2565
|
+
process.exit(0);
|
|
2566
|
+
}
|
|
2567
|
+
process.on("SIGINT", () => shutdown("SIGINT"));
|
|
2568
|
+
process.on("SIGTERM", () => shutdown("SIGTERM"));
|
|
2569
|
+
if (cfg.host === "0.0.0.0") {
|
|
2570
|
+
if (includeAdminStatic) {
|
|
2571
|
+
console.log(`[model-gate] \u5DF2\u542F\u52A8\uFF0C\u76D1\u542C\u6240\u6709\u7F51\u5361\uFF08\u7AEF\u53E3 ${cfg.port}\uFF09\uFF0C\u7BA1\u7406\u754C\u9762\u53EF\u8BBF\u95EE\u5165\u53E3:`);
|
|
2572
|
+
console.log(` http://127.0.0.1:${cfg.port}/admin\uFF08\u672C\u673A\uFF09`);
|
|
2573
|
+
for (const ip of localIPv4Addresses()) {
|
|
2574
|
+
console.log(` http://${ip}:${cfg.port}/admin`);
|
|
2575
|
+
}
|
|
2576
|
+
} else {
|
|
2577
|
+
console.log(`[model-gate] \u5DF2\u542F\u52A8\uFF08\u5F00\u53D1\u6A21\u5F0F\uFF0C\u4EC5 API\uFF09\uFF0C\u7AEF\u53E3 ${cfg.port}\uFF1B\u7BA1\u7406\u754C\u9762\u901A\u8FC7 Vite: http://localhost:5173/admin`);
|
|
2578
|
+
}
|
|
2579
|
+
} else if (includeAdminStatic) {
|
|
2580
|
+
console.log(`[model-gate] \u5DF2\u542F\u52A8: http://${cfg.host}:${cfg.port}/admin\uFF08\u7BA1\u7406\u754C\u9762\uFF09`);
|
|
2581
|
+
} else {
|
|
2582
|
+
console.log(`[model-gate] \u5DF2\u542F\u52A8\uFF08\u5F00\u53D1\u6A21\u5F0F\uFF0C\u4EC5 API\uFF09: http://${cfg.host}:${cfg.port}`);
|
|
2583
|
+
console.log(`[model-gate] \u7BA1\u7406\u754C\u9762\u901A\u8FC7 Vite: http://localhost:5173/admin`);
|
|
2584
|
+
}
|
|
2585
|
+
console.log(`[model-gate] \u914D\u7F6E: ${configPath} | \u522B\u540D: ${Object.keys(cfg.aliases).join(", ") || "(\u672A\u914D\u7F6E)"} | \u9ED8\u8BA4\u6A21\u578B: ${Object.keys(cfg.aliases).length > 0 ? cfg.default_model : "(\u672A\u914D\u7F6E)"}`);
|