mower-ng/ui/dist/assets/Log.js
fuyn101 672db5033f
All checks were successful
ci/woodpecker/push/check_format Pipeline was successful
还原plan导出图片的方法
2025-02-19 17:41:18 +08:00

241 lines
25 KiB
JavaScript

import{c as Ne,_ as Ie,u as De,a as Ee,b as qe}from"./DropDown2.js";import{V as Ke,ae as Ue,X as ze,aZ as Ae,x as Me,A as J,B as l,h as ue,r as P,c as V,p as Fe,w as Ye,b as me,av as je,Z as m,M as K,$ as i,ak as Xe,al as Ge,a7 as fe,a9 as Q,S as he,ac as Se,n as ye,G as ke,a0 as T,aD as $e,at as Re,b2 as ve,a3 as q,b3 as Ze,aC as Je,aa as j,aT as xe,b0 as E,au as Qe,as as _e,a5 as Te,ay as et,aB as tt,aF as nt,aG as ot,af as it,aU as X,aW as ce,aH as Z,aO as le,aM as N,aI as d,aL as I,ao as rt,a4 as lt,i as at,b4 as st,aK as L,F as ae,aV as Be,z as we}from"./_plugin-vue_export-helper.js";import{d as ct,u as dt,s as Le,e as ut}from"./main.js";import{u as mt,P as ht}from"./Play.js";import{r as ft}from"./index.js";import{S as gt}from"./Scrollbar.js";import{u as pt}from"./use-locale.js";import{t as bt}from"./throttle.js";import{_ as vt}from"./Image.js";import{_ as xt}from"./Checkbox.js";import{N as _t}from"./Icon.js";import"./HelpText.js";import"./Tooltip.js";import"./cssr.js";import"./next-frame-once.js";import"./use-compitable.js";import"./common.js";import"./Input.js";import"./Add.js";import"./Select.js";import"./Tag.js";import"./create.js";import"./get-slot.js";import"./Avatar.js";import"./utils.js";import"./Forward.js";import"./Dropdown.js";import"./download.js";function wt(e){const{textColor2:n,modalColor:r,borderColor:o,fontSize:t,primaryColor:c}=e;return{loaderFontSize:t,loaderTextColor:n,loaderColor:r,loaderBorder:`1px solid ${o}`,loadingColor:c}}const yt=Ke({name:"Log",common:ze,peers:{Scrollbar:Ue,Code:Ne},self:wt}),zt={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"};function St(e){const{primaryColor:n,opacityDisabled:r,borderRadius:o,textColor3:t}=e;return Object.assign(Object.assign({},zt),{iconColor:t,textColor:"white",loadingColor:n,opacityDisabled:r,railColor:"rgba(0, 0, 0, .14)",railColorActive:n,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:o,railBorderRadiusMedium:o,railBorderRadiusLarge:o,buttonBorderRadiusSmall:o,buttonBorderRadiusMedium:o,buttonBorderRadiusLarge:o,boxShadowFocus:`0 0 0 2px ${Ae(n,{alpha:.2})}`})}const Ct={common:ze,self:St},kt={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"};function $t(e){const{textColor3:n,infoColor:r,errorColor:o,successColor:t,warningColor:c,textColor1:u,textColor2:h,railColor:_,fontWeightStrong:v,fontSize:C}=e;return Object.assign(Object.assign({},kt),{contentFontSize:C,titleFontWeight:v,circleBorder:`2px solid ${n}`,circleBorderInfo:`2px solid ${r}`,circleBorderError:`2px solid ${o}`,circleBorderSuccess:`2px solid ${t}`,circleBorderWarning:`2px solid ${c}`,iconColor:n,iconColorInfo:r,iconColorError:o,iconColorSuccess:t,iconColorWarning:c,titleTextColor:u,contentTextColor:h,metaTextColor:n,lineColor:_})}const Rt={common:ze,self:$t},Pe=Me("n-log"),Tt=J({props:{line:{type:String,default:""}},setup(e){const{trimRef:n,highlightRef:r,languageRef:o,mergedHljsRef:t}=ue(Pe),c=P(null),u=V(()=>n.value?e.line.trim():e.line);function h(){c.value&&(c.value.innerHTML=_(o.value,u.value))}function _(v,C){const{value:w}=t;return w&&v&&w.getLanguage(v)?w.highlight(C,{language:v}).value:C}return Fe(()=>{r.value&&h()}),Ye(me(e,"line"),()=>{r.value&&h()}),{highlight:r,selfRef:c,maybeTrimmedLines:u}},render(){const{highlight:e,maybeTrimmedLines:n}=this;return l("pre",{ref:"selfRef"},e?null:n)}}),Bt=J({name:"LogLoader",props:{clsPrefix:{type:String,required:!0}},setup(){return{locale:pt("Log").localeRef}},render(){const{clsPrefix:e}=this;return l("div",{class:`${e}-log-loader`},l(je,{clsPrefix:e,strokeWidth:24,scale:.85}),l("span",{class:`${e}-log-loader__content`},this.locale.loading))}}),Lt=m("log",`
position: relative;
box-sizing: border-box;
transition: border-color .3s var(--n-bezier);
`,[K("pre",`
white-space: pre-wrap;
word-break: break-word;
margin: 0;
`),m("log-loader",`
transition:
color .3s var(--n-bezier),
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
box-sizing: border-box;
position: absolute;
right: 16px;
top: 8px;
height: 34px;
border-radius: 17px;
line-height: 34px;
white-space: nowrap;
overflow: hidden;
border: var(--n-loader-border);
color: var(--n-loader-text-color);
background-color: var(--n-loader-color);
font-size: var(--n-loader-font-size);
`,[ct(),i("content",`
display: inline-block;
vertical-align: bottom;
line-height: 34px;
padding-left: 40px;
padding-right: 20px;
white-space: nowrap;
`),m("base-loading",`
color: var(--n-loading-color);
position: absolute;
left: 12px;
top: calc(50% - 10px);
font-size: 20px;
width: 20px;
height: 20px;
display: inline-block;
`)])]),Vt=Object.assign(Object.assign({},Q.props),{loading:Boolean,trim:Boolean,log:String,fontSize:{type:Number,default:14},lines:{type:Array,default:()=>[]},lineHeight:{type:Number,default:1.25},language:String,rows:{type:Number,default:15},offsetTop:{type:Number,default:0},offsetBottom:{type:Number,default:0},hljs:Object,onReachTop:Function,onReachBottom:Function,onRequireMore:Function}),Ht=J({name:"Log",props:Vt,setup(e){const{mergedClsPrefixRef:n,inlineThemeDisabled:r}=fe(e),o=P(!1),t=V(()=>e.language!==void 0),c=V(()=>`calc(${Math.round(e.rows*e.lineHeight*e.fontSize)}px)`),u=V(()=>{const{log:g}=e;return g?g.split(`
`):e.lines}),h=P(null),_=Q("Log","-log",Lt,yt,e,n);function v(g){const b=g.target,$=b.firstElementChild;if(o.value){ye(()=>{o.value=!1});return}const B=b.offsetHeight,S=b.scrollTop,R=$.offsetHeight,a=S,O=R-S-B;if(a<=e.offsetTop){const{onReachTop:k,onRequireMore:p}=e;p&&p("top"),k&&k()}if(O<=e.offsetBottom){const{onReachBottom:k,onRequireMore:p}=e;p&&p("bottom"),k&&k()}}const C=bt(w,300);function w(g){if(o.value){ye(()=>{o.value=!1});return}if(h.value){const{containerRef:b,contentRef:$}=h.value;if(b&&$){const B=b.offsetHeight,S=b.scrollTop,R=$.offsetHeight,a=S,O=R-S-B,k=g.deltaY;if(a===0&&k<0){const{onRequireMore:p}=e;p&&p("top")}if(O<=0&&k>0){const{onRequireMore:p}=e;p&&p("bottom")}}}}function s(g){const{value:b}=h;if(!b)return;const{silent:$,top:B,position:S}=g;$&&(o.value=!0),B!==void 0?b.scrollTo({left:0,top:B}):(S==="bottom"||S==="top")&&b.scrollTo({position:S})}function f(g=!1){ke("log","`scrollToTop` is deprecated, please use `scrollTo({ position: 'top'})` instead."),s({position:"top",silent:g})}function y(g=!1){ke("log","`scrollToTop` is deprecated, please use `scrollTo({ position: 'bottom'})` instead."),s({position:"bottom",silent:g})}he(Pe,{languageRef:me(e,"language"),mergedHljsRef:De(e),trimRef:me(e,"trim"),highlightRef:t});const Y={scrollTo:s},U=V(()=>{const{self:{loaderFontSize:g,loaderTextColor:b,loaderColor:$,loaderBorder:B,loadingColor:S},common:{cubicBezierEaseInOut:R}}=_.value;return{"--n-bezier":R,"--n-loader-font-size":g,"--n-loader-border":B,"--n-loader-color":$,"--n-loader-text-color":b,"--n-loading-color":S}}),H=r?Se("log",void 0,U,e):void 0;return Object.assign(Object.assign({},Y),{mergedClsPrefix:n,scrollbarRef:h,mergedTheme:_,styleHeight:c,mergedLines:u,scrollToTop:f,scrollToBottom:y,handleWheel:C,handleScroll:v,cssVars:r?void 0:U,themeClass:H==null?void 0:H.themeClass,onRender:H==null?void 0:H.onRender})},render(){const{mergedClsPrefix:e,mergedTheme:n,onRender:r}=this;return r==null||r(),l("div",{class:[`${e}-log`,this.themeClass],style:[{lineHeight:this.lineHeight,height:this.styleHeight},this.cssVars],onWheelPassive:this.handleWheel},[l(Xe,{ref:"scrollbarRef",theme:n.peers.Scrollbar,themeOverrides:n.peerOverrides.Scrollbar,onScroll:this.handleScroll},{default:()=>l(Ie,{internalNoHighlight:!0,internalFontSize:this.fontSize,theme:n.peers.Code,themeOverrides:n.peerOverrides.Code},{default:()=>this.mergedLines.map((o,t)=>l(Tt,{key:t,line:o}))})}),l(Ge,{name:"fade-in-scale-up-transition"},{default:()=>this.loading?l(Bt,{clsPrefix:e}):null})])}}),Mt=m("switch",`
height: var(--n-height);
min-width: var(--n-width);
vertical-align: middle;
user-select: none;
-webkit-user-select: none;
display: inline-flex;
outline: none;
justify-content: center;
align-items: center;
`,[i("children-placeholder",`
height: var(--n-rail-height);
display: flex;
flex-direction: column;
overflow: hidden;
pointer-events: none;
visibility: hidden;
`),i("rail-placeholder",`
display: flex;
flex-wrap: none;
`),i("button-placeholder",`
width: calc(1.75 * var(--n-rail-height));
height: var(--n-rail-height);
`),m("base-loading",`
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%) translateY(-50%);
font-size: calc(var(--n-button-width) - 4px);
color: var(--n-loading-color);
transition: color .3s var(--n-bezier);
`,[Re({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),i("checked, unchecked",`
transition: color .3s var(--n-bezier);
color: var(--n-text-color);
box-sizing: border-box;
position: absolute;
white-space: nowrap;
top: 0;
bottom: 0;
display: flex;
align-items: center;
line-height: 1;
`),i("checked",`
right: 0;
padding-right: calc(1.25 * var(--n-rail-height) - var(--n-offset));
`),i("unchecked",`
left: 0;
justify-content: flex-end;
padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset));
`),K("&:focus",[i("rail",`
box-shadow: var(--n-box-shadow-focus);
`)]),T("round",[i("rail","border-radius: calc(var(--n-rail-height) / 2);",[i("button","border-radius: calc(var(--n-button-height) / 2);")])]),$e("disabled",[$e("icon",[T("rubber-band",[T("pressed",[i("rail",[i("button","max-width: var(--n-button-width-pressed);")])]),i("rail",[K("&:active",[i("button","max-width: var(--n-button-width-pressed);")])]),T("active",[T("pressed",[i("rail",[i("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),i("rail",[K("&:active",[i("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),T("active",[i("rail",[i("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),i("rail",`
overflow: hidden;
height: var(--n-rail-height);
min-width: var(--n-rail-width);
border-radius: var(--n-rail-border-radius);
cursor: pointer;
position: relative;
transition:
opacity .3s var(--n-bezier),
background .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
background-color: var(--n-rail-color);
`,[i("button-icon",`
color: var(--n-icon-color);
transition: color .3s var(--n-bezier);
font-size: calc(var(--n-button-height) - 4px);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
display: flex;
justify-content: center;
align-items: center;
line-height: 1;
`,[Re()]),i("button",`
align-items: center;
top: var(--n-offset);
left: var(--n-offset);
height: var(--n-button-height);
width: var(--n-button-width-pressed);
max-width: var(--n-button-width);
border-radius: var(--n-button-border-radius);
background-color: var(--n-button-color);
box-shadow: var(--n-button-box-shadow);
box-sizing: border-box;
cursor: inherit;
content: "";
position: absolute;
transition:
background-color .3s var(--n-bezier),
left .3s var(--n-bezier),
opacity .3s var(--n-bezier),
max-width .3s var(--n-bezier),
box-shadow .3s var(--n-bezier);
`)]),T("active",[i("rail","background-color: var(--n-rail-color-active);")]),T("loading",[i("rail",`
cursor: wait;
`)]),T("disabled",[i("rail",`
cursor: not-allowed;
opacity: .5;
`)])]),Ft=Object.assign(Object.assign({},Q.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let se;const jt=J({name:"Switch",props:Ft,slots:Object,setup(e){se===void 0&&(typeof CSS<"u"?typeof CSS.supports<"u"?se=CSS.supports("width","max(1px)"):se=!1:se=!0);const{mergedClsPrefixRef:n,inlineThemeDisabled:r}=fe(e),o=Q("Switch","-switch",Mt,Ct,e,n),t=Ze(e),{mergedSizeRef:c,mergedDisabledRef:u}=t,h=P(e.defaultValue),_=me(e,"value"),v=Je(_,h),C=V(()=>v.value===e.checkedValue),w=P(!1),s=P(!1),f=V(()=>{const{railStyle:a}=e;if(a)return a({focused:s.value,checked:C.value})});function y(a){const{"onUpdate:value":O,onChange:k,onUpdateValue:p}=e,{nTriggerFormInput:ee,nTriggerFormChange:G}=t;O&&_e(O,a),p&&_e(p,a),k&&_e(k,a),h.value=a,ee(),G()}function Y(){const{nTriggerFormFocus:a}=t;a()}function U(){const{nTriggerFormBlur:a}=t;a()}function H(){e.loading||u.value||(v.value!==e.checkedValue?y(e.checkedValue):y(e.uncheckedValue))}function g(){s.value=!0,Y()}function b(){s.value=!1,U(),w.value=!1}function $(a){e.loading||u.value||a.key===" "&&(v.value!==e.checkedValue?y(e.checkedValue):y(e.uncheckedValue),w.value=!1)}function B(a){e.loading||u.value||a.key===" "&&(a.preventDefault(),w.value=!0)}const S=V(()=>{const{value:a}=c,{self:{opacityDisabled:O,railColor:k,railColorActive:p,buttonBoxShadow:ee,buttonColor:G,boxShadowFocus:M,loadingColor:z,textColor:te,iconColor:D,[j("buttonHeight",a)]:F,[j("buttonWidth",a)]:ne,[j("buttonWidthPressed",a)]:oe,[j("railHeight",a)]:W,[j("railWidth",a)]:A,[j("railBorderRadius",a)]:ge,[j("buttonBorderRadius",a)]:pe},common:{cubicBezierEaseInOut:be}}=o.value;let ie,x,re;return se?(ie=`calc((${W} - ${F}) / 2)`,x=`max(${W}, ${F})`,re=`max(${A}, calc(${A} + ${F} - ${W}))`):(ie=xe((E(W)-E(F))/2),x=xe(Math.max(E(W),E(F))),re=E(W)>E(F)?A:xe(E(A)+E(F)-E(W))),{"--n-bezier":be,"--n-button-border-radius":pe,"--n-button-box-shadow":ee,"--n-button-color":G,"--n-button-width":ne,"--n-button-width-pressed":oe,"--n-button-height":F,"--n-height":x,"--n-offset":ie,"--n-opacity-disabled":O,"--n-rail-border-radius":ge,"--n-rail-color":k,"--n-rail-color-active":p,"--n-rail-height":W,"--n-rail-width":A,"--n-width":re,"--n-box-shadow-focus":M,"--n-loading-color":z,"--n-text-color":te,"--n-icon-color":D}}),R=r?Se("switch",V(()=>c.value[0]),S,e):void 0;return{handleClick:H,handleBlur:b,handleFocus:g,handleKeyup:$,handleKeydown:B,mergedRailStyle:f,pressed:w,mergedClsPrefix:n,mergedValue:v,checked:C,mergedDisabled:u,cssVars:r?void 0:S,themeClass:R==null?void 0:R.themeClass,onRender:R==null?void 0:R.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:n,checked:r,mergedRailStyle:o,onRender:t,$slots:c}=this;t==null||t();const{checked:u,unchecked:h,icon:_,"checked-icon":v,"unchecked-icon":C}=c,w=!(ve(_)&&ve(v)&&ve(C));return l("div",{role:"switch","aria-checked":r,class:[`${e}-switch`,this.themeClass,w&&`${e}-switch--icon`,r&&`${e}-switch--active`,n&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},l("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:o},q(u,s=>q(h,f=>s||f?l("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},l("div",{class:`${e}-switch__rail-placeholder`},l("div",{class:`${e}-switch__button-placeholder`}),s),l("div",{class:`${e}-switch__rail-placeholder`},l("div",{class:`${e}-switch__button-placeholder`}),f)):null)),l("div",{class:`${e}-switch__button`},q(_,s=>q(v,f=>q(C,y=>l(Qe,null,{default:()=>this.loading?l(je,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(f||s)?l("div",{class:`${e}-switch__button-icon`,key:f?"checked-icon":"icon"},f||s):!this.checked&&(y||s)?l("div",{class:`${e}-switch__button-icon`,key:y?"unchecked-icon":"icon"},y||s):null})))),q(u,s=>s&&l("div",{key:"checked",class:`${e}-switch__checked`},s)),q(h,s=>s&&l("div",{key:"unchecked",class:`${e}-switch__unchecked`},s)))))}}),Ve=1.25,Pt=m("timeline",`
position: relative;
width: 100%;
display: flex;
flex-direction: column;
line-height: ${Ve};
`,[T("horizontal",`
flex-direction: row;
`,[K(">",[m("timeline-item",`
flex-shrink: 0;
padding-right: 40px;
`,[T("dashed-line-type",[K(">",[m("timeline-item-timeline",[i("line",`
background-image: linear-gradient(90deg, var(--n-color-start), var(--n-color-start) 50%, transparent 50%, transparent 100%);
background-size: 10px 1px;
`)])])]),K(">",[m("timeline-item-content",`
margin-top: calc(var(--n-icon-size) + 12px);
`,[K(">",[i("meta",`
margin-top: 6px;
margin-bottom: unset;
`)])]),m("timeline-item-timeline",`
width: 100%;
height: calc(var(--n-icon-size) + 12px);
`,[i("line",`
left: var(--n-icon-size);
top: calc(var(--n-icon-size) / 2 - 1px);
right: 0px;
width: unset;
height: 2px;
`)])])])])]),T("right-placement",[m("timeline-item",[m("timeline-item-content",`
text-align: right;
margin-right: calc(var(--n-icon-size) + 12px);
`),m("timeline-item-timeline",`
width: var(--n-icon-size);
right: 0;
`)])]),T("left-placement",[m("timeline-item",[m("timeline-item-content",`
margin-left: calc(var(--n-icon-size) + 12px);
`),m("timeline-item-timeline",`
left: 0;
`)])]),m("timeline-item",`
position: relative;
`,[K("&:last-child",[m("timeline-item-timeline",[i("line",`
display: none;
`)]),m("timeline-item-content",[i("meta",`
margin-bottom: 0;
`)])]),m("timeline-item-content",[i("title",`
margin: var(--n-title-margin);
font-size: var(--n-title-font-size);
transition: color .3s var(--n-bezier);
font-weight: var(--n-title-font-weight);
color: var(--n-title-text-color);
`),i("content",`
transition: color .3s var(--n-bezier);
font-size: var(--n-content-font-size);
color: var(--n-content-text-color);
`),i("meta",`
transition: color .3s var(--n-bezier);
font-size: 12px;
margin-top: 6px;
margin-bottom: 20px;
color: var(--n-meta-text-color);
`)]),T("dashed-line-type",[m("timeline-item-timeline",[i("line",`
--n-color-start: var(--n-line-color);
transition: --n-color-start .3s var(--n-bezier);
background-color: transparent;
background-image: linear-gradient(180deg, var(--n-color-start), var(--n-color-start) 50%, transparent 50%, transparent 100%);
background-size: 1px 10px;
`)])]),m("timeline-item-timeline",`
width: calc(var(--n-icon-size) + 12px);
position: absolute;
top: calc(var(--n-title-font-size) * ${Ve} / 2 - var(--n-icon-size) / 2);
height: 100%;
`,[i("circle",`
border: var(--n-circle-border);
transition:
background-color .3s var(--n-bezier),
border-color .3s var(--n-bezier);
width: var(--n-icon-size);
height: var(--n-icon-size);
border-radius: var(--n-icon-size);
box-sizing: border-box;
`),i("icon",`
color: var(--n-icon-color);
font-size: var(--n-icon-size);
height: var(--n-icon-size);
width: var(--n-icon-size);
display: flex;
align-items: center;
justify-content: center;
`),i("line",`
transition: background-color .3s var(--n-bezier);
position: absolute;
top: var(--n-icon-size);
left: calc(var(--n-icon-size) / 2 - 1px);
bottom: 0px;
width: 2px;
background-color: var(--n-line-color);
`)])])]),Wt=Object.assign(Object.assign({},Q.props),{horizontal:Boolean,itemPlacement:{type:String,default:"left"},size:{type:String,default:"medium"},iconSize:Number}),We=Me("n-timeline"),Ot=J({name:"Timeline",props:Wt,setup(e,{slots:n}){const{mergedClsPrefixRef:r}=fe(e),o=Q("Timeline","-timeline",Pt,Rt,e,r);return he(We,{props:e,mergedThemeRef:o,mergedClsPrefixRef:r}),()=>{const{value:t}=r;return l("div",{class:[`${t}-timeline`,e.horizontal&&`${t}-timeline--horizontal`,`${t}-timeline--${e.size}-size`,!e.horizontal&&`${t}-timeline--${e.itemPlacement}-placement`]},n)}}}),Nt={time:[String,Number],title:String,content:String,color:String,lineType:{type:String,default:"default"},type:{type:String,default:"default"}},It=J({name:"TimelineItem",props:Nt,slots:Object,setup(e){const n=ue(We);n||et("timeline-item","`n-timeline-item` must be placed inside `n-timeline`."),mt();const{inlineThemeDisabled:r}=fe(),o=V(()=>{const{props:{size:c,iconSize:u},mergedThemeRef:h}=n,{type:_}=e,{self:{titleTextColor:v,contentTextColor:C,metaTextColor:w,lineColor:s,titleFontWeight:f,contentFontSize:y,[j("iconSize",c)]:Y,[j("titleMargin",c)]:U,[j("titleFontSize",c)]:H,[j("circleBorder",_)]:g,[j("iconColor",_)]:b},common:{cubicBezierEaseInOut:$}}=h.value;return{"--n-bezier":$,"--n-circle-border":g,"--n-icon-color":b,"--n-content-font-size":y,"--n-content-text-color":C,"--n-line-color":s,"--n-meta-text-color":w,"--n-title-font-size":H,"--n-title-font-weight":f,"--n-title-margin":U,"--n-title-text-color":v,"--n-icon-size":tt(u)||Y}}),t=r?Se("timeline-item",V(()=>{const{props:{size:c,iconSize:u}}=n,{type:h}=e;return`${c[0]}${u||"a"}${h[0]}`}),o,n.props):void 0;return{mergedClsPrefix:n.mergedClsPrefixRef,cssVars:r?void 0:o,themeClass:t==null?void 0:t.themeClass,onRender:t==null?void 0:t.onRender}},render(){const{mergedClsPrefix:e,color:n,onRender:r,$slots:o}=this;return r==null||r(),l("div",{class:[`${e}-timeline-item`,this.themeClass,`${e}-timeline-item--${this.type}-type`,`${e}-timeline-item--${this.lineType}-line-type`],style:this.cssVars},l("div",{class:`${e}-timeline-item-timeline`},l("div",{class:`${e}-timeline-item-timeline__line`}),q(o.icon,t=>t?l("div",{class:`${e}-timeline-item-timeline__icon`,style:{color:n}},t):l("div",{class:`${e}-timeline-item-timeline__circle`,style:{borderColor:n}}))),l("div",{class:`${e}-timeline-item-content`},q(o.header,t=>t||this.title?l("div",{class:`${e}-timeline-item-content__title`},t||this.title):null),l("div",{class:`${e}-timeline-item-content__content`},Te(o.default,()=>[this.content])),l("div",{class:`${e}-timeline-item-content__meta`},Te(o.footer,()=>[this.time]))))}});var de={},He;function Dt(){if(He)return de;He=1,Object.defineProperty(de,"__esModule",{value:!0});const e=ft(),n={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512"};return de.default=(0,e.defineComponent)({name:"Stop",render:function(o,t){return(0,e.openBlock)(),(0,e.createElementBlock)("svg",n,t[0]||(t[0]=[(0,e.createElementVNode)("path",{d:"M392 432H120a40 40 0 0 1-40-40V120a40 40 0 0 1 40-40h272a40 40 0 0 1 40 40v272a40 40 0 0 1-40 40z",fill:"currentColor"},null,-1)]))}}),de}var Et=Dt();const qt=nt(Et),Kt={class:"home-container"},Ut={class:"action-container"},At={class:"scroll-container"},Yt={key:0,class:"scroll-label"},Xt={__name:"Log",setup(e){st(M=>({"28472a46":d(S),"7a005605":d(R)}));const n=dt(),{log:r,log_mobile:o,running:t,task_list:c,waiting:u,get_task_id:h,sc_uri:_,speed_msg:v,basement_task_list:C}=Le(n),{get_tasks:w}=n,s=ue("axios"),f=ue("mobile"),y=P(!0);function Y(M){M||ye(()=>{var z;(z=document.querySelector(".n-scrollbar-content"))==null||z.scrollIntoView(!1)})}Fe(()=>{w(),G()}),it(()=>{clearTimeout(h.value)});function U(){t.value=!0,s.get("/start"),w()}function H(){u.value=!0,s.get("/stop").then(M=>{t.value=!M.data,u.value=!1})}P(!0);const g=P(!1),b=P(!0);he("show_task",g),he("add_task",b);const $=ut(),{conf:B}=Le($),S=V(()=>f.value?"cover, cover":"753px, cover"),R=V(()=>f.value?"25% 0, 50%, 50%":"70% -15%, 50% 50%");function a(){s.get("/stop-maa")}const O=[{label:"停止Maa",key:"maa"}],k=P(!0),p=P({}),ee=M=>{const z=new Date,te=new Date(M),D=Math.floor((te-z)/1e3);if(D<=0)return"正在执行";const F=Math.floor(D/3600),ne=Math.floor(D%3600/60),oe=D%60;return`${String(F).padStart(2,"0")}:${String(ne).padStart(2,"0")}:${String(oe).padStart(2,"0")}`},G=()=>{c.value.forEach(M=>{p.value[M.time]=ee(M.time)}),requestAnimationFrame(G)};return(M,z)=>{const te=vt,D=It,F=Ot,ne=gt,oe=Ht,W=_t,A=lt,ge=Ee,pe=qe,be=xt,ie=jt;return L(),X("div",Kt,[z[4]||(z[4]=ce("div",{class:"log-bg"},null,-1)),d(k)?(L(),Z(te,{key:0,"preview-disabled":"",width:"100%",class:"sc",src:d(_)==""?"/bg2.webp":d(_),"object-fit":"scale-down"},null,8,["src"])):le("",!0),N(ne,{"x-scrollable":"",style:{"max-height":"100px"}},{default:I(()=>[N(F,{horizontal:""},{default:I(()=>[(L(!0),X(ae,null,Be(d(c),x=>(L(),X(ae,{key:x.time},[Object.keys(x.plan).length?(L(!0),X(ae,{key:0},Be(x.plan,(re,Ce)=>(L(),Z(D,{key:Ce,title:Ce,content:re.map(Oe=>Oe||"_").join(", "),time:`${x.time.split("T")[1].split(".")[0]} (剩余时间: ${d(p)[x.time]})`},null,8,["title","content","time"]))),128)):(L(),Z(D,{key:x.time,content:x.meta_data+x.type.display_value,time:`${x.time.split("T")[1].split(".")[0]} (剩余时间: ${d(p)[x.time]})`},null,8,["content","time"]))],64))),128))]),_:1})]),_:1}),N(oe,{class:rt(["log",{"auto-scroll":d(y)}]),log:d(f)?d(o):d(r),language:"mower",style:{"user-select":"text"}},null,8,["class","log"]),ce("div",Ut,[d(t)?(L(),Z(ge,{key:0,select:a,options:O,type:"error",up:!0},{default:I(()=>[N(A,{type:"error",onClick:H,loading:d(u),disabled:d(u)},{icon:I(()=>[N(W,null,{default:I(()=>[N(d(qt))]),_:1})]),default:I(()=>[d(f)?le("",!0):(L(),X(ae,{key:0},[we("停止运行")],64))]),_:1},8,["loading","disabled"])]),_:1})):(L(),Z(A,{key:1,type:"primary",onClick:U,loading:d(u),disabled:d(u)},{icon:I(()=>[N(W,null,{default:I(()=>[N(d(ht))]),_:1})]),default:I(()=>[d(f)?le("",!0):(L(),X(ae,{key:0},[we("开始运行")],64))]),_:1},8,["loading","disabled"])),N(pe),d(f)?le("",!0):(L(),Z(be,{key:2,checked:d(B).start_automatically,"onUpdate:checked":z[0]||(z[0]=x=>d(B).start_automatically=x)},{default:I(()=>z[2]||(z[2]=[we(" 启动后自动运行 ")])),_:1},8,["checked"])),z[3]||(z[3]=ce("div",{class:"expand"},null,-1)),ce("div",At,[N(ie,{value:d(y),"onUpdate:value":[z[1]||(z[1]=x=>at(y)?y.value=x:null),Y]},null,8,["value"]),d(f)?le("",!0):(L(),X("span",Yt,"自动滚动"))])])])}}},Cn=ot(Xt,[["__scopeId","data-v-80dfd5eb"]]);export{Cn as default};