mira-app-server
Version:
Mira Server - standalone server application using mira-app-core
109 lines (92 loc) • 76.4 kB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-OOzZz4T6.js","../css/index-CUYZI462.css"])))=>i.map(i=>d[i]);
import{aJ as N,cx as Fe,c8 as _,de as He,al as G,dl as ye,bJ as he,cM as oe,bZ as l,at as L,dq as u,cc as Y,cB as V,as as o,cr as d,G as se,aw as Ve,cT as Ae,aG as w,bM as le,b7 as ie,bV as de,bX as Be,ds as Ke,dt as ee,aW as Je,a1 as z,ax as v,c6 as ue,cO as Ye,ak as re,bB as ce,cN as _e,aH as c,cY as Q,bA as ne,f as Qe,e as Xe,d as Ze,c as $e,b as et,a as tt,B as pe,x as O,cb as X,bL as F,av as R,aQ as Re,bQ as ke,bb as q,d3 as rt,cR as qe,bH as be,g as at,E as Ee,dr as Le,dg as nt,dh as ot,aE as st,t as lt,p as it,o as dt,n as ut,l as ct,j as pt,c5 as Ie,a0 as we,d1 as Ne,d0 as mt,cF as Ge,cU as ft,d2 as Ue,db as vt}from"./index-OOzZz4T6.js";import{a as gt}from"./Collection-xoV-DHwv.js";import{u as bt}from"./useArrowNavigation-D-pctMGk.js";import{u as yt}from"./useKbd-kRIii9yh.js";import{I as Oe}from"./Input-CZG1tOaA.js";import{L as je}from"./Label-bwL3QO2u.js";import{B as ht}from"./index--EpjhOjd.js";import{c as Se}from"./createLucideIcon-DGRAKu_b.js";import{b as wt,d as xt,c as _t,T as kt}from"./TabsTrigger-BT8zVtVt.js";import"./usePrimitiveElement-CCN0lZVt.js";const St={"aria-live":"polite","aria-atomic":"true",role:"status",style:{transform:"translateX(-100%)",position:"absolute",pointerEvents:"none",opacity:0,margin:0}},[ze,Ct]=Ve("StepperRoot");var Dt=N({__name:"StepperRoot",props:{defaultValue:{type:Number,required:!1,default:1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},modelValue:{type:Number,required:!1},linear:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(r,{expose:a,emit:n}){const e=r,i=n,{dir:s,orientation:t,linear:p}=Fe(e),k=gt(s),g=_(new Set),m=He(e,"modelValue",i,{defaultValue:e.defaultValue,passive:e.modelValue===void 0}),y=G(()=>Array.from(g.value)),T=G(()=>m.value===1),S=G(()=>m.value===y.value.length),I=G(()=>g.value.size);function P(A){A>I.value||A<1||g.value.size&&y.value[A]&&y.value[A].getAttribute("disabled")||p.value&&A>(m.value??1)+1||(m.value=A)}function E(){P((m.value??1)+1)}function j(){P((m.value??1)-1)}function h(){return(m.value??1)<I.value}function D(){return(m.value??1)>1}const f=_(null),b=_(null),C=G(()=>f.value?f.value.getAttribute("disabled")==="":!0),M=G(()=>b.value?b.value.getAttribute("disabled")==="":!0);return ye(m,async()=>{await he(()=>{f.value=y.value.length&&m.value<y.value.length?y.value[m.value]:null,b.value=y.value.length&&m.value>1?y.value[m.value-2]:null})}),ye(y,async()=>{await he(()=>{f.value=y.value.length&&m.value<y.value.length?y.value[m.value]:null,b.value=y.value.length&&m.value>1?y.value[m.value-2]:null})}),Ct({modelValue:m,changeModelValue:A=>{m.value=A},orientation:t,dir:k,linear:p,totalStepperItems:g}),a({goToStep:P,nextStep:E,prevStep:j,modelValue:m,totalSteps:I,isNextDisabled:C,isPrevDisabled:M,isFirstStep:T,isLastStep:S,hasNext:h,hasPrev:D}),oe(),(A,Z)=>(l(),L(V(se),{role:"group","aria-label":"progress",as:A.as,"as-child":A.asChild,"data-linear":V(p)?"":void 0,"data-orientation":A.orientation},{default:u(()=>[Y(A.$slots,"default",{modelValue:V(m),totalSteps:g.value.size,isNextDisabled:C.value,isPrevDisabled:M.value,isFirstStep:T.value,isLastStep:S.value,goToStep:P,nextStep:E,prevStep:j,hasNext:h,hasPrev:D}),o("div",St," Step "+d(V(m))+" of "+d(g.value.size),1)]),_:3},8,["as","as-child","data-linear","data-orientation"]))}}),At=Dt;const[We,Lt]=Ve("StepperItem");var It=N({__name:"StepperItem",props:{step:{type:Number,required:!0},disabled:{type:Boolean,required:!1,default:!1},completed:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const a=r,{disabled:n,step:e,completed:i}=Fe(a),{forwardRef:s}=oe(),t=ze(),p=Ae(void 0,"reka-stepper-item-title"),k=Ae(void 0,"reka-stepper-item-description"),g=G(()=>i.value?"completed":t.modelValue.value===e.value?"active":t.modelValue.value>e.value?"completed":"inactive"),m=G(()=>n.value?!1:t.linear.value?e.value<=t.modelValue.value||e.value===t.modelValue.value+1:!0);return Lt({titleId:p,descriptionId:k,state:g,disabled:n,step:e,isFocusable:m}),(y,T)=>(l(),L(V(se),{ref:V(s),as:y.as,"as-child":y.asChild,"aria-current":g.value==="active"?"true":void 0,"data-state":g.value,disabled:V(n)||!m.value?"":void 0,"data-disabled":V(n)||!m.value?"":void 0,"data-orientation":V(t).orientation.value},{default:u(()=>[Y(y.$slots,"default",{state:g.value})]),_:3},8,["as","as-child","aria-current","data-state","disabled","data-disabled","data-orientation"]))}}),Tt=It,Pt=N({__name:"StepperIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(r){const a=r,n=We();return oe(),(e,i)=>(l(),L(V(se),le(ie(a)),{default:u(()=>[Y(e.$slots,"default",{step:V(n).step.value},()=>[w(" Step "+d(V(n).step.value),1)])]),_:3},16))}}),Mt=Pt,Ft=N({__name:"StepperTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(r){const a=ze(),n=We(),e=yt(),i=G(()=>Array.from(a.totalStepperItems.value));function s(g){if(!n.disabled.value){if(a.linear.value){if((n.step.value<=a.modelValue.value||n.step.value===a.modelValue.value+1)&&g.ctrlKey===!1){a.changeModelValue(n.step.value);return}}else if(g.ctrlKey===!1){a.changeModelValue(n.step.value);return}g.preventDefault()}}function t(g){g.preventDefault(),!n.disabled.value&&((g.key===e.ENTER||g.key===e.SPACE)&&!g.ctrlKey&&!g.shiftKey&&a.changeModelValue(n.step.value),[e.ARROW_LEFT,e.ARROW_RIGHT,e.ARROW_UP,e.ARROW_DOWN].includes(g.key)&&bt(g,Je(),void 0,{itemsArray:i.value,focus:!0,loop:!1,arrowKeyOptions:a.orientation.value,dir:a.dir.value}))}const{forwardRef:p,currentElement:k}=oe();return de(()=>{a.totalStepperItems.value.add(k.value)}),Be(()=>{a.totalStepperItems.value.delete(k.value)}),(g,m)=>(l(),L(V(se),{ref:V(p),type:g.as==="button"?"button":void 0,as:g.as,"as-child":g.asChild,"data-state":V(n).state.value,disabled:V(n).disabled.value||!V(n).isFocusable.value?"":void 0,"data-disabled":V(n).disabled.value||!V(n).isFocusable.value?"":void 0,"data-orientation":V(a).orientation.value,tabindex:V(n).isFocusable.value?0:-1,"aria-describedby":V(n).descriptionId,"aria-labelledby":V(n).titleId,onMousedown:ee(s,["left"]),onKeydown:Ke(t,["enter","space","left","right","up","down"])},{default:u(()=>[Y(g.$slots,"default")]),_:3},8,["type","as","as-child","data-state","disabled","data-disabled","data-orientation","tabindex","aria-describedby","aria-labelledby"]))}}),Vt=Ft;/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Bt=Se("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rt=Se("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-vue-next v1.0.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ce=Se("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Te=`#version 300 es
in vec2 position;
void main() {
gl_Position = vec4(position, 0.0, 1.0);
}
`,Pe=`#version 300 es
precision highp float;
uniform float uTime;
uniform float uAmplitude;
uniform vec3 uColorStops[3];
uniform vec2 uResolution;
uniform float uBlend;
out vec4 fragColor;
vec3 permute(vec3 x) {
return mod(((x * 34.0) + 1.0) * x, 289.0);
}
float snoise(vec2 v){
const vec4 C = vec4(
0.211324865405187, 0.366025403784439,
-0.577350269189626, 0.024390243902439
);
vec2 i = floor(v + dot(v, C.yy));
vec2 x0 = v - i + dot(i, C.xx);
vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);
vec4 x12 = x0.xyxy + C.xxzz;
x12.xy -= i1;
i = mod(i, 289.0);
vec3 p = permute(
permute(i.y + vec3(0.0, i1.y, 1.0))
+ i.x + vec3(0.0, i1.x, 1.0)
);
vec3 m = max(
0.5 - vec3(
dot(x0, x0),
dot(x12.xy, x12.xy),
dot(x12.zw, x12.zw)
),
0.0
);
m = m * m;
m = m * m;
vec3 x = 2.0 * fract(p * C.www) - 1.0;
vec3 h = abs(x) - 0.5;
vec3 ox = floor(x + 0.5);
vec3 a0 = x - ox;
m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);
vec3 g;
g.x = a0.x * x0.x + h.x * x0.y;
g.yz = a0.yz * x12.xz + h.yz * x12.yw;
return 130.0 * dot(m, g);
}
struct ColorStop {
vec3 color;
float position;
};
#define COLOR_RAMP(colors, factor, finalColor) { int index = 0; for (int i = 0; i < 2; i++) { ColorStop currentColor = colors[i]; bool isInBetween = currentColor.position <= factor; index = int(mix(float(index), float(i), float(isInBetween))); } ColorStop currentColor = colors[index]; ColorStop nextColor = colors[index + 1]; float range = nextColor.position - currentColor.position; float lerpFactor = (factor - currentColor.position) / range; finalColor = mix(currentColor.color, nextColor.color, lerpFactor); }
void main() {
vec2 uv = gl_FragCoord.xy / uResolution;
ColorStop colors[3];
colors[0] = ColorStop(uColorStops[0], 0.0);
colors[1] = ColorStop(uColorStops[1], 0.5);
colors[2] = ColorStop(uColorStops[2], 1.0);
vec3 rampColor;
COLOR_RAMP(colors, uv.x, rampColor);
float height = snoise(vec2(uv.x * 2.0 + uTime * 0.1, uTime * 0.25)) * 0.5 * uAmplitude;
height = exp(height);
height = (uv.y * 2.0 - height + 0.2);
float intensity = 0.6 * height;
float midPoint = 0.20;
float auroraAlpha = smoothstep(midPoint - uBlend * 0.5, midPoint + uBlend * 0.5, intensity);
vec3 auroraColor = intensity * rampColor;
fragColor = vec4(auroraColor * auroraAlpha, auroraAlpha);
}
`,qt=N({__name:"Aurora",props:{colorStops:{type:Array,required:!1,default:()=>["#3A29FF","#FF94B4","#FF3232"]},amplitude:{type:Number,required:!1,default:1},blend:{type:Number,required:!1,default:.5},speed:{type:Number,required:!1,default:1}},setup(r,{expose:a}){a();function n(h){const D=parseInt(h.slice(1,3),16)/255,f=parseInt(h.slice(3,5),16)/255,b=parseInt(h.slice(5,7),16)/255;return[D,f,b]}function e(h,D,f){const b=h.createShader(D);if(h.shaderSource(b,f),h.compileShader(b),!h.getShaderParameter(b,h.COMPILE_STATUS)){const C=h.getShaderInfoLog(b);throw h.deleteShader(b),new Error("Shader compile error: "+C)}return b}const i=r,s=_();let t=null,p=null,k=0,g=0;const m={};function y(){if(!t||!p)return;t.useProgram(p),i.colorStops.map(n).forEach((C,M)=>{const A=t.getUniformLocation(p,`uColorStops[${M}]`);A&&t.uniform3f(A,C[0],C[1],C[2])});const D=m.uResolution;D&&t.uniform2f(D,s.value.offsetWidth,s.value.offsetHeight);const f=m.uAmplitude;f&&t.uniform1f(f,i.amplitude);const b=m.uBlend;b&&t.uniform1f(b,i.blend)}function T(){if(!t||!s.value)return;const h=s.value.offsetWidth,D=s.value.offsetHeight,f=t.canvas;f.width=h*devicePixelRatio,f.height=D*devicePixelRatio,f.style.width=h+"px",f.style.height=D+"px",t.viewport(0,0,f.width,f.height),m.uResolution&&t.uniform2f(m.uResolution,h,D)}function S(){const h=s.value;if(!h)return;const D=document.createElement("canvas");if(h.appendChild(D),t=D.getContext("webgl2",{alpha:!0,premultipliedAlpha:!0,antialias:!0}),!t)return;t.clearColor(0,0,0,0),t.enable(t.BLEND),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA);const f=e(t,t.VERTEX_SHADER,Te),b=e(t,t.FRAGMENT_SHADER,Pe);if(p=t.createProgram(),t.attachShader(p,f),t.attachShader(p,b),t.linkProgram(p),t.deleteShader(f),t.deleteShader(b),!t.getProgramParameter(p,t.LINK_STATUS))throw new Error("Program link error: "+t.getProgramInfoLog(p));t.useProgram(p);const C=new Float32Array([-1,-1,3,-1,-1,3]),M=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,M),t.bufferData(t.ARRAY_BUFFER,C,t.STATIC_DRAW);const A=t.getAttribLocation(p,"position");t.enableVertexAttribArray(A),t.vertexAttribPointer(A,2,t.FLOAT,!1,0,0),m.uTime=t.getUniformLocation(p,"uTime"),m.uAmplitude=t.getUniformLocation(p,"uAmplitude"),m.uResolution=t.getUniformLocation(p,"uResolution"),m.uBlend=t.getUniformLocation(p,"uBlend"),y(),T(),g=performance.now(),I()}function I(){if(!t||!p)return;k=requestAnimationFrame(I);const D=(performance.now()-g)*.001*i.speed*.1;t.useProgram(p),m.uTime&&t.uniform1f(m.uTime,D),i.colorStops.map(n).forEach((b,C)=>{const M=t.getUniformLocation(p,`uColorStops[${C}]`);M&&t.uniform3f(M,b[0],b[1],b[2])}),m.uAmplitude&&t.uniform1f(m.uAmplitude,i.amplitude),m.uBlend&&t.uniform1f(m.uBlend,i.blend),t.drawArrays(t.TRIANGLES,0,3)}function P(){if(cancelAnimationFrame(k),t){const h=t.getExtension("WEBGL_lose_context");h&&h.loseContext();const D=t.canvas;s.value&&D.parentNode===s.value&&s.value.removeChild(D),t=null,p=null}}const E=()=>T();de(()=>{S(),window.addEventListener("resize",E)}),Be(()=>{window.removeEventListener("resize",E),P()});const j={VERT:Te,FRAG:Pe,hexToRGB:n,compileShader:e,props:i,container:s,get gl(){return t},set gl(h){t=h},get program(){return p},set program(h){p=h},get animId(){return k},set animId(h){k=h},get startTime(){return g},set startTime(h){g=h},uniformLocations:m,setUniforms:y,resize:T,initGL:S,animate:I,cleanup:P,onResize:E};return Object.defineProperty(j,"__isScriptSetup",{enumerable:!1,value:!0}),j}}),Et={ref:"container",class:"w-full h-full"};function Nt(r,a,n,e,i,s){return l(),v("div",Et,null,512)}const Gt=z(qt,[["render",Nt],["__file","D:/mira_typescript/packages/mira-client/src/renderer/components/Aurora.vue"]]),Ut=N({__name:"Stepper",props:{defaultValue:{type:Number,required:!1},orientation:{type:String,required:!1},dir:{type:String,required:!1},modelValue:{type:Number,required:!1},linear:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},class:{type:null,required:!1}},emits:["update:modelValue"],setup(r,{expose:a,emit:n}){a();const e=r,i=n,s=ue(e,"class"),t=Ye(s,i),p={props:e,emits:i,delegatedProps:s,forwarded:t,get StepperRoot(){return At},get cn(){return re}};return Object.defineProperty(p,"__isScriptSetup",{enumerable:!1,value:!0}),p}});function Ot(r,a,n,e,i,s){return l(),L(e.StepperRoot,ce({class:e.cn("flex gap-2",e.props.class)},e.forwarded),{default:u(t=>[Y(r.$slots,"default",le(ie(t)))]),_:3},16,["class"])}const jt=z(Ut,[["render",Ot],["__file","D:/mira_typescript/packages/mira-client/src/components/ui/stepper/Stepper.vue"]]),zt=N({__name:"StepperIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},class:{type:null,required:!1}},setup(r,{expose:a}){a();const n=r,e=ue(n,"class"),i=_e(e),s={props:n,delegatedProps:e,forwarded:i,get StepperIndicator(){return Mt},get cn(){return re}};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}});function Wt(r,a,n,e,i,s){return l(),L(e.StepperIndicator,ce(e.forwarded,{class:e.cn("inline-flex items-center justify-center rounded-full text-muted-foreground/50 w-8 h-8","group-data-[disabled]:text-muted-foreground group-data-[disabled]:opacity-50","group-data-[state=active]:bg-primary group-data-[state=active]:text-primary-foreground","group-data-[state=completed]:bg-accent group-data-[state=completed]:text-accent-foreground",e.props.class)}),{default:u(t=>[Y(r.$slots,"default",le(ie(t)))]),_:3},16,["class"])}const Ht=z(zt,[["render",Wt],["__file","D:/mira_typescript/packages/mira-client/src/components/ui/stepper/StepperIndicator.vue"]]),Kt=N({__name:"StepperItem",props:{step:{type:Number,required:!0},disabled:{type:Boolean,required:!1},completed:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},class:{type:null,required:!1}},setup(r,{expose:a}){a();const n=r,e=ue(n,"class"),i=_e(e),s={props:n,delegatedProps:e,forwarded:i,get StepperItem(){return Tt},get cn(){return re}};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}});function Jt(r,a,n,e,i,s){return l(),L(e.StepperItem,ce(e.forwarded,{class:e.cn("flex items-center gap-2 group data-[disabled]:pointer-events-none",e.props.class)}),{default:u(t=>[Y(r.$slots,"default",le(ie(t)))]),_:3},16,["class"])}const Yt=z(Kt,[["render",Jt],["__file","D:/mira_typescript/packages/mira-client/src/components/ui/stepper/StepperItem.vue"]]),Qt=N({__name:"StepperTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1},class:{type:null,required:!1}},setup(r,{expose:a}){a();const n=r,e=ue(n,"class"),i=_e(e),s={props:n,delegatedProps:e,forwarded:i,get StepperTrigger(){return Vt},get cn(){return re}};return Object.defineProperty(s,"__isScriptSetup",{enumerable:!1,value:!0}),s}});function Xt(r,a,n,e,i,s){return l(),L(e.StepperTrigger,ce(e.forwarded,{class:e.cn("p-1 flex flex-col items-center text-center gap-1 rounded-md",e.props.class)}),{default:u(()=>[Y(r.$slots,"default")]),_:3},16,["class"])}const Zt=z(Qt,[["render",Xt],["__file","D:/mira_typescript/packages/mira-client/src/components/ui/stepper/StepperTrigger.vue"]]),$t=N({name:"LoginStepper",__name:"LoginStepper",props:{currentStep:{type:Number,required:!0},healthData:{type:[Object,null],required:!0}},setup(r,{expose:a}){a();const n={get Stepper(){return jt},get StepperItem(){return Yt},get StepperTrigger(){return Zt},get StepperIndicator(){return Ht}};return Object.defineProperty(n,"__isScriptSetup",{enumerable:!1,value:!0}),n}}),er={class:"text-xs text-muted-foreground dark:text-muted-foreground mt-1 text-center"},tr={class:"text-xs text-muted-foreground dark:text-muted-foreground mt-1 text-center"},rr={class:"text-xs text-muted-foreground dark:text-muted-foreground mt-1 text-center"};function ar(r,a,n,e,i,s){return l(),L(e.Stepper,{"model-value":n.currentStep,class:"flex items-center justify-center gap-0 mb-6"},{default:u(()=>[c(e.StepperItem,{step:1,completed:n.currentStep>1},{default:u(()=>[c(e.StepperTrigger,null,{default:u(()=>[c(e.StepperIndicator,null,{default:u(()=>a[0]||(a[0]=[w("1")])),_:1})]),_:1}),o("div",er,d(r.$t("views.loginStepper.server")),1)]),_:1},8,["completed"]),a[3]||(a[3]=o("div",{class:"flex-1 h-0.5 bg-accent dark:bg-muted mx-2 self-center -mt-4"},null,-1)),c(e.StepperItem,{step:2,completed:n.currentStep>2,disabled:!n.healthData||n.healthData.authRequired===!1},{default:u(()=>[c(e.StepperTrigger,null,{default:u(()=>[c(e.StepperIndicator,null,{default:u(()=>a[1]||(a[1]=[w("2")])),_:1})]),_:1}),o("div",tr,d(r.$t("views.loginStepper.auth")),1)]),_:1},8,["completed","disabled"]),a[4]||(a[4]=o("div",{class:"flex-1 h-0.5 bg-accent dark:bg-muted mx-2 self-center -mt-4"},null,-1)),c(e.StepperItem,{step:3,disabled:n.currentStep<3},{default:u(()=>[c(e.StepperTrigger,null,{default:u(()=>[c(e.StepperIndicator,null,{default:u(()=>a[2]||(a[2]=[w("3")])),_:1})]),_:1}),o("div",rr,d(r.$t("views.loginStepper.library")),1)]),_:1},8,["disabled"])]),_:1},8,["model-value"])}const nr=z($t,[["render",ar],["__file","D:/mira_typescript/packages/mira-client/src/renderer/views/LoginView/LoginStepper.vue"]]),or=N({name:"ServerStep",__name:"ServerStep",props:ne({loading:{type:Boolean,required:!0},selectedServerId:{type:String,required:!0},services:{type:Array,required:!0},backendStatus:{type:Object,required:!0},backendStatusLabel:{type:Function,required:!0},backendStatusClass:{type:Function,required:!0},backendStatusDotClass:{type:Function,required:!0}},{showAddForm:{type:Boolean,required:!0},showAddFormModifiers:{},showWsField:{type:Boolean,required:!0},showWsFieldModifiers:{},serverName:{type:String,required:!0},serverNameModifiers:{},serverAddress:{type:String,required:!0},serverAddressModifiers:{},wsAddress:{type:String,required:!0},wsAddressModifiers:{}}),emits:ne(["quickConnect","testConnection","deleteServer"],["update:showAddForm","update:showWsField","update:serverName","update:serverAddress","update:wsAddress"]),setup(r,{expose:a,emit:n}){a();const e=Q(r,"showAddForm"),i=Q(r,"showWsField"),s=Q(r,"serverName"),t=Q(r,"serverAddress"),p=Q(r,"wsAddress"),k=n,g=_(null);function m(P){g.value=P}function y(P){P||T()}function T(){g.value=null}async function S(){const P=g.value;P&&(T(),await he(),k("deleteServer",P.id))}const I={showAddForm:e,showWsField:i,serverName:s,serverAddress:t,wsAddress:p,emit:k,deleteTarget:g,openDeleteDialog:m,handleDeleteDialogOpenChange:y,closeDeleteDialog:T,handleDeleteServer:S,get Input(){return Oe},get Button(){return pe},get Label(){return je},get Badge(){return ht},get Loader2(){return Ce},get AlertDialog(){return tt},get AlertDialogContent(){return et},get AlertDialogDescription(){return $e},get AlertDialogFooter(){return Ze},get AlertDialogHeader(){return Xe},get AlertDialogTitle(){return Qe}};return Object.defineProperty(I,"__isScriptSetup",{enumerable:!1,value:!0}),I}}),sr={key:0,class:"flex flex-col gap-4"},lr={class:"flex flex-col gap-3"},ir={class:"text-sm text-muted-foreground dark:text-muted-foreground"},dr=["onClick"],ur={key:0,class:"absolute inset-0 z-10 flex items-center justify-center bg-background/60 backdrop-blur-[1px]"},cr={class:"flex items-center gap-2 text-primary dark:text-primary"},pr={class:"text-xs font-medium"},mr={key:1,class:"absolute inset-x-0 top-0 h-0.5 bg-primary/70 dark:bg-primary/70 animate-[scan_1.2s_ease-in-out_infinite]"},fr={class:"flex flex-col min-w-0 flex-1"},vr={class:"flex items-center gap-2"},gr={class:"font-semibold text-sm text-foreground dark:text-muted-foreground truncate"},br={key:0,class:"material-icons text-[10px] animate-spin"},yr={class:"text-xs text-muted-foreground dark:text-muted-foreground truncate"},hr={key:0,class:"text-center py-4 text-sm text-muted-foreground dark:text-muted-foreground"},wr={class:"flex flex-col gap-1"},xr={class:"flex flex-col gap-1"},_r={class:"material-icons text-sm"},kr={key:0,class:"flex flex-col gap-1"};function Sr(r,a,n,e,i,s){return l(),v("div",null,[e.showAddForm?(l(),v("form",{key:1,onSubmit:a[6]||(a[6]=ee(t=>e.emit("testConnection"),["prevent"])),class:"flex flex-col gap-4 relative"},[o("button",{type:"button",class:"absolute -top-1 right-0 flex items-center gap-1 text-xs text-muted-foreground hover:text-muted-foreground dark:text-muted-foreground dark:hover:text-muted-foreground bg-transparent border-none cursor-pointer",onClick:a[1]||(a[1]=t=>e.showAddForm=!1)},[a[10]||(a[10]=o("span",{class:"material-icons text-sm"},"arrow_back",-1)),w(" "+d(r.$t("views.serverStep.backToList")),1)]),o("div",wr,[c(e.Label,null,{default:u(()=>[w(d(r.$t("views.serverStep.serverName")),1)]),_:1}),c(e.Input,{modelValue:e.serverName,"onUpdate:modelValue":a[2]||(a[2]=t=>e.serverName=t),type:"text",placeholder:r.$t("views.serverStep.serverName"),required:""},null,8,["modelValue","placeholder"])]),o("div",xr,[c(e.Label,null,{default:u(()=>[w(d(r.$t("views.serverStep.serverAddress")),1)]),_:1}),c(e.Input,{modelValue:e.serverAddress,"onUpdate:modelValue":a[3]||(a[3]=t=>e.serverAddress=t),type:"text",placeholder:"http://192.168.1.100",required:""},null,8,["modelValue"])]),c(e.Button,{type:"button",variant:"ghost",size:"sm",onClick:a[4]||(a[4]=t=>e.showWsField=!e.showWsField)},{default:u(()=>[o("span",_r,d(e.showWsField?"expand_less":"expand_more"),1),w(" "+d(r.$t("views.serverStep.wsAddressToggle")),1)]),_:1}),e.showWsField?(l(),v("div",kr,[c(e.Label,null,{default:u(()=>[w(d(r.$t("views.serverStep.wsAddressLabel")),1)]),_:1}),c(e.Input,{modelValue:e.wsAddress,"onUpdate:modelValue":a[5]||(a[5]=t=>e.wsAddress=t),type:"text",placeholder:r.$t("views.serverStep.wsPortPlaceholder")},null,8,["modelValue","placeholder"])])):R("",!0),c(e.Button,{type:"submit",class:"w-full",disabled:n.loading},{default:u(()=>[n.loading?(l(),L(e.Loader2,{key:0,class:"animate-spin"})):R("",!0),w(" "+d(n.loading?r.$t("views.serverStep.connecting"):r.$t("views.serverStep.next")),1)]),_:1},8,["disabled"])],32)):(l(),v("div",sr,[o("div",lr,[o("div",{class:"flex items-center justify-center gap-2 p-3 border-2 border-dashed border-border dark:border-border rounded-xl cursor-pointer transition-all hover:border-primary dark:hover:border-primary hover:bg-primary/10 dark:hover:bg-primary/10",onClick:a[0]||(a[0]=t=>e.showAddForm=!0)},[a[7]||(a[7]=o("span",{class:"material-icons text-2xl text-muted-foreground dark:text-muted-foreground"},"add",-1)),o("span",ir,d(r.$t("views.serverStep.addServer")),1)]),(l(!0),v(O,null,X(n.services,t=>(l(),v("div",{key:t.id,class:F(["relative flex items-center gap-3 p-3 border-2 rounded-xl cursor-pointer transition-all overflow-hidden group",n.loading&&n.selectedServerId===t.id?"border-primary dark:border-primary bg-primary/15 dark:bg-primary/10":"border-border dark:border-border hover:border-primary dark:hover:border-primary hover:bg-primary/10 dark:hover:bg-primary/10"]),onClick:p=>e.emit("quickConnect",t)},[n.loading&&n.selectedServerId===t.id?(l(),v("div",ur,[o("div",cr,[c(e.Loader2,{class:"w-4 h-4 animate-spin"}),o("span",pr,d(r.$t("views.serverStep.connecting")),1)])])):R("",!0),n.loading&&n.selectedServerId===t.id?(l(),v("div",mr)):R("",!0),a[9]||(a[9]=o("span",{class:"material-icons text-lg text-primary dark:text-primary"},"dns",-1)),o("div",fr,[o("div",vr,[o("span",gr,d(t.name),1),c(e.Badge,{variant:"outline",class:F([n.backendStatusClass(t.id),"shrink-0 gap-1 px-1.5 py-0 text-[10px]"])},{default:u(()=>[n.backendStatus[t.id]==="checking"?(l(),v("span",br,"sync")):(l(),v("span",{key:1,class:F(["w-1.5 h-1.5 rounded-full",n.backendStatusDotClass(t.id)])},null,2)),w(" "+d(n.backendStatusLabel(t.id)),1)]),_:2},1032,["class"])]),o("span",yr,d(t.serverUrl),1)]),c(e.Button,{variant:"ghost",size:"icon-sm",class:"opacity-0 group-hover:opacity-100 transition-opacity shrink-0 text-muted-foreground hover:text-destructive",onClick:ee(p=>e.openDeleteDialog(t),["stop"])},{default:u(()=>[...a[8]||(a[8]=[o("span",{class:"material-icons text-base"},"delete",-1)])]),_:2},1032,["onClick"])],10,dr))),128))]),n.services.length===0?(l(),v("div",hr,d(r.$t("views.serverStep.noServers")),1)):R("",!0),e.deleteTarget?(l(),L(e.AlertDialog,{key:1,open:!0,"onUpdate:open":e.handleDeleteDialogOpenChange},{default:u(()=>[c(e.AlertDialogContent,null,{default:u(()=>[c(e.AlertDialogHeader,null,{default:u(()=>[c(e.AlertDialogTitle,null,{default:u(()=>[w(d(r.$t("views.serverStep.deleteTitle")),1)]),_:1}),c(e.AlertDialogDescription,null,{default:u(()=>[w(d(r.$t("views.serverStep.deleteDesc",{name:e.deleteTarget?.name})),1)]),_:1})]),_:1}),c(e.AlertDialogFooter,null,{default:u(()=>[c(e.Button,{type:"button",variant:"outline",onClick:e.closeDeleteDialog},{default:u(()=>[w(d(r.$t("views.serverStep.cancel")),1)]),_:1}),c(e.Button,{type:"button",class:"bg-destructive hover:bg-destructive text-white",onClick:e.handleDeleteServer},{default:u(()=>[w(d(r.$t("views.serverStep.delete")),1)]),_:1})]),_:1})]),_:1})]),_:1})):R("",!0)]))])}const Cr=z(or,[["render",Sr],["__scopeId","data-v-d827f57e"],["__file","D:/mira_typescript/packages/mira-client/src/renderer/views/LoginView/ServerStep.vue"]]),Dr=N({name:"AuthStep",__name:"AuthStep",props:ne({loading:{type:Boolean,required:!0},healthData:{type:[Object,null],required:!0},credentials:{type:Object,required:!0},registerForm:{type:Object,required:!0}},{showPassword:{type:Boolean,required:!0},showPasswordModifiers:{},showConfirmPassword:{type:Boolean,required:!0},showConfirmPasswordModifiers:{}}),emits:ne(["login","register","back"],["update:showPassword","update:showConfirmPassword"]),setup(r,{expose:a,emit:n}){a();const e=Q(r,"showPassword"),i=Q(r,"showConfirmPassword"),t={showPassword:e,showConfirmPassword:i,emit:n,get Tabs(){return kt},get TabsList(){return _t},get TabsTrigger(){return xt},get TabsContent(){return wt},get Input(){return Oe},get Button(){return pe},get Label(){return je},get Loader2(){return Ce}};return Object.defineProperty(t,"__isScriptSetup",{enumerable:!1,value:!0}),t}}),Ar={class:"flex flex-col gap-4"},Lr={class:"flex flex-col gap-1"},Ir={class:"flex flex-col gap-1"},Tr={class:"relative"},Pr={class:"material-icons text-sm"},Mr={class:"flex flex-col gap-1"},Fr={class:"flex flex-col gap-1"},Vr={class:"flex flex-col gap-1"},Br={class:"relative"},Rr={class:"material-icons text-sm"},qr={class:"flex flex-col gap-1"},Er={class:"relative"},Nr={class:"material-icons text-sm"};function Gr(r,a,n,e,i,s){return l(),v("div",Ar,[c(e.Tabs,{"default-value":"login",class:"justify-center"},{default:u(()=>[c(e.TabsList,null,{default:u(()=>[c(e.TabsTrigger,{value:"login"},{default:u(()=>[w(d(r.$t("views.authStep.login")),1)]),_:1}),n.healthData?.allowRegistration!==!1?(l(),L(e.TabsTrigger,{key:0,value:"register"},{default:u(()=>[w(d(r.$t("views.authStep.register")),1)]),_:1})):R("",!0)]),_:1}),c(e.TabsContent,{value:"login"},{default:u(()=>[o("form",{onSubmit:a[4]||(a[4]=ee(t=>e.emit("login"),["prevent"])),class:"space-y-4"},[o("div",Lr,[c(e.Label,null,{default:u(()=>[w(d(r.$t("views.authStep.username")),1)]),_:1}),c(e.Input,{modelValue:n.credentials.username,"onUpdate:modelValue":a[0]||(a[0]=t=>n.credentials.username=t),type:"text",placeholder:r.$t("views.authStep.username"),required:""},null,8,["modelValue","placeholder"])]),o("div",Ir,[c(e.Label,null,{default:u(()=>[w(d(r.$t("views.authStep.password")),1)]),_:1}),o("div",Tr,[c(e.Input,{modelValue:n.credentials.password,"onUpdate:modelValue":a[1]||(a[1]=t=>n.credentials.password=t),type:e.showPassword?"text":"password",placeholder:r.$t("views.authStep.password"),required:"",class:"pr-9"},null,8,["modelValue","type","placeholder"]),c(e.Button,{type:"button",variant:"ghost",size:"icon-sm",class:"absolute right-0.5 top-1/2 -translate-y-1/2",onClick:a[2]||(a[2]=t=>e.showPassword=!e.showPassword)},{default:u(()=>[o("span",Pr,d(e.showPassword?"visibility_off":"visibility"),1)]),_:1})])]),c(e.Button,{type:"submit",class:"w-full",disabled:n.loading},{default:u(()=>[n.loading?(l(),L(e.Loader2,{key:0,class:"animate-spin"})):R("",!0),w(" "+d(n.loading?r.$t("views.authStep.loggingIn"):r.$t("views.authStep.loginNext")),1)]),_:1},8,["disabled"]),c(e.Button,{type:"button",variant:"ghost",class:"w-full",onClick:a[3]||(a[3]=t=>e.emit("back")),disabled:n.loading},{default:u(()=>[w(d(r.$t("views.authStep.previous")),1)]),_:1},8,["disabled"])],32)]),_:1}),c(e.TabsContent,{value:"register"},{default:u(()=>[o("form",{onSubmit:a[12]||(a[12]=ee(t=>e.emit("register"),["prevent"])),class:"space-y-4"},[o("div",Mr,[c(e.Label,null,{default:u(()=>[w(d(r.$t("views.authStep.username")),1)]),_:1}),c(e.Input,{modelValue:n.credentials.username,"onUpdate:modelValue":a[5]||(a[5]=t=>n.credentials.username=t),type:"text",placeholder:r.$t("views.authStep.username"),required:""},null,8,["modelValue","placeholder"])]),o("div",Fr,[c(e.Label,null,{default:u(()=>[w(d(r.$t("views.authStep.emailOptional")),1)]),_:1}),c(e.Input,{modelValue:n.registerForm.email,"onUpdate:modelValue":a[6]||(a[6]=t=>n.registerForm.email=t),type:"email",placeholder:r.$t("views.authStep.email")},null,8,["modelValue","placeholder"])]),o("div",Vr,[c(e.Label,null,{default:u(()=>[w(d(r.$t("views.authStep.password")),1)]),_:1}),o("div",Br,[c(e.Input,{modelValue:n.credentials.password,"onUpdate:modelValue":a[7]||(a[7]=t=>n.credentials.password=t),type:e.showPassword?"text":"password",placeholder:r.$t("views.authStep.passwordRule"),required:"",class:"pr-9"},null,8,["modelValue","type","placeholder"]),c(e.Button,{type:"button",variant:"ghost",size:"icon-sm",class:"absolute right-0.5 top-1/2 -translate-y-1/2",onClick:a[8]||(a[8]=t=>e.showPassword=!e.showPassword)},{default:u(()=>[o("span",Rr,d(e.showPassword?"visibility_off":"visibility"),1)]),_:1})])]),o("div",qr,[c(e.Label,null,{default:u(()=>[w(d(r.$t("views.authStep.confirmPassword")),1)]),_:1}),o("div",Er,[c(e.Input,{modelValue:n.registerForm.confirmPassword,"onUpdate:modelValue":a[9]||(a[9]=t=>n.registerForm.confirmPassword=t),type:e.showConfirmPassword?"text":"password",placeholder:r.$t("views.authStep.confirmPassword"),required:"",class:"pr-9"},null,8,["modelValue","type","placeholder"]),c(e.Button,{type:"button",variant:"ghost",size:"icon-sm",class:"absolute right-0.5 top-1/2 -translate-y-1/2",onClick:a[10]||(a[10]=t=>e.showConfirmPassword=!e.showConfirmPassword)},{default:u(()=>[o("span",Nr,d(e.showConfirmPassword?"visibility_off":"visibility"),1)]),_:1})])]),c(e.Button,{type:"submit",class:"w-full",disabled:n.loading},{default:u(()=>[n.loading?(l(),L(e.Loader2,{key:0,class:"animate-spin"})):R("",!0),w(" "+d(n.loading?r.$t("views.authStep.registering"):r.$t("views.authStep.registerSubmit")),1)]),_:1},8,["disabled"]),c(e.Button,{type:"button",variant:"ghost",class:"w-full",onClick:a[11]||(a[11]=t=>e.emit("back")),disabled:n.loading},{default:u(()=>[w(d(r.$t("views.authStep.previous")),1)]),_:1},8,["disabled"])],32)]),_:1})]),_:1})])}const Ur=z(Dr,[["render",Gr],["__file","D:/mira_typescript/packages/mira-client/src/renderer/views/LoginView/AuthStep.vue"]]),Or=N({name:"LibraryStep",__name:"LibraryStep",props:{loading:{type:Boolean,required:!0},libraries:{type:Array,required:!0},selectedLibraryId:{type:String,required:!0},isLibraryAccessible:{type:Function,required:!0}},emits:["update:selectedLibraryId","connect","back"],setup(r,{expose:a,emit:n}){a();const e=r,i=n;function s(p){e.isLibraryAccessible(p)&&i("update:selectedLibraryId",p.id)}const t={props:e,emit:i,select:s,get Button(){return pe},get Loader2(){return Ce}};return Object.defineProperty(t,"__isScriptSetup",{enumerable:!1,value:!0}),t}}),jr={class:"flex flex-col gap-4"},zr={key:0,class:"text-center py-8 text-muted-foreground dark:text-muted-foreground"},Wr={key:1,class:"text-center py-8 text-muted-foreground dark:text-muted-foreground"},Hr={key:2,class:"flex flex-col gap-2 max-h-60 overflow-y-auto"},Kr=["onClick"],Jr={class:"flex-1 min-w-0"},Yr={class:"font-semibold text-sm text-foreground dark:text-muted-foreground"},Qr={class:"text-xs text-muted-foreground dark:text-muted-foreground overflow-hidden text-ellipsis whitespace-nowrap"},Xr={key:0,class:"material-icons text-xl text-muted-foreground dark:text-muted-foreground"},Zr={key:1,class:"material-icons text-xl text-primary dark:text-primary"};function $r(r,a,n,e,i,s){return l(),v("div",jr,[n.loading?(l(),v("div",zr,d(r.$t("views.libraryStep.loading")),1)):n.libraries.length===0?(l(),v("div",Wr,d(r.$t("views.libraryStep.empty")),1)):(l(),v("div",Hr,[(l(!0),v(O,null,X(n.libraries,t=>(l(),v("div",{key:t.id,class:F(["flex items-center gap-3 p-3 border-2 rounded-lg cursor-pointer transition-all",[n.selectedLibraryId===t.id?"border-primary dark:border-primary bg-primary/15 dark:bg-primary/15":n.isLibraryAccessible(t)?"border-border dark:border-border hover:border-primary dark:hover:border-primary hover:bg-primary/10 dark:hover:bg-primary/10":"opacity-50 cursor-not-allowed border-border dark:border-border bg-muted dark:bg-muted"]]),onClick:p=>e.select(t)},[o("span",{class:F(["material-icons text-2xl",n.selectedLibraryId===t.id?"text-primary dark:text-primary":"text-muted-foreground dark:text-muted-foreground"])},d(t.icon==="default"?"folder":"folder_special"),3),o("div",Jr,[o("div",Yr,d(t.name),1),o("div",Qr,d(t.path),1)]),n.isLibraryAccessible(t)?n.selectedLibraryId===t.id?(l(),v("span",Zr,"check_circle")):R("",!0):(l(),v("span",Xr,"lock"))],10,Kr))),128))])),c(e.Button,{class:"w-full",disabled:!n.selectedLibraryId||n.loading,onClick:a[0]||(a[0]=t=>e.emit("connect"))},{default:u(()=>[n.loading?(l(),L(e.Loader2,{key:0,class:"animate-spin"})):R("",!0),w(" "+d(r.$t("views.libraryStep.connect")),1)]),_:1},8,["disabled"]),c(e.Button,{type:"button",variant:"ghost",class:"w-full",onClick:a[1]||(a[1]=t=>e.emit("back")),disabled:n.loading},{default:u(()=>[w(d(r.$t("views.libraryStep.previous")),1)]),_:1},8,["disabled"])])}const ea=z(Or,[["render",$r],["__file","D:/mira_typescript/packages/mira-client/src/renderer/views/LoginView/LibraryStep.vue"]]);function ta(r,a){const n=r.replace(/^v/,"").split(".").map(i=>parseInt(i,10)),e=a.replace(/^v/,"").split(".").map(i=>parseInt(i,10));for(let i=0;i<Math.max(n.length,e.length);i++){const s=n[i]||0,t=e[i]||0;if(Number.isNaN(s)||Number.isNaN(t))return 0;if(s>t)return 1;if(s<t)return-1}return 0}function ra(){const r=_("idle"),a=_(null),n=_(null),e=_(""),i=_(!1),s=_([]),t=Re.isElectron&&!!window.electronAPI?.serverDeploy,p=G(()=>r.value==="update-available"&&!!n.value);async function k(){if(!t){r.value="unavailable";return}r.value="checking",e.value="";try{const m=window.electronAPI.serverDeploy,[y,T]=await Promise.all([m.getInstalledVersion(),m.getLatestVersion()]),S=y.data?.installed?y.data.version??null:null,I=T.data?.latest??null;if(a.value=S,n.value=I,!S){r.value=I?"update-available":"not-installed";return}if(!I){r.value="up-to-date";return}r.value=ta(I,S)>0?"update-available":"up-to-date"}catch(m){r.value="error",e.value=m instanceof Error?m.message:String(m)}}async function g(m){if(!t||i.value)return;i.value=!0,s.value=[];const y=window.electronAPI.serverDeploy,T=S=>{S.type==="data"&&S.line&&s.value.push(S.line)};y.onUpdateProgress(T);try{const S=await y.update(m);S.success?await k():e.value=S.message||S.data?.message||q.global.t("composables.useServerDeploy.updateFailed")}catch(S){e.value=S instanceof Error?S.message:String(S)}finally{y.removeUpdateProgressListener(),i.value=!1}}return ke(()=>{t&&window.electronAPI?.serverDeploy.removeUpdateProgressListener()}),{status:r,installedVersion:a,latestVersion:n,errorMessage:e,updateInProgress:i,updateLog:s,hasUpdate:p,isElectron:t,checkVersion:k,runUpdate:g}}const aa=N({__name:"DeploymentChecklist",emits:["connect"],setup(r,{expose:a,emit:n}){a();const e=n,i=rt(),{t:s}=qe(),t=_("https://registry.npmjs.org/"),p=_(""),k=G(()=>[{label:s("business.deploymentChecklist.registryOfficial"),region:s("business.deploymentChecklist.regionOverseas"),value:"https://registry.npmjs.org/"},{label:s("business.deploymentChecklist.registryNpmmirror"),region:s("business.deploymentChecklist.regionDomestic"),value:"https://registry.npmmirror.com/"},{label:s("business.deploymentChecklist.registryTencent"),region:s("business.deploymentChecklist.regionDomestic"),value:"https://mirrors.cloud.tencent.com/npm/"},{label:s("business.deploymentChecklist.registryHuawei"),region:s("business.deploymentChecklist.regionDomestic"),value:"https://repo.huaweicloud.com/repository/npm/"}]),g=G(()=>i.isDarkMode),{status:m,installedVersion:y,latestVersion:T,errorMessage:S,updateInProgress:I,updateLog:P,checkVersion:E}=ra();de(()=>{E()});const j=G(()=>[{id:1,title:s("business.deploymentChecklist.task1Title"),subtitle:s("business.deploymentChecklist.task1Subtitle"),status:"pending",info:null},{id:2,title:s("business.deploymentChecklist.task2Title"),subtitle:s("business.deploymentChecklist.task2Subtitle"),status:"pending",info:null},{id:3,title:s("business.deploymentChecklist.task3Title"),subtitle:s("business.deploymentChecklist.task3Subtitle"),status:"pending",info:null},{id:4,title:s("business.deploymentChecklist.task4Title"),subtitle:s("business.deploymentChecklist.task4Subtitle"),status:"pending",info:null},{id:5,title:s("business.deploymentChecklist.task5Title"),subtitle:s("business.deploymentChecklist.task5Subtitle"),status:"pending",info:null}]),h=_(j.value.map(B=>({...B}))),D=_("idle"),f=_(new Set),b=_("");let C=!1;function M(B,H){h.value=h.value.map(x=>x.id===B?{...x,...H}:x)}function A(B,H){const x=new Set(f.value);H?x.add(B):x.delete(B),f.value=x}function Z(B){A(B,!f.value.has(B))}function U(B,H){const x=h.value.find(K=>K.id===B);if(!x)return;const W=x.info?x.info.split(`
`):[];M(B,{info:[...W,H].slice(-100).join(`
`)})}async function te(){if(C||I.value||!window.electronAPI?.serverDeploy)return;C=!0,D.value="running",b.value="",f.value=new Set,h.value=h.value.map(x=>({...x,status:"pending",info:null}));const B=window.electronAPI.serverDeploy,H=x=>{x.type==="status"&&x.status&&(M(x.stepId,{status:x.status}),x.status==="success"&&A(x.stepId,!1),x.status==="failed"&&A(x.stepId,!0)),x.type==="output"&&x.line&&(U(x.stepId,x.line),A(x.stepId,!0))};B.removeDeployProgressListener(),B.onDeployProgress(H);try{const x=await B.deploy({registry:t.value,proxy:p.value||void 0});if(!x.success){const W=h.value.find(K=>K.status==="running");W&&(M(W.id,{status:"failed"}),x.message&&U(W.id,x.message)),D.value="failed";return}if(!x.data?.defaultLibraryId)throw new Error(s("business.deploymentChecklist.noDefaultLibrary"));b.value=x.data.defaultLibraryId,D.value="success",await E()}catch(x){const W=h.value.find(K=>K.status==="running");W&&(M(W.id,{status:"failed"}),U(W.id,x instanceof Error?x.message:String(x))),D.value="failed"}finally{B.removeDeployProgressListener(),C=!1}}function me(){b.value&&e("connect",b.value)}const fe=be.rect,ve=be.g,ge=be.path;ke(()=>{C=!1,window.electronAPI?.serverDeploy.removeDeployProgressListener()});const ae={emit:e,settingsStore:i,t:s,registry:t,proxy:p,registryOptions:k,isDarkMode:g,deployStatus:m,installedVersion:y,latestVersion:T,deployError:S,updateInProgress:I,updateLog:P,checkVersion:E,defaultTasks:j,tasks:h,pipelineStatus:D,expandedTaskIds:f,defaultLibraryId:b,get running(){return C},set running(B){C=B},updateTask:M,setTaskExpanded:A,toggleTask:Z,appendTaskOutput:U,runPipeline:te,connectNow:me,MotionRect:fe,MotionG:ve,MotionPath:ge,get Motion(){return Ee},get AnimatePresence(){return at},get cn(){return re}};return Object.defineProperty(ae,"__isScriptSetup",{enumerable:!1,value:!0}),ae}}),na={class:"flex h-full min-h-0 w-full flex-col font-sans"},oa={key:0,class:"material-icons text-sm animate-spin text-muted-foreground shrink-0"},sa={key:1,class:"material-icons text-sm text-emerald-500 shrink-0"},la={key:2,class:"material-icons text-sm text-amber-500 shrink-0"},ia={key:3,class:"material-icons text-sm text-muted-foreground shrink-0"},da={key:4,class:"material-icons text-sm text-destructive shrink-0"},ua={key:5,class:"material-icons text-sm text-muted-foreground shrink-0"},ca={class:"flex-1 min-w-0 break-words"},pa={class:"grid gap-1"},ma={class:"font-semibold"},fa=["value"],va={disabled:""},ga={class:"grid gap-1"},ba={class:"font-semibold"},ya={class:"flex min-h-0 flex-1 flex-col gap-2.5 overflow-y-auto pr-1"},ha={class:"flex w-full items-center justify-between"},wa={class:"flex min-w-0 flex-1 items-center gap-3 pr-2"},xa={key:0,class:"h-4.5 w-4.5 text-current",viewBox:"0 0 16 16",fill:"currentColor"},_a={key:1,class:"h-4.5 w-4.5 text-current",viewBox:"0 0 16 16",fill:"currentColor"},ka={key:2,class:"h-4.5 w-4.5 text-current",viewBox:"0 0 16 16",fill:"currentColor"},Sa={key:3,class:"h-4.5 w-4.5 text-current",viewBox:"0 0 16 16",fill:"currentColor"},Ca=["fill"],Da={key:4,class:"h-4.5 w-4.5 text-current",viewBox:"0 0 16 16",fill:"currentColor"},Aa={class:"flex min-w-0 flex-col"},La={class:"flex items-center gap-2"},Ia=["title","onClick"],Ta={class:"material-icons text-base"},Pa={class:"h-3 w-3 stroke-current",viewBox:"0 0 16 16",fill:"none"},Ma={class:"min-h-0 overflow-hidden"},Fa={class:"mt-3"};function Va(r,a,n,e,i,s){return l(),v("div",na,[o("div",{class:F(e.cn("mb-3 flex items-start gap-2 rounded-2xl p-2.5 text-xs transition-colors",e.isDarkMode?"bg-neutral-950 text-neutral-300":"bg-neutral-100 text-neutral-700"))},[e.deployStatus==="checking"||e.updateInProgress?(l(),v("span",oa,"sync")):e.deployStatus==="up-to-date"?(l(),v("span",sa,"check_circle")):e.deployStatus==="update-available"?(l(),v("span",la,"arrow_upward")):e.deployStatus==="not-installed"?(l(),v("span",ia,"download")):e.deployStatus==="error"?(l(),v("span",da,"error")):(l(),v("span",ua,"dns")),o("span",ca,[e.deployStatus==="checking"?(l(),v(O,{key:0},[w(d(r.$t("business.deploymentChecklist.statusChecking")),1)],64)):e.updateInProgress?(l(),v(O,{key:1},[w(d(r.$t("business.deploymentChecklist.statusUpdating",{log:e.updateLog.length?r.$t("business.deploymentChecklist.updateLogLines",{count:e.updateLog.length}):""})),1)],64)):e.deployStatus==="up-to-date"?(l(),v(O,{key:2},[w(d(r.$t("business.deploymentChecklist.statusUpToDate",{version:e.installedVersion})),1)],64)):e.deployStatus==="update-available"?(l(),v(O,{key:3},[w(d(e.installedVersion?r.$t("business.deploymentChecklist.statusUpdateAvailableInstalled",{installed:e.installedVersion,latest:e.latestVersion}):r.$t("business.deploymentChecklist.statusUpdateAvailableNotInstalled",{latest:e.latestVersion})),1)],64)):e.deployStatus==="not-installed"?(l(),v(O,{key:4},[w(d(r.$t("business.deploymentChecklist.statusNotInstalled")),1)],64)):e.deployStatus==="error"?(l(),v(O,{key:5},[w(d(r.$t("business.deploymentChecklist.statusError",{error:e.deployError})),1)],64)):(l(),v(O,{key:6},[w(d(r.$t("business.deploymentChecklist.statusWaiting")),1)],64))]),e.deployStatus==="update-available"&&!e.updateInProgress?(l(),v("button",{key:6,type:"button",class:F(e.cn("shrink-0 rounded-lg px-2.5 py-1 text-[11px] font-semibold transition-colors border-none cursor-pointer",e.isDarkMode?"bg-amber-500/20 text-amber-300 hover:bg-amber-500/30":"bg-amber-100 text-amber-700 hover:bg-amber-200")),onClick:e.runPipeline},d(e.installedVersion?r.$t("business.deploymentChecklist.actionUpdate"):r.$t("business.deploymentChecklist.actionInstall")),3)):R("",!0),e.deployStatus==="error"?(l(),v("button",{key:7,type:"button",class:"shrink-0 rounded-lg px-2 py-1 text-[11px] font-semibold text-muted-foreground hover:text-foreground border border-border bg-transparent cursor-pointer transition-colors",onClick:a[0]||(a[0]=(...t)=>e.checkVersion&&e.checkVersion(...t))},d(r.$t("common.retry")),1)):R("",!0)],2),e.updateInProgress&&e.updateLog.length?(l(),v("div",{key:0,class:F(e.cn("mb-3 max-h-24 overflow-y-auto rounded-2xl p-2.5 font-mono text-[10px] leading-relaxed transition-colors",e.isDarkMode?"bg-neutral-950 text-neutral-400":"bg-neutral-100 text-neutral-500"))},[(l(!0),v(O,null,X(e.updateLog,(t,p)=>(l(),v("div",{key:p},d(t),1))),128))],2)):R("",!0),o("div",{class:F(e.cn("mb-3 grid gap-2 rounded-2xl p-3 text-xs",e.isDarkMode?"bg-neutral-950 text-neutral-200":"bg-neutral-100 text-neutral-800"))},[o("label",pa,[o("span",ma,d(r.$t("business.deploymentChecklist.npmRegistryLabel")),1),Le(o("select",{"onUpdate:modelValue":a[1]||(a[1]=t=>e.registry=t),class:"h-8 rounded-lg border border-border bg-background px-2 text-xs"},[(l(!0),v(O,null,X(e.registryOptions,t=>(l(),v("option",{key:t.value,value:t.value},d(t.label)+"("+d(t.region)+") ",9,fa))),128)),o("option",va,d(r.$t("business.deploymentChecklist.registryTsinghua")),1)],512),[[nt,e.registry]])]),o("label",ga,[o("span",ba,d(r.$t("business.deploymentChecklist.proxyLabel")),1),Le(o("input",{"onUpdate:modelValue":a[2]||(a[2]=t=>e.proxy=t),type:"url",placeholder:"http://127.0.0.1:7890",class:"h-8 rounded-lg border border-border bg-background px-2 text-xs"},null,512),[[ot,e.proxy]])])],2),o("div",ya,[(l(!0),v(O,null,X(e.tasks,t=>(l(),v("div",{key:t.id,class:"relative flex w-full flex-col items-center"},[o("div",{class:F(e.cn("relative z-10 flex w-full items-center justify-between rounded-2xl p-2.5 transition-colors duration-300",e.isDarkMode?"bg-neutral-950 text-neutral-200":"bg-neutral-100/90 text-neutral-800"))},[o("div",ha,[o("div",wa,[o("div",{class:F(e.cn("flex h-9 w-9 shrink-0 items-center justify-center rounded-xl transition-all duration-300",t.status==="success"?e.isDarkMode?"bg-neutral-800 text-neutral-300":"bg-white text-neutral-600 shadow-sm":t.status==="running"?e.isDarkMode?"bg-neutral-800 text-neutral-100":"bg-white text-neutral-900 shadow-sm":e.isDarkMode?"bg-neutral-900 text-neutral-400":"bg-neutral-200/60 text-neutral-500"))},[t.id===1?(l(),v("svg",xa,[a[3]||(a[3]=o("path",{d:"M8 1L2 4.5v7L8 15l6-3.5v-7L8 1zm0 2.3l3.8 2.2v5L8 12.7 4.2 10.5v-5L8 3.3z"},null,-1)),t.status==="running"?(l(),L(e.MotionPath,{key:0,d:"M5 8h6",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round",fill:"none",animate:{pathLength:[0,1]},transition:{repeat:1/0,duration:1.2,ease:"easeInOut"}})):R("",!0)])):t.id===2?(l(),v("svg",_a,[a[5]||(a[5]=o("path",{d:"M2.5 9a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v4a1.5 1.5 0 0 1-1.5 1.5h-8A1.5 1.5 0 0 1 2.5 13V9z"},null,-1)),c(e.MotionG,{animate:t.status==="running"?{y:[-2.5,2]}:{y:0},transition:t.status==="running"?{repeat:1/0,duration:.85,ease:"easeInOut"}:{}},{default:u(()=>[...a[4]||(a[4]=[o("path",{d:"M8 1.5a1 1 0 0 1 1 1V6h1.8a.8.8 0 0 1 .56 1.36l-2.8 2.8a.8.8 0 0 1-1.12 0l-2.8-2.8A.8.8 0 0 1 5.2 6H7V2.5a1 1 0 0 1 1-1z"},null,-1)])]),_:2},1032,["animate","transition"])])):t.id===3?(l(),v("svg",ka,[a[7]||(a[7]=o("path",{d:"M2.5 9a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v4a1.5 1.5 0 0 1-1.5 1.5h-8A1.5 1.5 0 0 1 2.5 13V9z"},null,-1)),c(e.MotionG,{animate:t.status==="running"?{y:[-2.5,2]}:{y:0},transition:t.status==="running"?{repeat:1/0,duration:.85,ease:"easeInOut"}:{}},{default:u(()=>[...a[6]||(a[6]=[o("path",{d:"M8 1.5a1 1 0 0 1 1 1V6h1.8a.8.8 0 0 1 .56 1.36l-2.8 2.8a.8.8 0 0 1-1.12 0l-2.8-2.8A.8.8 0 0 1 5.2 6H7V2.5a1 1 0 0 1 1-1z"},null,-1)])]),_:2},1032,["animate","transition"])])):t.id===4?(l(),v("svg",Sa,[a[8]||(a[8]=st('<rect x="3" y="3" width="10" height="10" rx="2"></rect><rect x="5.5" y="1" width="1.5" height="2" rx="0.5"></rect><rect x="9" y="1" width="1.5" height="2" rx="0.5"></rect><rect x="5.5" y="13" width="1.5" height="2" rx="0.5"></rect><rect x="9" y="13" width="1.5" height="2" rx="0.5"></rect><rect x="1" y="5.5" width="2" height="1.5" rx="0.5"></rect><rect x="1" y="9" width="2" height="1.5" rx="0.5"></rect><rect x="13" y="5.5" width="2" height="1.5" rx="0.5"></rect><rect x="13" y="9" width="2" height="1.5" rx="0.5"></rect>',9)),o("rect",{x:"5.5",y:"5.5",width:"5",height:"5",rx:"1",fill:e.isDarkMode?"#0a0a0a":"#ffffff"},null,8,Ca),c(e.MotionRect,{x:"6.5",y:"6.5",width:"3",height:"3",rx:"0.5",fill:"currentColor",animate:t.status==="running"?{scale:[1,1.2,1],opacity:[.6,1,.6]}:{},transition:t.status==="running"?{repeat:1/0,duration:1,ease:"easeInOut"}:{},style:{"transform-origin":"8px 8px"}},null,8,["animate","transition"])])):(l(),v("svg",Da,[...a[9]||(a[9]=[o("path",{d:"M8 1.5L1.5 5 8 8.5 14.5 5 8 1.5z"},null,-1),o("path