diff --git a/CHANGELOG.md b/CHANGELOG.md index 443a215..10105e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [3.5.5] - 2026-03-05 +### ✨ Added +- **自定义** + - 增加自定义生成等待超时时间 + ### 🐛 Fixed - **适配器** - 修复 ChatGPT 文本适配器响应被截断的问题 diff --git a/config.example.yaml b/config.example.yaml index 564b95a..ca6aa0a 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -34,6 +34,12 @@ backend: enabled: true # 启用故障转移 maxRetries: 2 # 最多重试次数 (0=无限制) + # ======================================== + # 生成等待时间 + # ======================================== + # 程序等待生成结果返回的最大超时时间,单位毫秒 + waitTimeout: 120000 + # ======================================== # 浏览器实例列表 # ======================================== diff --git a/src/backend/adapter/chatgpt.js b/src/backend/adapter/chatgpt.js index 5e075e9..f2b9a36 100644 --- a/src/backend/adapter/chatgpt.js +++ b/src/backend/adapter/chatgpt.js @@ -31,7 +31,8 @@ const INPUT_SELECTOR = '.ProseMirror'; * @returns {Promise<{image?: string, error?: string}>} */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { - const { page } = context; + const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; const sendBtnLocator = page.getByRole('button', { name: 'Send prompt' }); try { @@ -94,7 +95,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { conversationResponse = await waitApiResponse(page, { urlMatch: 'backend-api/f/conversation', method: 'POST', - timeout: 120000, // 图片生成可能较慢 + timeout: waitTimeout, // 图片生成可能较慢 meta }); } catch (e) { @@ -144,7 +145,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { } catch { return false; } - }, { timeout: 120000 }); + }, { timeout: waitTimeout }); } catch (e) { const pageError = normalizePageError(e, meta); if (pageError) return pageError; diff --git a/src/backend/adapter/chatgpt_text.js b/src/backend/adapter/chatgpt_text.js index 52a5aa6..0247e31 100644 --- a/src/backend/adapter/chatgpt_text.js +++ b/src/backend/adapter/chatgpt_text.js @@ -80,7 +80,8 @@ async function selectModel(page, codeName, meta = {}) { * @returns {Promise<{text?: string, error?: string}>} */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { - const { page } = context; + const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; const sendBtnLocator = page.getByRole('button', { name: 'Send prompt' }); try { @@ -223,7 +224,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { } catch { return false; } - }, { timeout: 120000 }); + }, { timeout: waitTimeout }); } catch (e) { const pageError = normalizePageError(e, meta); if (pageError) return pageError; diff --git a/src/backend/adapter/deepseek_text.js b/src/backend/adapter/deepseek_text.js index 2ecbbf1..2fddc49 100644 --- a/src/backend/adapter/deepseek_text.js +++ b/src/backend/adapter/deepseek_text.js @@ -82,7 +82,8 @@ async function configureModel(page, modelConfig, meta = {}) { * @returns {Promise<{text?: string, error?: string}>} */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { - const { page } = context; + const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; try { logger.info('适配器', '开启新会话...', meta); @@ -208,7 +209,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { } catch { return false; } - }, { timeout: 120000 }); + }, { timeout: waitTimeout }); // 5. 发送提示词 logger.debug('适配器', '发送提示词...', meta); diff --git a/src/backend/adapter/gemini.js b/src/backend/adapter/gemini.js index 9b888b1..f515332 100644 --- a/src/backend/adapter/gemini.js +++ b/src/backend/adapter/gemini.js @@ -32,7 +32,8 @@ const TARGET_URL = 'https://gemini.google.com/app?hl=en'; * @returns {Promise<{image?: string, error?: string}>} */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { - const { page } = context; + const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; const inputLocator = page.getByRole('textbox'); const sendBtnLocator = page.getByRole('button', { name: 'Send message' }); @@ -100,7 +101,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const streamApiResponsePromise = waitApiResponse(page, { urlMatch: 'assistant.lamda.BardFrontendService/StreamGenerate', method: 'POST', - timeout: 120000, + timeout: waitTimeout, meta }); @@ -138,7 +139,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { urlMatch: 'contribution.usercontent.google.com/download', urlContains: 'filename=video.mp4', method: 'GET', - timeout: 180000, // 视频生成可能更慢 + timeout: waitTimeout, meta }); } catch (e) { diff --git a/src/backend/adapter/gemini_biz.js b/src/backend/adapter/gemini_biz.js index 4302f75..6c18e2e 100644 --- a/src/backend/adapter/gemini_biz.js +++ b/src/backend/adapter/gemini_biz.js @@ -98,6 +98,7 @@ async function handleAccountChooser(page) { */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; try { // 支持新路径 adapter.gemini_biz.entryUrl,向下兼容旧路径 geminiBiz.entryUrl @@ -180,7 +181,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const apiResponsePromise = waitApiResponse(page, { urlMatch: 'global/widgetStreamAssist', method: 'POST', - timeout: 120000, + timeout: waitTimeout, errorText: ['modelArmorViolation'], meta }); @@ -217,7 +218,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const imageResponsePromise = waitApiResponse(page, { urlMatch: 'download/v1alpha/projects', method: 'GET', - timeout: 120000, + timeout: waitTimeout, errorText: ['is unable to reply as the prompt'], meta }); diff --git a/src/backend/adapter/gemini_biz_text.js b/src/backend/adapter/gemini_biz_text.js index bf987b4..d70cdae 100644 --- a/src/backend/adapter/gemini_biz_text.js +++ b/src/backend/adapter/gemini_biz_text.js @@ -97,6 +97,7 @@ async function handleAccountChooser(page) { */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; try { // 支持新路径 adapter.gemini_biz.entryUrl,向下兼容旧路径 geminiBiz.entryUrl @@ -190,7 +191,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const apiResponsePromise = waitApiResponse(page, { urlMatch: 'global/widgetStreamAssist', method: 'POST', - timeout: 120000, + timeout: waitTimeout, errorText: ['modelArmorViolation'], meta }); diff --git a/src/backend/adapter/gemini_text.js b/src/backend/adapter/gemini_text.js index f51ac85..2daa3b4 100644 --- a/src/backend/adapter/gemini_text.js +++ b/src/backend/adapter/gemini_text.js @@ -30,7 +30,8 @@ const TARGET_URL = 'https://gemini.google.com/app?hl=en'; * @returns {Promise<{text?: string, error?: string}>} */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { - const { page } = context; + const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; const inputLocator = page.getByRole('textbox'); const sendBtnLocator = page.getByRole('button', { name: 'Send message' }); @@ -151,7 +152,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const apiResponsePromise = waitApiResponse(page, { urlMatch: 'assistant.lamda.BardFrontendService/StreamGenerate', method: 'POST', - timeout: 120000, + timeout: waitTimeout, meta }); diff --git a/src/backend/adapter/google_flow.js b/src/backend/adapter/google_flow.js index d3342e2..c1d151f 100644 --- a/src/backend/adapter/google_flow.js +++ b/src/backend/adapter/google_flow.js @@ -48,7 +48,8 @@ async function detectImageAspect(imgPath) { * @returns {Promise<{image?: string, error?: string}>} */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { - const { page } = context; + const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; // 获取模型配置 const modelConfig = manifest.models.find(m => m.id === modelId) || manifest.models[0]; @@ -197,7 +198,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const apiResponsePromise = waitApiResponse(page, { urlMatch: 'flowMedia:batchGenerateImages', method: 'POST', - timeout: 120000, + timeout: waitTimeout, meta }); diff --git a/src/backend/adapter/lmarena.js b/src/backend/adapter/lmarena.js index 7dc624a..f3ce4bd 100644 --- a/src/backend/adapter/lmarena.js +++ b/src/backend/adapter/lmarena.js @@ -52,6 +52,7 @@ function extractImage(text) { */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; const textareaSelector = 'textarea'; try { @@ -117,7 +118,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const responsePromise = waitApiResponse(page, { urlMatch: '/nextjs-api/stream', method: 'POST', - timeout: 120000, + timeout: waitTimeout, meta }); diff --git a/src/backend/adapter/lmarena_text.js b/src/backend/adapter/lmarena_text.js index 9abcd45..f580d09 100644 --- a/src/backend/adapter/lmarena_text.js +++ b/src/backend/adapter/lmarena_text.js @@ -31,7 +31,8 @@ const TARGET_URL_SEARCH = 'https://lmarena.ai/zh/c/new?mode=direct&chat-modality * @returns {Promise<{image?: string, text?: string, error?: string}>} 生成结果 */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { - const { page } = context; + const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; const textareaSelector = 'textarea'; // Worker 已验证,直接解析模型配置 @@ -101,7 +102,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const responsePromise = waitApiResponse(page, { urlMatch: '/nextjs-api/stream', method: 'POST', - timeout: 120000, + timeout: waitTimeout, meta }); diff --git a/src/backend/adapter/nanobananafree_ai.js b/src/backend/adapter/nanobananafree_ai.js index ffefdc6..ce7956a 100644 --- a/src/backend/adapter/nanobananafree_ai.js +++ b/src/backend/adapter/nanobananafree_ai.js @@ -31,7 +31,8 @@ const TARGET_URL = 'https://nanobananafree.ai/'; * @returns {Promise<{image?: string, text?: string, error?: string}>} 生成结果 */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { - const { page } = context; + const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; const textareaSelector = 'textarea'; try { @@ -63,7 +64,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const responsePromise = waitApiResponse(page, { urlMatch: 'v1/generateContent', method: 'POST', - timeout: 120000, + timeout: waitTimeout, meta }); diff --git a/src/backend/adapter/zai_is.js b/src/backend/adapter/zai_is.js index 419a560..c5041cb 100644 --- a/src/backend/adapter/zai_is.js +++ b/src/backend/adapter/zai_is.js @@ -116,6 +116,7 @@ async function handleDiscordAuth(page) { */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; try { // 开启新对话 - 先等待可能正在进行的登录处理完成 @@ -276,7 +277,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { completionsResponse = await waitApiResponse(page, { urlMatch: 'chat/completions', method: 'POST', - timeout: 120000, + timeout: waitTimeout, errorText: ['Model is unable to process your request', 'Rate limit reached'], meta }); @@ -312,7 +313,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { completedResponse = await waitApiResponse(page, { urlMatch: 'chat/completed', method: 'POST', - timeout: 120000, + timeout: waitTimeout, errorText: ['Model is unable to process your request', 'Rate limit reached'], meta }); diff --git a/src/backend/adapter/zai_is_text.js b/src/backend/adapter/zai_is_text.js index 5c1ea0a..0b39696 100644 --- a/src/backend/adapter/zai_is_text.js +++ b/src/backend/adapter/zai_is_text.js @@ -133,6 +133,7 @@ function extractTextContent(content) { */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; try { // 开启新对话 - 先等待可能正在进行的登录处理完成 @@ -245,7 +246,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { completionsResponse = await waitApiResponse(page, { urlMatch: 'chat/completions', method: 'POST', - timeout: 120000, + timeout: waitTimeout, errorText: ['Model is unable to process your request', 'Rate limit reached'], meta }); @@ -281,7 +282,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { completedResponse = await waitApiResponse(page, { urlMatch: 'chat/completed', method: 'POST', - timeout: 120000, + timeout: waitTimeout, errorText: ['Model is unable to process your request', 'Rate limit reached'], meta }); diff --git a/src/backend/adapter/zenmux_ai_text.js b/src/backend/adapter/zenmux_ai_text.js index 8157f35..6b03fab 100644 --- a/src/backend/adapter/zenmux_ai_text.js +++ b/src/backend/adapter/zenmux_ai_text.js @@ -30,7 +30,8 @@ const SEND_BUTTON_SELECTOR = '.input-actions-send button'; * @returns {Promise<{text?: string, error?: string}>} 生成结果 */ async function generate(context, prompt, imgPaths, modelId, meta = {}) { - const { page } = context; + const { page, config } = context; + const waitTimeout = config?.backend?.pool?.waitTimeout ?? 120000; try { const targetUrl = 'https://zenmux.ai/settings/chat'; @@ -137,7 +138,7 @@ async function generate(context, prompt, imgPaths, modelId, meta = {}) { const apiResponsePromise = waitApiResponse(page, { urlMatch: 'v1/chat/completions', method: 'POST', - timeout: 120000, + timeout: waitTimeout, meta }); diff --git a/src/config/manager.js b/src/config/manager.js index 5f6bae1..d27183f 100644 --- a/src/config/manager.js +++ b/src/config/manager.js @@ -281,6 +281,7 @@ export function getPoolConfig() { return { strategy: pool.strategy || 'least_busy', + waitTimeout: pool.waitTimeout != null ? Math.round(pool.waitTimeout / 1000) : 120, failover: { enabled: failover.enabled !== false, // 默认 true maxRetries: failover.maxRetries ?? 2 @@ -302,6 +303,12 @@ export function savePoolConfig(data) { config.backend.pool.strategy = data.strategy; } + if (data.waitTimeout !== undefined) { + // 前端传入秒,写入 YAML 为毫秒 + const ms = Number(data.waitTimeout) * 1000; + if (ms > 0) config.backend.pool.waitTimeout = ms; + } + if (data.failover) { if (!config.backend.pool.failover) config.backend.pool.failover = {}; if (data.failover.enabled !== undefined) { diff --git a/webui/dist/assets/index.js b/webui/dist/assets/index.js index b93e4c2..c91dfbf 100644 --- a/webui/dist/assets/index.js +++ b/webui/dist/assets/index.js @@ -471,5 +471,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `]:{color:e.colorTextDisabled}}}}}},Fce=e=>{const{componentCls:t,antCls:n,iconCls:o,fontSize:r,lineHeight:i}=e,l=`${t}-list-item`,a=`${l}-actions`,s=`${l}-action`,c=Math.round(r*i);return{[`${t}-wrapper`]:{[`${t}-list`]:m(m({},qo()),{lineHeight:e.lineHeight,[l]:{position:"relative",height:e.lineHeight*r,marginTop:e.marginXS,fontSize:r,display:"flex",alignItems:"center",transition:`background-color ${e.motionDurationSlow}`,"&:hover":{backgroundColor:e.controlItemBgHover},[`${l}-name`]:m(m({},Yt),{padding:`0 ${e.paddingXS}px`,lineHeight:i,flex:"auto",transition:`all ${e.motionDurationSlow}`}),[a]:{[s]:{opacity:0},[`${s}${n}-btn-sm`]:{height:c,border:0,lineHeight:1,"> span":{transform:"scale(1)"}},[` ${s}:focus, &.picture ${s} - `]:{opacity:1},[o]:{color:e.colorTextDescription,transition:`all ${e.motionDurationSlow}`},[`&:hover ${o}`]:{color:e.colorText}},[`${t}-icon ${o}`]:{color:e.colorTextDescription,fontSize:r},[`${l}-progress`]:{position:"absolute",bottom:-e.uploadProgressOffset,width:"100%",paddingInlineStart:r+e.paddingXS,fontSize:r,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${l}:hover ${s}`]:{opacity:1,color:e.colorText},[`${l}-error`]:{color:e.colorError,[`${l}-name, ${t}-icon ${o}`]:{color:e.colorError},[a]:{[`${o}, ${o}:hover`]:{color:e.colorError},[s]:{opacity:1}}},[`${t}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},s3=new ot("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),c3=new ot("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}}),Lce=e=>{const{componentCls:t}=e,n=`${t}-animate-inline`;return[{[`${t}-wrapper`]:{[`${n}-appear, ${n}-enter, ${n}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[`${n}-appear, ${n}-enter`]:{animationName:s3},[`${n}-leave`]:{animationName:c3}}},s3,c3]},zce=e=>{const{componentCls:t,iconCls:n,uploadThumbnailSize:o,uploadProgressOffset:r}=e,i=`${t}-list`,l=`${i}-item`;return{[`${t}-wrapper`]:{[`${i}${i}-picture, ${i}${i}-picture-card`]:{[l]:{position:"relative",height:o+e.lineWidth*2+e.paddingXS*2,padding:e.paddingXS,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},[`${l}-thumbnail`]:m(m({},Yt),{width:o,height:o,lineHeight:`${o+e.paddingSM}px`,textAlign:"center",flex:"none",[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${l}-progress`]:{bottom:r,width:`calc(100% - ${e.paddingSM*2}px)`,marginTop:0,paddingInlineStart:o+e.paddingXS}},[`${l}-error`]:{borderColor:e.colorError,[`${l}-thumbnail ${n}`]:{"svg path[fill='#e6f7ff']":{fill:e.colorErrorBg},"svg path[fill='#1890ff']":{fill:e.colorError}}},[`${l}-uploading`]:{borderStyle:"dashed",[`${l}-name`]:{marginBottom:r}}}}}},Hce=e=>{const{componentCls:t,iconCls:n,fontSizeLG:o,colorTextLightSolid:r}=e,i=`${t}-list`,l=`${i}-item`,a=e.uploadPicCardSize;return{[`${t}-wrapper${t}-picture-card-wrapper`]:m(m({},qo()),{display:"inline-block",width:"100%",[`${t}${t}-select`]:{width:a,height:a,marginInlineEnd:e.marginXS,marginBottom:e.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:`${e.lineWidth}px dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[`> ${t}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimary}},[`${i}${i}-picture-card`]:{[`${i}-item-container`]:{display:"inline-block",width:a,height:a,marginBlock:`0 ${e.marginXS}px`,marginInline:`0 ${e.marginXS}px`,verticalAlign:"top"},"&::after":{display:"none"},[l]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${e.paddingXS*2}px)`,height:`calc(100% - ${e.paddingXS*2}px)`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'" "'}},[`${l}:hover`]:{[`&::before, ${l}-actions`]:{opacity:1}},[`${l}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${e.motionDurationSlow}`,[`${n}-eye, ${n}-download, ${n}-delete`]:{zIndex:10,width:o,margin:`0 ${e.marginXXS}px`,fontSize:o,cursor:"pointer",transition:`all ${e.motionDurationSlow}`}},[`${l}-actions, ${l}-actions:hover`]:{[`${n}-eye, ${n}-download, ${n}-delete`]:{color:new ht(r).setAlpha(.65).toRgbString(),"&:hover":{color:r}}},[`${l}-thumbnail, ${l}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${l}-name`]:{display:"none",textAlign:"center"},[`${l}-file + ${l}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${e.paddingXS*2}px)`},[`${l}-uploading`]:{[`&${l}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[`${l}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${e.paddingXS*2}px)`,paddingInlineStart:0}}})}},jce=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},Vce=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:m(m({},Ue(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-disabled`]:{color:n,cursor:"not-allowed"}})}},Wce=Ke("Upload",e=>{const{fontSizeHeading3:t,fontSize:n,lineHeight:o,lineWidth:r,controlHeightLG:i}=e,l=Math.round(n*o),a=ke(e,{uploadThumbnailSize:t*2,uploadProgressOffset:l/2+r,uploadPicCardSize:i*2.55});return[Vce(a),kce(a),zce(a),Hce(a),Fce(a),Lce(a),jce(a),Fc(a)]});var Kce=function(e,t,n,o){function r(i){return i instanceof n?i:new n(function(l){l(i)})}return new(n||(n=Promise))(function(i,l){function a(u){try{c(o.next(u))}catch(d){l(d)}}function s(u){try{c(o.throw(u))}catch(d){l(d)}}function c(u){u.done?i(u.value):r(u.value).then(a,s)}c((o=o.apply(e,t||[])).next())})},Gce=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{var M;return(M=s.value)!==null&&M!==void 0?M:d.value}),[g,v]=Tt(e.defaultFileList||[],{value:ze(e,"fileList"),postState:M=>{const A=Date.now();return(M??[]).map((R,L)=>(!R.uid&&!Object.isFrozen(R)&&(R.uid=`__AUTO__${A}_${L}__`),R))}}),h=re("drop"),b=re(null);We(()=>{Ot(e.fileList!==void 0||o.value===void 0,"Upload","`value` is not a valid prop, do you mean `fileList`?"),Ot(e.transformFile===void 0,"Upload","`transformFile` is deprecated. Please use `beforeUpload` directly."),Ot(e.remove===void 0,"Upload","`remove` props is deprecated. Please use `remove` event.")});const y=(M,A,R)=>{var L,P;let D=[...A];e.maxCount===1?D=D.slice(-1):e.maxCount&&(D=D.slice(0,e.maxCount)),v(D);const N={file:M,fileList:D};R&&(N.event=R),(L=e["onUpdate:fileList"])===null||L===void 0||L.call(e,N.fileList),(P=e.onChange)===null||P===void 0||P.call(e,N),i.onFieldChange()},S=(M,A)=>Kce(this,void 0,void 0,function*(){const{beforeUpload:R,transformFile:L}=e;let P=M;if(R){const D=yield R(M,A);if(D===!1)return!1;if(delete M[Ps],D===Ps)return Object.defineProperty(M,Ps,{value:!0,configurable:!0}),!1;typeof D=="object"&&D&&(P=D)}return L&&(P=yield L(P)),P}),$=M=>{const A=M.filter(P=>!P.file[Ps]);if(!A.length)return;const R=A.map(P=>Fu(P.file));let L=[...g.value];R.forEach(P=>{L=Lu(P,L)}),R.forEach((P,D)=>{let N=P;if(A[D].parsedFile)P.status="uploading";else{const{originFileObj:k}=P;let F;try{F=new File([k],k.name,{type:k.type})}catch{F=new Blob([k],{type:k.type}),F.name=k.name,F.lastModifiedDate=new Date,F.lastModified=new Date().getTime()}F.uid=P.uid,N=F}y(N,L)})},x=(M,A,R)=>{try{typeof M=="string"&&(M=JSON.parse(M))}catch{}if(!ov(A,g.value))return;const L=Fu(A);L.status="done",L.percent=100,L.response=M,L.xhr=R;const P=Lu(L,g.value);y(L,P)},C=(M,A)=>{if(!ov(A,g.value))return;const R=Fu(A);R.status="uploading",R.percent=M.percent;const L=Lu(R,g.value);y(R,L,M)},O=(M,A,R)=>{if(!ov(R,g.value))return;const L=Fu(R);L.error=M,L.response=A,L.status="error";const P=Lu(L,g.value);y(L,P)},w=M=>{let A;const R=e.onRemove||e.remove;Promise.resolve(typeof R=="function"?R(M):R).then(L=>{var P,D;if(L===!1)return;const N=Ice(M,g.value);N&&(A=m(m({},M),{status:"removed"}),(P=g.value)===null||P===void 0||P.forEach(k=>{const F=A.uid!==void 0?"uid":"name";k[F]===A[F]&&!Object.isFrozen(k)&&(k.status="removed")}),(D=b.value)===null||D===void 0||D.abort(A),y(A,N))})},T=M=>{var A;h.value=M.type,M.type==="drop"&&((A=e.onDrop)===null||A===void 0||A.call(e,M))};r({onBatchStart:$,onSuccess:x,onProgress:C,onError:O,fileList:g,upload:b});const[E]=ko("Upload",Un.Upload,I(()=>e.locale)),_=(M,A)=>{const{removeIcon:R,previewIcon:L,downloadIcon:P,previewFile:D,onPreview:N,onDownload:k,isImageUrl:F,progress:z,itemRender:H,iconRender:j,showUploadList:Y}=e,{showDownloadIcon:Q,showPreviewIcon:U,showRemoveIcon:ee}=typeof Y=="boolean"?{}:Y;return Y?f(Bce,{prefixCls:l.value,listType:e.listType,items:g.value,previewFile:D,onPreview:N,onDownload:k,onRemove:w,showRemoveIcon:!p.value&&ee,showPreviewIcon:U,showDownloadIcon:Q,removeIcon:R,previewIcon:L,downloadIcon:P,iconRender:j,locale:E.value,isImageUrl:F,progress:z,itemRender:H,appendActionVisible:A,appendAction:M},m({},n)):M?.()};return()=>{var M,A,R;const{listType:L,type:P}=e,{class:D,style:N}=o,k=Gce(o,["class","style"]),F=m(m(m({onBatchStart:$,onError:O,onProgress:C,onSuccess:x},k),e),{id:(M=e.id)!==null&&M!==void 0?M:i.id.value,prefixCls:l.value,beforeUpload:S,onChange:void 0,disabled:p.value});delete F.remove,(!n.default||p.value)&&delete F.id;const z={[`${l.value}-rtl`]:a.value==="rtl"};if(P==="drag"){const Q=ae(l.value,{[`${l.value}-drag`]:!0,[`${l.value}-drag-uploading`]:g.value.some(U=>U.status==="uploading"),[`${l.value}-drag-hover`]:h.value==="dragover",[`${l.value}-disabled`]:p.value,[`${l.value}-rtl`]:a.value==="rtl"},o.class,u.value);return c(f("span",B(B({},o),{},{class:ae(`${l.value}-wrapper`,z,D,u.value)}),[f("div",{class:Q,onDrop:T,onDragover:T,onDragleave:T,style:o.style},[f(o3,B(B({},F),{},{ref:b,class:`${l.value}-btn`}),B({default:()=>[f("div",{class:`${l.value}-drag-container`},[(A=n.default)===null||A===void 0?void 0:A.call(n)])]},n))]),_()]))}const H=ae(l.value,{[`${l.value}-select`]:!0,[`${l.value}-select-${L}`]:!0,[`${l.value}-disabled`]:p.value,[`${l.value}-rtl`]:a.value==="rtl"}),j=$t((R=n.default)===null||R===void 0?void 0:R.call(n)),Y=Q=>f("div",{class:H,style:Q},[f(o3,B(B({},F),{},{ref:b}),n)]);return c(L==="picture-card"?f("span",B(B({},o),{},{class:ae(`${l.value}-wrapper`,`${l.value}-picture-card-wrapper`,z,o.class,u.value)}),[_(Y,!!(j&&j.length))]):f("span",B(B({},o),{},{class:ae(`${l.value}-wrapper`,z,o.class,u.value)}),[Y(j&&j.length?void 0:{display:"none"}),_()]))}}});var u3=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{const{height:r}=e,i=u3(e,["height"]),{style:l}=o,a=u3(o,["style"]),s=m(m(m({},i),a),{type:"drag",style:m(m({},l),{height:typeof r=="number"?`${r}px`:r})});return f(Nd,s,n)}}}),Xce=Bd,Uce=m(Nd,{Dragger:Bd,LIST_IGNORE:Ps,install(e){return e.component(Nd.name,Nd),e.component(Bd.name,Bd),e}});function Yce(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function qce(e){return Object.keys(e).map(t=>`${Yce(t)}: ${e[t]};`).join(" ")}function d3(){return window.devicePixelRatio||1}function rv(e,t,n,o){e.translate(t,n),e.rotate(Math.PI/180*Number(o)),e.translate(-t,-n)}const Zce=(e,t)=>{let n=!1;return e.removedNodes.length&&(n=Array.from(e.removedNodes).some(o=>o===t)),e.type==="attributes"&&e.target===t&&(n=!0),n};var Qce=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r2&&arguments[2]!==void 0?arguments[2]:{};const{window:o=W8}=n,r=Qce(n,["window"]);let i;const l=j8(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},s=ye(()=>ay(e),u=>{a(),l.value&&o&&u&&(i=new MutationObserver(t),i.observe(u,r))},{immediate:!0}),c=()=>{a(),s()};return H8(c),{isSupported:l,stop:c}}const iv=2,f3=3,eue=()=>({zIndex:Number,rotate:Number,width:Number,height:Number,image:String,content:Fe([String,Array]),font:De(),rootClassName:String,gap:at(),offset:at()}),tue=ie({name:"AWatermark",inheritAttrs:!1,props:Ze(eue(),{zIndex:9,rotate:-22,font:{},gap:[100,100]}),setup(e,t){let{slots:n,attrs:o}=t;const[,r]=Zr(),i=oe(),l=oe(),a=oe(!1),s=I(()=>{var _,M;return(M=(_=e.gap)===null||_===void 0?void 0:_[0])!==null&&M!==void 0?M:100}),c=I(()=>{var _,M;return(M=(_=e.gap)===null||_===void 0?void 0:_[1])!==null&&M!==void 0?M:100}),u=I(()=>s.value/2),d=I(()=>c.value/2),p=I(()=>{var _,M;return(M=(_=e.offset)===null||_===void 0?void 0:_[0])!==null&&M!==void 0?M:u.value}),g=I(()=>{var _,M;return(M=(_=e.offset)===null||_===void 0?void 0:_[1])!==null&&M!==void 0?M:d.value}),v=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.fontSize)!==null&&M!==void 0?M:r.value.fontSizeLG}),h=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.fontWeight)!==null&&M!==void 0?M:"normal"}),b=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.fontStyle)!==null&&M!==void 0?M:"normal"}),y=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.fontFamily)!==null&&M!==void 0?M:"sans-serif"}),S=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.color)!==null&&M!==void 0?M:r.value.colorFill}),$=I(()=>{var _;const M={zIndex:(_=e.zIndex)!==null&&_!==void 0?_:9,position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",backgroundRepeat:"repeat"};let A=p.value-u.value,R=g.value-d.value;return A>0&&(M.left=`${A}px`,M.width=`calc(100% - ${A}px)`,A=0),R>0&&(M.top=`${R}px`,M.height=`calc(100% - ${R}px)`,R=0),M.backgroundPosition=`${A}px ${R}px`,M}),x=()=>{l.value&&(l.value.remove(),l.value=void 0)},C=(_,M)=>{var A;i.value&&l.value&&(a.value=!0,l.value.setAttribute("style",qce(m(m({},$.value),{backgroundImage:`url('${_}')`,backgroundSize:`${(s.value+M)*iv}px`}))),(A=i.value)===null||A===void 0||A.append(l.value),setTimeout(()=>{a.value=!1}))},O=_=>{let M=120,A=64;const R=e.content,L=e.image,P=e.width,D=e.height;if(!L&&_.measureText){_.font=`${Number(v.value)}px ${y.value}`;const N=Array.isArray(R)?R:[R],k=N.map(F=>_.measureText(F).width);M=Math.ceil(Math.max(...k)),A=Number(v.value)*N.length+(N.length-1)*f3}return[P??M,D??A]},w=(_,M,A,R,L)=>{const P=d3(),D=e.content,N=Number(v.value)*P;_.font=`${b.value} normal ${h.value} ${N}px/${L}px ${y.value}`,_.fillStyle=S.value,_.textAlign="center",_.textBaseline="top",_.translate(R/2,0);const k=Array.isArray(D)?D:[D];k?.forEach((F,z)=>{_.fillText(F??"",M,A+z*(N+f3*P))})},T=()=>{var _;const M=document.createElement("canvas"),A=M.getContext("2d"),R=e.image,L=(_=e.rotate)!==null&&_!==void 0?_:-22;if(A){l.value||(l.value=document.createElement("div"));const P=d3(),[D,N]=O(A),k=(s.value+D)*P,F=(c.value+N)*P;M.setAttribute("width",`${k*iv}px`),M.setAttribute("height",`${F*iv}px`);const z=s.value*P/2,H=c.value*P/2,j=D*P,Y=N*P,Q=(j+s.value*P)/2,U=(Y+c.value*P)/2,ee=z+k,X=H+F,J=Q+k,Z=U+F;if(A.save(),rv(A,Q,U,L),R){const G=new Image;G.onload=()=>{A.drawImage(G,z,H,j,Y),A.restore(),rv(A,J,Z,L),A.drawImage(G,ee,X,j,Y),C(M.toDataURL(),D)},G.crossOrigin="anonymous",G.referrerPolicy="no-referrer",G.src=R}else w(A,z,H,j,Y),A.restore(),rv(A,J,Z,L),w(A,ee,X,j,Y),C(M.toDataURL(),D)}};return We(()=>{T()}),ye(()=>[e,r.value.colorFill,r.value.fontSizeLG],()=>{T()},{deep:!0,flush:"post"}),Qe(()=>{x()}),Jce(i,_=>{a.value||_.forEach(M=>{Zce(M,l.value)&&(x(),T())})},{attributes:!0,subtree:!0,childList:!0,attributeFilter:["style","class"]}),()=>{var _;return f("div",B(B({},o),{},{ref:i,class:[o.class,e.rootClassName],style:[{position:"relative"},o.style]}),[(_=n.default)===null||_===void 0?void 0:_.call(n)])}}}),nue=Et(tue);function p3(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}}function g3(e){return{backgroundColor:e.bgColorSelected,boxShadow:e.boxShadow}}const oue=m({overflow:"hidden"},Yt),rue=e=>{const{componentCls:t}=e;return{[t]:m(m(m(m(m({},Ue(e)),{display:"inline-block",padding:e.segmentedContainerPadding,color:e.labelColor,backgroundColor:e.bgColor,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,[`${t}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",width:"100%"},[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-block`]:{display:"flex"},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid} ${e.motionEaseInOut}`,borderRadius:e.borderRadiusSM,"&-selected":m(m({},g3(e)),{color:e.labelColorHover}),"&::after":{content:'""',position:"absolute",width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",transition:`background-color ${e.motionDurationMid}`,pointerEvents:"none"},[`&:hover:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.labelColorHover,"&::after":{backgroundColor:e.bgColorHover}},"&-label":m({minHeight:e.controlHeight-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeight-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`},oue),"&-icon + *":{marginInlineStart:e.marginSM/2},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${t}-thumb`]:m(m({},g3(e)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${e.paddingXXS}px 0`,borderRadius:e.borderRadiusSM,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:e.controlHeightLG-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightLG-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:e.controlHeightSM-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightSM-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontalSM}px`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),p3(`&-disabled ${t}-item`,e)),p3(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"}})}},iue=Ke("Segmented",e=>{const{lineWidthBold:t,lineWidth:n,colorTextLabel:o,colorText:r,colorFillSecondary:i,colorBgLayout:l,colorBgElevated:a}=e,s=ke(e,{segmentedPaddingHorizontal:e.controlPaddingHorizontal-n,segmentedPaddingHorizontalSM:e.controlPaddingHorizontalSM-n,segmentedContainerPadding:t,labelColor:o,labelColorHover:r,bgColor:l,bgColorHover:i,bgColorSelected:a});return[rue(s)]}),h3=e=>e?{left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth}:null,ta=e=>e!==void 0?`${e}px`:void 0,lue=ie({props:{value:Ct(),getValueIndex:Ct(),prefixCls:Ct(),motionName:Ct(),onMotionStart:Ct(),onMotionEnd:Ct(),direction:Ct(),containerRef:Ct()},emits:["motionStart","motionEnd"],setup(e,t){let{emit:n}=t;const o=re(),r=v=>{var h;const b=e.getValueIndex(v),y=(h=e.containerRef.value)===null||h===void 0?void 0:h.querySelectorAll(`.${e.prefixCls}-item`)[b];return y?.offsetParent&&y},i=re(null),l=re(null);ye(()=>e.value,(v,h)=>{const b=r(h),y=r(v),S=h3(b),$=h3(y);i.value=S,l.value=$,n(b&&y?"motionStart":"motionEnd")},{flush:"post"});const a=I(()=>{var v,h;return e.direction==="rtl"?ta(-((v=i.value)===null||v===void 0?void 0:v.right)):ta((h=i.value)===null||h===void 0?void 0:h.left)}),s=I(()=>{var v,h;return e.direction==="rtl"?ta(-((v=l.value)===null||v===void 0?void 0:v.right)):ta((h=l.value)===null||h===void 0?void 0:h.left)});let c;const u=v=>{clearTimeout(c),rt(()=>{v&&(v.style.transform="translateX(var(--thumb-start-left))",v.style.width="var(--thumb-start-width)")})},d=v=>{c=setTimeout(()=>{v&&($f(v,`${e.motionName}-appear-active`),v.style.transform="translateX(var(--thumb-active-left))",v.style.width="var(--thumb-active-width)")})},p=v=>{i.value=null,l.value=null,v&&(v.style.transform=null,v.style.width=null,Cf(v,`${e.motionName}-appear-active`)),n("motionEnd")},g=I(()=>{var v,h;return{"--thumb-start-left":a.value,"--thumb-start-width":ta((v=i.value)===null||v===void 0?void 0:v.width),"--thumb-active-left":s.value,"--thumb-active-width":ta((h=l.value)===null||h===void 0?void 0:h.width)}});return Qe(()=>{clearTimeout(c)}),()=>{const v={ref:o,style:g.value,class:[`${e.prefixCls}-thumb`]};return f(pn,{appear:!0,onBeforeEnter:u,onEnter:d,onAfterEnter:p},{default:()=>[!i.value||!l.value?null:f("div",v,null)]})}}});function aue(e){return e.map(t=>typeof t=="object"&&t!==null?t:{label:t?.toString(),title:t?.toString(),value:t})}const sue=()=>({prefixCls:String,options:at(),block:$e(),disabled:$e(),size:Ne(),value:m(m({},Fe([String,Number])),{required:!0}),motionName:String,onChange:ve(),"onUpdate:value":ve()}),pE=(e,t)=>{let{slots:n,emit:o}=t;const{value:r,disabled:i,payload:l,title:a,prefixCls:s,label:c=n.label,checked:u,className:d}=e,p=g=>{i||o("change",g,r)};return f("label",{class:ae({[`${s}-item-disabled`]:i},d)},[f("input",{class:`${s}-item-input`,type:"radio",disabled:i,checked:u,onChange:p},null),f("div",{class:`${s}-item-label`,title:typeof a=="string"?a:""},[typeof c=="function"?c({value:r,disabled:i,payload:l,title:a}):c??r])])};pE.inheritAttrs=!1;const cue=ie({name:"ASegmented",inheritAttrs:!1,props:Ze(sue(),{options:[],motionName:"thumb-motion"}),slots:Object,setup(e,t){let{emit:n,slots:o,attrs:r}=t;const{prefixCls:i,direction:l,size:a}=Te("segmented",e),[s,c]=iue(i),u=oe(),d=oe(!1),p=I(()=>aue(e.options)),g=(v,h)=>{e.disabled||(n("update:value",h),n("change",h))};return()=>{const v=i.value;return s(f("div",B(B({},r),{},{class:ae(v,{[c.value]:!0,[`${v}-block`]:e.block,[`${v}-disabled`]:e.disabled,[`${v}-lg`]:a.value=="large",[`${v}-sm`]:a.value=="small",[`${v}-rtl`]:l.value==="rtl"},r.class),ref:u}),[f("div",{class:`${v}-group`},[f(lue,{containerRef:u,prefixCls:v,value:e.value,motionName:`${v}-${e.motionName}`,direction:l.value,getValueIndex:h=>p.value.findIndex(b=>b.value===h),onMotionStart:()=>{d.value=!0},onMotionEnd:()=>{d.value=!1}},null),p.value.map(h=>f(pE,B(B({key:h.value,prefixCls:v,checked:h.value===e.value,onChange:g},h),{},{className:ae(h.className,`${v}-item`,{[`${v}-item-selected`]:h.value===e.value&&!d.value}),disabled:!!e.disabled||!!h.disabled}),o))])]))}}}),uue=Et(cue),due=e=>{const{componentCls:t}=e;return{[t]:m(m({},Ue(e)),{display:"flex",justifyContent:"center",alignItems:"center",padding:e.paddingSM,backgroundColor:e.colorWhite,borderRadius:e.borderRadiusLG,border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,position:"relative",width:"100%",height:"100%",overflow:"hidden",[`& > ${t}-mask`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:10,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",color:e.colorText,lineHeight:e.lineHeight,background:e.QRCodeMaskBackgroundColor,textAlign:"center",[`& > ${t}-expired , & > ${t}-scanned`]:{color:e.QRCodeTextColor}},"&-icon":{marginBlockEnd:e.marginXS,fontSize:e.controlHeight}}),[`${t}-borderless`]:{borderColor:"transparent"}}},fue=Ke("QRCode",e=>due(ke(e,{QRCodeTextColor:"rgba(0, 0, 0, 0.88)",QRCodeMaskBackgroundColor:"rgba(255, 255, 255, 0.96)"})));var pue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"};function v3(e){for(var t=1;t({size:{type:Number,default:160},value:{type:String,required:!0},type:Ne("canvas"),color:String,bgColor:String,includeMargin:Boolean,imageSettings:De()}),Rue=()=>m(m({},D1()),{errorLevel:Ne("M"),icon:String,iconSize:{type:Number,default:40},status:Ne("active"),bordered:{type:Boolean,default:!0}});var Eo;(function(e){class t{static encodeText(a,s){const c=e.QrSegment.makeSegments(a);return t.encodeSegments(c,s)}static encodeBinary(a,s){const c=e.QrSegment.makeBytes(a);return t.encodeSegments([c],s)}static encodeSegments(a,s){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:40,d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1,p=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||d<-1||d>7)throw new RangeError("Invalid value");let g,v;for(g=c;;g++){const S=t.getNumDataCodewords(g,s)*8,$=i.getTotalBits(a,g);if($<=S){v=$;break}if(g>=u)throw new RangeError("Data too long")}for(const S of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&v<=t.getNumDataCodewords(g,S)*8&&(s=S);const h=[];for(const S of a){n(S.mode.modeBits,4,h),n(S.numChars,S.mode.numCharCountBits(g),h);for(const $ of S.getData())h.push($)}r(h.length==v);const b=t.getNumDataCodewords(g,s)*8;r(h.length<=b),n(0,Math.min(4,b-h.length),h),n(0,(8-h.length%8)%8,h),r(h.length%8==0);for(let S=236;h.lengthy[$>>>3]|=S<<7-($&7)),new t(g,s,y,d)}constructor(a,s,c,u){if(this.version=a,this.errorCorrectionLevel=s,this.modules=[],this.isFunction=[],at.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=a*4+17;const d=[];for(let g=0;g>>9)*1335;const u=(s<<10|c)^21522;r(u>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,o(u,d));this.setFunctionModule(8,7,o(u,6)),this.setFunctionModule(8,8,o(u,7)),this.setFunctionModule(7,8,o(u,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,o(u,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,o(u,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,o(u,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let c=0;c<12;c++)a=a<<1^(a>>>11)*7973;const s=this.version<<12|a;r(s>>>18==0);for(let c=0;c<18;c++){const u=o(s,c),d=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(d,p,u),this.setFunctionModule(p,d,u)}}drawFinderPattern(a,s){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){const d=Math.max(Math.abs(u),Math.abs(c)),p=a+u,g=s+c;0<=p&&p{(S!=v-d||x>=g)&&y.push($[S])});return r(y.length==p),y}drawCodewords(a){if(a.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let u=0;u>>3],7-(s&7)),s++)}}r(s==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let s=0;s5&&a++):(this.finderPenaltyAddHistory(g,v),p||(a+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),p=this.modules[d][h],g=1);a+=this.finderPenaltyTerminateAndCount(p,g,v)*t.PENALTY_N3}for(let d=0;d5&&a++):(this.finderPenaltyAddHistory(g,v),p||(a+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),p=this.modules[h][d],g=1);a+=this.finderPenaltyTerminateAndCount(p,g,v)*t.PENALTY_N3}for(let d=0;dp+(g?1:0),s);const c=this.size*this.size,u=Math.ceil(Math.abs(s*20-c*10)/c)-1;return r(0<=u&&u<=9),a+=u*t.PENALTY_N4,r(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{const a=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2,c=[6];for(let u=this.size-7;c.lengtht.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*a+128)*a+64;if(a>=2){const c=Math.floor(a/7)+2;s-=(25*c-10)*c-55,a>=7&&(s-=36)}return r(208<=s&&s<=29648),s}static getNumDataCodewords(a,s){return Math.floor(t.getNumRawDataModules(a)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][a]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");const s=[];for(let u=0;u0);for(const u of a){const d=u^c.shift();c.push(0),s.forEach((p,g)=>c[g]^=t.reedSolomonMultiply(p,d))}return c}static reedSolomonMultiply(a,s){if(a>>>8||s>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(s>>>u&1)*a;return r(c>>>8==0),c}finderPenaltyCountPatterns(a){const s=a[1];r(s<=this.size*3);const c=s>0&&a[2]==s&&a[3]==s*3&&a[4]==s&&a[5]==s;return(c&&a[0]>=s*4&&a[6]>=s?1:0)+(c&&a[6]>=s*4&&a[0]>=s?1:0)}finderPenaltyTerminateAndCount(a,s,c){return a&&(this.finderPenaltyAddHistory(s,c),s=0),s+=this.size,this.finderPenaltyAddHistory(s,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(a,s){s[0]==0&&(a+=this.size),s.pop(),s.unshift(a)}}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(l,a,s){if(a<0||a>31||l>>>a)throw new RangeError("Value out of range");for(let c=a-1;c>=0;c--)s.push(l>>>c&1)}function o(l,a){return(l>>>a&1)!=0}function r(l){if(!l)throw new Error("Assertion error")}class i{static makeBytes(a){const s=[];for(const c of a)n(c,8,s);return new i(i.Mode.BYTE,a.length,s)}static makeNumeric(a){if(!i.isNumeric(a))throw new RangeError("String contains non-numeric characters");const s=[];for(let c=0;c=1<1&&arguments[1]!==void 0?arguments[1]:0;const n=[];return e.forEach(function(o,r){let i=null;o.forEach(function(l,a){if(!l&&i!==null){n.push(`M${i+t} ${r+t}h${a-i}v1H${i+t}z`),i=null;return}if(a===o.length-1){if(!l)return;i===null?n.push(`M${a+t},${r+t} h1v1H${a+t}z`):n.push(`M${i+t},${r+t} h${a+1-i}v1H${i+t}z`);return}l&&i===null&&(i=a)})}),n.join("")}function SE(e,t){return e.slice().map((n,o)=>o=t.y+t.h?n:n.map((r,i)=>i=t.x+t.w?r:!1))}function $E(e,t,n,o){if(o==null)return null;const r=e.length+n*2,i=Math.floor(t*Bue),l=r/t,a=(o.width||i)*l,s=(o.height||i)*l,c=o.x==null?e.length/2-a/2:o.x*l,u=o.y==null?e.length/2-s/2:o.y*l;let d=null;if(o.excavate){const p=Math.floor(c),g=Math.floor(u),v=Math.ceil(a+c-p),h=Math.ceil(s+u-g);d={x:p,y:g,w:v,h}}return{x:c,y:u,h:s,w:a,excavation:d}}function CE(e,t){return t!=null?Math.floor(t):e?Due:Nue}const kue=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Fue=ie({name:"QRCodeCanvas",inheritAttrs:!1,props:m(m({},D1()),{level:String,bgColor:String,fgColor:String,marginSize:Number}),setup(e,t){let{attrs:n,expose:o}=t;const r=I(()=>{var s;return(s=e.imageSettings)===null||s===void 0?void 0:s.src}),i=oe(null),l=oe(null),a=oe(!1);return o({toDataURL:(s,c)=>{var u;return(u=i.value)===null||u===void 0?void 0:u.toDataURL(s,c)}}),Le(()=>{const{value:s,size:c=qm,level:u=hE,bgColor:d=vE,fgColor:p=mE,includeMargin:g=bE,marginSize:v,imageSettings:h}=e;if(i.value!=null){const b=i.value,y=b.getContext("2d");if(!y)return;let S=Eo.QrCode.encodeText(s,gE[u]).getModules();const $=CE(g,v),x=S.length+$*2,C=$E(S,c,$,h),O=l.value,w=a.value&&C!=null&&O!==null&&O.complete&&O.naturalHeight!==0&&O.naturalWidth!==0;w&&C.excavation!=null&&(S=SE(S,C.excavation));const T=window.devicePixelRatio||1;b.height=b.width=c*T;const E=c/x*T;y.scale(E,E),y.fillStyle=d,y.fillRect(0,0,x,x),y.fillStyle=p,kue?y.fill(new Path2D(yE(S,$))):S.forEach(function(_,M){_.forEach(function(A,R){A&&y.fillRect(R+$,M+$,1,1)})}),w&&y.drawImage(O,C.x+$,C.y+$,C.w,C.h)}},{flush:"post"}),ye(r,()=>{a.value=!1}),()=>{var s;const c=(s=e.size)!==null&&s!==void 0?s:qm,u={height:`${c}px`,width:`${c}px`};let d=null;return r.value!=null&&(d=f("img",{src:r.value,key:r.value,style:{display:"none"},onLoad:()=>{a.value=!0},ref:l},null)),f(He,null,[f("canvas",B(B({},n),{},{style:[u,n.style],ref:i}),null),d])}}}),Lue=ie({name:"QRCodeSVG",inheritAttrs:!1,props:m(m({},D1()),{color:String,level:String,bgColor:String,fgColor:String,marginSize:Number,title:String}),setup(e){let t=null,n=null,o=null,r=null,i=null,l=null;return Le(()=>{const{value:a,size:s=qm,level:c=hE,includeMargin:u=bE,marginSize:d,imageSettings:p}=e;t=Eo.QrCode.encodeText(a,gE[c]).getModules(),n=CE(u,d),o=t.length+n*2,r=$E(t,s,n,p),p!=null&&r!=null&&(r.excavation!=null&&(t=SE(t,r.excavation)),l=f("image",{"xlink:href":p.src,height:r.h,width:r.w,x:r.x+n,y:r.y+n,preserveAspectRatio:"none"},null)),i=yE(t,n)}),()=>{const a=e.bgColor&&vE,s=e.fgColor&&mE;return f("svg",{height:e.size,width:e.size,viewBox:`0 0 ${o} ${o}`},[!!e.title&&f("title",null,[e.title]),f("path",{fill:a,d:`M0,0 h${o}v${o}H0z`,"shape-rendering":"crispEdges"},null),f("path",{fill:s,d:i,"shape-rendering":"crispEdges"},null),l])}}}),zue=ie({name:"AQrcode",inheritAttrs:!1,props:Rue(),emits:["refresh"],setup(e,t){let{emit:n,attrs:o,expose:r}=t;const[i]=ko("QRCode"),{prefixCls:l}=Te("qrcode",e),[a,s]=fue(l),[,c]=Zr(),u=re();r({toDataURL:(p,g)=>{var v;return(v=u.value)===null||v===void 0?void 0:v.toDataURL(p,g)}});const d=I(()=>{const{value:p,icon:g="",size:v=160,iconSize:h=40,color:b=c.value.colorText,bgColor:y="transparent",errorLevel:S="M"}=e,$={src:g,x:void 0,y:void 0,height:h,width:h,excavate:!0};return{value:p,size:v-(c.value.paddingSM+c.value.lineWidth)*2,level:S,bgColor:y,fgColor:b,imageSettings:g?$:void 0}});return()=>{const p=l.value;return a(f("div",B(B({},o),{},{style:[o.style,{width:`${e.size}px`,height:`${e.size}px`,backgroundColor:d.value.bgColor}],class:[s.value,p,{[`${p}-borderless`]:!e.bordered}]}),[e.status!=="active"&&f("div",{class:`${p}-mask`},[e.status==="loading"&&f(mr,null,null),e.status==="expired"&&f(He,null,[f("p",{class:`${p}-expired`},[i.value.expired]),f(jt,{type:"link",onClick:g=>n("refresh",g)},{default:()=>[i.value.refresh],icon:()=>f(_1,null,null)})]),e.status==="scanned"&&f("p",{class:`${p}-scanned`},[i.value.scanned])]),e.type==="canvas"?f(Fue,B({ref:u},d.value),null):f(Lue,d.value,null)]))}}}),Hue=Et(zue);function jue(e){const t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:o,right:r,bottom:i,left:l}=e.getBoundingClientRect();return o>=0&&l>=0&&r<=t&&i<=n}function Vue(e,t,n,o){const[r,i]=bt(void 0);Le(()=>{const u=typeof e.value=="function"?e.value():e.value;i(u||null)},{flush:"post"});const[l,a]=bt(null),s=()=>{if(!t.value){a(null);return}if(r.value){!jue(r.value)&&t.value&&r.value.scrollIntoView(o.value);const{left:u,top:d,width:p,height:g}=r.value.getBoundingClientRect(),v={left:u,top:d,width:p,height:g,radius:0};JSON.stringify(l.value)!==JSON.stringify(v)&&a(v)}else a(null)};return We(()=>{ye([t,r],()=>{s()},{flush:"post",immediate:!0}),window.addEventListener("resize",s)}),Qe(()=>{window.removeEventListener("resize",s)}),[I(()=>{var u,d;if(!l.value)return l.value;const p=((u=n.value)===null||u===void 0?void 0:u.offset)||6,g=((d=n.value)===null||d===void 0?void 0:d.radius)||2;return{left:l.value.left-p,top:l.value.top-p,width:l.value.width+p*2,height:l.value.height+p*2,radius:g}}),r]}const Wue=()=>({arrow:Fe([Boolean,Object]),target:Fe([String,Function,Object]),title:Fe([String,Object]),description:Fe([String,Object]),placement:Ne(),mask:Fe([Object,Boolean],!0),className:{type:String},style:De(),scrollIntoViewOptions:Fe([Boolean,Object])}),N1=()=>m(m({},Wue()),{prefixCls:{type:String},total:{type:Number},current:{type:Number},onClose:ve(),onFinish:ve(),renderPanel:ve(),onPrev:ve(),onNext:ve()}),Kue=ie({name:"DefaultPanel",inheritAttrs:!1,props:N1(),setup(e,t){let{attrs:n}=t;return()=>{const{prefixCls:o,current:r,total:i,title:l,description:a,onClose:s,onPrev:c,onNext:u,onFinish:d}=e;return f("div",B(B({},n),{},{class:ae(`${o}-content`,n.class)}),[f("div",{class:`${o}-inner`},[f("button",{type:"button",onClick:s,"aria-label":"Close",class:`${o}-close`},[f("span",{class:`${o}-close-x`},[vt("×")])]),f("div",{class:`${o}-header`},[f("div",{class:`${o}-title`},[l])]),f("div",{class:`${o}-description`},[a]),f("div",{class:`${o}-footer`},[f("div",{class:`${o}-sliders`},[i>1?[...Array.from({length:i}).keys()].map((p,g)=>f("span",{key:p,class:g===r?"active":""},null)):null]),f("div",{class:`${o}-buttons`},[r!==0?f("button",{class:`${o}-prev-btn`,onClick:c},[vt("Prev")]):null,r===i-1?f("button",{class:`${o}-finish-btn`,onClick:d},[vt("Finish")]):f("button",{class:`${o}-next-btn`,onClick:u},[vt("Next")])])])])])}}}),Gue=ie({name:"TourStep",inheritAttrs:!1,props:N1(),setup(e,t){let{attrs:n}=t;return()=>{const{current:o,renderPanel:r}=e;return f(He,null,[typeof r=="function"?r(m(m({},n),e),o):f(Kue,B(B({},n),e),null)])}}});let P3=0;const Xue=Rn();function Uue(){let e;return Xue?(e=P3,P3+=1):e="TEST_OR_SSR",e}function Yue(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:re("");const t=`vc_unique_${Uue()}`;return e.value||t}const zu={fill:"transparent","pointer-events":"auto"},que=ie({name:"TourMask",props:{prefixCls:{type:String},pos:De(),rootClassName:{type:String},showMask:$e(),fill:{type:String,default:"rgba(0,0,0,0.5)"},open:$e(),animated:Fe([Boolean,Object]),zIndex:{type:Number}},setup(e,t){let{attrs:n}=t;const o=Yue();return()=>{const{prefixCls:r,open:i,rootClassName:l,pos:a,showMask:s,fill:c,animated:u,zIndex:d}=e,p=`${r}-mask-${o}`,g=typeof u=="object"?u?.placeholder:u;return f(Dc,{visible:i,autoLock:!0},{default:()=>i&&f("div",B(B({},n),{},{class:ae(`${r}-mask`,l,n.class),style:[{position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},n.style]}),[s?f("svg",{style:{width:"100%",height:"100%"}},[f("defs",null,[f("mask",{id:p},[f("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"},null),a&&f("rect",{x:a.left,y:a.top,rx:a.radius,width:a.width,height:a.height,fill:"black",class:g?`${r}-placeholder-animated`:""},null)])]),f("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:c,mask:`url(#${p})`},null),a&&f(He,null,[f("rect",B(B({},zu),{},{x:"0",y:"0",width:"100%",height:a.top}),null),f("rect",B(B({},zu),{},{x:"0",y:"0",width:a.left,height:"100%"}),null),f("rect",B(B({},zu),{},{x:"0",y:a.top+a.height,width:"100%",height:`calc(100vh - ${a.top+a.height}px)`}),null),f("rect",B(B({},zu),{},{x:a.left+a.width,y:"0",width:`calc(100vw - ${a.left+a.width}px)`,height:"100%"}),null)])]):null])})}}}),Zue=[0,0],I3={left:{points:["cr","cl"],offset:[-8,0]},right:{points:["cl","cr"],offset:[8,0]},top:{points:["bc","tc"],offset:[0,-8]},bottom:{points:["tc","bc"],offset:[0,8]},topLeft:{points:["bl","tl"],offset:[0,-8]},leftTop:{points:["tr","tl"],offset:[-8,0]},topRight:{points:["br","tr"],offset:[0,-8]},rightTop:{points:["tl","tr"],offset:[8,0]},bottomRight:{points:["tr","br"],offset:[0,8]},rightBottom:{points:["bl","br"],offset:[8,0]},bottomLeft:{points:["tl","bl"],offset:[0,8]},leftBottom:{points:["br","bl"],offset:[-8,0]}};function xE(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const t={};return Object.keys(I3).forEach(n=>{t[n]=m(m({},I3[n]),{autoArrow:e,targetOffset:Zue})}),t}xE();var Que=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{const{builtinPlacements:e,popupAlign:t}=DP();return{builtinPlacements:e,popupAlign:t,steps:at(),open:$e(),defaultCurrent:{type:Number},current:{type:Number},onChange:ve(),onClose:ve(),onFinish:ve(),mask:Fe([Boolean,Object],!0),arrow:Fe([Boolean,Object],!0),rootClassName:{type:String},placement:Ne("bottom"),prefixCls:{type:String,default:"rc-tour"},renderPanel:ve(),gap:De(),animated:Fe([Boolean,Object]),scrollIntoViewOptions:Fe([Boolean,Object],!0),zIndex:{type:Number,default:1001}}},Jue=ie({name:"Tour",inheritAttrs:!1,props:Ze(wE(),{}),setup(e){const{defaultCurrent:t,placement:n,mask:o,scrollIntoViewOptions:r,open:i,gap:l,arrow:a}=Ko(e),s=re(),[c,u]=Tt(0,{value:I(()=>e.current),defaultValue:t.value}),[d,p]=Tt(void 0,{value:I(()=>e.open),postState:w=>c.value<0||c.value>=e.steps.length?!1:w??!0}),g=oe(d.value);Le(()=>{d.value&&!g.value&&u(0),g.value=d.value});const v=I(()=>e.steps[c.value]||{}),h=I(()=>{var w;return(w=v.value.placement)!==null&&w!==void 0?w:n.value}),b=I(()=>{var w;return d.value&&((w=v.value.mask)!==null&&w!==void 0?w:o.value)}),y=I(()=>{var w;return(w=v.value.scrollIntoViewOptions)!==null&&w!==void 0?w:r.value}),[S,$]=Vue(I(()=>v.value.target),i,l,y),x=I(()=>$.value?typeof v.value.arrow>"u"?a.value:v.value.arrow:!1),C=I(()=>typeof x.value=="object"?x.value.pointAtCenter:!1);ye(C,()=>{var w;(w=s.value)===null||w===void 0||w.forcePopupAlign()}),ye(c,()=>{var w;(w=s.value)===null||w===void 0||w.forcePopupAlign()});const O=w=>{var T;u(w),(T=e.onChange)===null||T===void 0||T.call(e,w)};return()=>{var w;const{prefixCls:T,steps:E,onClose:_,onFinish:M,rootClassName:A,renderPanel:R,animated:L,zIndex:P}=e,D=Que(e,["prefixCls","steps","onClose","onFinish","rootClassName","renderPanel","animated","zIndex"]);if($.value===void 0)return null;const N=()=>{p(!1),_?.(c.value)},k=typeof b.value=="boolean"?b.value:!!b.value,F=typeof b.value=="boolean"?void 0:b.value,z=()=>$.value||document.body,H=()=>f(Gue,B({arrow:x.value,key:"content",prefixCls:T,total:E.length,renderPanel:R,onPrev:()=>{O(c.value-1)},onNext:()=>{O(c.value+1)},onClose:N,current:c.value,onFinish:()=>{N(),M?.()}},v.value),null),j=I(()=>{const Y=S.value||lv,Q={};return Object.keys(Y).forEach(U=>{typeof Y[U]=="number"?Q[U]=`${Y[U]}px`:Q[U]=Y[U]}),Q});return d.value?f(He,null,[f(que,{zIndex:P,prefixCls:T,pos:S.value,showMask:k,style:F?.style,fill:F?.color,open:d.value,animated:L,rootClassName:A},null),f(Ll,B(B({},D),{},{arrow:!!D.arrow,builtinPlacements:v.value.target?(w=D.builtinPlacements)!==null&&w!==void 0?w:xE(C.value):void 0,ref:s,popupStyle:v.value.target?v.value.style:m(m({},v.value.style),{position:"fixed",left:lv.left,top:lv.top,transform:"translate(-50%, -50%)"}),popupPlacement:h.value,popupVisible:d.value,popupClassName:ae(A,v.value.className),prefixCls:T,popup:H,forceRender:!1,destroyPopupOnHide:!0,zIndex:P,mask:!1,getTriggerDOMNode:z}),{default:()=>[f(Dc,{visible:d.value,autoLock:!0},{default:()=>[f("div",{class:ae(A,`${T}-target-placeholder`),style:m(m({},j.value),{position:"fixed",pointerEvents:"none"})},null)]})]})]):null}}}),ede=()=>m(m({},wE()),{steps:{type:Array},prefixCls:{type:String},current:{type:Number},type:{type:String},"onUpdate:current":Function}),tde=()=>m(m({},N1()),{cover:{type:Object},nextButtonProps:{type:Object},prevButtonProps:{type:Object},current:{type:Number},type:{type:String}}),nde=ie({name:"ATourPanel",inheritAttrs:!1,props:tde(),setup(e,t){let{attrs:n,slots:o}=t;const{current:r,total:i}=Ko(e),l=I(()=>r.value===i.value-1),a=c=>{var u;const d=e.prevButtonProps;(u=e.onPrev)===null||u===void 0||u.call(e,c),typeof d?.onClick=="function"&&d?.onClick()},s=c=>{var u,d;const p=e.nextButtonProps;l.value?(u=e.onFinish)===null||u===void 0||u.call(e,c):(d=e.onNext)===null||d===void 0||d.call(e,c),typeof p?.onClick=="function"&&p?.onClick()};return()=>{const{prefixCls:c,title:u,onClose:d,cover:p,description:g,type:v,arrow:h}=e,b=e.prevButtonProps,y=e.nextButtonProps;let S;u&&(S=f("div",{class:`${c}-header`},[f("div",{class:`${c}-title`},[u])]));let $;g&&($=f("div",{class:`${c}-description`},[g]));let x;p&&(x=f("div",{class:`${c}-cover`},[p]));let C;o.indicatorsRender?C=o.indicatorsRender({current:r.value,total:i}):C=[...Array.from({length:i.value}).keys()].map((T,E)=>f("span",{key:T,class:ae(E===r.value&&`${c}-indicator-active`,`${c}-indicator`)},null));const O=v==="primary"?"default":"primary",w={type:"default",ghost:v==="primary"};return f(Rl,{componentName:"Tour",defaultLocale:Un.Tour},{default:T=>{var E;return f("div",B(B({},n),{},{class:ae(v==="primary"?`${c}-primary`:"",n.class,`${c}-content`)}),[h&&f("div",{class:`${c}-arrow`,key:"arrow"},null),f("div",{class:`${c}-inner`},[f(kn,{class:`${c}-close`,onClick:d},null),x,S,$,f("div",{class:`${c}-footer`},[i.value>1&&f("div",{class:`${c}-indicators`},[C]),f("div",{class:`${c}-buttons`},[r.value!==0?f(jt,B(B(B({},w),b),{},{onClick:a,size:"small",class:ae(`${c}-prev-btn`,b?.className)}),{default:()=>[Ov(b?.children)?b.children():(E=b?.children)!==null&&E!==void 0?E:T.Previous]}):null,f(jt,B(B({type:O},y),{},{onClick:s,size:"small",class:ae(`${c}-next-btn`,y?.className)}),{default:()=>[Ov(y?.children)?y?.children():l.value?T.Finish:T.Next]})])])])])}})}}}),ode=e=>{let{defaultType:t,steps:n,current:o,defaultCurrent:r}=e;const i=re(r?.value),l=I(()=>o?.value);ye(l,u=>{i.value=u??r?.value},{immediate:!0});const a=u=>{i.value=u},s=I(()=>{var u,d;return typeof i.value=="number"?n&&((d=(u=n.value)===null||u===void 0?void 0:u[i.value])===null||d===void 0?void 0:d.type):t?.value});return{currentMergedType:I(()=>{var u;return(u=s.value)!==null&&u!==void 0?u:t?.value}),updateInnerCurrent:a}},rde=e=>{const{componentCls:t,lineHeight:n,padding:o,paddingXS:r,borderRadius:i,borderRadiusXS:l,colorPrimary:a,colorText:s,colorFill:c,indicatorHeight:u,indicatorWidth:d,boxShadowTertiary:p,tourZIndexPopup:g,fontSize:v,colorBgContainer:h,fontWeightStrong:b,marginXS:y,colorTextLightSolid:S,tourBorderRadius:$,colorWhite:x,colorBgTextHover:C,tourCloseSize:O,motionDurationSlow:w,antCls:T}=e;return[{[t]:m(m({},Ue(e)),{color:s,position:"absolute",zIndex:g,display:"block",visibility:"visible",fontSize:v,lineHeight:n,width:520,"--antd-arrow-background-color":h,"&-pure":{maxWidth:"100%",position:"relative"},[`&${t}-hidden`]:{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{textAlign:"start",textDecoration:"none",borderRadius:$,boxShadow:p,position:"relative",backgroundColor:h,border:"none",backgroundClip:"padding-box",[`${t}-close`]:{position:"absolute",top:o,insetInlineEnd:o,color:e.colorIcon,outline:"none",width:O,height:O,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:e.colorIconHover,backgroundColor:e.wireframe?"transparent":e.colorFillContent}},[`${t}-cover`]:{textAlign:"center",padding:`${o+O+r}px ${o}px 0`,img:{width:"100%"}},[`${t}-header`]:{padding:`${o}px ${o}px ${r}px`,[`${t}-title`]:{lineHeight:n,fontSize:v,fontWeight:b}},[`${t}-description`]:{padding:`0 ${o}px`,lineHeight:n,wordWrap:"break-word"},[`${t}-footer`]:{padding:`${r}px ${o}px ${o}px`,textAlign:"end",borderRadius:`0 0 ${l}px ${l}px`,display:"flex",[`${t}-indicators`]:{display:"inline-block",[`${t}-indicator`]:{width:d,height:u,display:"inline-block",borderRadius:"50%",background:c,"&:not(:last-child)":{marginInlineEnd:u},"&-active":{background:a}}},[`${t}-buttons`]:{marginInlineStart:"auto",[`${T}-btn`]:{marginInlineStart:y}}}},[`${t}-primary, &${t}-primary`]:{"--antd-arrow-background-color":a,[`${t}-inner`]:{color:S,textAlign:"start",textDecoration:"none",backgroundColor:a,borderRadius:i,boxShadow:p,[`${t}-close`]:{color:S},[`${t}-indicators`]:{[`${t}-indicator`]:{background:new ht(S).setAlpha(.15).toRgbString(),"&-active":{background:S}}},[`${t}-prev-btn`]:{color:S,borderColor:new ht(S).setAlpha(.15).toRgbString(),backgroundColor:a,"&:hover":{backgroundColor:new ht(S).setAlpha(.15).toRgbString(),borderColor:"transparent"}},[`${t}-next-btn`]:{color:a,borderColor:"transparent",background:x,"&:hover":{background:new ht(C).onBackground(x).toRgbString()}}}}}),[`${t}-mask`]:{[`${t}-placeholder-animated`]:{transition:`all ${w}`}},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${t}-inner`]:{borderRadius:Math.min($,_b)}}},Ab(e,{colorBg:"var(--antd-arrow-background-color)",contentRadius:$,limitVerticalRadius:!0})]},ide=Ke("Tour",e=>{const{borderRadiusLG:t,fontSize:n,lineHeight:o}=e,r=ke(e,{tourZIndexPopup:e.zIndexPopupBase+70,indicatorWidth:6,indicatorHeight:6,tourBorderRadius:t,tourCloseSize:n*o});return[rde(r)]});var lde=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{const{steps:h,current:b,type:y,rootClassName:S}=e,$=lde(e,["steps","current","type","rootClassName"]),x=ae({[`${c.value}-primary`]:g.value==="primary",[`${c.value}-rtl`]:u.value==="rtl"},p.value,S),C=(T,E)=>f(nde,B(B({},T),{},{type:y,current:E}),{indicatorsRender:r.indicatorsRender}),O=T=>{v(T),o("update:current",T),o("change",T)},w=I(()=>Mb({arrowPointAtCenter:!0,autoAdjustOverflow:!0}));return d(f(Jue,B(B(B({},n),$),{},{rootClassName:x,prefixCls:c.value,current:b,defaultCurrent:e.defaultCurrent,animated:!0,renderPanel:C,onChange:O,steps:h,builtinPlacements:w.value}),null))}}}),sde=Et(ade),OE=Symbol("appConfigContext"),cde=e=>Xe(OE,e),ude=()=>je(OE,{}),PE=Symbol("appContext"),dde=e=>Xe(PE,e),fde=ut({message:{},notification:{},modal:{}}),pde=()=>je(PE,fde),gde=e=>{const{componentCls:t,colorText:n,fontSize:o,lineHeight:r,fontFamily:i}=e;return{[t]:{color:n,fontSize:o,lineHeight:r,fontFamily:i}}},hde=Ke("App",e=>[gde(e)]),vde=()=>({rootClassName:String,message:De(),notification:De()}),mde=()=>pde(),Qs=ie({name:"AApp",props:Ze(vde(),{}),setup(e,t){let{slots:n}=t;const{prefixCls:o}=Te("app",e),[r,i]=hde(o),l=I(()=>ae(i.value,o.value,e.rootClassName)),a=ude(),s=I(()=>({message:m(m({},a.message),e.message),notification:m(m({},a.notification),e.notification)}));cde(s.value);const[c,u]=QI(s.value.message),[d,p]=u5(s.value.notification),[g,v]=pT(),h=I(()=>({message:c,notification:d,modal:g}));return dde(h.value),()=>{var b;return r(f("div",{class:l.value},[v(),u(),p(),(b=n.default)===null||b===void 0?void 0:b.call(n)]))}}});Qs.useApp=mde;Qs.install=function(e){e.component(Qs.name,Qs)};const IE=["wrap","nowrap","wrap-reverse"],TE=["flex-start","flex-end","start","end","center","space-between","space-around","space-evenly","stretch","normal","left","right"],EE=["center","start","end","flex-start","flex-end","self-start","self-end","baseline","normal","stretch"],bde=(e,t)=>{const n={};return IE.forEach(o=>{n[`${e}-wrap-${o}`]=t.wrap===o}),n},yde=(e,t)=>{const n={};return EE.forEach(o=>{n[`${e}-align-${o}`]=t.align===o}),n[`${e}-align-stretch`]=!t.align&&!!t.vertical,n},Sde=(e,t)=>{const n={};return TE.forEach(o=>{n[`${e}-justify-${o}`]=t.justify===o}),n};function $de(e,t){return ae(m(m(m({},bde(e,t)),yde(e,t)),Sde(e,t)))}const Cde=e=>{const{componentCls:t}=e;return{[t]:{display:"flex","&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"},"&:empty":{display:"none"}}}},xde=e=>{const{componentCls:t}=e;return{[t]:{"&-gap-small":{gap:e.flexGapSM},"&-gap-middle":{gap:e.flexGap},"&-gap-large":{gap:e.flexGapLG}}}},wde=e=>{const{componentCls:t}=e,n={};return IE.forEach(o=>{n[`${t}-wrap-${o}`]={flexWrap:o}}),n},Ode=e=>{const{componentCls:t}=e,n={};return EE.forEach(o=>{n[`${t}-align-${o}`]={alignItems:o}}),n},Pde=e=>{const{componentCls:t}=e,n={};return TE.forEach(o=>{n[`${t}-justify-${o}`]={justifyContent:o}}),n},Ide=Ke("Flex",e=>{const t=ke(e,{flexGapSM:e.paddingXS,flexGap:e.padding,flexGapLG:e.paddingLG});return[Cde(t),xde(t),wde(t),Ode(t),Pde(t)]});function T3(e){return["small","middle","large"].includes(e)}const Tde=()=>({prefixCls:Ne(),vertical:$e(),wrap:Ne(),justify:Ne(),align:Ne(),flex:Fe([Number,String]),gap:Fe([Number,String]),component:Ct()});var Ede=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{var u;return[l.value,s.value,$de(l.value,e),{[`${l.value}-rtl`]:i.value==="rtl",[`${l.value}-gap-${e.gap}`]:T3(e.gap),[`${l.value}-vertical`]:(u=e.vertical)!==null&&u!==void 0?u:r?.value.vertical}]});return()=>{var u;const{flex:d,gap:p,component:g="div"}=e,v=Ede(e,["flex","gap","component"]),h={};return d&&(h.flex=d),p&&!T3(p)&&(h.gap=`${p}px`),a(f(g,B({class:[o.class,c.value],style:[o.style,h]},nt(v,["justify","wrap","align","vertical"])),{default:()=>[(u=n.default)===null||u===void 0?void 0:u.call(n)]}))}}}),_de=Et(Mde),E3=Object.freeze(Object.defineProperty({__proto__:null,Affix:yP,Alert:UV,Anchor:ol,AnchorLink:k0,App:Qs,AutoComplete:xV,AutoCompleteOptGroup:CV,AutoCompleteOption:$V,Avatar:ml,AvatarGroup:pf,BackTop:kf,Badge:Vs,BadgeRibbon:gf,Breadcrumb:bl,BreadcrumbItem:Sc,BreadcrumbSeparator:xf,Button:jt,ButtonGroup:yf,Calendar:HX,Card:wa,CardGrid:Tf,CardMeta:If,Carousel:IY,Cascader:jZ,CheckableTag:Rf,Checkbox:_o,CheckboxGroup:_f,Col:UZ,Collapse:Ks,CollapsePanel:Ef,Comment:JZ,Compact:df,ConfigProvider:Sl,DatePicker:vJ,Descriptions:la,DescriptionsItem:O5,DirectoryTree:Ed,Divider:EJ,Drawer:WJ,Dropdown:Xo,DropdownButton:yc,Empty:bi,Flex:_de,FloatButton:Ti,FloatButtonGroup:Bf,Form:yi,FormItem:WI,FormItemRest:sf,Grid:XZ,Image:il,ImagePreviewGroup:U5,Input:ln,InputGroup:N5,InputNumber:$te,InputPassword:F5,InputSearch:B5,Layout:Dte,LayoutContent:Rte,LayoutFooter:_te,LayoutHeader:Mte,LayoutSider:Ate,List:di,ListItem:J5,ListItemMeta:Z5,LocaleProvider:UI,Mentions:Hne,MentionsOption:Od,Menu:Gt,MenuDivider:Cc,MenuItem:vr,MenuItemGroup:$c,Modal:Dt,MonthPicker:vd,PageHeader:moe,Pagination:gg,Popconfirm:xoe,Popover:Rb,Progress:Jy,QRCode:Hue,QuarterPicker:md,Radio:jn,RadioButton:Of,RadioGroup:sy,RangePicker:bd,Rate:ure,Result:Cl,Row:Pre,Segmented:uue,Select:mn,SelectOptGroup:bV,SelectOption:mV,Skeleton:In,SkeletonAvatar:by,SkeletonButton:hy,SkeletonImage:my,SkeletonInput:vy,SkeletonTitle:Yp,Slider:Vre,Space:Ta,Spin:mr,Statistic:Br,StatisticCountdown:ooe,Step:Pd,Steps:aie,SubMenu:El,Switch:mie,TabPane:Pf,Table:Eae,TableColumn:_d,TableColumnGroup:Ad,TableSummary:Rd,TableSummaryCell:Kf,TableSummaryRow:Wf,Tabs:yl,Tag:Ia,Textarea:ky,TimePicker:wse,TimeRangePicker:Dd,Timeline:Zs,TimelineItem:Tc,Tooltip:to,Tour:sde,Transfer:Qae,Tree:ZT,TreeNode:Md,TreeSelect:Cse,TreeSelectNode:Ym,Typography:eo,TypographyLink:is,TypographyParagraph:ls,TypographyText:as,TypographyTitle:ss,Upload:Uce,UploadDragger:Xce,Watermark:nue,WeekPicker:hd,message:Gn,notification:_i},Symbol.toStringTag,{value:"Module"})),Ade=function(e){return Object.keys(E3).forEach(t=>{const n=E3[t];n.install&&e.use(n)}),e.use(v9.StyleProvider),e.config.globalProperties.$message=Gn,e.config.globalProperties.$notification=_i,e.config.globalProperties.$info=Dt.info,e.config.globalProperties.$success=Dt.success,e.config.globalProperties.$error=Dt.error,e.config.globalProperties.$warning=Dt.warning,e.config.globalProperties.$confirm=Dt.confirm,e.config.globalProperties.$destroyAll=Dt.destroyAll,e},Rde={version:aP,install:Ade};const aa=typeof document<"u";function ME(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Dde(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ME(e.default)}const Pt=Object.assign;function av(e,t){const n={};for(const o in t){const r=t[o];n[o]=Jo(r)?r.map(e):e(r)}return n}const Js=()=>{},Jo=Array.isArray;function M3(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}const _E=/#/g,Nde=/&/g,Bde=/\//g,kde=/=/g,Fde=/\?/g,AE=/\+/g,Lde=/%5B/g,zde=/%5D/g,RE=/%5E/g,Hde=/%60/g,DE=/%7B/g,jde=/%7C/g,NE=/%7D/g,Vde=/%20/g;function B1(e){return e==null?"":encodeURI(""+e).replace(jde,"|").replace(Lde,"[").replace(zde,"]")}function Wde(e){return B1(e).replace(DE,"{").replace(NE,"}").replace(RE,"^")}function Zm(e){return B1(e).replace(AE,"%2B").replace(Vde,"+").replace(_E,"%23").replace(Nde,"%26").replace(Hde,"`").replace(DE,"{").replace(NE,"}").replace(RE,"^")}function Kde(e){return Zm(e).replace(kde,"%3D")}function Gde(e){return B1(e).replace(_E,"%23").replace(Fde,"%3F")}function Xde(e){return Gde(e).replace(Bde,"%2F")}function Ec(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Ude=/\/$/,Yde=e=>e.replace(Ude,"");function sv(e,t,n="/"){let o,r={},i="",l="";const a=t.indexOf("#");let s=t.indexOf("?");return s=a>=0&&s>a?-1:s,s>=0&&(o=t.slice(0,s),i=t.slice(s,a>0?a:t.length),r=e(i.slice(1))),a>=0&&(o=o||t.slice(0,a),l=t.slice(a,t.length)),o=Jde(o??t,n),{fullPath:o+i+l,path:o,query:r,hash:Ec(l)}}function qde(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function _3(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Zde(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&ja(t.matched[o],n.matched[r])&&BE(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ja(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function BE(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Qde(e[n],t[n]))return!1;return!0}function Qde(e,t){return Jo(e)?A3(e,t):Jo(t)?A3(t,e):e?.valueOf()===t?.valueOf()}function A3(e,t){return Jo(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function Jde(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,l,a;for(l=0;l1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(l).join("/")}const si={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Qm=(function(e){return e.pop="pop",e.push="push",e})({}),cv=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function efe(e){if(!e)if(aa){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Yde(e)}const tfe=/^[^#]+#/;function nfe(e,t){return e.replace(tfe,"#")+t}function ofe(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const Cg=()=>({left:window.scrollX,top:window.scrollY});function rfe(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=ofe(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function R3(e,t){return(history.state?history.state.position-t:-1)+e}const Jm=new Map;function ife(e,t){Jm.set(e,t)}function lfe(e){const t=Jm.get(e);return Jm.delete(e),t}function afe(e){return typeof e=="string"||e&&typeof e=="object"}function kE(e){return typeof e=="string"||typeof e=="symbol"}let Kt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const FE=Symbol("");Kt.MATCHER_NOT_FOUND+"",Kt.NAVIGATION_GUARD_REDIRECT+"",Kt.NAVIGATION_ABORTED+"",Kt.NAVIGATION_CANCELLED+"",Kt.NAVIGATION_DUPLICATED+"";function Va(e,t){return Pt(new Error,{type:e,[FE]:!0},t)}function Ir(e,t){return e instanceof Error&&FE in e&&(t==null||!!(e.type&t))}const sfe=["params","query","hash"];function cfe(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of sfe)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function ufe(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;or&&Zm(r)):[o&&Zm(o)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function dfe(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=Jo(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const ffe=Symbol(""),N3=Symbol(""),xg=Symbol(""),LE=Symbol(""),e0=Symbol("");function Ss(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function vi(e,t,n,o,r,i=l=>l()){const l=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((a,s)=>{const c=p=>{p===!1?s(Va(Kt.NAVIGATION_ABORTED,{from:n,to:t})):p instanceof Error?s(p):afe(p)?s(Va(Kt.NAVIGATION_GUARD_REDIRECT,{from:t,to:p})):(l&&o.enterCallbacks[r]===l&&typeof p=="function"&&l.push(p),a())},u=i(()=>e.call(o&&o.instances[r],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(p=>s(p))})}function uv(e,t,n,o,r=i=>i()){const i=[];for(const l of e)for(const a in l.components){let s=l.components[a];if(!(t!=="beforeRouteEnter"&&!l.instances[a]))if(ME(s)){const c=(s.__vccOpts||s)[t];c&&i.push(vi(c,n,o,l,a,r))}else{let c=s();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${l.path}"`);const d=Dde(u)?u.default:u;l.mods[a]=u,l.components[a]=d;const p=(d.__vccOpts||d)[t];return p&&vi(p,n,o,l,a,r)()}))}}return i}function pfe(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;lja(c,a))?o.push(a):n.push(a));const s=e.matched[l];s&&(t.matched.find(c=>ja(c,s))||r.push(s))}return[n,o,r]}let gfe=()=>location.protocol+"//"+location.host;function zE(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let l=r.includes(e.slice(i))?e.slice(i).length:1,a=r.slice(l);return a[0]!=="/"&&(a="/"+a),_3(a,"")}return _3(n,e)+o+r}function hfe(e,t,n,o){let r=[],i=[],l=null;const a=({state:p})=>{const g=zE(e,location),v=n.value,h=t.value;let b=0;if(p){if(n.value=g,t.value=p,l&&l===v){l=null;return}b=h?p.position-h.position:0}else o(g);r.forEach(y=>{y(n.value,v,{delta:b,type:Qm.pop,direction:b?b>0?cv.forward:cv.back:cv.unknown})})};function s(){l=n.value}function c(p){r.push(p);const g=()=>{const v=r.indexOf(p);v>-1&&r.splice(v,1)};return i.push(g),g}function u(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(Pt({},p.state,{scroll:Cg()}),"")}}function d(){for(const p of i)p();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:s,listen:c,destroy:d}}function B3(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?Cg():null}}function vfe(e){const{history:t,location:n}=window,o={value:zE(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(s,c,u){const d=e.indexOf("#"),p=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+s:gfe()+e+s;try{t[u?"replaceState":"pushState"](c,"",p),r.value=c}catch(g){console.error(g),n[u?"replace":"assign"](p)}}function l(s,c){i(s,Pt({},t.state,B3(r.value.back,s,r.value.forward,!0),c,{position:r.value.position}),!0),o.value=s}function a(s,c){const u=Pt({},r.value,t.state,{forward:s,scroll:Cg()});i(u.current,u,!0),i(s,Pt({},B3(o.value,s,null),{position:u.position+1},c),!1),o.value=s}return{location:o,state:r,push:a,replace:l}}function mfe(e){e=efe(e);const t=vfe(e),n=hfe(e,t.state,t.location,t.replace);function o(i,l=!0){l||n.pauseListeners(),history.go(i)}const r=Pt({location:"",base:e,go:o,createHref:nfe.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let ul=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var cn=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(cn||{});const bfe={type:ul.Static,value:""},yfe=/[a-zA-Z0-9_]/;function Sfe(e){if(!e)return[[]];if(e==="/")return[[bfe]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(g){throw new Error(`ERR (${n})/"${c}": ${g}`)}let n=cn.Static,o=n;const r=[];let i;function l(){i&&r.push(i),i=[]}let a=0,s,c="",u="";function d(){c&&(n===cn.Static?i.push({type:ul.Static,value:c}):n===cn.Param||n===cn.ParamRegExp||n===cn.ParamRegExpEnd?(i.length>1&&(s==="*"||s==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:ul.Param,value:c,regexp:u,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):t("Invalid state to consume buffer"),c="")}function p(){c+=s}for(;at.length?t.length===1&&t[0]===Hn.Static+Hn.Segment?1:-1:0}function HE(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Ofe={strict:!1,end:!0,sensitive:!1};function Pfe(e,t,n){const o=xfe(Sfe(e.path),n),r=Pt(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ife(e,t){const n=[],o=new Map;t=M3(Ofe,t);function r(d){return o.get(d)}function i(d,p,g){const v=!g,h=z3(d);h.aliasOf=g&&g.record;const b=M3(t,d),y=[h];if("alias"in d){const x=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of x)y.push(z3(Pt({},h,{components:g?g.record.components:h.components,path:C,aliasOf:g?g.record:h})))}let S,$;for(const x of y){const{path:C}=x;if(p&&C[0]!=="/"){const O=p.record.path,w=O[O.length-1]==="/"?"":"/";x.path=p.record.path+(C&&w+C)}if(S=Pfe(x,p,b),g?g.alias.push(S):($=$||S,$!==S&&$.alias.push(S),v&&d.name&&!H3(S)&&l(d.name)),jE(S)&&s(S),h.children){const O=h.children;for(let w=0;w{l($)}:Js}function l(d){if(kE(d)){const p=o.get(d);p&&(o.delete(d),n.splice(n.indexOf(p),1),p.children.forEach(l),p.alias.forEach(l))}else{const p=n.indexOf(d);p>-1&&(n.splice(p,1),d.record.name&&o.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function a(){return n}function s(d){const p=Mfe(d,n);n.splice(p,0,d),d.record.name&&!H3(d)&&o.set(d.record.name,d)}function c(d,p){let g,v={},h,b;if("name"in d&&d.name){if(g=o.get(d.name),!g)throw Va(Kt.MATCHER_NOT_FOUND,{location:d});b=g.record.name,v=Pt(L3(p.params,g.keys.filter($=>!$.optional).concat(g.parent?g.parent.keys.filter($=>$.optional):[]).map($=>$.name)),d.params&&L3(d.params,g.keys.map($=>$.name))),h=g.stringify(v)}else if(d.path!=null)h=d.path,g=n.find($=>$.re.test(h)),g&&(v=g.parse(h),b=g.record.name);else{if(g=p.name?o.get(p.name):n.find($=>$.re.test(p.path)),!g)throw Va(Kt.MATCHER_NOT_FOUND,{location:d,currentLocation:p});b=g.record.name,v=Pt({},p.params,d.params),h=g.stringify(v)}const y=[];let S=g;for(;S;)y.unshift(S.record),S=S.parent;return{name:b,path:h,params:v,matched:y,meta:Efe(y)}}e.forEach(d=>i(d));function u(){n.length=0,o.clear()}return{addRoute:i,resolve:c,removeRoute:l,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function L3(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function z3(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Tfe(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Tfe(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function H3(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Efe(e){return e.reduce((t,n)=>Pt(t,n.meta),{})}function Mfe(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;HE(e,t[i])<0?o=i:n=i+1}const r=_fe(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function _fe(e){let t=e;for(;t=t.parent;)if(jE(t)&&HE(e,t)===0)return t}function jE({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function j3(e){const t=je(xg),n=je(LE),o=I(()=>{const s=gt(e.to);return t.resolve(s)}),r=I(()=>{const{matched:s}=o.value,{length:c}=s,u=s[c-1],d=n.matched;if(!u||!d.length)return-1;const p=d.findIndex(ja.bind(null,u));if(p>-1)return p;const g=V3(s[c-2]);return c>1&&V3(u)===g&&d[d.length-1].path!==g?d.findIndex(ja.bind(null,s[c-2])):p}),i=I(()=>r.value>-1&&Bfe(n.params,o.value.params)),l=I(()=>r.value>-1&&r.value===n.matched.length-1&&BE(n.params,o.value.params));function a(s={}){if(Nfe(s)){const c=t[gt(e.replace)?"replace":"push"](gt(e.to)).catch(Js);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:o,href:I(()=>o.value.href),isActive:i,isExactActive:l,navigate:a}}function Afe(e){return e.length===1?e[0]:e}const Rfe=ie({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:j3,setup(e,{slots:t}){const n=ut(j3(e)),{options:o}=je(xg),r=I(()=>({[W3(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[W3(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&Afe(t.default(n));return e.custom?i:Gr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Dfe=Rfe;function Nfe(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Bfe(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!Jo(r)||r.length!==o.length||o.some((i,l)=>i.valueOf()!==r[l].valueOf()))return!1}return!0}function V3(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const W3=(e,t,n)=>e??t??n,kfe=ie({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=je(e0),r=I(()=>e.route||o.value),i=je(N3,0),l=I(()=>{let c=gt(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=I(()=>r.value.matched[l.value]);Xe(N3,I(()=>l.value+1)),Xe(ffe,a),Xe(e0,r);const s=re();return ye(()=>[s.value,a.value,e.name],([c,u,d],[p,g,v])=>{u&&(u.instances[d]=c,g&&g!==u&&c&&c===p&&(u.leaveGuards.size||(u.leaveGuards=g.leaveGuards),u.updateGuards.size||(u.updateGuards=g.updateGuards))),c&&u&&(!g||!ja(u,g)||!p)&&(u.enterCallbacks[d]||[]).forEach(h=>h(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,d=a.value,p=d&&d.components[u];if(!p)return K3(n.default,{Component:p,route:c});const g=d.props[u],v=g?g===!0?c.params:typeof g=="function"?g(c):g:null,b=Gr(p,Pt({},v,t,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(d.instances[u]=null)},ref:s}));return K3(n.default,{Component:b,route:c})||b}}});function K3(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Ffe=kfe;function Lfe(e){const t=Ife(e.routes,e),n=e.parseQuery||ufe,o=e.stringifyQuery||D3,r=e.history,i=Ss(),l=Ss(),a=Ss(),s=oe(si);let c=si;aa&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=av.bind(null,X=>""+X),d=av.bind(null,Xde),p=av.bind(null,Ec);function g(X,J){let Z,G;return kE(X)?(Z=t.getRecordMatcher(X),G=J):G=X,t.addRoute(G,Z)}function v(X){const J=t.getRecordMatcher(X);J&&t.removeRoute(J)}function h(){return t.getRoutes().map(X=>X.record)}function b(X){return!!t.getRecordMatcher(X)}function y(X,J){if(J=Pt({},J||s.value),typeof X=="string"){const te=sv(n,X,J.path),ue=t.resolve({path:te.path},J),le=r.createHref(te.fullPath);return Pt(te,ue,{params:p(ue.params),hash:Ec(te.hash),redirectedFrom:void 0,href:le})}let Z;if(X.path!=null)Z=Pt({},X,{path:sv(n,X.path,J.path).path});else{const te=Pt({},X.params);for(const ue in te)te[ue]==null&&delete te[ue];Z=Pt({},X,{params:d(te)}),J.params=d(J.params)}const G=t.resolve(Z,J),q=X.hash||"";G.params=u(p(G.params));const V=qde(o,Pt({},X,{hash:Wde(q),path:G.path})),K=r.createHref(V);return Pt({fullPath:V,hash:q,query:o===D3?dfe(X.query):X.query||{}},G,{redirectedFrom:void 0,href:K})}function S(X){return typeof X=="string"?sv(n,X,s.value.path):Pt({},X)}function $(X,J){if(c!==X)return Va(Kt.NAVIGATION_CANCELLED,{from:J,to:X})}function x(X){return w(X)}function C(X){return x(Pt(S(X),{replace:!0}))}function O(X,J){const Z=X.matched[X.matched.length-1];if(Z&&Z.redirect){const{redirect:G}=Z;let q=typeof G=="function"?G(X,J):G;return typeof q=="string"&&(q=q.includes("?")||q.includes("#")?q=S(q):{path:q},q.params={}),Pt({query:X.query,hash:X.hash,params:q.path!=null?{}:X.params},q)}}function w(X,J){const Z=c=y(X),G=s.value,q=X.state,V=X.force,K=X.replace===!0,te=O(Z,G);if(te)return w(Pt(S(te),{state:typeof te=="object"?Pt({},q,te.state):q,force:V,replace:K}),J||Z);const ue=Z;ue.redirectedFrom=J;let le;return!V&&Zde(o,G,Z)&&(le=Va(Kt.NAVIGATION_DUPLICATED,{to:ue,from:G}),H(G,G,!0,!1)),(le?Promise.resolve(le):_(ue,G)).catch(ne=>Ir(ne)?Ir(ne,Kt.NAVIGATION_GUARD_REDIRECT)?ne:z(ne):k(ne,ue,G)).then(ne=>{if(ne){if(Ir(ne,Kt.NAVIGATION_GUARD_REDIRECT))return w(Pt({replace:K},S(ne.to),{state:typeof ne.to=="object"?Pt({},q,ne.to.state):q,force:V}),J||ue)}else ne=A(ue,G,!0,K,q);return M(ue,G,ne),ne})}function T(X,J){const Z=$(X,J);return Z?Promise.reject(Z):Promise.resolve()}function E(X){const J=Q.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(X):X()}function _(X,J){let Z;const[G,q,V]=pfe(X,J);Z=uv(G.reverse(),"beforeRouteLeave",X,J);for(const te of G)te.leaveGuards.forEach(ue=>{Z.push(vi(ue,X,J))});const K=T.bind(null,X,J);return Z.push(K),ee(Z).then(()=>{Z=[];for(const te of i.list())Z.push(vi(te,X,J));return Z.push(K),ee(Z)}).then(()=>{Z=uv(q,"beforeRouteUpdate",X,J);for(const te of q)te.updateGuards.forEach(ue=>{Z.push(vi(ue,X,J))});return Z.push(K),ee(Z)}).then(()=>{Z=[];for(const te of V)if(te.beforeEnter)if(Jo(te.beforeEnter))for(const ue of te.beforeEnter)Z.push(vi(ue,X,J));else Z.push(vi(te.beforeEnter,X,J));return Z.push(K),ee(Z)}).then(()=>(X.matched.forEach(te=>te.enterCallbacks={}),Z=uv(V,"beforeRouteEnter",X,J,E),Z.push(K),ee(Z))).then(()=>{Z=[];for(const te of l.list())Z.push(vi(te,X,J));return Z.push(K),ee(Z)}).catch(te=>Ir(te,Kt.NAVIGATION_CANCELLED)?te:Promise.reject(te))}function M(X,J,Z){a.list().forEach(G=>E(()=>G(X,J,Z)))}function A(X,J,Z,G,q){const V=$(X,J);if(V)return V;const K=J===si,te=aa?history.state:{};Z&&(G||K?r.replace(X.fullPath,Pt({scroll:K&&te&&te.scroll},q)):r.push(X.fullPath,q)),s.value=X,H(X,J,Z,K),z()}let R;function L(){R||(R=r.listen((X,J,Z)=>{if(!U.listening)return;const G=y(X),q=O(G,U.currentRoute.value);if(q){w(Pt(q,{replace:!0,force:!0}),G).catch(Js);return}c=G;const V=s.value;aa&&ife(R3(V.fullPath,Z.delta),Cg()),_(G,V).catch(K=>Ir(K,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_CANCELLED)?K:Ir(K,Kt.NAVIGATION_GUARD_REDIRECT)?(w(Pt(S(K.to),{force:!0}),G).then(te=>{Ir(te,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_DUPLICATED)&&!Z.delta&&Z.type===Qm.pop&&r.go(-1,!1)}).catch(Js),Promise.reject()):(Z.delta&&r.go(-Z.delta,!1),k(K,G,V))).then(K=>{K=K||A(G,V,!1),K&&(Z.delta&&!Ir(K,Kt.NAVIGATION_CANCELLED)?r.go(-Z.delta,!1):Z.type===Qm.pop&&Ir(K,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),M(G,V,K)}).catch(Js)}))}let P=Ss(),D=Ss(),N;function k(X,J,Z){z(X);const G=D.list();return G.length?G.forEach(q=>q(X,J,Z)):console.error(X),Promise.reject(X)}function F(){return N&&s.value!==si?Promise.resolve():new Promise((X,J)=>{P.add([X,J])})}function z(X){return N||(N=!X,L(),P.list().forEach(([J,Z])=>X?Z(X):J()),P.reset()),X}function H(X,J,Z,G){const{scrollBehavior:q}=e;if(!aa||!q)return Promise.resolve();const V=!Z&&lfe(R3(X.fullPath,0))||(G||!Z)&&history.state&&history.state.scroll||null;return rt().then(()=>q(X,J,V)).then(K=>K&&rfe(K)).catch(K=>k(K,X,J))}const j=X=>r.go(X);let Y;const Q=new Set,U={currentRoute:s,listening:!0,addRoute:g,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:b,getRoutes:h,resolve:y,options:e,push:x,replace:C,go:j,back:()=>j(-1),forward:()=>j(1),beforeEach:i.add,beforeResolve:l.add,afterEach:a.add,onError:D.add,isReady:F,install(X){X.component("RouterLink",Dfe),X.component("RouterView",Ffe),X.config.globalProperties.$router=U,Object.defineProperty(X.config.globalProperties,"$route",{enumerable:!0,get:()=>gt(s)}),aa&&!Y&&s.value===si&&(Y=!0,x(r.location).catch(G=>{}));const J={};for(const G in si)Object.defineProperty(J,G,{get:()=>s.value[G],enumerable:!0});X.provide(xg,U),X.provide(LE,b4(J)),X.provide(e0,s);const Z=X.unmount;Q.add(X),X.unmount=function(){Q.delete(X),Q.size<1&&(c=si,R&&R(),R=null,s.value=si,Y=!1,N=!1),Z()}}};function ee(X){return X.reduce((J,Z)=>J.then(()=>E(Z)),Promise.resolve())}return U}function zfe(){return je(xg)}const VE=M_("settings",{state:()=>({token:localStorage.getItem("admin_token")||"",serverConfig:{},browserConfig:{},workerConfig:[],poolConfig:{strategy:"least_busy",failover:{enabled:!1,maxRetries:3}},adapterConfig:{},adaptersMeta:[]}),actions:{setToken(e){this.token=e,e?localStorage.setItem("admin_token",e):localStorage.removeItem("admin_token")},getHeaders(){const e={"Content-Type":"application/json"};return this.token&&(e.Authorization=`Bearer ${this.token}`),e},async checkAuth(){try{return(await fetch("/admin/status",{headers:this.getHeaders()})).status!==401}catch{return!1}},async handleResponse(e,t){let n={};try{n=await e.json()}catch{}if(e.ok)return t&&Gn.success(t),{success:!0,data:n};{console.error("Request failed:",e.status,n);const o=n.error?.message||n.message||`请求未成功: ${e.status} ${e.statusText}`;return Dt.error({title:"保存失败",content:o,okText:"好的"}),{success:!1,data:n}}},async fetchServerConfig(){try{const e=await fetch("/admin/config/server",{headers:this.getHeaders()});e.ok&&(this.serverConfig=await e.json())}catch(e){console.error("Fetch server config failed",e)}},async saveServerConfig(e){try{const t=await fetch("/admin/config/server",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"服务器设置保存成功")).success)return this.serverConfig=e,!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1},async fetchBrowserConfig(){try{const e=await fetch("/admin/config/browser",{headers:this.getHeaders()});e.ok&&(this.browserConfig=await e.json())}catch(e){console.error("Fetch browser config failed",e)}},async saveBrowserConfig(e){try{const t=await fetch("/admin/config/browser",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"浏览器设置保存成功")).success)return this.browserConfig=e,!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1},async fetchWorkerConfig(){try{const e=await fetch("/admin/config/instances",{headers:this.getHeaders()});e.ok&&(this.workerConfig=await e.json())}catch(e){console.error("Fetch instance configuration failed",e)}},async saveWorkerConfig(e){try{const t=await fetch("/admin/config/instances",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"实例配置保存成功")).success)return this.workerConfig=e,!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1},async fetchPoolConfig(){try{const e=await fetch("/admin/config/pool",{headers:this.getHeaders()});if(e.ok){const t=await e.json();this.poolConfig={strategy:t.strategy||"least_busy",failover:{enabled:t.failover?.enabled||!1,maxRetries:t.failover?.maxRetries||3}}}}catch(e){console.error("Fetch pool config failed",e)}},async savePoolConfig(e){try{const t=await fetch("/admin/config/pool",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"工作池设置保存成功")).success)return this.poolConfig=e,!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1},async fetchAdaptersMeta(){try{const e=await fetch("/admin/adapters",{headers:this.getHeaders()});e.ok&&(this.adaptersMeta=await e.json())}catch(e){console.error("Fetch adapters meta failed",e)}},async fetchAdapterConfig(){try{const e=await fetch("/admin/config/adapters",{headers:this.getHeaders()});e.ok&&(this.adapterConfig=await e.json())}catch(e){console.error("Fetch adapter config failed",e)}},async saveAdapterConfig(e){try{const t=await fetch("/admin/config/adapters",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"适配器设置保存成功")).success)return this.adapterConfig={...this.adapterConfig,...e},!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1}}}),Hfe={style:{padding:"20px 0"}},jfe={style:{"text-align":"center","margin-bottom":"24px"}},Vfe={__name:"LoginModal",props:{visible:{type:Boolean,required:!0}},emits:["update:visible","success"],setup(e,{emit:t}){const n=t,o=VE(),r=re(o.token),i=re(!1),l=async()=>{if(!r.value){Gn.warning("请输入 Token");return}i.value=!0;try{const a=o.token;o.setToken(r.value),await o.checkAuth()?(Gn.success("验证成功"),n("success"),n("update:visible",!1)):(Gn.error("Token 验证失败,请检查是否正确"),o.setToken(a))}catch{Gn.error("验证过程发生错误")}finally{i.value=!1}};return(a,s)=>{const c=_t("a-avatar"),u=_t("a-input-password"),d=_t("a-form-item"),p=_t("a-button"),g=_t("a-form"),v=_t("a-modal");return Mt(),Ji(v,{open:e.visible,title:"需要身份验证",closable:!1,maskClosable:!1,footer:null,width:"400px",centered:""},{default:tt(()=>[xt("div",Hfe,[xt("div",jfe,[f(c,{size:64,style:{"background-color":"#1890ff"}},{icon:tt(()=>[f(gt(Gf))]),_:1}),s[1]||(s[1]=xt("div",{style:{"margin-top":"16px","font-size":"16px","font-weight":"500"}}," WebAI2API 管理面板 ",-1)),s[2]||(s[2]=xt("div",{style:{color:"#8c8c8c","margin-top":"8px"}}," 请输入访问 API Token 以继续 ",-1))]),f(g,{layout:"vertical"},{default:tt(()=>[f(d,{label:"API Token"},{default:tt(()=>[f(u,{value:r.value,"onUpdate:value":s[0]||(s[0]=h=>r.value=h),placeholder:"请输入 API Token",size:"large",onPressEnter:l},{prefix:tt(()=>[f(gt(Gf),{style:{color:"rgba(0,0,0,.25)"}})]),_:1},8,["value"])]),_:1}),f(p,{type:"primary",block:"",size:"large",loading:i.value,onClick:l},{default:tt(()=>[...s[3]||(s[3]=[vt(" 验证并登录 ",-1)])]),_:1},8,["loading"])]),_:1})])]),_:1},8,["open"])}}},Wfe=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Kfe={key:1},Gfe={href:"https://github.com/foxhui/WebAI2API",target:"_blank",style:{color:"#8c8c8c","font-size":"20px"}},Xfe={key:0},Ufe={style:{"margin-top":"8px","font-size":"12px",color:"#8c8c8c"}},Yfe={key:1},qfe={style:{"margin-top":"8px","font-size":"12px",color:"#ff4d4f"}},Zfe={key:2,style:{color:"#8c8c8c","font-size":"12px"}},Qfe={key:0},Jfe={style:{"margin-top":"8px","font-size":"12px",color:"#8c8c8c"}},epe={key:1},tpe={style:{"margin-top":"8px","font-size":"12px",color:"#ff4d4f"}},npe={key:2,style:{color:"#8c8c8c","font-size":"12px"}},ope={style:{"margin-bottom":"12px"}},rpe={style:{"margin-bottom":"12px"}},ipe={style:{"margin-bottom":"12px"}},lpe={style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"4px"}},ape={style:{margin:"0"}},spe={key:0,style:{"margin-top":"8px",display:"flex","flex-wrap":"wrap",gap:"4px"}},cpe={style:{"margin-bottom":"12px"}},upe={key:0},dpe={style:{"margin-bottom":"8px"}},fpe={key:0,style:{"font-size":"12px","max-height":"400px","overflow-y":"auto",background:"#fafafa",padding:"8px","border-radius":"4px"}},ppe={key:0,style:{"white-space":"pre-wrap","word-break":"break-all",margin:"0 0 8px 0"}},gpe={key:1,style:{display:"flex","flex-direction":"column",gap:"8px"}},hpe={style:{"font-size":"11px",color:"#8c8c8c","margin-bottom":"4px"}},vpe=["src","alt"],mpe={key:2,style:{display:"flex","flex-direction":"column",gap:"8px"}},bpe=["src"],ype={key:1},Spe={style:{"margin-top":"8px","font-size":"12px",color:"#ff4d4f"}},$pe={__name:"App",setup(e){const t=zfe(),n=VE(),o=re(["dash"]),r=re(!1),i=re(!1),l=re(!1),a=()=>{l.value=!0,n.setToken(""),setTimeout(()=>{l.value=!1,i.value=!0},500)},s=re(!1),c=re({models:{status:"pending",data:null,error:null},cookies:{status:"pending",data:null,error:null},chat:{status:"pending",data:null,error:null}}),u=re("Say hello in one word"),d=re(""),p=re([]),g=re([]),v=re(!1),h=re(""),b=async()=>{try{const L=await fetch("/v1/models",{headers:n.getHeaders()});if(L.ok){const P=await L.json();p.value=P.data||[],p.value.length>0&&!d.value&&(d.value=p.value[0].id)}}catch(L){console.error("获取模型列表失败",L)}},y=L=>new Promise((P,D)=>{const N=new FileReader;N.readAsDataURL(L),N.onload=()=>P(N.result),N.onerror=D}),S=L=>["image/png","image/jpeg","image/gif","image/webp"].includes(L.type)?(g.value.length>=10&&Gn.error("最多上传 10 张图片"),!1):(Gn.error("仅支持 PNG, JPEG, GIF, WebP 格式"),!1),$=async L=>{const P=L.file;if(P.status==="removed"){g.value=g.value.filter(D=>D.uid!==P.uid);return}try{const D=await y(P.originFileObj||P);g.value.push({uid:P.uid,name:P.name,base64:D})}catch{Gn.error("图片读取失败")}},x=L=>{const P=L.split(","),D=P[0].match(/:(.*?);/)[1],N=atob(P[1]);let k=N.length;const F=new Uint8Array(k);for(;k--;)F[k]=N.charCodeAt(k);return URL.createObjectURL(new Blob([F],{type:D}))},C=L=>{if(!L)return{text:"",images:[],videos:[]};if(L.trim().startsWith("data:video/"))try{const z=x(L.trim());return{text:"",images:[],videos:[{src:z,type:"video/mp4"}]}}catch(z){return console.error("视频转换失败",z),{text:L,images:[],videos:[]}}const P=/!\[([^\]]*)\]\(([^)]+)\)/g,D=[];let N,k=0,F=[];for(;(N=P.exec(L))!==null;)N.index>k&&F.push(L.substring(k,N.index)),D.push({alt:N[1]||"图片",src:N[2],type:"image"}),k=P.lastIndex;return k{c.value[L].status="loading",c.value[L].error=null,c.value[L].data=null,h.value="";try{let P,D;if(L==="models")P="/v1/models",D={headers:n.getHeaders()};else if(L==="cookies")P="/v1/cookies",D={headers:n.getHeaders()};else if(L==="chat"){P="/v1/chat/completions";let F;if(g.value.length>0){F=[{type:"text",text:u.value}];for(const z of g.value)F.push({type:"image_url",image_url:{url:z.base64}})}else F=u.value;if(D={method:"POST",headers:{...n.getHeaders(),"Content-Type":"application/json"},body:JSON.stringify({model:d.value,messages:[{role:"user",content:F}],stream:v.value})},v.value){const z=await fetch(P,D);if(!z.ok){const Q=await z.json();throw new Error(Q.error?.message||`HTTP ${z.status}`)}const H=z.body.getReader(),j=new TextDecoder;let Y="";for(;;){const{done:Q,value:U}=await H.read();if(Q)break;Y+=j.decode(U,{stream:!0});const ee=Y.split(` + `]:{opacity:1},[o]:{color:e.colorTextDescription,transition:`all ${e.motionDurationSlow}`},[`&:hover ${o}`]:{color:e.colorText}},[`${t}-icon ${o}`]:{color:e.colorTextDescription,fontSize:r},[`${l}-progress`]:{position:"absolute",bottom:-e.uploadProgressOffset,width:"100%",paddingInlineStart:r+e.paddingXS,fontSize:r,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[`${l}:hover ${s}`]:{opacity:1,color:e.colorText},[`${l}-error`]:{color:e.colorError,[`${l}-name, ${t}-icon ${o}`]:{color:e.colorError},[a]:{[`${o}, ${o}:hover`]:{color:e.colorError},[s]:{opacity:1}}},[`${t}-list-item-container`]:{transition:`opacity ${e.motionDurationSlow}, height ${e.motionDurationSlow}`,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}},s3=new ot("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),c3=new ot("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}}),Lce=e=>{const{componentCls:t}=e,n=`${t}-animate-inline`;return[{[`${t}-wrapper`]:{[`${n}-appear, ${n}-enter, ${n}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[`${n}-appear, ${n}-enter`]:{animationName:s3},[`${n}-leave`]:{animationName:c3}}},s3,c3]},zce=e=>{const{componentCls:t,iconCls:n,uploadThumbnailSize:o,uploadProgressOffset:r}=e,i=`${t}-list`,l=`${i}-item`;return{[`${t}-wrapper`]:{[`${i}${i}-picture, ${i}${i}-picture-card`]:{[l]:{position:"relative",height:o+e.lineWidth*2+e.paddingXS*2,padding:e.paddingXS,border:`${e.lineWidth}px ${e.lineType} ${e.colorBorder}`,borderRadius:e.borderRadiusLG,"&:hover":{background:"transparent"},[`${l}-thumbnail`]:m(m({},Yt),{width:o,height:o,lineHeight:`${o+e.paddingSM}px`,textAlign:"center",flex:"none",[n]:{fontSize:e.fontSizeHeading2,color:e.colorPrimary},img:{display:"block",width:"100%",height:"100%",overflow:"hidden"}}),[`${l}-progress`]:{bottom:r,width:`calc(100% - ${e.paddingSM*2}px)`,marginTop:0,paddingInlineStart:o+e.paddingXS}},[`${l}-error`]:{borderColor:e.colorError,[`${l}-thumbnail ${n}`]:{"svg path[fill='#e6f7ff']":{fill:e.colorErrorBg},"svg path[fill='#1890ff']":{fill:e.colorError}}},[`${l}-uploading`]:{borderStyle:"dashed",[`${l}-name`]:{marginBottom:r}}}}}},Hce=e=>{const{componentCls:t,iconCls:n,fontSizeLG:o,colorTextLightSolid:r}=e,i=`${t}-list`,l=`${i}-item`,a=e.uploadPicCardSize;return{[`${t}-wrapper${t}-picture-card-wrapper`]:m(m({},qo()),{display:"inline-block",width:"100%",[`${t}${t}-select`]:{width:a,height:a,marginInlineEnd:e.marginXS,marginBottom:e.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:`${e.lineWidth}px dashed ${e.colorBorder}`,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:`border-color ${e.motionDurationSlow}`,[`> ${t}`]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimary}},[`${i}${i}-picture-card`]:{[`${i}-item-container`]:{display:"inline-block",width:a,height:a,marginBlock:`0 ${e.marginXS}px`,marginInline:`0 ${e.marginXS}px`,verticalAlign:"top"},"&::after":{display:"none"},[l]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${e.paddingXS*2}px)`,height:`calc(100% - ${e.paddingXS*2}px)`,backgroundColor:e.colorBgMask,opacity:0,transition:`all ${e.motionDurationSlow}`,content:'" "'}},[`${l}:hover`]:{[`&::before, ${l}-actions`]:{opacity:1}},[`${l}-actions`]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:`all ${e.motionDurationSlow}`,[`${n}-eye, ${n}-download, ${n}-delete`]:{zIndex:10,width:o,margin:`0 ${e.marginXXS}px`,fontSize:o,cursor:"pointer",transition:`all ${e.motionDurationSlow}`}},[`${l}-actions, ${l}-actions:hover`]:{[`${n}-eye, ${n}-download, ${n}-delete`]:{color:new ht(r).setAlpha(.65).toRgbString(),"&:hover":{color:r}}},[`${l}-thumbnail, ${l}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[`${l}-name`]:{display:"none",textAlign:"center"},[`${l}-file + ${l}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${e.paddingXS*2}px)`},[`${l}-uploading`]:{[`&${l}`]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[`${l}-progress`]:{bottom:e.marginXL,width:`calc(100% - ${e.paddingXS*2}px)`,paddingInlineStart:0}}})}},jce=e=>{const{componentCls:t}=e;return{[`${t}-rtl`]:{direction:"rtl"}}},Vce=e=>{const{componentCls:t,colorTextDisabled:n}=e;return{[`${t}-wrapper`]:m(m({},Ue(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[`${t}-select`]:{display:"inline-block"},[`${t}-disabled`]:{color:n,cursor:"not-allowed"}})}},Wce=Ke("Upload",e=>{const{fontSizeHeading3:t,fontSize:n,lineHeight:o,lineWidth:r,controlHeightLG:i}=e,l=Math.round(n*o),a=ke(e,{uploadThumbnailSize:t*2,uploadProgressOffset:l/2+r,uploadPicCardSize:i*2.55});return[Vce(a),kce(a),zce(a),Hce(a),Fce(a),Lce(a),jce(a),Fc(a)]});var Kce=function(e,t,n,o){function r(i){return i instanceof n?i:new n(function(l){l(i)})}return new(n||(n=Promise))(function(i,l){function a(u){try{c(o.next(u))}catch(d){l(d)}}function s(u){try{c(o.throw(u))}catch(d){l(d)}}function c(u){u.done?i(u.value):r(u.value).then(a,s)}c((o=o.apply(e,t||[])).next())})},Gce=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{var M;return(M=s.value)!==null&&M!==void 0?M:d.value}),[g,v]=Tt(e.defaultFileList||[],{value:ze(e,"fileList"),postState:M=>{const A=Date.now();return(M??[]).map((R,L)=>(!R.uid&&!Object.isFrozen(R)&&(R.uid=`__AUTO__${A}_${L}__`),R))}}),h=re("drop"),b=re(null);We(()=>{Ot(e.fileList!==void 0||o.value===void 0,"Upload","`value` is not a valid prop, do you mean `fileList`?"),Ot(e.transformFile===void 0,"Upload","`transformFile` is deprecated. Please use `beforeUpload` directly."),Ot(e.remove===void 0,"Upload","`remove` props is deprecated. Please use `remove` event.")});const y=(M,A,R)=>{var L,P;let D=[...A];e.maxCount===1?D=D.slice(-1):e.maxCount&&(D=D.slice(0,e.maxCount)),v(D);const N={file:M,fileList:D};R&&(N.event=R),(L=e["onUpdate:fileList"])===null||L===void 0||L.call(e,N.fileList),(P=e.onChange)===null||P===void 0||P.call(e,N),i.onFieldChange()},S=(M,A)=>Kce(this,void 0,void 0,function*(){const{beforeUpload:R,transformFile:L}=e;let P=M;if(R){const D=yield R(M,A);if(D===!1)return!1;if(delete M[Ps],D===Ps)return Object.defineProperty(M,Ps,{value:!0,configurable:!0}),!1;typeof D=="object"&&D&&(P=D)}return L&&(P=yield L(P)),P}),$=M=>{const A=M.filter(P=>!P.file[Ps]);if(!A.length)return;const R=A.map(P=>Fu(P.file));let L=[...g.value];R.forEach(P=>{L=Lu(P,L)}),R.forEach((P,D)=>{let N=P;if(A[D].parsedFile)P.status="uploading";else{const{originFileObj:k}=P;let F;try{F=new File([k],k.name,{type:k.type})}catch{F=new Blob([k],{type:k.type}),F.name=k.name,F.lastModifiedDate=new Date,F.lastModified=new Date().getTime()}F.uid=P.uid,N=F}y(N,L)})},x=(M,A,R)=>{try{typeof M=="string"&&(M=JSON.parse(M))}catch{}if(!ov(A,g.value))return;const L=Fu(A);L.status="done",L.percent=100,L.response=M,L.xhr=R;const P=Lu(L,g.value);y(L,P)},C=(M,A)=>{if(!ov(A,g.value))return;const R=Fu(A);R.status="uploading",R.percent=M.percent;const L=Lu(R,g.value);y(R,L,M)},O=(M,A,R)=>{if(!ov(R,g.value))return;const L=Fu(R);L.error=M,L.response=A,L.status="error";const P=Lu(L,g.value);y(L,P)},w=M=>{let A;const R=e.onRemove||e.remove;Promise.resolve(typeof R=="function"?R(M):R).then(L=>{var P,D;if(L===!1)return;const N=Ice(M,g.value);N&&(A=m(m({},M),{status:"removed"}),(P=g.value)===null||P===void 0||P.forEach(k=>{const F=A.uid!==void 0?"uid":"name";k[F]===A[F]&&!Object.isFrozen(k)&&(k.status="removed")}),(D=b.value)===null||D===void 0||D.abort(A),y(A,N))})},T=M=>{var A;h.value=M.type,M.type==="drop"&&((A=e.onDrop)===null||A===void 0||A.call(e,M))};r({onBatchStart:$,onSuccess:x,onProgress:C,onError:O,fileList:g,upload:b});const[E]=ko("Upload",Un.Upload,I(()=>e.locale)),_=(M,A)=>{const{removeIcon:R,previewIcon:L,downloadIcon:P,previewFile:D,onPreview:N,onDownload:k,isImageUrl:F,progress:z,itemRender:H,iconRender:j,showUploadList:Y}=e,{showDownloadIcon:Q,showPreviewIcon:U,showRemoveIcon:ee}=typeof Y=="boolean"?{}:Y;return Y?f(Bce,{prefixCls:l.value,listType:e.listType,items:g.value,previewFile:D,onPreview:N,onDownload:k,onRemove:w,showRemoveIcon:!p.value&&ee,showPreviewIcon:U,showDownloadIcon:Q,removeIcon:R,previewIcon:L,downloadIcon:P,iconRender:j,locale:E.value,isImageUrl:F,progress:z,itemRender:H,appendActionVisible:A,appendAction:M},m({},n)):M?.()};return()=>{var M,A,R;const{listType:L,type:P}=e,{class:D,style:N}=o,k=Gce(o,["class","style"]),F=m(m(m({onBatchStart:$,onError:O,onProgress:C,onSuccess:x},k),e),{id:(M=e.id)!==null&&M!==void 0?M:i.id.value,prefixCls:l.value,beforeUpload:S,onChange:void 0,disabled:p.value});delete F.remove,(!n.default||p.value)&&delete F.id;const z={[`${l.value}-rtl`]:a.value==="rtl"};if(P==="drag"){const Q=ae(l.value,{[`${l.value}-drag`]:!0,[`${l.value}-drag-uploading`]:g.value.some(U=>U.status==="uploading"),[`${l.value}-drag-hover`]:h.value==="dragover",[`${l.value}-disabled`]:p.value,[`${l.value}-rtl`]:a.value==="rtl"},o.class,u.value);return c(f("span",B(B({},o),{},{class:ae(`${l.value}-wrapper`,z,D,u.value)}),[f("div",{class:Q,onDrop:T,onDragover:T,onDragleave:T,style:o.style},[f(o3,B(B({},F),{},{ref:b,class:`${l.value}-btn`}),B({default:()=>[f("div",{class:`${l.value}-drag-container`},[(A=n.default)===null||A===void 0?void 0:A.call(n)])]},n))]),_()]))}const H=ae(l.value,{[`${l.value}-select`]:!0,[`${l.value}-select-${L}`]:!0,[`${l.value}-disabled`]:p.value,[`${l.value}-rtl`]:a.value==="rtl"}),j=$t((R=n.default)===null||R===void 0?void 0:R.call(n)),Y=Q=>f("div",{class:H,style:Q},[f(o3,B(B({},F),{},{ref:b}),n)]);return c(L==="picture-card"?f("span",B(B({},o),{},{class:ae(`${l.value}-wrapper`,`${l.value}-picture-card-wrapper`,z,o.class,u.value)}),[_(Y,!!(j&&j.length))]):f("span",B(B({},o),{},{class:ae(`${l.value}-wrapper`,z,o.class,u.value)}),[Y(j&&j.length?void 0:{display:"none"}),_()]))}}});var u3=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{const{height:r}=e,i=u3(e,["height"]),{style:l}=o,a=u3(o,["style"]),s=m(m(m({},i),a),{type:"drag",style:m(m({},l),{height:typeof r=="number"?`${r}px`:r})});return f(Nd,s,n)}}}),Xce=Bd,Uce=m(Nd,{Dragger:Bd,LIST_IGNORE:Ps,install(e){return e.component(Nd.name,Nd),e.component(Bd.name,Bd),e}});function Yce(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function qce(e){return Object.keys(e).map(t=>`${Yce(t)}: ${e[t]};`).join(" ")}function d3(){return window.devicePixelRatio||1}function rv(e,t,n,o){e.translate(t,n),e.rotate(Math.PI/180*Number(o)),e.translate(-t,-n)}const Zce=(e,t)=>{let n=!1;return e.removedNodes.length&&(n=Array.from(e.removedNodes).some(o=>o===t)),e.type==="attributes"&&e.target===t&&(n=!0),n};var Qce=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r2&&arguments[2]!==void 0?arguments[2]:{};const{window:o=W8}=n,r=Qce(n,["window"]);let i;const l=j8(()=>o&&"MutationObserver"in o),a=()=>{i&&(i.disconnect(),i=void 0)},s=ye(()=>ay(e),u=>{a(),l.value&&o&&u&&(i=new MutationObserver(t),i.observe(u,r))},{immediate:!0}),c=()=>{a(),s()};return H8(c),{isSupported:l,stop:c}}const iv=2,f3=3,eue=()=>({zIndex:Number,rotate:Number,width:Number,height:Number,image:String,content:Fe([String,Array]),font:De(),rootClassName:String,gap:at(),offset:at()}),tue=ie({name:"AWatermark",inheritAttrs:!1,props:Ze(eue(),{zIndex:9,rotate:-22,font:{},gap:[100,100]}),setup(e,t){let{slots:n,attrs:o}=t;const[,r]=Zr(),i=oe(),l=oe(),a=oe(!1),s=I(()=>{var _,M;return(M=(_=e.gap)===null||_===void 0?void 0:_[0])!==null&&M!==void 0?M:100}),c=I(()=>{var _,M;return(M=(_=e.gap)===null||_===void 0?void 0:_[1])!==null&&M!==void 0?M:100}),u=I(()=>s.value/2),d=I(()=>c.value/2),p=I(()=>{var _,M;return(M=(_=e.offset)===null||_===void 0?void 0:_[0])!==null&&M!==void 0?M:u.value}),g=I(()=>{var _,M;return(M=(_=e.offset)===null||_===void 0?void 0:_[1])!==null&&M!==void 0?M:d.value}),v=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.fontSize)!==null&&M!==void 0?M:r.value.fontSizeLG}),h=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.fontWeight)!==null&&M!==void 0?M:"normal"}),b=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.fontStyle)!==null&&M!==void 0?M:"normal"}),y=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.fontFamily)!==null&&M!==void 0?M:"sans-serif"}),S=I(()=>{var _,M;return(M=(_=e.font)===null||_===void 0?void 0:_.color)!==null&&M!==void 0?M:r.value.colorFill}),$=I(()=>{var _;const M={zIndex:(_=e.zIndex)!==null&&_!==void 0?_:9,position:"absolute",left:0,top:0,width:"100%",height:"100%",pointerEvents:"none",backgroundRepeat:"repeat"};let A=p.value-u.value,R=g.value-d.value;return A>0&&(M.left=`${A}px`,M.width=`calc(100% - ${A}px)`,A=0),R>0&&(M.top=`${R}px`,M.height=`calc(100% - ${R}px)`,R=0),M.backgroundPosition=`${A}px ${R}px`,M}),x=()=>{l.value&&(l.value.remove(),l.value=void 0)},C=(_,M)=>{var A;i.value&&l.value&&(a.value=!0,l.value.setAttribute("style",qce(m(m({},$.value),{backgroundImage:`url('${_}')`,backgroundSize:`${(s.value+M)*iv}px`}))),(A=i.value)===null||A===void 0||A.append(l.value),setTimeout(()=>{a.value=!1}))},O=_=>{let M=120,A=64;const R=e.content,L=e.image,P=e.width,D=e.height;if(!L&&_.measureText){_.font=`${Number(v.value)}px ${y.value}`;const N=Array.isArray(R)?R:[R],k=N.map(F=>_.measureText(F).width);M=Math.ceil(Math.max(...k)),A=Number(v.value)*N.length+(N.length-1)*f3}return[P??M,D??A]},w=(_,M,A,R,L)=>{const P=d3(),D=e.content,N=Number(v.value)*P;_.font=`${b.value} normal ${h.value} ${N}px/${L}px ${y.value}`,_.fillStyle=S.value,_.textAlign="center",_.textBaseline="top",_.translate(R/2,0);const k=Array.isArray(D)?D:[D];k?.forEach((F,z)=>{_.fillText(F??"",M,A+z*(N+f3*P))})},T=()=>{var _;const M=document.createElement("canvas"),A=M.getContext("2d"),R=e.image,L=(_=e.rotate)!==null&&_!==void 0?_:-22;if(A){l.value||(l.value=document.createElement("div"));const P=d3(),[D,N]=O(A),k=(s.value+D)*P,F=(c.value+N)*P;M.setAttribute("width",`${k*iv}px`),M.setAttribute("height",`${F*iv}px`);const z=s.value*P/2,H=c.value*P/2,j=D*P,Y=N*P,Q=(j+s.value*P)/2,U=(Y+c.value*P)/2,ee=z+k,X=H+F,J=Q+k,Z=U+F;if(A.save(),rv(A,Q,U,L),R){const G=new Image;G.onload=()=>{A.drawImage(G,z,H,j,Y),A.restore(),rv(A,J,Z,L),A.drawImage(G,ee,X,j,Y),C(M.toDataURL(),D)},G.crossOrigin="anonymous",G.referrerPolicy="no-referrer",G.src=R}else w(A,z,H,j,Y),A.restore(),rv(A,J,Z,L),w(A,ee,X,j,Y),C(M.toDataURL(),D)}};return We(()=>{T()}),ye(()=>[e,r.value.colorFill,r.value.fontSizeLG],()=>{T()},{deep:!0,flush:"post"}),Qe(()=>{x()}),Jce(i,_=>{a.value||_.forEach(M=>{Zce(M,l.value)&&(x(),T())})},{attributes:!0,subtree:!0,childList:!0,attributeFilter:["style","class"]}),()=>{var _;return f("div",B(B({},o),{},{ref:i,class:[o.class,e.rootClassName],style:[{position:"relative"},o.style]}),[(_=n.default)===null||_===void 0?void 0:_.call(n)])}}}),nue=Et(tue);function p3(e,t){return{[`${e}, ${e}:hover, ${e}:focus`]:{color:t.colorTextDisabled,cursor:"not-allowed"}}}function g3(e){return{backgroundColor:e.bgColorSelected,boxShadow:e.boxShadow}}const oue=m({overflow:"hidden"},Yt),rue=e=>{const{componentCls:t}=e;return{[t]:m(m(m(m(m({},Ue(e)),{display:"inline-block",padding:e.segmentedContainerPadding,color:e.labelColor,backgroundColor:e.bgColor,borderRadius:e.borderRadius,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,[`${t}-group`]:{position:"relative",display:"flex",alignItems:"stretch",justifyItems:"flex-start",width:"100%"},[`&${t}-rtl`]:{direction:"rtl"},[`&${t}-block`]:{display:"flex"},[`&${t}-block ${t}-item`]:{flex:1,minWidth:0},[`${t}-item`]:{position:"relative",textAlign:"center",cursor:"pointer",transition:`color ${e.motionDurationMid} ${e.motionEaseInOut}`,borderRadius:e.borderRadiusSM,"&-selected":m(m({},g3(e)),{color:e.labelColorHover}),"&::after":{content:'""',position:"absolute",width:"100%",height:"100%",top:0,insetInlineStart:0,borderRadius:"inherit",transition:`background-color ${e.motionDurationMid}`,pointerEvents:"none"},[`&:hover:not(${t}-item-selected):not(${t}-item-disabled)`]:{color:e.labelColorHover,"&::after":{backgroundColor:e.bgColorHover}},"&-label":m({minHeight:e.controlHeight-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeight-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`},oue),"&-icon + *":{marginInlineStart:e.marginSM/2},"&-input":{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:0,opacity:0,pointerEvents:"none"}},[`${t}-thumb`]:m(m({},g3(e)),{position:"absolute",insetBlockStart:0,insetInlineStart:0,width:0,height:"100%",padding:`${e.paddingXXS}px 0`,borderRadius:e.borderRadiusSM,[`& ~ ${t}-item:not(${t}-item-selected):not(${t}-item-disabled)::after`]:{backgroundColor:"transparent"}}),[`&${t}-lg`]:{borderRadius:e.borderRadiusLG,[`${t}-item-label`]:{minHeight:e.controlHeightLG-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightLG-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontal}px`,fontSize:e.fontSizeLG},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadius}},[`&${t}-sm`]:{borderRadius:e.borderRadiusSM,[`${t}-item-label`]:{minHeight:e.controlHeightSM-e.segmentedContainerPadding*2,lineHeight:`${e.controlHeightSM-e.segmentedContainerPadding*2}px`,padding:`0 ${e.segmentedPaddingHorizontalSM}px`},[`${t}-item, ${t}-thumb`]:{borderRadius:e.borderRadiusXS}}}),p3(`&-disabled ${t}-item`,e)),p3(`${t}-item-disabled`,e)),{[`${t}-thumb-motion-appear-active`]:{transition:`transform ${e.motionDurationSlow} ${e.motionEaseInOut}, width ${e.motionDurationSlow} ${e.motionEaseInOut}`,willChange:"transform, width"}})}},iue=Ke("Segmented",e=>{const{lineWidthBold:t,lineWidth:n,colorTextLabel:o,colorText:r,colorFillSecondary:i,colorBgLayout:l,colorBgElevated:a}=e,s=ke(e,{segmentedPaddingHorizontal:e.controlPaddingHorizontal-n,segmentedPaddingHorizontalSM:e.controlPaddingHorizontalSM-n,segmentedContainerPadding:t,labelColor:o,labelColorHover:r,bgColor:l,bgColorHover:i,bgColorSelected:a});return[rue(s)]}),h3=e=>e?{left:e.offsetLeft,right:e.parentElement.clientWidth-e.clientWidth-e.offsetLeft,width:e.clientWidth}:null,ta=e=>e!==void 0?`${e}px`:void 0,lue=ie({props:{value:Ct(),getValueIndex:Ct(),prefixCls:Ct(),motionName:Ct(),onMotionStart:Ct(),onMotionEnd:Ct(),direction:Ct(),containerRef:Ct()},emits:["motionStart","motionEnd"],setup(e,t){let{emit:n}=t;const o=re(),r=v=>{var h;const b=e.getValueIndex(v),y=(h=e.containerRef.value)===null||h===void 0?void 0:h.querySelectorAll(`.${e.prefixCls}-item`)[b];return y?.offsetParent&&y},i=re(null),l=re(null);ye(()=>e.value,(v,h)=>{const b=r(h),y=r(v),S=h3(b),$=h3(y);i.value=S,l.value=$,n(b&&y?"motionStart":"motionEnd")},{flush:"post"});const a=I(()=>{var v,h;return e.direction==="rtl"?ta(-((v=i.value)===null||v===void 0?void 0:v.right)):ta((h=i.value)===null||h===void 0?void 0:h.left)}),s=I(()=>{var v,h;return e.direction==="rtl"?ta(-((v=l.value)===null||v===void 0?void 0:v.right)):ta((h=l.value)===null||h===void 0?void 0:h.left)});let c;const u=v=>{clearTimeout(c),rt(()=>{v&&(v.style.transform="translateX(var(--thumb-start-left))",v.style.width="var(--thumb-start-width)")})},d=v=>{c=setTimeout(()=>{v&&($f(v,`${e.motionName}-appear-active`),v.style.transform="translateX(var(--thumb-active-left))",v.style.width="var(--thumb-active-width)")})},p=v=>{i.value=null,l.value=null,v&&(v.style.transform=null,v.style.width=null,Cf(v,`${e.motionName}-appear-active`)),n("motionEnd")},g=I(()=>{var v,h;return{"--thumb-start-left":a.value,"--thumb-start-width":ta((v=i.value)===null||v===void 0?void 0:v.width),"--thumb-active-left":s.value,"--thumb-active-width":ta((h=l.value)===null||h===void 0?void 0:h.width)}});return Qe(()=>{clearTimeout(c)}),()=>{const v={ref:o,style:g.value,class:[`${e.prefixCls}-thumb`]};return f(pn,{appear:!0,onBeforeEnter:u,onEnter:d,onAfterEnter:p},{default:()=>[!i.value||!l.value?null:f("div",v,null)]})}}});function aue(e){return e.map(t=>typeof t=="object"&&t!==null?t:{label:t?.toString(),title:t?.toString(),value:t})}const sue=()=>({prefixCls:String,options:at(),block:$e(),disabled:$e(),size:Ne(),value:m(m({},Fe([String,Number])),{required:!0}),motionName:String,onChange:ve(),"onUpdate:value":ve()}),pE=(e,t)=>{let{slots:n,emit:o}=t;const{value:r,disabled:i,payload:l,title:a,prefixCls:s,label:c=n.label,checked:u,className:d}=e,p=g=>{i||o("change",g,r)};return f("label",{class:ae({[`${s}-item-disabled`]:i},d)},[f("input",{class:`${s}-item-input`,type:"radio",disabled:i,checked:u,onChange:p},null),f("div",{class:`${s}-item-label`,title:typeof a=="string"?a:""},[typeof c=="function"?c({value:r,disabled:i,payload:l,title:a}):c??r])])};pE.inheritAttrs=!1;const cue=ie({name:"ASegmented",inheritAttrs:!1,props:Ze(sue(),{options:[],motionName:"thumb-motion"}),slots:Object,setup(e,t){let{emit:n,slots:o,attrs:r}=t;const{prefixCls:i,direction:l,size:a}=Te("segmented",e),[s,c]=iue(i),u=oe(),d=oe(!1),p=I(()=>aue(e.options)),g=(v,h)=>{e.disabled||(n("update:value",h),n("change",h))};return()=>{const v=i.value;return s(f("div",B(B({},r),{},{class:ae(v,{[c.value]:!0,[`${v}-block`]:e.block,[`${v}-disabled`]:e.disabled,[`${v}-lg`]:a.value=="large",[`${v}-sm`]:a.value=="small",[`${v}-rtl`]:l.value==="rtl"},r.class),ref:u}),[f("div",{class:`${v}-group`},[f(lue,{containerRef:u,prefixCls:v,value:e.value,motionName:`${v}-${e.motionName}`,direction:l.value,getValueIndex:h=>p.value.findIndex(b=>b.value===h),onMotionStart:()=>{d.value=!0},onMotionEnd:()=>{d.value=!1}},null),p.value.map(h=>f(pE,B(B({key:h.value,prefixCls:v,checked:h.value===e.value,onChange:g},h),{},{className:ae(h.className,`${v}-item`,{[`${v}-item-selected`]:h.value===e.value&&!d.value}),disabled:!!e.disabled||!!h.disabled}),o))])]))}}}),uue=Et(cue),due=e=>{const{componentCls:t}=e;return{[t]:m(m({},Ue(e)),{display:"flex",justifyContent:"center",alignItems:"center",padding:e.paddingSM,backgroundColor:e.colorWhite,borderRadius:e.borderRadiusLG,border:`${e.lineWidth}px ${e.lineType} ${e.colorSplit}`,position:"relative",width:"100%",height:"100%",overflow:"hidden",[`& > ${t}-mask`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,zIndex:10,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",color:e.colorText,lineHeight:e.lineHeight,background:e.QRCodeMaskBackgroundColor,textAlign:"center",[`& > ${t}-expired , & > ${t}-scanned`]:{color:e.QRCodeTextColor}},"&-icon":{marginBlockEnd:e.marginXS,fontSize:e.controlHeight}}),[`${t}-borderless`]:{borderColor:"transparent"}}},fue=Ke("QRCode",e=>due(ke(e,{QRCodeTextColor:"rgba(0, 0, 0, 0.88)",QRCodeMaskBackgroundColor:"rgba(255, 255, 255, 0.96)"})));var pue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M917.7 148.8l-42.4-42.4c-1.6-1.6-3.6-2.3-5.7-2.3s-4.1.8-5.7 2.3l-76.1 76.1a199.27 199.27 0 00-112.1-34.3c-51.2 0-102.4 19.5-141.5 58.6L432.3 308.7a8.03 8.03 0 000 11.3L704 591.7c1.6 1.6 3.6 2.3 5.7 2.3 2 0 4.1-.8 5.7-2.3l101.9-101.9c68.9-69 77-175.7 24.3-253.5l76.1-76.1c3.1-3.2 3.1-8.3 0-11.4zM769.1 441.7l-59.4 59.4-186.8-186.8 59.4-59.4c24.9-24.9 58.1-38.7 93.4-38.7 35.3 0 68.4 13.7 93.4 38.7 24.9 24.9 38.7 58.1 38.7 93.4 0 35.3-13.8 68.4-38.7 93.4zm-190.2 105a8.03 8.03 0 00-11.3 0L501 613.3 410.7 523l66.7-66.7c3.1-3.1 3.1-8.2 0-11.3L441 408.6a8.03 8.03 0 00-11.3 0L363 475.3l-43-43a7.85 7.85 0 00-5.7-2.3c-2 0-4.1.8-5.7 2.3L206.8 534.2c-68.9 69-77 175.7-24.3 253.5l-76.1 76.1a8.03 8.03 0 000 11.3l42.4 42.4c1.6 1.6 3.6 2.3 5.7 2.3s4.1-.8 5.7-2.3l76.1-76.1c33.7 22.9 72.9 34.3 112.1 34.3 51.2 0 102.4-19.5 141.5-58.6l101.9-101.9c3.1-3.1 3.1-8.2 0-11.3l-43-43 66.7-66.7c3.1-3.1 3.1-8.2 0-11.3l-36.6-36.2zM441.7 769.1a131.32 131.32 0 01-93.4 38.7c-35.3 0-68.4-13.7-93.4-38.7a131.32 131.32 0 01-38.7-93.4c0-35.3 13.7-68.4 38.7-93.4l59.4-59.4 186.8 186.8-59.4 59.4z"}}]},name:"api",theme:"outlined"};function v3(e){for(var t=1;t({size:{type:Number,default:160},value:{type:String,required:!0},type:Ne("canvas"),color:String,bgColor:String,includeMargin:Boolean,imageSettings:De()}),Rue=()=>m(m({},D1()),{errorLevel:Ne("M"),icon:String,iconSize:{type:Number,default:40},status:Ne("active"),bordered:{type:Boolean,default:!0}});var Eo;(function(e){class t{static encodeText(a,s){const c=e.QrSegment.makeSegments(a);return t.encodeSegments(c,s)}static encodeBinary(a,s){const c=e.QrSegment.makeBytes(a);return t.encodeSegments([c],s)}static encodeSegments(a,s){let c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,u=arguments.length>3&&arguments[3]!==void 0?arguments[3]:40,d=arguments.length>4&&arguments[4]!==void 0?arguments[4]:-1,p=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!0;if(!(t.MIN_VERSION<=c&&c<=u&&u<=t.MAX_VERSION)||d<-1||d>7)throw new RangeError("Invalid value");let g,v;for(g=c;;g++){const S=t.getNumDataCodewords(g,s)*8,$=i.getTotalBits(a,g);if($<=S){v=$;break}if(g>=u)throw new RangeError("Data too long")}for(const S of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])p&&v<=t.getNumDataCodewords(g,S)*8&&(s=S);const h=[];for(const S of a){n(S.mode.modeBits,4,h),n(S.numChars,S.mode.numCharCountBits(g),h);for(const $ of S.getData())h.push($)}r(h.length==v);const b=t.getNumDataCodewords(g,s)*8;r(h.length<=b),n(0,Math.min(4,b-h.length),h),n(0,(8-h.length%8)%8,h),r(h.length%8==0);for(let S=236;h.lengthy[$>>>3]|=S<<7-($&7)),new t(g,s,y,d)}constructor(a,s,c,u){if(this.version=a,this.errorCorrectionLevel=s,this.modules=[],this.isFunction=[],at.MAX_VERSION)throw new RangeError("Version value out of range");if(u<-1||u>7)throw new RangeError("Mask value out of range");this.size=a*4+17;const d=[];for(let g=0;g>>9)*1335;const u=(s<<10|c)^21522;r(u>>>15==0);for(let d=0;d<=5;d++)this.setFunctionModule(8,d,o(u,d));this.setFunctionModule(8,7,o(u,6)),this.setFunctionModule(8,8,o(u,7)),this.setFunctionModule(7,8,o(u,8));for(let d=9;d<15;d++)this.setFunctionModule(14-d,8,o(u,d));for(let d=0;d<8;d++)this.setFunctionModule(this.size-1-d,8,o(u,d));for(let d=8;d<15;d++)this.setFunctionModule(8,this.size-15+d,o(u,d));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let a=this.version;for(let c=0;c<12;c++)a=a<<1^(a>>>11)*7973;const s=this.version<<12|a;r(s>>>18==0);for(let c=0;c<18;c++){const u=o(s,c),d=this.size-11+c%3,p=Math.floor(c/3);this.setFunctionModule(d,p,u),this.setFunctionModule(p,d,u)}}drawFinderPattern(a,s){for(let c=-4;c<=4;c++)for(let u=-4;u<=4;u++){const d=Math.max(Math.abs(u),Math.abs(c)),p=a+u,g=s+c;0<=p&&p{(S!=v-d||x>=g)&&y.push($[S])});return r(y.length==p),y}drawCodewords(a){if(a.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let s=0;for(let c=this.size-1;c>=1;c-=2){c==6&&(c=5);for(let u=0;u>>3],7-(s&7)),s++)}}r(s==a.length*8)}applyMask(a){if(a<0||a>7)throw new RangeError("Mask value out of range");for(let s=0;s5&&a++):(this.finderPenaltyAddHistory(g,v),p||(a+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),p=this.modules[d][h],g=1);a+=this.finderPenaltyTerminateAndCount(p,g,v)*t.PENALTY_N3}for(let d=0;d5&&a++):(this.finderPenaltyAddHistory(g,v),p||(a+=this.finderPenaltyCountPatterns(v)*t.PENALTY_N3),p=this.modules[h][d],g=1);a+=this.finderPenaltyTerminateAndCount(p,g,v)*t.PENALTY_N3}for(let d=0;dp+(g?1:0),s);const c=this.size*this.size,u=Math.ceil(Math.abs(s*20-c*10)/c)-1;return r(0<=u&&u<=9),a+=u*t.PENALTY_N4,r(0<=a&&a<=2568888),a}getAlignmentPatternPositions(){if(this.version==1)return[];{const a=Math.floor(this.version/7)+2,s=this.version==32?26:Math.ceil((this.version*4+4)/(a*2-2))*2,c=[6];for(let u=this.size-7;c.lengtht.MAX_VERSION)throw new RangeError("Version number out of range");let s=(16*a+128)*a+64;if(a>=2){const c=Math.floor(a/7)+2;s-=(25*c-10)*c-55,a>=7&&(s-=36)}return r(208<=s&&s<=29648),s}static getNumDataCodewords(a,s){return Math.floor(t.getNumRawDataModules(a)/8)-t.ECC_CODEWORDS_PER_BLOCK[s.ordinal][a]*t.NUM_ERROR_CORRECTION_BLOCKS[s.ordinal][a]}static reedSolomonComputeDivisor(a){if(a<1||a>255)throw new RangeError("Degree out of range");const s=[];for(let u=0;u0);for(const u of a){const d=u^c.shift();c.push(0),s.forEach((p,g)=>c[g]^=t.reedSolomonMultiply(p,d))}return c}static reedSolomonMultiply(a,s){if(a>>>8||s>>>8)throw new RangeError("Byte out of range");let c=0;for(let u=7;u>=0;u--)c=c<<1^(c>>>7)*285,c^=(s>>>u&1)*a;return r(c>>>8==0),c}finderPenaltyCountPatterns(a){const s=a[1];r(s<=this.size*3);const c=s>0&&a[2]==s&&a[3]==s*3&&a[4]==s&&a[5]==s;return(c&&a[0]>=s*4&&a[6]>=s?1:0)+(c&&a[6]>=s*4&&a[0]>=s?1:0)}finderPenaltyTerminateAndCount(a,s,c){return a&&(this.finderPenaltyAddHistory(s,c),s=0),s+=this.size,this.finderPenaltyAddHistory(s,c),this.finderPenaltyCountPatterns(c)}finderPenaltyAddHistory(a,s){s[0]==0&&(a+=this.size),s.pop(),s.unshift(a)}}t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(l,a,s){if(a<0||a>31||l>>>a)throw new RangeError("Value out of range");for(let c=a-1;c>=0;c--)s.push(l>>>c&1)}function o(l,a){return(l>>>a&1)!=0}function r(l){if(!l)throw new Error("Assertion error")}class i{static makeBytes(a){const s=[];for(const c of a)n(c,8,s);return new i(i.Mode.BYTE,a.length,s)}static makeNumeric(a){if(!i.isNumeric(a))throw new RangeError("String contains non-numeric characters");const s=[];for(let c=0;c=1<1&&arguments[1]!==void 0?arguments[1]:0;const n=[];return e.forEach(function(o,r){let i=null;o.forEach(function(l,a){if(!l&&i!==null){n.push(`M${i+t} ${r+t}h${a-i}v1H${i+t}z`),i=null;return}if(a===o.length-1){if(!l)return;i===null?n.push(`M${a+t},${r+t} h1v1H${a+t}z`):n.push(`M${i+t},${r+t} h${a+1-i}v1H${i+t}z`);return}l&&i===null&&(i=a)})}),n.join("")}function SE(e,t){return e.slice().map((n,o)=>o=t.y+t.h?n:n.map((r,i)=>i=t.x+t.w?r:!1))}function $E(e,t,n,o){if(o==null)return null;const r=e.length+n*2,i=Math.floor(t*Bue),l=r/t,a=(o.width||i)*l,s=(o.height||i)*l,c=o.x==null?e.length/2-a/2:o.x*l,u=o.y==null?e.length/2-s/2:o.y*l;let d=null;if(o.excavate){const p=Math.floor(c),g=Math.floor(u),v=Math.ceil(a+c-p),h=Math.ceil(s+u-g);d={x:p,y:g,w:v,h}}return{x:c,y:u,h:s,w:a,excavation:d}}function CE(e,t){return t!=null?Math.floor(t):e?Due:Nue}const kue=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Fue=ie({name:"QRCodeCanvas",inheritAttrs:!1,props:m(m({},D1()),{level:String,bgColor:String,fgColor:String,marginSize:Number}),setup(e,t){let{attrs:n,expose:o}=t;const r=I(()=>{var s;return(s=e.imageSettings)===null||s===void 0?void 0:s.src}),i=oe(null),l=oe(null),a=oe(!1);return o({toDataURL:(s,c)=>{var u;return(u=i.value)===null||u===void 0?void 0:u.toDataURL(s,c)}}),Le(()=>{const{value:s,size:c=qm,level:u=hE,bgColor:d=vE,fgColor:p=mE,includeMargin:g=bE,marginSize:v,imageSettings:h}=e;if(i.value!=null){const b=i.value,y=b.getContext("2d");if(!y)return;let S=Eo.QrCode.encodeText(s,gE[u]).getModules();const $=CE(g,v),x=S.length+$*2,C=$E(S,c,$,h),O=l.value,w=a.value&&C!=null&&O!==null&&O.complete&&O.naturalHeight!==0&&O.naturalWidth!==0;w&&C.excavation!=null&&(S=SE(S,C.excavation));const T=window.devicePixelRatio||1;b.height=b.width=c*T;const E=c/x*T;y.scale(E,E),y.fillStyle=d,y.fillRect(0,0,x,x),y.fillStyle=p,kue?y.fill(new Path2D(yE(S,$))):S.forEach(function(_,M){_.forEach(function(A,R){A&&y.fillRect(R+$,M+$,1,1)})}),w&&y.drawImage(O,C.x+$,C.y+$,C.w,C.h)}},{flush:"post"}),ye(r,()=>{a.value=!1}),()=>{var s;const c=(s=e.size)!==null&&s!==void 0?s:qm,u={height:`${c}px`,width:`${c}px`};let d=null;return r.value!=null&&(d=f("img",{src:r.value,key:r.value,style:{display:"none"},onLoad:()=>{a.value=!0},ref:l},null)),f(He,null,[f("canvas",B(B({},n),{},{style:[u,n.style],ref:i}),null),d])}}}),Lue=ie({name:"QRCodeSVG",inheritAttrs:!1,props:m(m({},D1()),{color:String,level:String,bgColor:String,fgColor:String,marginSize:Number,title:String}),setup(e){let t=null,n=null,o=null,r=null,i=null,l=null;return Le(()=>{const{value:a,size:s=qm,level:c=hE,includeMargin:u=bE,marginSize:d,imageSettings:p}=e;t=Eo.QrCode.encodeText(a,gE[c]).getModules(),n=CE(u,d),o=t.length+n*2,r=$E(t,s,n,p),p!=null&&r!=null&&(r.excavation!=null&&(t=SE(t,r.excavation)),l=f("image",{"xlink:href":p.src,height:r.h,width:r.w,x:r.x+n,y:r.y+n,preserveAspectRatio:"none"},null)),i=yE(t,n)}),()=>{const a=e.bgColor&&vE,s=e.fgColor&&mE;return f("svg",{height:e.size,width:e.size,viewBox:`0 0 ${o} ${o}`},[!!e.title&&f("title",null,[e.title]),f("path",{fill:a,d:`M0,0 h${o}v${o}H0z`,"shape-rendering":"crispEdges"},null),f("path",{fill:s,d:i,"shape-rendering":"crispEdges"},null),l])}}}),zue=ie({name:"AQrcode",inheritAttrs:!1,props:Rue(),emits:["refresh"],setup(e,t){let{emit:n,attrs:o,expose:r}=t;const[i]=ko("QRCode"),{prefixCls:l}=Te("qrcode",e),[a,s]=fue(l),[,c]=Zr(),u=re();r({toDataURL:(p,g)=>{var v;return(v=u.value)===null||v===void 0?void 0:v.toDataURL(p,g)}});const d=I(()=>{const{value:p,icon:g="",size:v=160,iconSize:h=40,color:b=c.value.colorText,bgColor:y="transparent",errorLevel:S="M"}=e,$={src:g,x:void 0,y:void 0,height:h,width:h,excavate:!0};return{value:p,size:v-(c.value.paddingSM+c.value.lineWidth)*2,level:S,bgColor:y,fgColor:b,imageSettings:g?$:void 0}});return()=>{const p=l.value;return a(f("div",B(B({},o),{},{style:[o.style,{width:`${e.size}px`,height:`${e.size}px`,backgroundColor:d.value.bgColor}],class:[s.value,p,{[`${p}-borderless`]:!e.bordered}]}),[e.status!=="active"&&f("div",{class:`${p}-mask`},[e.status==="loading"&&f(mr,null,null),e.status==="expired"&&f(He,null,[f("p",{class:`${p}-expired`},[i.value.expired]),f(jt,{type:"link",onClick:g=>n("refresh",g)},{default:()=>[i.value.refresh],icon:()=>f(_1,null,null)})]),e.status==="scanned"&&f("p",{class:`${p}-scanned`},[i.value.scanned])]),e.type==="canvas"?f(Fue,B({ref:u},d.value),null):f(Lue,d.value,null)]))}}}),Hue=Et(zue);function jue(e){const t=window.innerWidth||document.documentElement.clientWidth,n=window.innerHeight||document.documentElement.clientHeight,{top:o,right:r,bottom:i,left:l}=e.getBoundingClientRect();return o>=0&&l>=0&&r<=t&&i<=n}function Vue(e,t,n,o){const[r,i]=bt(void 0);Le(()=>{const u=typeof e.value=="function"?e.value():e.value;i(u||null)},{flush:"post"});const[l,a]=bt(null),s=()=>{if(!t.value){a(null);return}if(r.value){!jue(r.value)&&t.value&&r.value.scrollIntoView(o.value);const{left:u,top:d,width:p,height:g}=r.value.getBoundingClientRect(),v={left:u,top:d,width:p,height:g,radius:0};JSON.stringify(l.value)!==JSON.stringify(v)&&a(v)}else a(null)};return We(()=>{ye([t,r],()=>{s()},{flush:"post",immediate:!0}),window.addEventListener("resize",s)}),Qe(()=>{window.removeEventListener("resize",s)}),[I(()=>{var u,d;if(!l.value)return l.value;const p=((u=n.value)===null||u===void 0?void 0:u.offset)||6,g=((d=n.value)===null||d===void 0?void 0:d.radius)||2;return{left:l.value.left-p,top:l.value.top-p,width:l.value.width+p*2,height:l.value.height+p*2,radius:g}}),r]}const Wue=()=>({arrow:Fe([Boolean,Object]),target:Fe([String,Function,Object]),title:Fe([String,Object]),description:Fe([String,Object]),placement:Ne(),mask:Fe([Object,Boolean],!0),className:{type:String},style:De(),scrollIntoViewOptions:Fe([Boolean,Object])}),N1=()=>m(m({},Wue()),{prefixCls:{type:String},total:{type:Number},current:{type:Number},onClose:ve(),onFinish:ve(),renderPanel:ve(),onPrev:ve(),onNext:ve()}),Kue=ie({name:"DefaultPanel",inheritAttrs:!1,props:N1(),setup(e,t){let{attrs:n}=t;return()=>{const{prefixCls:o,current:r,total:i,title:l,description:a,onClose:s,onPrev:c,onNext:u,onFinish:d}=e;return f("div",B(B({},n),{},{class:ae(`${o}-content`,n.class)}),[f("div",{class:`${o}-inner`},[f("button",{type:"button",onClick:s,"aria-label":"Close",class:`${o}-close`},[f("span",{class:`${o}-close-x`},[vt("×")])]),f("div",{class:`${o}-header`},[f("div",{class:`${o}-title`},[l])]),f("div",{class:`${o}-description`},[a]),f("div",{class:`${o}-footer`},[f("div",{class:`${o}-sliders`},[i>1?[...Array.from({length:i}).keys()].map((p,g)=>f("span",{key:p,class:g===r?"active":""},null)):null]),f("div",{class:`${o}-buttons`},[r!==0?f("button",{class:`${o}-prev-btn`,onClick:c},[vt("Prev")]):null,r===i-1?f("button",{class:`${o}-finish-btn`,onClick:d},[vt("Finish")]):f("button",{class:`${o}-next-btn`,onClick:u},[vt("Next")])])])])])}}}),Gue=ie({name:"TourStep",inheritAttrs:!1,props:N1(),setup(e,t){let{attrs:n}=t;return()=>{const{current:o,renderPanel:r}=e;return f(He,null,[typeof r=="function"?r(m(m({},n),e),o):f(Kue,B(B({},n),e),null)])}}});let P3=0;const Xue=Rn();function Uue(){let e;return Xue?(e=P3,P3+=1):e="TEST_OR_SSR",e}function Yue(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:re("");const t=`vc_unique_${Uue()}`;return e.value||t}const zu={fill:"transparent","pointer-events":"auto"},que=ie({name:"TourMask",props:{prefixCls:{type:String},pos:De(),rootClassName:{type:String},showMask:$e(),fill:{type:String,default:"rgba(0,0,0,0.5)"},open:$e(),animated:Fe([Boolean,Object]),zIndex:{type:Number}},setup(e,t){let{attrs:n}=t;const o=Yue();return()=>{const{prefixCls:r,open:i,rootClassName:l,pos:a,showMask:s,fill:c,animated:u,zIndex:d}=e,p=`${r}-mask-${o}`,g=typeof u=="object"?u?.placeholder:u;return f(Dc,{visible:i,autoLock:!0},{default:()=>i&&f("div",B(B({},n),{},{class:ae(`${r}-mask`,l,n.class),style:[{position:"fixed",left:0,right:0,top:0,bottom:0,zIndex:d,pointerEvents:"none"},n.style]}),[s?f("svg",{style:{width:"100%",height:"100%"}},[f("defs",null,[f("mask",{id:p},[f("rect",{x:"0",y:"0",width:"100vw",height:"100vh",fill:"white"},null),a&&f("rect",{x:a.left,y:a.top,rx:a.radius,width:a.width,height:a.height,fill:"black",class:g?`${r}-placeholder-animated`:""},null)])]),f("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:c,mask:`url(#${p})`},null),a&&f(He,null,[f("rect",B(B({},zu),{},{x:"0",y:"0",width:"100%",height:a.top}),null),f("rect",B(B({},zu),{},{x:"0",y:"0",width:a.left,height:"100%"}),null),f("rect",B(B({},zu),{},{x:"0",y:a.top+a.height,width:"100%",height:`calc(100vh - ${a.top+a.height}px)`}),null),f("rect",B(B({},zu),{},{x:a.left+a.width,y:"0",width:`calc(100vw - ${a.left+a.width}px)`,height:"100%"}),null)])]):null])})}}}),Zue=[0,0],I3={left:{points:["cr","cl"],offset:[-8,0]},right:{points:["cl","cr"],offset:[8,0]},top:{points:["bc","tc"],offset:[0,-8]},bottom:{points:["tc","bc"],offset:[0,8]},topLeft:{points:["bl","tl"],offset:[0,-8]},leftTop:{points:["tr","tl"],offset:[-8,0]},topRight:{points:["br","tr"],offset:[0,-8]},rightTop:{points:["tl","tr"],offset:[8,0]},bottomRight:{points:["tr","br"],offset:[0,8]},rightBottom:{points:["bl","br"],offset:[8,0]},bottomLeft:{points:["tl","bl"],offset:[0,8]},leftBottom:{points:["br","bl"],offset:[-8,0]}};function xE(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;const t={};return Object.keys(I3).forEach(n=>{t[n]=m(m({},I3[n]),{autoArrow:e,targetOffset:Zue})}),t}xE();var Que=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{const{builtinPlacements:e,popupAlign:t}=DP();return{builtinPlacements:e,popupAlign:t,steps:at(),open:$e(),defaultCurrent:{type:Number},current:{type:Number},onChange:ve(),onClose:ve(),onFinish:ve(),mask:Fe([Boolean,Object],!0),arrow:Fe([Boolean,Object],!0),rootClassName:{type:String},placement:Ne("bottom"),prefixCls:{type:String,default:"rc-tour"},renderPanel:ve(),gap:De(),animated:Fe([Boolean,Object]),scrollIntoViewOptions:Fe([Boolean,Object],!0),zIndex:{type:Number,default:1001}}},Jue=ie({name:"Tour",inheritAttrs:!1,props:Ze(wE(),{}),setup(e){const{defaultCurrent:t,placement:n,mask:o,scrollIntoViewOptions:r,open:i,gap:l,arrow:a}=Ko(e),s=re(),[c,u]=Tt(0,{value:I(()=>e.current),defaultValue:t.value}),[d,p]=Tt(void 0,{value:I(()=>e.open),postState:w=>c.value<0||c.value>=e.steps.length?!1:w??!0}),g=oe(d.value);Le(()=>{d.value&&!g.value&&u(0),g.value=d.value});const v=I(()=>e.steps[c.value]||{}),h=I(()=>{var w;return(w=v.value.placement)!==null&&w!==void 0?w:n.value}),b=I(()=>{var w;return d.value&&((w=v.value.mask)!==null&&w!==void 0?w:o.value)}),y=I(()=>{var w;return(w=v.value.scrollIntoViewOptions)!==null&&w!==void 0?w:r.value}),[S,$]=Vue(I(()=>v.value.target),i,l,y),x=I(()=>$.value?typeof v.value.arrow>"u"?a.value:v.value.arrow:!1),C=I(()=>typeof x.value=="object"?x.value.pointAtCenter:!1);ye(C,()=>{var w;(w=s.value)===null||w===void 0||w.forcePopupAlign()}),ye(c,()=>{var w;(w=s.value)===null||w===void 0||w.forcePopupAlign()});const O=w=>{var T;u(w),(T=e.onChange)===null||T===void 0||T.call(e,w)};return()=>{var w;const{prefixCls:T,steps:E,onClose:_,onFinish:M,rootClassName:A,renderPanel:R,animated:L,zIndex:P}=e,D=Que(e,["prefixCls","steps","onClose","onFinish","rootClassName","renderPanel","animated","zIndex"]);if($.value===void 0)return null;const N=()=>{p(!1),_?.(c.value)},k=typeof b.value=="boolean"?b.value:!!b.value,F=typeof b.value=="boolean"?void 0:b.value,z=()=>$.value||document.body,H=()=>f(Gue,B({arrow:x.value,key:"content",prefixCls:T,total:E.length,renderPanel:R,onPrev:()=>{O(c.value-1)},onNext:()=>{O(c.value+1)},onClose:N,current:c.value,onFinish:()=>{N(),M?.()}},v.value),null),j=I(()=>{const Y=S.value||lv,Q={};return Object.keys(Y).forEach(U=>{typeof Y[U]=="number"?Q[U]=`${Y[U]}px`:Q[U]=Y[U]}),Q});return d.value?f(He,null,[f(que,{zIndex:P,prefixCls:T,pos:S.value,showMask:k,style:F?.style,fill:F?.color,open:d.value,animated:L,rootClassName:A},null),f(Ll,B(B({},D),{},{arrow:!!D.arrow,builtinPlacements:v.value.target?(w=D.builtinPlacements)!==null&&w!==void 0?w:xE(C.value):void 0,ref:s,popupStyle:v.value.target?v.value.style:m(m({},v.value.style),{position:"fixed",left:lv.left,top:lv.top,transform:"translate(-50%, -50%)"}),popupPlacement:h.value,popupVisible:d.value,popupClassName:ae(A,v.value.className),prefixCls:T,popup:H,forceRender:!1,destroyPopupOnHide:!0,zIndex:P,mask:!1,getTriggerDOMNode:z}),{default:()=>[f(Dc,{visible:d.value,autoLock:!0},{default:()=>[f("div",{class:ae(A,`${T}-target-placeholder`),style:m(m({},j.value),{position:"fixed",pointerEvents:"none"})},null)]})]})]):null}}}),ede=()=>m(m({},wE()),{steps:{type:Array},prefixCls:{type:String},current:{type:Number},type:{type:String},"onUpdate:current":Function}),tde=()=>m(m({},N1()),{cover:{type:Object},nextButtonProps:{type:Object},prevButtonProps:{type:Object},current:{type:Number},type:{type:String}}),nde=ie({name:"ATourPanel",inheritAttrs:!1,props:tde(),setup(e,t){let{attrs:n,slots:o}=t;const{current:r,total:i}=Ko(e),l=I(()=>r.value===i.value-1),a=c=>{var u;const d=e.prevButtonProps;(u=e.onPrev)===null||u===void 0||u.call(e,c),typeof d?.onClick=="function"&&d?.onClick()},s=c=>{var u,d;const p=e.nextButtonProps;l.value?(u=e.onFinish)===null||u===void 0||u.call(e,c):(d=e.onNext)===null||d===void 0||d.call(e,c),typeof p?.onClick=="function"&&p?.onClick()};return()=>{const{prefixCls:c,title:u,onClose:d,cover:p,description:g,type:v,arrow:h}=e,b=e.prevButtonProps,y=e.nextButtonProps;let S;u&&(S=f("div",{class:`${c}-header`},[f("div",{class:`${c}-title`},[u])]));let $;g&&($=f("div",{class:`${c}-description`},[g]));let x;p&&(x=f("div",{class:`${c}-cover`},[p]));let C;o.indicatorsRender?C=o.indicatorsRender({current:r.value,total:i}):C=[...Array.from({length:i.value}).keys()].map((T,E)=>f("span",{key:T,class:ae(E===r.value&&`${c}-indicator-active`,`${c}-indicator`)},null));const O=v==="primary"?"default":"primary",w={type:"default",ghost:v==="primary"};return f(Rl,{componentName:"Tour",defaultLocale:Un.Tour},{default:T=>{var E;return f("div",B(B({},n),{},{class:ae(v==="primary"?`${c}-primary`:"",n.class,`${c}-content`)}),[h&&f("div",{class:`${c}-arrow`,key:"arrow"},null),f("div",{class:`${c}-inner`},[f(kn,{class:`${c}-close`,onClick:d},null),x,S,$,f("div",{class:`${c}-footer`},[i.value>1&&f("div",{class:`${c}-indicators`},[C]),f("div",{class:`${c}-buttons`},[r.value!==0?f(jt,B(B(B({},w),b),{},{onClick:a,size:"small",class:ae(`${c}-prev-btn`,b?.className)}),{default:()=>[Ov(b?.children)?b.children():(E=b?.children)!==null&&E!==void 0?E:T.Previous]}):null,f(jt,B(B({type:O},y),{},{onClick:s,size:"small",class:ae(`${c}-next-btn`,y?.className)}),{default:()=>[Ov(y?.children)?y?.children():l.value?T.Finish:T.Next]})])])])])}})}}}),ode=e=>{let{defaultType:t,steps:n,current:o,defaultCurrent:r}=e;const i=re(r?.value),l=I(()=>o?.value);ye(l,u=>{i.value=u??r?.value},{immediate:!0});const a=u=>{i.value=u},s=I(()=>{var u,d;return typeof i.value=="number"?n&&((d=(u=n.value)===null||u===void 0?void 0:u[i.value])===null||d===void 0?void 0:d.type):t?.value});return{currentMergedType:I(()=>{var u;return(u=s.value)!==null&&u!==void 0?u:t?.value}),updateInnerCurrent:a}},rde=e=>{const{componentCls:t,lineHeight:n,padding:o,paddingXS:r,borderRadius:i,borderRadiusXS:l,colorPrimary:a,colorText:s,colorFill:c,indicatorHeight:u,indicatorWidth:d,boxShadowTertiary:p,tourZIndexPopup:g,fontSize:v,colorBgContainer:h,fontWeightStrong:b,marginXS:y,colorTextLightSolid:S,tourBorderRadius:$,colorWhite:x,colorBgTextHover:C,tourCloseSize:O,motionDurationSlow:w,antCls:T}=e;return[{[t]:m(m({},Ue(e)),{color:s,position:"absolute",zIndex:g,display:"block",visibility:"visible",fontSize:v,lineHeight:n,width:520,"--antd-arrow-background-color":h,"&-pure":{maxWidth:"100%",position:"relative"},[`&${t}-hidden`]:{display:"none"},[`${t}-content`]:{position:"relative"},[`${t}-inner`]:{textAlign:"start",textDecoration:"none",borderRadius:$,boxShadow:p,position:"relative",backgroundColor:h,border:"none",backgroundClip:"padding-box",[`${t}-close`]:{position:"absolute",top:o,insetInlineEnd:o,color:e.colorIcon,outline:"none",width:O,height:O,borderRadius:e.borderRadiusSM,transition:`background-color ${e.motionDurationMid}, color ${e.motionDurationMid}`,display:"flex",alignItems:"center",justifyContent:"center","&:hover":{color:e.colorIconHover,backgroundColor:e.wireframe?"transparent":e.colorFillContent}},[`${t}-cover`]:{textAlign:"center",padding:`${o+O+r}px ${o}px 0`,img:{width:"100%"}},[`${t}-header`]:{padding:`${o}px ${o}px ${r}px`,[`${t}-title`]:{lineHeight:n,fontSize:v,fontWeight:b}},[`${t}-description`]:{padding:`0 ${o}px`,lineHeight:n,wordWrap:"break-word"},[`${t}-footer`]:{padding:`${r}px ${o}px ${o}px`,textAlign:"end",borderRadius:`0 0 ${l}px ${l}px`,display:"flex",[`${t}-indicators`]:{display:"inline-block",[`${t}-indicator`]:{width:d,height:u,display:"inline-block",borderRadius:"50%",background:c,"&:not(:last-child)":{marginInlineEnd:u},"&-active":{background:a}}},[`${t}-buttons`]:{marginInlineStart:"auto",[`${T}-btn`]:{marginInlineStart:y}}}},[`${t}-primary, &${t}-primary`]:{"--antd-arrow-background-color":a,[`${t}-inner`]:{color:S,textAlign:"start",textDecoration:"none",backgroundColor:a,borderRadius:i,boxShadow:p,[`${t}-close`]:{color:S},[`${t}-indicators`]:{[`${t}-indicator`]:{background:new ht(S).setAlpha(.15).toRgbString(),"&-active":{background:S}}},[`${t}-prev-btn`]:{color:S,borderColor:new ht(S).setAlpha(.15).toRgbString(),backgroundColor:a,"&:hover":{backgroundColor:new ht(S).setAlpha(.15).toRgbString(),borderColor:"transparent"}},[`${t}-next-btn`]:{color:a,borderColor:"transparent",background:x,"&:hover":{background:new ht(C).onBackground(x).toRgbString()}}}}}),[`${t}-mask`]:{[`${t}-placeholder-animated`]:{transition:`all ${w}`}},[["&-placement-left","&-placement-leftTop","&-placement-leftBottom","&-placement-right","&-placement-rightTop","&-placement-rightBottom"].join(",")]:{[`${t}-inner`]:{borderRadius:Math.min($,_b)}}},Ab(e,{colorBg:"var(--antd-arrow-background-color)",contentRadius:$,limitVerticalRadius:!0})]},ide=Ke("Tour",e=>{const{borderRadiusLG:t,fontSize:n,lineHeight:o}=e,r=ke(e,{tourZIndexPopup:e.zIndexPopupBase+70,indicatorWidth:6,indicatorHeight:6,tourBorderRadius:t,tourCloseSize:n*o});return[rde(r)]});var lde=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{const{steps:h,current:b,type:y,rootClassName:S}=e,$=lde(e,["steps","current","type","rootClassName"]),x=ae({[`${c.value}-primary`]:g.value==="primary",[`${c.value}-rtl`]:u.value==="rtl"},p.value,S),C=(T,E)=>f(nde,B(B({},T),{},{type:y,current:E}),{indicatorsRender:r.indicatorsRender}),O=T=>{v(T),o("update:current",T),o("change",T)},w=I(()=>Mb({arrowPointAtCenter:!0,autoAdjustOverflow:!0}));return d(f(Jue,B(B(B({},n),$),{},{rootClassName:x,prefixCls:c.value,current:b,defaultCurrent:e.defaultCurrent,animated:!0,renderPanel:C,onChange:O,steps:h,builtinPlacements:w.value}),null))}}}),sde=Et(ade),OE=Symbol("appConfigContext"),cde=e=>Xe(OE,e),ude=()=>je(OE,{}),PE=Symbol("appContext"),dde=e=>Xe(PE,e),fde=ut({message:{},notification:{},modal:{}}),pde=()=>je(PE,fde),gde=e=>{const{componentCls:t,colorText:n,fontSize:o,lineHeight:r,fontFamily:i}=e;return{[t]:{color:n,fontSize:o,lineHeight:r,fontFamily:i}}},hde=Ke("App",e=>[gde(e)]),vde=()=>({rootClassName:String,message:De(),notification:De()}),mde=()=>pde(),Qs=ie({name:"AApp",props:Ze(vde(),{}),setup(e,t){let{slots:n}=t;const{prefixCls:o}=Te("app",e),[r,i]=hde(o),l=I(()=>ae(i.value,o.value,e.rootClassName)),a=ude(),s=I(()=>({message:m(m({},a.message),e.message),notification:m(m({},a.notification),e.notification)}));cde(s.value);const[c,u]=QI(s.value.message),[d,p]=u5(s.value.notification),[g,v]=pT(),h=I(()=>({message:c,notification:d,modal:g}));return dde(h.value),()=>{var b;return r(f("div",{class:l.value},[v(),u(),p(),(b=n.default)===null||b===void 0?void 0:b.call(n)]))}}});Qs.useApp=mde;Qs.install=function(e){e.component(Qs.name,Qs)};const IE=["wrap","nowrap","wrap-reverse"],TE=["flex-start","flex-end","start","end","center","space-between","space-around","space-evenly","stretch","normal","left","right"],EE=["center","start","end","flex-start","flex-end","self-start","self-end","baseline","normal","stretch"],bde=(e,t)=>{const n={};return IE.forEach(o=>{n[`${e}-wrap-${o}`]=t.wrap===o}),n},yde=(e,t)=>{const n={};return EE.forEach(o=>{n[`${e}-align-${o}`]=t.align===o}),n[`${e}-align-stretch`]=!t.align&&!!t.vertical,n},Sde=(e,t)=>{const n={};return TE.forEach(o=>{n[`${e}-justify-${o}`]=t.justify===o}),n};function $de(e,t){return ae(m(m(m({},bde(e,t)),yde(e,t)),Sde(e,t)))}const Cde=e=>{const{componentCls:t}=e;return{[t]:{display:"flex","&-vertical":{flexDirection:"column"},"&-rtl":{direction:"rtl"},"&:empty":{display:"none"}}}},xde=e=>{const{componentCls:t}=e;return{[t]:{"&-gap-small":{gap:e.flexGapSM},"&-gap-middle":{gap:e.flexGap},"&-gap-large":{gap:e.flexGapLG}}}},wde=e=>{const{componentCls:t}=e,n={};return IE.forEach(o=>{n[`${t}-wrap-${o}`]={flexWrap:o}}),n},Ode=e=>{const{componentCls:t}=e,n={};return EE.forEach(o=>{n[`${t}-align-${o}`]={alignItems:o}}),n},Pde=e=>{const{componentCls:t}=e,n={};return TE.forEach(o=>{n[`${t}-justify-${o}`]={justifyContent:o}}),n},Ide=Ke("Flex",e=>{const t=ke(e,{flexGapSM:e.paddingXS,flexGap:e.padding,flexGapLG:e.paddingLG});return[Cde(t),xde(t),wde(t),Ode(t),Pde(t)]});function T3(e){return["small","middle","large"].includes(e)}const Tde=()=>({prefixCls:Ne(),vertical:$e(),wrap:Ne(),justify:Ne(),align:Ne(),flex:Fe([Number,String]),gap:Fe([Number,String]),component:Ct()});var Ede=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,o=Object.getOwnPropertySymbols(e);r{var u;return[l.value,s.value,$de(l.value,e),{[`${l.value}-rtl`]:i.value==="rtl",[`${l.value}-gap-${e.gap}`]:T3(e.gap),[`${l.value}-vertical`]:(u=e.vertical)!==null&&u!==void 0?u:r?.value.vertical}]});return()=>{var u;const{flex:d,gap:p,component:g="div"}=e,v=Ede(e,["flex","gap","component"]),h={};return d&&(h.flex=d),p&&!T3(p)&&(h.gap=`${p}px`),a(f(g,B({class:[o.class,c.value],style:[o.style,h]},nt(v,["justify","wrap","align","vertical"])),{default:()=>[(u=n.default)===null||u===void 0?void 0:u.call(n)]}))}}}),_de=Et(Mde),E3=Object.freeze(Object.defineProperty({__proto__:null,Affix:yP,Alert:UV,Anchor:ol,AnchorLink:k0,App:Qs,AutoComplete:xV,AutoCompleteOptGroup:CV,AutoCompleteOption:$V,Avatar:ml,AvatarGroup:pf,BackTop:kf,Badge:Vs,BadgeRibbon:gf,Breadcrumb:bl,BreadcrumbItem:Sc,BreadcrumbSeparator:xf,Button:jt,ButtonGroup:yf,Calendar:HX,Card:wa,CardGrid:Tf,CardMeta:If,Carousel:IY,Cascader:jZ,CheckableTag:Rf,Checkbox:_o,CheckboxGroup:_f,Col:UZ,Collapse:Ks,CollapsePanel:Ef,Comment:JZ,Compact:df,ConfigProvider:Sl,DatePicker:vJ,Descriptions:la,DescriptionsItem:O5,DirectoryTree:Ed,Divider:EJ,Drawer:WJ,Dropdown:Xo,DropdownButton:yc,Empty:bi,Flex:_de,FloatButton:Ti,FloatButtonGroup:Bf,Form:yi,FormItem:WI,FormItemRest:sf,Grid:XZ,Image:il,ImagePreviewGroup:U5,Input:ln,InputGroup:N5,InputNumber:$te,InputPassword:F5,InputSearch:B5,Layout:Dte,LayoutContent:Rte,LayoutFooter:_te,LayoutHeader:Mte,LayoutSider:Ate,List:di,ListItem:J5,ListItemMeta:Z5,LocaleProvider:UI,Mentions:Hne,MentionsOption:Od,Menu:Gt,MenuDivider:Cc,MenuItem:vr,MenuItemGroup:$c,Modal:Dt,MonthPicker:vd,PageHeader:moe,Pagination:gg,Popconfirm:xoe,Popover:Rb,Progress:Jy,QRCode:Hue,QuarterPicker:md,Radio:jn,RadioButton:Of,RadioGroup:sy,RangePicker:bd,Rate:ure,Result:Cl,Row:Pre,Segmented:uue,Select:mn,SelectOptGroup:bV,SelectOption:mV,Skeleton:In,SkeletonAvatar:by,SkeletonButton:hy,SkeletonImage:my,SkeletonInput:vy,SkeletonTitle:Yp,Slider:Vre,Space:Ta,Spin:mr,Statistic:Br,StatisticCountdown:ooe,Step:Pd,Steps:aie,SubMenu:El,Switch:mie,TabPane:Pf,Table:Eae,TableColumn:_d,TableColumnGroup:Ad,TableSummary:Rd,TableSummaryCell:Kf,TableSummaryRow:Wf,Tabs:yl,Tag:Ia,Textarea:ky,TimePicker:wse,TimeRangePicker:Dd,Timeline:Zs,TimelineItem:Tc,Tooltip:to,Tour:sde,Transfer:Qae,Tree:ZT,TreeNode:Md,TreeSelect:Cse,TreeSelectNode:Ym,Typography:eo,TypographyLink:is,TypographyParagraph:ls,TypographyText:as,TypographyTitle:ss,Upload:Uce,UploadDragger:Xce,Watermark:nue,WeekPicker:hd,message:Gn,notification:_i},Symbol.toStringTag,{value:"Module"})),Ade=function(e){return Object.keys(E3).forEach(t=>{const n=E3[t];n.install&&e.use(n)}),e.use(v9.StyleProvider),e.config.globalProperties.$message=Gn,e.config.globalProperties.$notification=_i,e.config.globalProperties.$info=Dt.info,e.config.globalProperties.$success=Dt.success,e.config.globalProperties.$error=Dt.error,e.config.globalProperties.$warning=Dt.warning,e.config.globalProperties.$confirm=Dt.confirm,e.config.globalProperties.$destroyAll=Dt.destroyAll,e},Rde={version:aP,install:Ade};const aa=typeof document<"u";function ME(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Dde(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ME(e.default)}const Pt=Object.assign;function av(e,t){const n={};for(const o in t){const r=t[o];n[o]=Jo(r)?r.map(e):e(r)}return n}const Js=()=>{},Jo=Array.isArray;function M3(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}const _E=/#/g,Nde=/&/g,Bde=/\//g,kde=/=/g,Fde=/\?/g,AE=/\+/g,Lde=/%5B/g,zde=/%5D/g,RE=/%5E/g,Hde=/%60/g,DE=/%7B/g,jde=/%7C/g,NE=/%7D/g,Vde=/%20/g;function B1(e){return e==null?"":encodeURI(""+e).replace(jde,"|").replace(Lde,"[").replace(zde,"]")}function Wde(e){return B1(e).replace(DE,"{").replace(NE,"}").replace(RE,"^")}function Zm(e){return B1(e).replace(AE,"%2B").replace(Vde,"+").replace(_E,"%23").replace(Nde,"%26").replace(Hde,"`").replace(DE,"{").replace(NE,"}").replace(RE,"^")}function Kde(e){return Zm(e).replace(kde,"%3D")}function Gde(e){return B1(e).replace(_E,"%23").replace(Fde,"%3F")}function Xde(e){return Gde(e).replace(Bde,"%2F")}function Ec(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Ude=/\/$/,Yde=e=>e.replace(Ude,"");function sv(e,t,n="/"){let o,r={},i="",l="";const a=t.indexOf("#");let s=t.indexOf("?");return s=a>=0&&s>a?-1:s,s>=0&&(o=t.slice(0,s),i=t.slice(s,a>0?a:t.length),r=e(i.slice(1))),a>=0&&(o=o||t.slice(0,a),l=t.slice(a,t.length)),o=Jde(o??t,n),{fullPath:o+i+l,path:o,query:r,hash:Ec(l)}}function qde(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function _3(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Zde(e,t,n){const o=t.matched.length-1,r=n.matched.length-1;return o>-1&&o===r&&ja(t.matched[o],n.matched[r])&&BE(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ja(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function BE(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Qde(e[n],t[n]))return!1;return!0}function Qde(e,t){return Jo(e)?A3(e,t):Jo(t)?A3(t,e):e?.valueOf()===t?.valueOf()}function A3(e,t){return Jo(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function Jde(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),r=o[o.length-1];(r===".."||r===".")&&o.push("");let i=n.length-1,l,a;for(l=0;l1&&i--;else break;return n.slice(0,i).join("/")+"/"+o.slice(l).join("/")}const si={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Qm=(function(e){return e.pop="pop",e.push="push",e})({}),cv=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function efe(e){if(!e)if(aa){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Yde(e)}const tfe=/^[^#]+#/;function nfe(e,t){return e.replace(tfe,"#")+t}function ofe(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const Cg=()=>({left:window.scrollX,top:window.scrollY});function rfe(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),r=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!r)return;t=ofe(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function R3(e,t){return(history.state?history.state.position-t:-1)+e}const Jm=new Map;function ife(e,t){Jm.set(e,t)}function lfe(e){const t=Jm.get(e);return Jm.delete(e),t}function afe(e){return typeof e=="string"||e&&typeof e=="object"}function kE(e){return typeof e=="string"||typeof e=="symbol"}let Kt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const FE=Symbol("");Kt.MATCHER_NOT_FOUND+"",Kt.NAVIGATION_GUARD_REDIRECT+"",Kt.NAVIGATION_ABORTED+"",Kt.NAVIGATION_CANCELLED+"",Kt.NAVIGATION_DUPLICATED+"";function Va(e,t){return Pt(new Error,{type:e,[FE]:!0},t)}function Ir(e,t){return e instanceof Error&&FE in e&&(t==null||!!(e.type&t))}const sfe=["params","query","hash"];function cfe(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of sfe)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function ufe(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;or&&Zm(r)):[o&&Zm(o)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+n,r!=null&&(t+="="+r))})}return t}function dfe(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=Jo(o)?o.map(r=>r==null?null:""+r):o==null?o:""+o)}return t}const ffe=Symbol(""),N3=Symbol(""),xg=Symbol(""),LE=Symbol(""),e0=Symbol("");function Ss(){let e=[];function t(o){return e.push(o),()=>{const r=e.indexOf(o);r>-1&&e.splice(r,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function vi(e,t,n,o,r,i=l=>l()){const l=o&&(o.enterCallbacks[r]=o.enterCallbacks[r]||[]);return()=>new Promise((a,s)=>{const c=p=>{p===!1?s(Va(Kt.NAVIGATION_ABORTED,{from:n,to:t})):p instanceof Error?s(p):afe(p)?s(Va(Kt.NAVIGATION_GUARD_REDIRECT,{from:t,to:p})):(l&&o.enterCallbacks[r]===l&&typeof p=="function"&&l.push(p),a())},u=i(()=>e.call(o&&o.instances[r],t,n,c));let d=Promise.resolve(u);e.length<3&&(d=d.then(c)),d.catch(p=>s(p))})}function uv(e,t,n,o,r=i=>i()){const i=[];for(const l of e)for(const a in l.components){let s=l.components[a];if(!(t!=="beforeRouteEnter"&&!l.instances[a]))if(ME(s)){const c=(s.__vccOpts||s)[t];c&&i.push(vi(c,n,o,l,a,r))}else{let c=s();i.push(()=>c.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${l.path}"`);const d=Dde(u)?u.default:u;l.mods[a]=u,l.components[a]=d;const p=(d.__vccOpts||d)[t];return p&&vi(p,n,o,l,a,r)()}))}}return i}function pfe(e,t){const n=[],o=[],r=[],i=Math.max(t.matched.length,e.matched.length);for(let l=0;lja(c,a))?o.push(a):n.push(a));const s=e.matched[l];s&&(t.matched.find(c=>ja(c,s))||r.push(s))}return[n,o,r]}let gfe=()=>location.protocol+"//"+location.host;function zE(e,t){const{pathname:n,search:o,hash:r}=t,i=e.indexOf("#");if(i>-1){let l=r.includes(e.slice(i))?e.slice(i).length:1,a=r.slice(l);return a[0]!=="/"&&(a="/"+a),_3(a,"")}return _3(n,e)+o+r}function hfe(e,t,n,o){let r=[],i=[],l=null;const a=({state:p})=>{const g=zE(e,location),v=n.value,h=t.value;let b=0;if(p){if(n.value=g,t.value=p,l&&l===v){l=null;return}b=h?p.position-h.position:0}else o(g);r.forEach(y=>{y(n.value,v,{delta:b,type:Qm.pop,direction:b?b>0?cv.forward:cv.back:cv.unknown})})};function s(){l=n.value}function c(p){r.push(p);const g=()=>{const v=r.indexOf(p);v>-1&&r.splice(v,1)};return i.push(g),g}function u(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(Pt({},p.state,{scroll:Cg()}),"")}}function d(){for(const p of i)p();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:s,listen:c,destroy:d}}function B3(e,t,n,o=!1,r=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:r?Cg():null}}function vfe(e){const{history:t,location:n}=window,o={value:zE(e,n)},r={value:t.state};r.value||i(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(s,c,u){const d=e.indexOf("#"),p=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+s:gfe()+e+s;try{t[u?"replaceState":"pushState"](c,"",p),r.value=c}catch(g){console.error(g),n[u?"replace":"assign"](p)}}function l(s,c){i(s,Pt({},t.state,B3(r.value.back,s,r.value.forward,!0),c,{position:r.value.position}),!0),o.value=s}function a(s,c){const u=Pt({},r.value,t.state,{forward:s,scroll:Cg()});i(u.current,u,!0),i(s,Pt({},B3(o.value,s,null),{position:u.position+1},c),!1),o.value=s}return{location:o,state:r,push:a,replace:l}}function mfe(e){e=efe(e);const t=vfe(e),n=hfe(e,t.state,t.location,t.replace);function o(i,l=!0){l||n.pauseListeners(),history.go(i)}const r=Pt({location:"",base:e,go:o,createHref:nfe.bind(null,e)},t,n);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}let ul=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var cn=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(cn||{});const bfe={type:ul.Static,value:""},yfe=/[a-zA-Z0-9_]/;function Sfe(e){if(!e)return[[]];if(e==="/")return[[bfe]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(g){throw new Error(`ERR (${n})/"${c}": ${g}`)}let n=cn.Static,o=n;const r=[];let i;function l(){i&&r.push(i),i=[]}let a=0,s,c="",u="";function d(){c&&(n===cn.Static?i.push({type:ul.Static,value:c}):n===cn.Param||n===cn.ParamRegExp||n===cn.ParamRegExpEnd?(i.length>1&&(s==="*"||s==="+")&&t(`A repeatable param (${c}) must be alone in its segment. eg: '/:ids+.`),i.push({type:ul.Param,value:c,regexp:u,repeatable:s==="*"||s==="+",optional:s==="*"||s==="?"})):t("Invalid state to consume buffer"),c="")}function p(){c+=s}for(;at.length?t.length===1&&t[0]===Hn.Static+Hn.Segment?1:-1:0}function HE(e,t){let n=0;const o=e.score,r=t.score;for(;n0&&t[t.length-1]<0}const Ofe={strict:!1,end:!0,sensitive:!1};function Pfe(e,t,n){const o=xfe(Sfe(e.path),n),r=Pt(o,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function Ife(e,t){const n=[],o=new Map;t=M3(Ofe,t);function r(d){return o.get(d)}function i(d,p,g){const v=!g,h=z3(d);h.aliasOf=g&&g.record;const b=M3(t,d),y=[h];if("alias"in d){const x=typeof d.alias=="string"?[d.alias]:d.alias;for(const C of x)y.push(z3(Pt({},h,{components:g?g.record.components:h.components,path:C,aliasOf:g?g.record:h})))}let S,$;for(const x of y){const{path:C}=x;if(p&&C[0]!=="/"){const O=p.record.path,w=O[O.length-1]==="/"?"":"/";x.path=p.record.path+(C&&w+C)}if(S=Pfe(x,p,b),g?g.alias.push(S):($=$||S,$!==S&&$.alias.push(S),v&&d.name&&!H3(S)&&l(d.name)),jE(S)&&s(S),h.children){const O=h.children;for(let w=0;w{l($)}:Js}function l(d){if(kE(d)){const p=o.get(d);p&&(o.delete(d),n.splice(n.indexOf(p),1),p.children.forEach(l),p.alias.forEach(l))}else{const p=n.indexOf(d);p>-1&&(n.splice(p,1),d.record.name&&o.delete(d.record.name),d.children.forEach(l),d.alias.forEach(l))}}function a(){return n}function s(d){const p=Mfe(d,n);n.splice(p,0,d),d.record.name&&!H3(d)&&o.set(d.record.name,d)}function c(d,p){let g,v={},h,b;if("name"in d&&d.name){if(g=o.get(d.name),!g)throw Va(Kt.MATCHER_NOT_FOUND,{location:d});b=g.record.name,v=Pt(L3(p.params,g.keys.filter($=>!$.optional).concat(g.parent?g.parent.keys.filter($=>$.optional):[]).map($=>$.name)),d.params&&L3(d.params,g.keys.map($=>$.name))),h=g.stringify(v)}else if(d.path!=null)h=d.path,g=n.find($=>$.re.test(h)),g&&(v=g.parse(h),b=g.record.name);else{if(g=p.name?o.get(p.name):n.find($=>$.re.test(p.path)),!g)throw Va(Kt.MATCHER_NOT_FOUND,{location:d,currentLocation:p});b=g.record.name,v=Pt({},p.params,d.params),h=g.stringify(v)}const y=[];let S=g;for(;S;)y.unshift(S.record),S=S.parent;return{name:b,path:h,params:v,matched:y,meta:Efe(y)}}e.forEach(d=>i(d));function u(){n.length=0,o.clear()}return{addRoute:i,resolve:c,removeRoute:l,clearRoutes:u,getRoutes:a,getRecordMatcher:r}}function L3(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function z3(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Tfe(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Tfe(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function H3(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Efe(e){return e.reduce((t,n)=>Pt(t,n.meta),{})}function Mfe(e,t){let n=0,o=t.length;for(;n!==o;){const i=n+o>>1;HE(e,t[i])<0?o=i:n=i+1}const r=_fe(e);return r&&(o=t.lastIndexOf(r,o-1)),o}function _fe(e){let t=e;for(;t=t.parent;)if(jE(t)&&HE(e,t)===0)return t}function jE({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function j3(e){const t=je(xg),n=je(LE),o=I(()=>{const s=gt(e.to);return t.resolve(s)}),r=I(()=>{const{matched:s}=o.value,{length:c}=s,u=s[c-1],d=n.matched;if(!u||!d.length)return-1;const p=d.findIndex(ja.bind(null,u));if(p>-1)return p;const g=V3(s[c-2]);return c>1&&V3(u)===g&&d[d.length-1].path!==g?d.findIndex(ja.bind(null,s[c-2])):p}),i=I(()=>r.value>-1&&Bfe(n.params,o.value.params)),l=I(()=>r.value>-1&&r.value===n.matched.length-1&&BE(n.params,o.value.params));function a(s={}){if(Nfe(s)){const c=t[gt(e.replace)?"replace":"push"](gt(e.to)).catch(Js);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>c),c}return Promise.resolve()}return{route:o,href:I(()=>o.value.href),isActive:i,isExactActive:l,navigate:a}}function Afe(e){return e.length===1?e[0]:e}const Rfe=ie({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:j3,setup(e,{slots:t}){const n=ut(j3(e)),{options:o}=je(xg),r=I(()=>({[W3(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[W3(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=t.default&&Afe(t.default(n));return e.custom?i:Gr("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:r.value},i)}}}),Dfe=Rfe;function Nfe(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Bfe(e,t){for(const n in t){const o=t[n],r=e[n];if(typeof o=="string"){if(o!==r)return!1}else if(!Jo(r)||r.length!==o.length||o.some((i,l)=>i.valueOf()!==r[l].valueOf()))return!1}return!0}function V3(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const W3=(e,t,n)=>e??t??n,kfe=ie({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=je(e0),r=I(()=>e.route||o.value),i=je(N3,0),l=I(()=>{let c=gt(i);const{matched:u}=r.value;let d;for(;(d=u[c])&&!d.components;)c++;return c}),a=I(()=>r.value.matched[l.value]);Xe(N3,I(()=>l.value+1)),Xe(ffe,a),Xe(e0,r);const s=re();return ye(()=>[s.value,a.value,e.name],([c,u,d],[p,g,v])=>{u&&(u.instances[d]=c,g&&g!==u&&c&&c===p&&(u.leaveGuards.size||(u.leaveGuards=g.leaveGuards),u.updateGuards.size||(u.updateGuards=g.updateGuards))),c&&u&&(!g||!ja(u,g)||!p)&&(u.enterCallbacks[d]||[]).forEach(h=>h(c))},{flush:"post"}),()=>{const c=r.value,u=e.name,d=a.value,p=d&&d.components[u];if(!p)return K3(n.default,{Component:p,route:c});const g=d.props[u],v=g?g===!0?c.params:typeof g=="function"?g(c):g:null,b=Gr(p,Pt({},v,t,{onVnodeUnmounted:y=>{y.component.isUnmounted&&(d.instances[u]=null)},ref:s}));return K3(n.default,{Component:b,route:c})||b}}});function K3(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Ffe=kfe;function Lfe(e){const t=Ife(e.routes,e),n=e.parseQuery||ufe,o=e.stringifyQuery||D3,r=e.history,i=Ss(),l=Ss(),a=Ss(),s=oe(si);let c=si;aa&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=av.bind(null,X=>""+X),d=av.bind(null,Xde),p=av.bind(null,Ec);function g(X,J){let Z,G;return kE(X)?(Z=t.getRecordMatcher(X),G=J):G=X,t.addRoute(G,Z)}function v(X){const J=t.getRecordMatcher(X);J&&t.removeRoute(J)}function h(){return t.getRoutes().map(X=>X.record)}function b(X){return!!t.getRecordMatcher(X)}function y(X,J){if(J=Pt({},J||s.value),typeof X=="string"){const te=sv(n,X,J.path),ue=t.resolve({path:te.path},J),le=r.createHref(te.fullPath);return Pt(te,ue,{params:p(ue.params),hash:Ec(te.hash),redirectedFrom:void 0,href:le})}let Z;if(X.path!=null)Z=Pt({},X,{path:sv(n,X.path,J.path).path});else{const te=Pt({},X.params);for(const ue in te)te[ue]==null&&delete te[ue];Z=Pt({},X,{params:d(te)}),J.params=d(J.params)}const G=t.resolve(Z,J),q=X.hash||"";G.params=u(p(G.params));const V=qde(o,Pt({},X,{hash:Wde(q),path:G.path})),K=r.createHref(V);return Pt({fullPath:V,hash:q,query:o===D3?dfe(X.query):X.query||{}},G,{redirectedFrom:void 0,href:K})}function S(X){return typeof X=="string"?sv(n,X,s.value.path):Pt({},X)}function $(X,J){if(c!==X)return Va(Kt.NAVIGATION_CANCELLED,{from:J,to:X})}function x(X){return w(X)}function C(X){return x(Pt(S(X),{replace:!0}))}function O(X,J){const Z=X.matched[X.matched.length-1];if(Z&&Z.redirect){const{redirect:G}=Z;let q=typeof G=="function"?G(X,J):G;return typeof q=="string"&&(q=q.includes("?")||q.includes("#")?q=S(q):{path:q},q.params={}),Pt({query:X.query,hash:X.hash,params:q.path!=null?{}:X.params},q)}}function w(X,J){const Z=c=y(X),G=s.value,q=X.state,V=X.force,K=X.replace===!0,te=O(Z,G);if(te)return w(Pt(S(te),{state:typeof te=="object"?Pt({},q,te.state):q,force:V,replace:K}),J||Z);const ue=Z;ue.redirectedFrom=J;let le;return!V&&Zde(o,G,Z)&&(le=Va(Kt.NAVIGATION_DUPLICATED,{to:ue,from:G}),H(G,G,!0,!1)),(le?Promise.resolve(le):_(ue,G)).catch(ne=>Ir(ne)?Ir(ne,Kt.NAVIGATION_GUARD_REDIRECT)?ne:z(ne):k(ne,ue,G)).then(ne=>{if(ne){if(Ir(ne,Kt.NAVIGATION_GUARD_REDIRECT))return w(Pt({replace:K},S(ne.to),{state:typeof ne.to=="object"?Pt({},q,ne.to.state):q,force:V}),J||ue)}else ne=A(ue,G,!0,K,q);return M(ue,G,ne),ne})}function T(X,J){const Z=$(X,J);return Z?Promise.reject(Z):Promise.resolve()}function E(X){const J=Q.values().next().value;return J&&typeof J.runWithContext=="function"?J.runWithContext(X):X()}function _(X,J){let Z;const[G,q,V]=pfe(X,J);Z=uv(G.reverse(),"beforeRouteLeave",X,J);for(const te of G)te.leaveGuards.forEach(ue=>{Z.push(vi(ue,X,J))});const K=T.bind(null,X,J);return Z.push(K),ee(Z).then(()=>{Z=[];for(const te of i.list())Z.push(vi(te,X,J));return Z.push(K),ee(Z)}).then(()=>{Z=uv(q,"beforeRouteUpdate",X,J);for(const te of q)te.updateGuards.forEach(ue=>{Z.push(vi(ue,X,J))});return Z.push(K),ee(Z)}).then(()=>{Z=[];for(const te of V)if(te.beforeEnter)if(Jo(te.beforeEnter))for(const ue of te.beforeEnter)Z.push(vi(ue,X,J));else Z.push(vi(te.beforeEnter,X,J));return Z.push(K),ee(Z)}).then(()=>(X.matched.forEach(te=>te.enterCallbacks={}),Z=uv(V,"beforeRouteEnter",X,J,E),Z.push(K),ee(Z))).then(()=>{Z=[];for(const te of l.list())Z.push(vi(te,X,J));return Z.push(K),ee(Z)}).catch(te=>Ir(te,Kt.NAVIGATION_CANCELLED)?te:Promise.reject(te))}function M(X,J,Z){a.list().forEach(G=>E(()=>G(X,J,Z)))}function A(X,J,Z,G,q){const V=$(X,J);if(V)return V;const K=J===si,te=aa?history.state:{};Z&&(G||K?r.replace(X.fullPath,Pt({scroll:K&&te&&te.scroll},q)):r.push(X.fullPath,q)),s.value=X,H(X,J,Z,K),z()}let R;function L(){R||(R=r.listen((X,J,Z)=>{if(!U.listening)return;const G=y(X),q=O(G,U.currentRoute.value);if(q){w(Pt(q,{replace:!0,force:!0}),G).catch(Js);return}c=G;const V=s.value;aa&&ife(R3(V.fullPath,Z.delta),Cg()),_(G,V).catch(K=>Ir(K,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_CANCELLED)?K:Ir(K,Kt.NAVIGATION_GUARD_REDIRECT)?(w(Pt(S(K.to),{force:!0}),G).then(te=>{Ir(te,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_DUPLICATED)&&!Z.delta&&Z.type===Qm.pop&&r.go(-1,!1)}).catch(Js),Promise.reject()):(Z.delta&&r.go(-Z.delta,!1),k(K,G,V))).then(K=>{K=K||A(G,V,!1),K&&(Z.delta&&!Ir(K,Kt.NAVIGATION_CANCELLED)?r.go(-Z.delta,!1):Z.type===Qm.pop&&Ir(K,Kt.NAVIGATION_ABORTED|Kt.NAVIGATION_DUPLICATED)&&r.go(-1,!1)),M(G,V,K)}).catch(Js)}))}let P=Ss(),D=Ss(),N;function k(X,J,Z){z(X);const G=D.list();return G.length?G.forEach(q=>q(X,J,Z)):console.error(X),Promise.reject(X)}function F(){return N&&s.value!==si?Promise.resolve():new Promise((X,J)=>{P.add([X,J])})}function z(X){return N||(N=!X,L(),P.list().forEach(([J,Z])=>X?Z(X):J()),P.reset()),X}function H(X,J,Z,G){const{scrollBehavior:q}=e;if(!aa||!q)return Promise.resolve();const V=!Z&&lfe(R3(X.fullPath,0))||(G||!Z)&&history.state&&history.state.scroll||null;return rt().then(()=>q(X,J,V)).then(K=>K&&rfe(K)).catch(K=>k(K,X,J))}const j=X=>r.go(X);let Y;const Q=new Set,U={currentRoute:s,listening:!0,addRoute:g,removeRoute:v,clearRoutes:t.clearRoutes,hasRoute:b,getRoutes:h,resolve:y,options:e,push:x,replace:C,go:j,back:()=>j(-1),forward:()=>j(1),beforeEach:i.add,beforeResolve:l.add,afterEach:a.add,onError:D.add,isReady:F,install(X){X.component("RouterLink",Dfe),X.component("RouterView",Ffe),X.config.globalProperties.$router=U,Object.defineProperty(X.config.globalProperties,"$route",{enumerable:!0,get:()=>gt(s)}),aa&&!Y&&s.value===si&&(Y=!0,x(r.location).catch(G=>{}));const J={};for(const G in si)Object.defineProperty(J,G,{get:()=>s.value[G],enumerable:!0});X.provide(xg,U),X.provide(LE,b4(J)),X.provide(e0,s);const Z=X.unmount;Q.add(X),X.unmount=function(){Q.delete(X),Q.size<1&&(c=si,R&&R(),R=null,s.value=si,Y=!1,N=!1),Z()}}};function ee(X){return X.reduce((J,Z)=>J.then(()=>E(Z)),Promise.resolve())}return U}function zfe(){return je(xg)}const VE=M_("settings",{state:()=>({token:localStorage.getItem("admin_token")||"",serverConfig:{},browserConfig:{},workerConfig:[],poolConfig:{strategy:"least_busy",waitTimeout:120,failover:{enabled:!1,maxRetries:3}},adapterConfig:{},adaptersMeta:[]}),actions:{setToken(e){this.token=e,e?localStorage.setItem("admin_token",e):localStorage.removeItem("admin_token")},getHeaders(){const e={"Content-Type":"application/json"};return this.token&&(e.Authorization=`Bearer ${this.token}`),e},async checkAuth(){try{return(await fetch("/admin/status",{headers:this.getHeaders()})).status!==401}catch{return!1}},async handleResponse(e,t){let n={};try{n=await e.json()}catch{}if(e.ok)return t&&Gn.success(t),{success:!0,data:n};{console.error("Request failed:",e.status,n);const o=n.error?.message||n.message||`请求未成功: ${e.status} ${e.statusText}`;return Dt.error({title:"保存失败",content:o,okText:"好的"}),{success:!1,data:n}}},async fetchServerConfig(){try{const e=await fetch("/admin/config/server",{headers:this.getHeaders()});e.ok&&(this.serverConfig=await e.json())}catch(e){console.error("Fetch server config failed",e)}},async saveServerConfig(e){try{const t=await fetch("/admin/config/server",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"服务器设置保存成功")).success)return this.serverConfig=e,!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1},async fetchBrowserConfig(){try{const e=await fetch("/admin/config/browser",{headers:this.getHeaders()});e.ok&&(this.browserConfig=await e.json())}catch(e){console.error("Fetch browser config failed",e)}},async saveBrowserConfig(e){try{const t=await fetch("/admin/config/browser",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"浏览器设置保存成功")).success)return this.browserConfig=e,!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1},async fetchWorkerConfig(){try{const e=await fetch("/admin/config/instances",{headers:this.getHeaders()});e.ok&&(this.workerConfig=await e.json())}catch(e){console.error("Fetch instance configuration failed",e)}},async saveWorkerConfig(e){try{const t=await fetch("/admin/config/instances",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"实例配置保存成功")).success)return this.workerConfig=e,!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1},async fetchPoolConfig(){try{const e=await fetch("/admin/config/pool",{headers:this.getHeaders()});if(e.ok){const t=await e.json();this.poolConfig={strategy:t.strategy||"least_busy",waitTimeout:t.waitTimeout??120,failover:{enabled:t.failover?.enabled||!1,maxRetries:t.failover?.maxRetries||3}}}}catch(e){console.error("Fetch pool config failed",e)}},async savePoolConfig(e){try{const t=await fetch("/admin/config/pool",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"工作池设置保存成功")).success)return this.poolConfig=e,!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1},async fetchAdaptersMeta(){try{const e=await fetch("/admin/adapters",{headers:this.getHeaders()});e.ok&&(this.adaptersMeta=await e.json())}catch(e){console.error("Fetch adapters meta failed",e)}},async fetchAdapterConfig(){try{const e=await fetch("/admin/config/adapters",{headers:this.getHeaders()});e.ok&&(this.adapterConfig=await e.json())}catch(e){console.error("Fetch adapter config failed",e)}},async saveAdapterConfig(e){try{const t=await fetch("/admin/config/adapters",{method:"POST",headers:this.getHeaders(),body:JSON.stringify(e)});if((await this.handleResponse(t,"适配器设置保存成功")).success)return this.adapterConfig={...this.adapterConfig,...e},!0}catch(t){Dt.error({title:"保存失败 (网络异常)",content:t.message})}return!1}}}),Hfe={style:{padding:"20px 0"}},jfe={style:{"text-align":"center","margin-bottom":"24px"}},Vfe={__name:"LoginModal",props:{visible:{type:Boolean,required:!0}},emits:["update:visible","success"],setup(e,{emit:t}){const n=t,o=VE(),r=re(o.token),i=re(!1),l=async()=>{if(!r.value){Gn.warning("请输入 Token");return}i.value=!0;try{const a=o.token;o.setToken(r.value),await o.checkAuth()?(Gn.success("验证成功"),n("success"),n("update:visible",!1)):(Gn.error("Token 验证失败,请检查是否正确"),o.setToken(a))}catch{Gn.error("验证过程发生错误")}finally{i.value=!1}};return(a,s)=>{const c=_t("a-avatar"),u=_t("a-input-password"),d=_t("a-form-item"),p=_t("a-button"),g=_t("a-form"),v=_t("a-modal");return Mt(),Ji(v,{open:e.visible,title:"需要身份验证",closable:!1,maskClosable:!1,footer:null,width:"400px",centered:""},{default:tt(()=>[xt("div",Hfe,[xt("div",jfe,[f(c,{size:64,style:{"background-color":"#1890ff"}},{icon:tt(()=>[f(gt(Gf))]),_:1}),s[1]||(s[1]=xt("div",{style:{"margin-top":"16px","font-size":"16px","font-weight":"500"}}," WebAI2API 管理面板 ",-1)),s[2]||(s[2]=xt("div",{style:{color:"#8c8c8c","margin-top":"8px"}}," 请输入访问 API Token 以继续 ",-1))]),f(g,{layout:"vertical"},{default:tt(()=>[f(d,{label:"API Token"},{default:tt(()=>[f(u,{value:r.value,"onUpdate:value":s[0]||(s[0]=h=>r.value=h),placeholder:"请输入 API Token",size:"large",onPressEnter:l},{prefix:tt(()=>[f(gt(Gf),{style:{color:"rgba(0,0,0,.25)"}})]),_:1},8,["value"])]),_:1}),f(p,{type:"primary",block:"",size:"large",loading:i.value,onClick:l},{default:tt(()=>[...s[3]||(s[3]=[vt(" 验证并登录 ",-1)])]),_:1},8,["loading"])]),_:1})])]),_:1},8,["open"])}}},Wfe=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},Kfe={key:1},Gfe={href:"https://github.com/foxhui/WebAI2API",target:"_blank",style:{color:"#8c8c8c","font-size":"20px"}},Xfe={key:0},Ufe={style:{"margin-top":"8px","font-size":"12px",color:"#8c8c8c"}},Yfe={key:1},qfe={style:{"margin-top":"8px","font-size":"12px",color:"#ff4d4f"}},Zfe={key:2,style:{color:"#8c8c8c","font-size":"12px"}},Qfe={key:0},Jfe={style:{"margin-top":"8px","font-size":"12px",color:"#8c8c8c"}},epe={key:1},tpe={style:{"margin-top":"8px","font-size":"12px",color:"#ff4d4f"}},npe={key:2,style:{color:"#8c8c8c","font-size":"12px"}},ope={style:{"margin-bottom":"12px"}},rpe={style:{"margin-bottom":"12px"}},ipe={style:{"margin-bottom":"12px"}},lpe={style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"4px"}},ape={style:{margin:"0"}},spe={key:0,style:{"margin-top":"8px",display:"flex","flex-wrap":"wrap",gap:"4px"}},cpe={style:{"margin-bottom":"12px"}},upe={key:0},dpe={style:{"margin-bottom":"8px"}},fpe={key:0,style:{"font-size":"12px","max-height":"400px","overflow-y":"auto",background:"#fafafa",padding:"8px","border-radius":"4px"}},ppe={key:0,style:{"white-space":"pre-wrap","word-break":"break-all",margin:"0 0 8px 0"}},gpe={key:1,style:{display:"flex","flex-direction":"column",gap:"8px"}},hpe={style:{"font-size":"11px",color:"#8c8c8c","margin-bottom":"4px"}},vpe=["src","alt"],mpe={key:2,style:{display:"flex","flex-direction":"column",gap:"8px"}},bpe=["src"],ype={key:1},Spe={style:{"margin-top":"8px","font-size":"12px",color:"#ff4d4f"}},$pe={__name:"App",setup(e){const t=zfe(),n=VE(),o=re(["dash"]),r=re(!1),i=re(!1),l=re(!1),a=()=>{l.value=!0,n.setToken(""),setTimeout(()=>{l.value=!1,i.value=!0},500)},s=re(!1),c=re({models:{status:"pending",data:null,error:null},cookies:{status:"pending",data:null,error:null},chat:{status:"pending",data:null,error:null}}),u=re("Say hello in one word"),d=re(""),p=re([]),g=re([]),v=re(!1),h=re(""),b=async()=>{try{const L=await fetch("/v1/models",{headers:n.getHeaders()});if(L.ok){const P=await L.json();p.value=P.data||[],p.value.length>0&&!d.value&&(d.value=p.value[0].id)}}catch(L){console.error("获取模型列表失败",L)}},y=L=>new Promise((P,D)=>{const N=new FileReader;N.readAsDataURL(L),N.onload=()=>P(N.result),N.onerror=D}),S=L=>["image/png","image/jpeg","image/gif","image/webp"].includes(L.type)?(g.value.length>=10&&Gn.error("最多上传 10 张图片"),!1):(Gn.error("仅支持 PNG, JPEG, GIF, WebP 格式"),!1),$=async L=>{const P=L.file;if(P.status==="removed"){g.value=g.value.filter(D=>D.uid!==P.uid);return}try{const D=await y(P.originFileObj||P);g.value.push({uid:P.uid,name:P.name,base64:D})}catch{Gn.error("图片读取失败")}},x=L=>{const P=L.split(","),D=P[0].match(/:(.*?);/)[1],N=atob(P[1]);let k=N.length;const F=new Uint8Array(k);for(;k--;)F[k]=N.charCodeAt(k);return URL.createObjectURL(new Blob([F],{type:D}))},C=L=>{if(!L)return{text:"",images:[],videos:[]};if(L.trim().startsWith("data:video/"))try{const z=x(L.trim());return{text:"",images:[],videos:[{src:z,type:"video/mp4"}]}}catch(z){return console.error("视频转换失败",z),{text:L,images:[],videos:[]}}const P=/!\[([^\]]*)\]\(([^)]+)\)/g,D=[];let N,k=0,F=[];for(;(N=P.exec(L))!==null;)N.index>k&&F.push(L.substring(k,N.index)),D.push({alt:N[1]||"图片",src:N[2],type:"image"}),k=P.lastIndex;return k{c.value[L].status="loading",c.value[L].error=null,c.value[L].data=null,h.value="";try{let P,D;if(L==="models")P="/v1/models",D={headers:n.getHeaders()};else if(L==="cookies")P="/v1/cookies",D={headers:n.getHeaders()};else if(L==="chat"){P="/v1/chat/completions";let F;if(g.value.length>0){F=[{type:"text",text:u.value}];for(const z of g.value)F.push({type:"image_url",image_url:{url:z.base64}})}else F=u.value;if(D={method:"POST",headers:{...n.getHeaders(),"Content-Type":"application/json"},body:JSON.stringify({model:d.value,messages:[{role:"user",content:F}],stream:v.value})},v.value){const z=await fetch(P,D);if(!z.ok){const Q=await z.json();throw new Error(Q.error?.message||`HTTP ${z.status}`)}const H=z.body.getReader(),j=new TextDecoder;let Y="";for(;;){const{done:Q,value:U}=await H.read();if(Q)break;Y+=j.decode(U,{stream:!0});const ee=Y.split(` `);Y=ee.pop()||"";for(const X of ee)if(X.startsWith("data: ")){const J=X.slice(6).trim();if(J==="[DONE]")continue;try{const G=JSON.parse(J).choices?.[0]?.delta?.content||"";h.value+=G}catch{}}}c.value[L].status="success",c.value[L].data={content:h.value};return}}const N=await fetch(P,D),k=await N.json();N.ok?(c.value[L].status="success",L==="chat"&&k.choices?.[0]?.message?.content?c.value[L].data={content:k.choices[0].message.content}:c.value[L].data=k):(c.value[L].status="error",c.value[L].error=k.error?.message||`HTTP ${N.status}`)}catch(P){c.value[L].status="error",c.value[L].error=P.message}},w=()=>{s.value=!0,Object.keys(c.value).forEach(L=>{c.value[L]={status:"pending",data:null,error:null}}),g.value=[],b()},T={dash:"/","settings-server":"/settings/server","settings-workers":"/settings/workers","settings-browser":"/settings/browser","settings-adapters":"/settings/adapters","tools-display":"/tools/display","tools-cache":"/tools/cache","tools-logs":"/tools/logs"},E=({key:L})=>{const P=T[L];P&&t.push(P)},_=re(!0);let M=null,A=!1;async function R(){try{(await fetch("/admin/status",{headers:n.getHeaders(),signal:AbortSignal.timeout(5e3)})).ok&&A&&(A=!1,Dt.destroyAll(),window.location.reload())}catch{!A&&!_.value&&(A=!0,Dt.warning({title:"后端连接断开",content:"无法连接到后端服务,请检查服务是否正在运行。连接恢复后页面将自动刷新。",okText:"我知道了",centered:!0}))}}return We(async()=>{const L=()=>{window.innerWidth<=768&&(r.value=!0)};L(),window.addEventListener("resize",L);try{n.token?await n.checkAuth()||(n.setToken(""),i.value=!0):i.value=!0}catch(P){console.error("Auth check failed",P),i.value=!0}finally{_.value=!1}M=setInterval(R,5e3),wn(()=>{window.removeEventListener("resize",L),M&&clearInterval(M)})}),(L,P)=>{const D=_t("a-spin"),N=_t("a-button"),k=_t("a-flex"),F=_t("a-layout-header"),z=_t("a-menu-item"),H=_t("a-sub-menu"),j=_t("a-menu"),Y=_t("a-layout-sider"),Q=_t("router-view"),U=_t("a-layout-content"),ee=_t("a-card"),X=_t("a-layout-footer"),J=_t("a-layout"),Z=_t("a-tag"),G=_t("a-select-option"),q=_t("a-select"),V=_t("a-textarea"),K=_t("a-upload-dragger"),te=_t("a-checkbox"),ue=_t("a-space"),le=_t("a-drawer");return _.value?(Mt(),Ji(D,{key:0,spinning:_.value,tip:"正在验证身份...",size:"large",style:{height:"100vh",display:"flex","align-items":"center","justify-content":"center"}},null,8,["spinning"])):(Mt(),rn("div",Kfe,[f(Vfe,{visible:i.value,"onUpdate:visible":P[0]||(P[0]=ne=>i.value=ne)},null,8,["visible"]),f(J,{style:{"min-height":"100vh"},theme:"light"},{default:tt(()=>[f(F,{class:"header",style:{background:"rgba(255, 255, 255, 0.7)","backdrop-filter":"blur(20px)","-webkit-backdrop-filter":"blur(20px)","border-bottom":"1.5px solid rgba(0, 0, 0, 0.05)",display:"flex","align-items":"center",padding:"0 24px",position:"fixed",width:"100%",top:"0","z-index":"1000"}},{default:tt(()=>[P[12]||(P[12]=xt("div",{class:"logo",style:{"font-size":"1.25rem","font-weight":"bold",color:"#1890ff","margin-right":"24px"}}," WebAI2API ",-1)),f(k,{justify:"end",align:"center",style:{flex:"1"},gap:12},{default:tt(()=>[f(N,{onClick:w},{icon:tt(()=>[f(gt(O1))]),default:tt(()=>[P[10]||(P[10]=vt(" 接口测试 ",-1))]),_:1}),f(N,{danger:"",loading:l.value,onClick:a},{icon:tt(()=>[f(gt(M1))]),default:tt(()=>[P[11]||(P[11]=vt(" 退出登录 ",-1))]),_:1},8,["loading"])]),_:1})]),_:1}),f(J,{style:{"margin-top":"64px"}},{default:tt(()=>[f(Y,{collapsed:r.value,"onUpdate:collapsed":P[2]||(P[2]=ne=>r.value=ne),collapsible:"",theme:"light",style:{position:"fixed",left:"0",top:"64px",height:"calc(100vh - 64px)","overflow-y":"auto","z-index":"100"}},{default:tt(()=>[f(j,{selectedKeys:o.value,"onUpdate:selectedKeys":P[1]||(P[1]=ne=>o.value=ne),mode:"inline",onClick:E},{default:tt(()=>[f(z,{key:"dash"},{default:tt(()=>[f(gt(P1)),P[13]||(P[13]=xt("span",null,"状态概览",-1))]),_:1}),f(H,{key:"settings"},{title:tt(()=>[xt("span",null,[f(gt(A1)),P[14]||(P[14]=xt("span",null,"系统设置",-1))])]),default:tt(()=>[f(z,{key:"settings-server"},{default:tt(()=>[...P[15]||(P[15]=[vt("服务器",-1)])]),_:1}),f(z,{key:"settings-workers"},{default:tt(()=>[...P[16]||(P[16]=[vt("工作池",-1)])]),_:1}),f(z,{key:"settings-browser"},{default:tt(()=>[...P[17]||(P[17]=[vt("浏览器",-1)])]),_:1}),f(z,{key:"settings-adapters"},{default:tt(()=>[...P[18]||(P[18]=[vt("适配器",-1)])]),_:1})]),_:1}),f(H,{key:"tools"},{title:tt(()=>[xt("span",null,[f(gt(R1)),P[19]||(P[19]=xt("span",null,"系统管理",-1))])]),default:tt(()=>[f(z,{key:"tools-display"},{default:tt(()=>[...P[20]||(P[20]=[vt("虚拟显示器",-1)])]),_:1}),f(z,{key:"tools-cache"},{default:tt(()=>[...P[21]||(P[21]=[vt("缓存与重启",-1)])]),_:1}),f(z,{key:"tools-logs"},{default:tt(()=>[...P[22]||(P[22]=[vt("日志查看器",-1)])]),_:1})]),_:1})]),_:1},8,["selectedKeys"])]),_:1},8,["collapsed"]),f(J,{style:Jf({marginLeft:r.value?"80px":"200px",padding:"16px",transition:"margin-left 0.2s"})},{default:tt(()=>[f(U,{style:{"min-height":"280px"}},{default:tt(()=>[f(Q)]),_:1}),f(X,{class:"footer",style:{padding:"0px","margin-top":"10px"}},{default:tt(()=>[f(ee,{bordered:!1,bodyStyle:{padding:"16px 24px",display:"flex",justifyContent:"space-between",alignItems:"center"}},{default:tt(()=>[xt("div",null,[xt("a",Gfe,[f(gt(I1))])])]),_:1})]),_:1})]),_:1},8,["style"])]),_:1})]),_:1}),f(le,{open:s.value,"onUpdate:open":P[9]||(P[9]=ne=>s.value=ne),title:"接口测试",placement:"right",width:500},{default:tt(()=>[f(ue,{direction:"vertical",style:{width:"100%"},size:"large"},{default:tt(()=>[f(ee,{title:"GET /v1/models",size:"small"},{extra:tt(()=>[f(N,{size:"small",type:"primary",onClick:P[3]||(P[3]=ne=>O("models")),loading:c.value.models.status==="loading"},{default:tt(()=>[...P[23]||(P[23]=[vt(" 测试 ",-1)])]),_:1},8,["loading"])]),default:tt(()=>[c.value.models.status==="success"?(Mt(),rn("div",Xfe,[f(Z,{color:"success"},{default:tt(()=>[f(gt(hl)),P[24]||(P[24]=vt(" 成功 ",-1))]),_:1}),xt("div",Ufe," 返回 "+ao(c.value.models.data?.data?.length||0)+" 个模型 ",1)])):c.value.models.status==="error"?(Mt(),rn("div",Yfe,[f(Z,{color:"error"},{default:tt(()=>[f(gt(vl)),P[25]||(P[25]=vt(" 失败 ",-1))]),_:1}),xt("div",qfe,ao(c.value.models.error),1)])):(Mt(),rn("div",Zfe,"点击测试按钮开始"))]),_:1}),f(ee,{title:"GET /v1/cookies",size:"small"},{extra:tt(()=>[f(N,{size:"small",type:"primary",onClick:P[4]||(P[4]=ne=>O("cookies")),loading:c.value.cookies.status==="loading"},{default:tt(()=>[...P[26]||(P[26]=[vt(" 测试 ",-1)])]),_:1},8,["loading"])]),default:tt(()=>[c.value.cookies.status==="success"?(Mt(),rn("div",Qfe,[f(Z,{color:"success"},{default:tt(()=>[f(gt(hl)),P[27]||(P[27]=vt(" 成功 ",-1))]),_:1}),xt("div",Jfe," 返回 "+ao(c.value.cookies.data?.cookies?.length||0)+" 个 Cookie ",1)])):c.value.cookies.status==="error"?(Mt(),rn("div",epe,[f(Z,{color:"error"},{default:tt(()=>[f(gt(vl)),P[28]||(P[28]=vt(" 失败 ",-1))]),_:1}),xt("div",tpe,ao(c.value.cookies.error),1)])):(Mt(),rn("div",npe,"点击测试按钮开始"))]),_:1}),f(ee,{title:"POST /v1/chat/completions",size:"small"},{extra:tt(()=>[f(N,{size:"small",type:"primary",onClick:P[5]||(P[5]=ne=>O("chat")),loading:c.value.chat.status==="loading",disabled:!d.value},{default:tt(()=>[...P[29]||(P[29]=[vt(" 测试 ",-1)])]),_:1},8,["loading","disabled"])]),default:tt(()=>[xt("div",ope,[P[30]||(P[30]=xt("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"4px"}},"模型",-1)),f(q,{value:d.value,"onUpdate:value":P[6]||(P[6]=ne=>d.value=ne),style:{width:"100%"},size:"small",placeholder:"选择模型","show-search":""},{default:tt(()=>[(Mt(!0),rn(He,null,lu(p.value,ne=>(Mt(),Ji(G,{key:ne.id,value:ne.id},{default:tt(()=>[vt(ao(ne.id),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])]),xt("div",rpe,[P[31]||(P[31]=xt("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"4px"}},"提示词",-1)),f(V,{value:u.value,"onUpdate:value":P[7]||(P[7]=ne=>u.value=ne),placeholder:"输入提示词",rows:2,size:"small"},null,8,["value"])]),xt("div",ipe,[xt("div",lpe," 附加图片 ("+ao(g.value.length)+"/10) ",1),f(K,{"file-list":[],multiple:!0,"before-upload":S,onChange:$,accept:".png,.jpg,.jpeg,.gif,.webp","show-upload-list":!1,style:{padding:"8px"}},{default:tt(()=>[xt("p",ape,[f(gt(T1),{style:{"font-size":"24px",color:"#1890ff"}})]),P[32]||(P[32]=xt("p",{style:{"font-size":"12px",margin:"4px 0 0 0",color:"#8c8c8c"}}," 点击或拖拽上传图片 (PNG/JPEG/GIF/WebP) ",-1))]),_:1}),g.value.length>0?(Mt(),rn("div",spe,[(Mt(!0),rn(He,null,lu(g.value,ne=>(Mt(),Ji(Z,{key:ne.uid,closable:"",onClose:ce=>g.value=g.value.filter(se=>se.uid!==ne.uid)},{default:tt(()=>[f(gt(E1)),vt(" "+ao(ne.name.slice(0,15))+ao(ne.name.length>15?"...":""),1)]),_:2},1032,["onClose"]))),128))])):Xl("",!0)]),xt("div",cpe,[f(te,{checked:v.value,"onUpdate:checked":P[8]||(P[8]=ne=>v.value=ne)},{default:tt(()=>[...P[33]||(P[33]=[vt("流式响应",-1)])]),_:1},8,["checked"])]),c.value.chat.status==="loading"||c.value.chat.status==="success"?(Mt(),rn("div",upe,[xt("div",dpe,[c.value.chat.status==="loading"?(Mt(),Ji(Z,{key:0,color:"processing"},{default:tt(()=>[f(gt(Nn)),vt(" "+ao(v.value?"正在接收流式响应...":"请求中,可能需要较长时间..."),1)]),_:1})):(Mt(),Ji(Z,{key:1,color:"success"},{default:tt(()=>[f(gt(hl)),P[34]||(P[34]=vt(" 成功 ",-1))]),_:1}))]),(v.value?h.value:c.value.chat.data?.content)?(Mt(),rn("div",fpe,[C(v.value?h.value:c.value.chat.data?.content).text?(Mt(),rn("pre",ppe,ao(C(v.value?h.value:c.value.chat.data?.content).text),1)):Xl("",!0),C(v.value?h.value:c.value.chat.data?.content).images.length>0?(Mt(),rn("div",gpe,[(Mt(!0),rn(He,null,lu(C(v.value?h.value:c.value.chat.data?.content).images,(ne,ce)=>(Mt(),rn("div",{key:ce,style:{border:"1px solid #d9d9d9","border-radius":"4px",padding:"4px",background:"white"}},[xt("div",hpe,ao(ne.alt),1),xt("img",{src:ne.src,alt:ne.alt,style:{"max-width":"100%",height:"auto",display:"block","border-radius":"2px"}},null,8,vpe)]))),128))])):Xl("",!0),C(v.value?h.value:c.value.chat.data?.content).videos.length>0?(Mt(),rn("div",mpe,[(Mt(!0),rn(He,null,lu(C(v.value?h.value:c.value.chat.data?.content).videos,(ne,ce)=>(Mt(),rn("div",{key:"video-"+ce,style:{border:"1px solid #d9d9d9","border-radius":"4px",padding:"4px",background:"white"}},[P[35]||(P[35]=xt("div",{style:{"font-size":"11px",color:"#8c8c8c","margin-bottom":"4px"}},"生成的视频",-1)),xt("video",{src:ne.src,controls:"",style:{"max-width":"100%",height:"auto",display:"block","border-radius":"2px"}}," 您的浏览器不支持视频播放。 ",8,bpe)]))),128))])):Xl("",!0)])):Xl("",!0)])):c.value.chat.status==="error"?(Mt(),rn("div",ype,[f(Z,{color:"error"},{default:tt(()=>[f(gt(vl)),P[36]||(P[36]=vt(" 失败 ",-1))]),_:1}),xt("div",Spe,ao(c.value.chat.error),1)])):Xl("",!0)]),_:1})]),_:1})]),_:1},8,["open"])]))}}},Cpe=Wfe($pe,[["__scopeId","data-v-5ef25f71"]]),xpe=[{path:"/",component:()=>ii(()=>import("./dash.js"),__vite__mapDeps([0,1,2]))},{path:"/settings/server",component:()=>ii(()=>import("./server.js"),__vite__mapDeps([3,4]))},{path:"/settings/workers",component:()=>ii(()=>import("./workers.js"),[])},{path:"/settings/browser",component:()=>ii(()=>import("./browser.js"),[])},{path:"/settings/adapters",component:()=>ii(()=>import("./adapters.js"),[])},{path:"/tools/display",component:()=>ii(()=>import("./display.js"),__vite__mapDeps([5,2]))},{path:"/tools/cache",component:()=>ii(()=>import("./cache.js"),__vite__mapDeps([6,1]))},{path:"/tools/logs",component:()=>ii(()=>import("./logs.js"),__vite__mapDeps([7,8]))}],wpe=Lfe({history:mfe(),routes:xpe}),Ope=w_(),wg=mO(Cpe);wg.use(Ope);wg.use(wpe);wg.use(Rde);wg.mount("#app");export{r0 as A,Vp as B,hl as C,$g as D,jp as E,He as F,Ve as I,Nn as L,Dt as M,M1 as P,_1 as R,A1 as S,Wfe as _,wn as a,Ji as b,f as c,Mt as d,Xl as e,_t as f,xt as g,vt as h,vl as i,rn as j,VE as k,ut as l,Gn as m,I as n,We as o,lu as p,ii as q,re as r,Gr as s,ao as t,gt as u,g1 as v,tt as w,cg as x,M_ as y,w1 as z}; diff --git a/webui/dist/assets/workers.js b/webui/dist/assets/workers.js index 5471c2f..2865842 100644 --- a/webui/dist/assets/workers.js +++ b/webui/dist/assets/workers.js @@ -1 +1 @@ -import{k as re,n as D,o as ie,r as _,b as A,d as i,w as s,c as n,g as o,f as r,h as v,j as d,e as y,t as x,F as $,p as pe}from"./index.js";const ue={style:{"margin-bottom":"24px"}},de={style:{"margin-bottom":"8px"}},ve={style:{"margin-bottom":"8px"}},me={style:{display:"flex","justify-content":"flex-end","margin-top":"24px"}},ye={style:{display:"flex","justify-content":"space-between","align-items":"center"}},xe={key:0},ge={key:3},fe=["onClick"],ke=["onClick"],we={style:{"margin-bottom":"24px"}},be={style:{"margin-bottom":"16px"}},_e={style:{"margin-bottom":"16px"}},ce={style:{"margin-bottom":"16px"}},Ce={style:{"margin-bottom":"16px"}},Me={style:{"margin-left":"8px"}},Ue={key:0,style:{"margin-bottom":"16px"}},he={key:1,style:{"margin-bottom":"16px"}},Te={key:2,style:{"margin-bottom":"16px"}},Pe={key:3,style:{"margin-bottom":"16px"}},De={style:{"margin-left":"8px"}},Se={key:4,style:{"margin-bottom":"16px"}},We={key:5,style:{"margin-bottom":"16px"}},Ae={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-bottom":"8px"}},$e=["onClick"],ze=["onClick"],Ie={style:{"font-weight":"600"}},Ne={style:{"font-size":"12px",color:"#8c8c8c"}},He={key:0},je={key:0},Fe={style:{"text-align":"right"}},Oe={style:{"margin-bottom":"16px"}},Ve={style:{"margin-bottom":"16px"}},Be={style:{"margin-bottom":"16px"}},Ee={style:{"margin-bottom":"16px"}},Ke={__name:"workers",setup(Le){const u=re(),g=D({get:()=>u.poolConfig,set:l=>u.poolConfig=l}),H=async()=>{await u.savePoolConfig(g.value)};ie(async()=>{await Promise.all([u.fetchWorkerConfig(),u.fetchPoolConfig(),u.fetchAdaptersMeta()])});const j=D(()=>{const l=u.adaptersMeta.map(e=>({label:e.displayName||e.id,value:e.id}));return l.find(e=>e.value==="merge")||l.unshift({label:"Merge(聚合模式)",value:"merge"}),l}),F=D(()=>u.adaptersMeta.filter(l=>l.id!=="merge").map(l=>({label:l.displayName||l.id,value:l.id}))),h=l=>l==="merge"?"Merge(聚合模式)":u.adaptersMeta.find(k=>k.id===l)?.displayName||l,O=[{title:"实例名称",dataIndex:"name",key:"name"},{title:"Worker 数量",dataIndex:"workerCount",key:"workerCount"},{title:"代理",dataIndex:"proxy",key:"proxy"},{title:"数据标记",key:"userDataMark",dataIndex:"userDataMark"},{title:"操作",key:"action"}],T=D({get:()=>u.workerConfig,set:l=>{u.workerConfig=l}}),w=_(!1),f=_(null),a=_({name:"",userDataMark:"",proxy:!1,proxyType:"socks5",proxyHost:"",proxyPort:1080,proxyAuth:!1,proxyUsername:"",proxyPassword:"",workers:[]}),V=()=>{f.value=null;const l=Math.random().toString(36).substring(2,7);a.value={name:`instance-${(T.value||[]).length+1}-${l}`,userDataMark:"",proxy:!1,proxyType:"socks5",proxyHost:"",proxyPort:1080,proxyAuth:!1,proxyUsername:"",proxyPassword:"",workers:[]},w.value=!0},B=l=>{f.value=l,a.value={name:l.name,userDataMark:l.userDataMark||"",proxy:!!l.proxy,proxyType:l.proxy?.type||"socks5",proxyHost:l.proxy?.host||"",proxyPort:l.proxy?.port||1080,proxyAuth:l.proxy?.auth||!1,proxyUsername:l.proxy?.username||"",proxyPassword:l.proxy?.password||"",workers:l.workers?[...l.workers]:[]},(l.proxy===null||l.proxy===void 0)&&(a.value.proxy=!1),w.value=!0},E=async l=>{const e=T.value.filter(k=>k.id!==l.id);await u.saveWorkerConfig(e)},L=async()=>{const l={id:f.value?f.value.id:`inst_${Date.now()}`,name:a.value.name,userDataMark:a.value.userDataMark,workers:a.value.workers,proxy:a.value.proxy?{enable:!0,type:a.value.proxyType,host:a.value.proxyHost,port:a.value.proxyPort,auth:a.value.proxyAuth,username:a.value.proxyUsername,password:a.value.proxyPassword}:null};let e=[...T.value||[]];if(f.value===null)e.push(l);else{const b=e.findIndex(P=>P.id===f.value.id);b>-1&&(e[b]=l)}await u.saveWorkerConfig(e)&&(w.value=!1)},c=_(-1),C=_(!1),p=_({name:"",type:"lmarena",mergeTypes:[],mergeMonitor:""}),R=()=>{c.value=-1;const l=Math.random().toString(36).substring(2,7);p.value={name:`worker-${a.value.workers.length+1}-${l}`,type:"lmarena",mergeTypes:[],mergeMonitor:""},C.value=!0},K=l=>{c.value=l;const e=a.value.workers[l];p.value={name:e.name,type:e.type,mergeTypes:e.mergeTypes?[...e.mergeTypes]:[],mergeMonitor:e.mergeMonitor||""},C.value=!0},q=()=>{c.value===-1?a.value.workers.push({...p.value}):a.value.workers[c.value]={...p.value},C.value=!1},G=l=>{a.value.workers.splice(l,1)};return(l,e)=>{const k=r("a-segmented"),b=r("a-switch"),P=r("a-col"),z=r("a-input-number"),J=r("a-row"),M=r("a-button"),I=r("a-card"),Q=r("a-tag"),X=r("a-divider"),Y=r("a-table"),U=r("a-input"),Z=r("a-input-password"),ee=r("a-collapse-panel"),te=r("a-collapse"),oe=r("a-list-item"),ae=r("a-list"),le=r("a-drawer"),S=r("a-select"),N=r("a-select-option"),ne=r("a-modal"),se=r("a-layout");return i(),A(se,{style:{background:"transparent"}},{default:s(()=>[n(I,{title:"负载均衡",bordered:!1,style:{width:"100%","margin-bottom":"10px"}},{default:s(()=>[o("div",ue,[e[19]||(e[19]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"调度策略",-1)),e[20]||(e[20]=o("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"12px"}}," 选择任务分配到工作实例的调度算法 ",-1)),n(k,{value:g.value.strategy,"onUpdate:value":e[0]||(e[0]=t=>g.value.strategy=t),block:"",options:[{label:"最少繁忙",value:"least_busy"},{label:"轮询",value:"round_robin"},{label:"随机",value:"random"}]},null,8,["value"])]),n(J,{gutter:16},{default:s(()=>[n(P,{xs:24,md:12},{default:s(()=>[o("div",de,[e[21]||(e[21]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"故障转移",-1)),e[22]||(e[22]=o("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"12px"}}," 启用后,任务失败时会自动切换到其他可用实例重试 ",-1)),n(b,{checked:g.value.failover.enabled,"onUpdate:checked":e[1]||(e[1]=t=>g.value.failover.enabled=t)},null,8,["checked"])])]),_:1}),n(P,{xs:24,md:12},{default:s(()=>[o("div",ve,[e[23]||(e[23]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"重试次数",-1)),e[24]||(e[24]=o("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"12px"}}," 故障转移时最大重试次数,范围 1-10 ",-1)),n(z,{value:g.value.failover.maxRetries,"onUpdate:value":e[2]||(e[2]=t=>g.value.failover.maxRetries=t),min:1,max:10,disabled:!g.value.failover.enabled,style:{width:"100%"},placeholder:"请输入重试次数"},null,8,["value","disabled"])])]),_:1})]),_:1}),o("div",me,[n(M,{type:"primary",onClick:H},{default:s(()=>[...e[25]||(e[25]=[v(" 保存设置 ",-1)])]),_:1})])]),_:1}),n(I,{bordered:!1,style:{width:"100%"}},{title:s(()=>[o("div",ye,[e[27]||(e[27]=o("span",null,"实例列表",-1)),n(M,{type:"primary",onClick:V},{default:s(()=>[...e[26]||(e[26]=[v(" 创建实例 ",-1)])]),_:1})])]),default:s(()=>[n(Y,{columns:O,"data-source":T.value,pagination:!1},{bodyCell:s(({column:t,record:m})=>[t.key==="name"?(i(),d("a",xe,x(m.name),1)):t.key==="workerCount"?(i(),d($,{key:1},[v(x(m.workers?m.workers.length:0),1)],64)):t.key==="proxy"?(i(),A(Q,{key:2,color:m.proxy?"green":"default"},{default:s(()=>[v(x(m.proxy?"已启用":"未启用"),1)]),_:2},1032,["color"])):t.key==="action"?(i(),d("span",ge,[o("a",{onClick:W=>B(m)},"编辑",8,fe),n(X,{type:"vertical"}),o("a",{style:{color:"#ff4d4f"},onClick:W=>E(m)},"删除",8,ke)])):y("",!0)]),_:1},8,["data-source"])]),_:1}),n(le,{open:w.value,"onUpdate:open":e[13]||(e[13]=t=>w.value=t),title:f.value===null?"创建实例":`编辑实例 - ${f.value.name}`,placement:"right",width:"500"},{footer:s(()=>[o("div",Fe,[n(M,{style:{"margin-right":"8px"},onClick:e[12]||(e[12]=t=>w.value=!1)},{default:s(()=>[...e[40]||(e[40]=[v("取消",-1)])]),_:1}),n(M,{type:"primary",onClick:L},{default:s(()=>[...e[41]||(e[41]=[v("保存",-1)])]),_:1})])]),default:s(()=>[o("div",we,[o("div",be,[e[28]||(e[28]=o("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"实例名称",-1)),e[29]||(e[29]=o("div",{style:{"font-size":"12px",color:"#ff4d4f","margin-bottom":"8px"}}," * 名称必须全局唯一,不可重复 ",-1)),n(U,{value:a.value.name,"onUpdate:value":e[3]||(e[3]=t=>a.value.name=t),placeholder:"请输入实例名称"},null,8,["value"])]),o("div",_e,[e[30]||(e[30]=o("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"数据标记",-1)),e[31]||(e[31]=o("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"8px"}}," 用于区分实例数据存储的文件夹名称 (userDataMark) ",-1)),n(U,{value:a.value.userDataMark,"onUpdate:value":e[4]||(e[4]=t=>a.value.userDataMark=t),placeholder:"请输入数据标记,如: main-gemini"},null,8,["value"])]),o("div",ce,[n(te,null,{default:s(()=>[n(ee,{key:"proxy",header:"代理设置"},{default:s(()=>[o("div",Ce,[n(b,{checked:a.value.proxy,"onUpdate:checked":e[5]||(e[5]=t=>a.value.proxy=t)},null,8,["checked"]),o("span",Me,x(a.value.proxy?"已启用代理":"未启用代理"),1)]),a.value.proxy?(i(),d("div",Ue,[e[32]||(e[32]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"代理类型",-1)),n(k,{value:a.value.proxyType,"onUpdate:value":e[6]||(e[6]=t=>a.value.proxyType=t),block:"",options:[{label:"SOCKS5",value:"socks5"},{label:"HTTP",value:"http"}],style:{width:"100%"}},null,8,["value"])])):y("",!0),a.value.proxy?(i(),d("div",he,[e[33]||(e[33]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"服务器地址",-1)),n(U,{value:a.value.proxyHost,"onUpdate:value":e[7]||(e[7]=t=>a.value.proxyHost=t),placeholder:"例如: 127.0.0.1"},null,8,["value"])])):y("",!0),a.value.proxy?(i(),d("div",Te,[e[34]||(e[34]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"端口",-1)),n(z,{value:a.value.proxyPort,"onUpdate:value":e[8]||(e[8]=t=>a.value.proxyPort=t),min:1,max:65535,style:{width:"100%"},placeholder:"例如: 1080"},null,8,["value"])])):y("",!0),a.value.proxy?(i(),d("div",Pe,[e[35]||(e[35]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"身份验证",-1)),n(b,{checked:a.value.proxyAuth,"onUpdate:checked":e[9]||(e[9]=t=>a.value.proxyAuth=t)},null,8,["checked"]),o("span",De,x(a.value.proxyAuth?"需要验证":"无需验证"),1)])):y("",!0),a.value.proxy&&a.value.proxyAuth?(i(),d("div",Se,[e[36]||(e[36]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"用户名",-1)),n(U,{value:a.value.proxyUsername,"onUpdate:value":e[10]||(e[10]=t=>a.value.proxyUsername=t),placeholder:"请输入用户名"},null,8,["value"])])):y("",!0),a.value.proxy&&a.value.proxyAuth?(i(),d("div",We,[e[37]||(e[37]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"密码",-1)),n(Z,{value:a.value.proxyPassword,"onUpdate:value":e[11]||(e[11]=t=>a.value.proxyPassword=t),placeholder:"请输入密码"},null,8,["value"])])):y("",!0)]),_:1})]),_:1})]),o("div",null,[o("div",Ae,[e[39]||(e[39]=o("div",{style:{"font-weight":"600"}},"Worker 列表",-1)),n(M,{size:"small",type:"primary",onClick:R},{default:s(()=>[...e[38]||(e[38]=[v(" 添加 Worker ",-1)])]),_:1})]),n(ae,{bordered:"","data-source":a.value.workers,style:{"margin-top":"8px"}},{renderItem:s(({item:t,index:m})=>[n(oe,null,{actions:s(()=>[o("a",{onClick:W=>K(m)},"编辑",8,$e),o("a",{style:{color:"#ff4d4f"},onClick:W=>G(m)},"删除",8,ze)]),default:s(()=>[o("div",null,[o("div",Ie,x(t.name),1),o("div",Ne,[v(" 类型: "+x(h(t.type))+" ",1),t.type==="merge"?(i(),d("span",He,[v(" | 聚合: "+x(t.mergeTypes?.map(h).join(", ")||"无")+" ",1),t.mergeMonitor?(i(),d("span",je," | 监控: "+x(h(t.mergeMonitor)),1)):y("",!0)])):y("",!0)])])]),_:2},1024)]),_:1},8,["data-source"])])])]),_:1},8,["open","title"]),n(ne,{open:C.value,"onUpdate:open":e[18]||(e[18]=t=>C.value=t),title:c.value===-1?"添加 Worker":"编辑 Worker",okText:"确定",cancelText:"取消",onOk:q},{default:s(()=>[o("div",Oe,[e[42]||(e[42]=o("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"Worker 名称",-1)),e[43]||(e[43]=o("div",{style:{"font-size":"12px",color:"#ff4d4f","margin-bottom":"8px"}}," * 名称必须全局唯一,不可重复 ",-1)),n(U,{value:p.value.name,"onUpdate:value":e[14]||(e[14]=t=>p.value.name=t),placeholder:"例如: default"},null,8,["value"])]),o("div",Ve,[e[44]||(e[44]=o("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"适配器类型",-1)),n(S,{value:p.value.type,"onUpdate:value":e[15]||(e[15]=t=>p.value.type=t),style:{width:"100%"},options:j.value},null,8,["value","options"])]),p.value.type==="merge"?(i(),d($,{key:0},[o("div",Be,[e[45]||(e[45]=o("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"聚合类型",-1)),e[46]||(e[46]=o("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"8px"}}," 选择要聚合的后端适配器(可多选) ",-1)),n(S,{value:p.value.mergeTypes,"onUpdate:value":e[16]||(e[16]=t=>p.value.mergeTypes=t),mode:"multiple",style:{width:"100%"},placeholder:"选择要聚合的适配器",options:F.value},null,8,["value","options"])]),o("div",Ee,[e[48]||(e[48]=o("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"空闲监控后端",-1)),e[49]||(e[49]=o("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"8px"}}," 空闲时挂机监控的后端(可选) ",-1)),n(S,{value:p.value.mergeMonitor,"onUpdate:value":e[17]||(e[17]=t=>p.value.mergeMonitor=t),style:{width:"100%"},placeholder:"选择监控后端(可留空)","allow-clear":""},{default:s(()=>[n(N,{value:""},{default:s(()=>[...e[47]||(e[47]=[v("无",-1)])]),_:1}),(i(!0),d($,null,pe(p.value.mergeTypes,t=>(i(),A(N,{key:t,value:t},{default:s(()=>[v(x(h(t)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])],64)):y("",!0)]),_:1},8,["open","title"])]),_:1})}}};export{Ke as default}; +import{k as re,n as D,o as ie,r as _,b as W,d as i,w as s,c as n,g as t,f as r,h as v,j as d,e as x,t as g,F as z,p as pe}from"./index.js";const ue={style:{"margin-bottom":"24px"}},de={style:{"margin-bottom":"24px"}},ve={style:{"margin-bottom":"24px"}},me={style:{"margin-bottom":"8px"}},ye={style:{"margin-bottom":"8px"}},xe={style:{display:"flex","justify-content":"flex-end","margin-top":"24px"}},ge={style:{display:"flex","justify-content":"space-between","align-items":"center"}},fe={key:0},ke={key:3},we=["onClick"],be=["onClick"],_e={style:{"margin-bottom":"24px"}},Ce={style:{"margin-bottom":"16px"}},Me={style:{"margin-bottom":"16px"}},ce={style:{"margin-bottom":"16px"}},Ue={style:{"margin-bottom":"16px"}},Te={style:{"margin-left":"8px"}},he={key:0,style:{"margin-bottom":"16px"}},Pe={key:1,style:{"margin-bottom":"16px"}},De={key:2,style:{"margin-bottom":"16px"}},Ae={key:3,style:{"margin-bottom":"16px"}},Se={style:{"margin-left":"8px"}},We={key:4,style:{"margin-bottom":"16px"}},ze={key:5,style:{"margin-bottom":"16px"}},$e={style:{display:"flex","justify-content":"space-between","align-items":"center","margin-bottom":"8px"}},Ie=["onClick"],Ne=["onClick"],He={style:{"font-weight":"600"}},je={style:{"font-size":"12px",color:"#8c8c8c"}},Fe={key:0},Oe={key:0},Ve={style:{"text-align":"right"}},Be={style:{"margin-bottom":"16px"}},Ee={style:{"margin-bottom":"16px"}},Le={style:{"margin-bottom":"16px"}},Re={style:{"margin-bottom":"16px"}},Ge={__name:"workers",setup(Ke){const u=re(),m=D({get:()=>u.poolConfig,set:a=>u.poolConfig=a}),F=async()=>{await u.savePoolConfig(m.value)};ie(async()=>{await Promise.all([u.fetchWorkerConfig(),u.fetchPoolConfig(),u.fetchAdaptersMeta()])});const O=D(()=>{const a=u.adaptersMeta.map(e=>({label:e.displayName||e.id,value:e.id}));return a.find(e=>e.value==="merge")||a.unshift({label:"Merge(聚合模式)",value:"merge"}),a}),V=D(()=>u.adaptersMeta.filter(a=>a.id!=="merge").map(a=>({label:a.displayName||a.id,value:a.id}))),h=a=>a==="merge"?"Merge(聚合模式)":u.adaptersMeta.find(k=>k.id===a)?.displayName||a,B=[{title:"实例名称",dataIndex:"name",key:"name"},{title:"Worker 数量",dataIndex:"workerCount",key:"workerCount"},{title:"代理",dataIndex:"proxy",key:"proxy"},{title:"数据标记",key:"userDataMark",dataIndex:"userDataMark"},{title:"操作",key:"action"}],P=D({get:()=>u.workerConfig,set:a=>{u.workerConfig=a}}),w=_(!1),f=_(null),l=_({name:"",userDataMark:"",proxy:!1,proxyType:"socks5",proxyHost:"",proxyPort:1080,proxyAuth:!1,proxyUsername:"",proxyPassword:"",workers:[]}),E=()=>{f.value=null;const a=Math.random().toString(36).substring(2,7);l.value={name:`instance-${(P.value||[]).length+1}-${a}`,userDataMark:"",proxy:!1,proxyType:"socks5",proxyHost:"",proxyPort:1080,proxyAuth:!1,proxyUsername:"",proxyPassword:"",workers:[]},w.value=!0},L=a=>{f.value=a,l.value={name:a.name,userDataMark:a.userDataMark||"",proxy:!!a.proxy,proxyType:a.proxy?.type||"socks5",proxyHost:a.proxy?.host||"",proxyPort:a.proxy?.port||1080,proxyAuth:a.proxy?.auth||!1,proxyUsername:a.proxy?.username||"",proxyPassword:a.proxy?.password||"",workers:a.workers?[...a.workers]:[]},(a.proxy===null||a.proxy===void 0)&&(l.value.proxy=!1),w.value=!0},R=async a=>{const e=P.value.filter(k=>k.id!==a.id);await u.saveWorkerConfig(e)},K=async()=>{const a={id:f.value?f.value.id:`inst_${Date.now()}`,name:l.value.name,userDataMark:l.value.userDataMark,workers:l.value.workers,proxy:l.value.proxy?{enable:!0,type:l.value.proxyType,host:l.value.proxyHost,port:l.value.proxyPort,auth:l.value.proxyAuth,username:l.value.proxyUsername,password:l.value.proxyPassword}:null};let e=[...P.value||[]];if(f.value===null)e.push(a);else{const b=e.findIndex(c=>c.id===f.value.id);b>-1&&(e[b]=a)}await u.saveWorkerConfig(e)&&(w.value=!1)},C=_(-1),M=_(!1),p=_({name:"",type:"lmarena",mergeTypes:[],mergeMonitor:""}),q=()=>{C.value=-1;const a=Math.random().toString(36).substring(2,7);p.value={name:`worker-${l.value.workers.length+1}-${a}`,type:"lmarena",mergeTypes:[],mergeMonitor:""},M.value=!0},G=a=>{C.value=a;const e=l.value.workers[a];p.value={name:e.name,type:e.type,mergeTypes:e.mergeTypes?[...e.mergeTypes]:[],mergeMonitor:e.mergeMonitor||""},M.value=!0},J=()=>{C.value===-1?l.value.workers.push({...p.value}):l.value.workers[C.value]={...p.value},M.value=!1},Q=a=>{l.value.workers.splice(a,1)};return(a,e)=>{const k=r("a-segmented"),b=r("a-input-number"),c=r("a-switch"),$=r("a-col"),X=r("a-row"),I=r("a-collapse-panel"),N=r("a-collapse"),U=r("a-button"),H=r("a-card"),Y=r("a-tag"),Z=r("a-divider"),ee=r("a-table"),T=r("a-input"),te=r("a-input-password"),oe=r("a-list-item"),le=r("a-list"),ae=r("a-drawer"),A=r("a-select"),j=r("a-select-option"),ne=r("a-modal"),se=r("a-layout");return i(),W(se,{style:{background:"transparent"}},{default:s(()=>[n(H,{title:"负载均衡",bordered:!1,style:{width:"100%","margin-bottom":"10px"}},{default:s(()=>[t("div",ue,[e[20]||(e[20]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"调度策略",-1)),e[21]||(e[21]=t("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"12px"}}," 选择任务分配到工作实例的调度算法 ",-1)),n(k,{value:m.value.strategy,"onUpdate:value":e[0]||(e[0]=o=>m.value.strategy=o),block:"",options:[{label:"最少繁忙",value:"least_busy"},{label:"轮询",value:"round_robin"},{label:"随机",value:"random"}]},null,8,["value"])]),t("div",de,[e[23]||(e[23]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"生成等待超时",-1)),e[24]||(e[24]=t("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"12px"}}," 等待 AI 生成结果的最长时间,单位:秒(默认 120 秒) ",-1)),n(b,{value:m.value.waitTimeout,"onUpdate:value":e[1]||(e[1]=o=>m.value.waitTimeout=o),min:30,max:3600,step:30,style:{width:"100%"},placeholder:"请输入超时秒数"},{addonAfter:s(()=>[...e[22]||(e[22]=[v("秒",-1)])]),_:1},8,["value"])]),t("div",ve,[n(N,null,{default:s(()=>[n(I,{key:"failover",header:"故障转移"},{default:s(()=>[n(X,{gutter:16},{default:s(()=>[n($,{xs:24,md:12},{default:s(()=>[t("div",me,[e[25]||(e[25]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"启用故障转移",-1)),e[26]||(e[26]=t("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"12px"}}," 启用后,任务失败时会自动切换到其他可用实例重试 ",-1)),n(c,{checked:m.value.failover.enabled,"onUpdate:checked":e[2]||(e[2]=o=>m.value.failover.enabled=o)},null,8,["checked"])])]),_:1}),n($,{xs:24,md:12},{default:s(()=>[t("div",ye,[e[27]||(e[27]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"重试次数",-1)),e[28]||(e[28]=t("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"12px"}}," 故障转移时最大重试次数,范围 1-10 ",-1)),n(b,{value:m.value.failover.maxRetries,"onUpdate:value":e[3]||(e[3]=o=>m.value.failover.maxRetries=o),min:1,max:10,disabled:!m.value.failover.enabled,style:{width:"100%"},placeholder:"请输入重试次数"},null,8,["value","disabled"])])]),_:1})]),_:1})]),_:1})]),_:1})]),t("div",xe,[n(U,{type:"primary",onClick:F},{default:s(()=>[...e[29]||(e[29]=[v(" 保存设置 ",-1)])]),_:1})])]),_:1}),n(H,{bordered:!1,style:{width:"100%"}},{title:s(()=>[t("div",ge,[e[31]||(e[31]=t("span",null,"实例列表",-1)),n(U,{type:"primary",onClick:E},{default:s(()=>[...e[30]||(e[30]=[v(" 创建实例 ",-1)])]),_:1})])]),default:s(()=>[n(ee,{columns:B,"data-source":P.value,pagination:!1},{bodyCell:s(({column:o,record:y})=>[o.key==="name"?(i(),d("a",fe,g(y.name),1)):o.key==="workerCount"?(i(),d(z,{key:1},[v(g(y.workers?y.workers.length:0),1)],64)):o.key==="proxy"?(i(),W(Y,{key:2,color:y.proxy?"green":"default"},{default:s(()=>[v(g(y.proxy?"已启用":"未启用"),1)]),_:2},1032,["color"])):o.key==="action"?(i(),d("span",ke,[t("a",{onClick:S=>L(y)},"编辑",8,we),n(Z,{type:"vertical"}),t("a",{style:{color:"#ff4d4f"},onClick:S=>R(y)},"删除",8,be)])):x("",!0)]),_:1},8,["data-source"])]),_:1}),n(ae,{open:w.value,"onUpdate:open":e[14]||(e[14]=o=>w.value=o),title:f.value===null?"创建实例":`编辑实例 - ${f.value.name}`,placement:"right",width:"500"},{footer:s(()=>[t("div",Ve,[n(U,{style:{"margin-right":"8px"},onClick:e[13]||(e[13]=o=>w.value=!1)},{default:s(()=>[...e[44]||(e[44]=[v("取消",-1)])]),_:1}),n(U,{type:"primary",onClick:K},{default:s(()=>[...e[45]||(e[45]=[v("保存",-1)])]),_:1})])]),default:s(()=>[t("div",_e,[t("div",Ce,[e[32]||(e[32]=t("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"实例名称",-1)),e[33]||(e[33]=t("div",{style:{"font-size":"12px",color:"#ff4d4f","margin-bottom":"8px"}}," * 名称必须全局唯一,不可重复 ",-1)),n(T,{value:l.value.name,"onUpdate:value":e[4]||(e[4]=o=>l.value.name=o),placeholder:"请输入实例名称"},null,8,["value"])]),t("div",Me,[e[34]||(e[34]=t("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"数据标记",-1)),e[35]||(e[35]=t("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"8px"}}," 用于区分实例数据存储的文件夹名称 (userDataMark) ",-1)),n(T,{value:l.value.userDataMark,"onUpdate:value":e[5]||(e[5]=o=>l.value.userDataMark=o),placeholder:"请输入数据标记,如: main-gemini"},null,8,["value"])]),t("div",ce,[n(N,null,{default:s(()=>[n(I,{key:"proxy",header:"代理设置"},{default:s(()=>[t("div",Ue,[n(c,{checked:l.value.proxy,"onUpdate:checked":e[6]||(e[6]=o=>l.value.proxy=o)},null,8,["checked"]),t("span",Te,g(l.value.proxy?"已启用代理":"未启用代理"),1)]),l.value.proxy?(i(),d("div",he,[e[36]||(e[36]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"代理类型",-1)),n(k,{value:l.value.proxyType,"onUpdate:value":e[7]||(e[7]=o=>l.value.proxyType=o),block:"",options:[{label:"SOCKS5",value:"socks5"},{label:"HTTP",value:"http"}],style:{width:"100%"}},null,8,["value"])])):x("",!0),l.value.proxy?(i(),d("div",Pe,[e[37]||(e[37]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"服务器地址",-1)),n(T,{value:l.value.proxyHost,"onUpdate:value":e[8]||(e[8]=o=>l.value.proxyHost=o),placeholder:"例如: 127.0.0.1"},null,8,["value"])])):x("",!0),l.value.proxy?(i(),d("div",De,[e[38]||(e[38]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"端口",-1)),n(b,{value:l.value.proxyPort,"onUpdate:value":e[9]||(e[9]=o=>l.value.proxyPort=o),min:1,max:65535,style:{width:"100%"},placeholder:"例如: 1080"},null,8,["value"])])):x("",!0),l.value.proxy?(i(),d("div",Ae,[e[39]||(e[39]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"身份验证",-1)),n(c,{checked:l.value.proxyAuth,"onUpdate:checked":e[10]||(e[10]=o=>l.value.proxyAuth=o)},null,8,["checked"]),t("span",Se,g(l.value.proxyAuth?"需要验证":"无需验证"),1)])):x("",!0),l.value.proxy&&l.value.proxyAuth?(i(),d("div",We,[e[40]||(e[40]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"用户名",-1)),n(T,{value:l.value.proxyUsername,"onUpdate:value":e[11]||(e[11]=o=>l.value.proxyUsername=o),placeholder:"请输入用户名"},null,8,["value"])])):x("",!0),l.value.proxy&&l.value.proxyAuth?(i(),d("div",ze,[e[41]||(e[41]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"密码",-1)),n(te,{value:l.value.proxyPassword,"onUpdate:value":e[12]||(e[12]=o=>l.value.proxyPassword=o),placeholder:"请输入密码"},null,8,["value"])])):x("",!0)]),_:1})]),_:1})]),t("div",null,[t("div",$e,[e[43]||(e[43]=t("div",{style:{"font-weight":"600"}},"Worker 列表",-1)),n(U,{size:"small",type:"primary",onClick:q},{default:s(()=>[...e[42]||(e[42]=[v(" 添加 Worker ",-1)])]),_:1})]),n(le,{bordered:"","data-source":l.value.workers,style:{"margin-top":"8px"}},{renderItem:s(({item:o,index:y})=>[n(oe,null,{actions:s(()=>[t("a",{onClick:S=>G(y)},"编辑",8,Ie),t("a",{style:{color:"#ff4d4f"},onClick:S=>Q(y)},"删除",8,Ne)]),default:s(()=>[t("div",null,[t("div",He,g(o.name),1),t("div",je,[v(" 类型: "+g(h(o.type))+" ",1),o.type==="merge"?(i(),d("span",Fe,[v(" | 聚合: "+g(o.mergeTypes?.map(h).join(", ")||"无")+" ",1),o.mergeMonitor?(i(),d("span",Oe," | 监控: "+g(h(o.mergeMonitor)),1)):x("",!0)])):x("",!0)])])]),_:2},1024)]),_:1},8,["data-source"])])])]),_:1},8,["open","title"]),n(ne,{open:M.value,"onUpdate:open":e[19]||(e[19]=o=>M.value=o),title:C.value===-1?"添加 Worker":"编辑 Worker",okText:"确定",cancelText:"取消",onOk:J},{default:s(()=>[t("div",Be,[e[46]||(e[46]=t("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"Worker 名称",-1)),e[47]||(e[47]=t("div",{style:{"font-size":"12px",color:"#ff4d4f","margin-bottom":"8px"}}," * 名称必须全局唯一,不可重复 ",-1)),n(T,{value:p.value.name,"onUpdate:value":e[15]||(e[15]=o=>p.value.name=o),placeholder:"例如: default"},null,8,["value"])]),t("div",Ee,[e[48]||(e[48]=t("div",{style:{"font-weight":"600","margin-bottom":"8px"}},"适配器类型",-1)),n(A,{value:p.value.type,"onUpdate:value":e[16]||(e[16]=o=>p.value.type=o),style:{width:"100%"},options:O.value},null,8,["value","options"])]),p.value.type==="merge"?(i(),d(z,{key:0},[t("div",Le,[e[49]||(e[49]=t("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"聚合类型",-1)),e[50]||(e[50]=t("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"8px"}}," 选择要聚合的后端适配器(可多选) ",-1)),n(A,{value:p.value.mergeTypes,"onUpdate:value":e[17]||(e[17]=o=>p.value.mergeTypes=o),mode:"multiple",style:{width:"100%"},placeholder:"选择要聚合的适配器",options:V.value},null,8,["value","options"])]),t("div",Re,[e[52]||(e[52]=t("div",{style:{"font-weight":"600","margin-bottom":"4px"}},"空闲监控后端",-1)),e[53]||(e[53]=t("div",{style:{"font-size":"12px",color:"#8c8c8c","margin-bottom":"8px"}}," 空闲时挂机监控的后端(可选) ",-1)),n(A,{value:p.value.mergeMonitor,"onUpdate:value":e[18]||(e[18]=o=>p.value.mergeMonitor=o),style:{width:"100%"},placeholder:"选择监控后端(可留空)","allow-clear":""},{default:s(()=>[n(j,{value:""},{default:s(()=>[...e[51]||(e[51]=[v("无",-1)])]),_:1}),(i(!0),d(z,null,pe(p.value.mergeTypes,o=>(i(),W(j,{key:o,value:o},{default:s(()=>[v(g(h(o)),1)]),_:2},1032,["value"]))),128))]),_:1},8,["value"])])],64)):x("",!0)]),_:1},8,["open","title"])]),_:1})}}};export{Ge as default}; diff --git a/webui/src/components/settings/workers.vue b/webui/src/components/settings/workers.vue index 1e38ad8..bb03cfa 100644 --- a/webui/src/components/settings/workers.vue +++ b/webui/src/components/settings/workers.vue @@ -261,29 +261,47 @@ const handleRemoveWorker = (index) => { ]" /> - - - -
-
故障转移
-
- 启用后,任务失败时会自动切换到其他可用实例重试 -
- -
-
+ +
+
生成等待超时
+
+ 等待 AI 生成结果的最长时间,单位:秒(默认 120 秒) +
+ + + +
- -
-
重试次数
-
- 故障转移时最大重试次数,范围 1-10 -
- -
-
-
+ +
+ + + + +
+
启用故障转移
+
+ 启用后,任务失败时会自动切换到其他可用实例重试 +
+ +
+
+ + +
+
重试次数
+
+ 故障转移时最大重试次数,范围 1-10 +
+ +
+
+
+
+
+
diff --git a/webui/src/stores/settings.js b/webui/src/stores/settings.js index 6c6ef87..c4338b7 100644 --- a/webui/src/stores/settings.js +++ b/webui/src/stores/settings.js @@ -9,6 +9,7 @@ export const useSettingsStore = defineStore('settings', { workerConfig: [], poolConfig: { strategy: 'least_busy', + waitTimeout: 120, failover: { enabled: false, maxRetries: 3 @@ -164,6 +165,7 @@ export const useSettingsStore = defineStore('settings', { // 合并以确保结构存在 this.poolConfig = { strategy: data.strategy || 'least_busy', + waitTimeout: data.waitTimeout ?? 120, failover: { enabled: data.failover?.enabled || false, maxRetries: data.failover?.maxRetries || 3