import{p as N,_ as Vt,n as Lt,a as I,r as J,c as z,q as Pt,o as qt,m as Ut,b as D,d as c,h as Z,i as me,w as h,e as E,f as R,g as p,t as T,k as g,s as It,F as ee,v as ye,E as y,x as X}from"./index-DvbGwVAp.js";async function Dt(n={}){const{data:e}=await N.get("/accounts",{params:n});return e}async function Ft(n){const{data:e}=await N.post("/accounts",n);return e}async function $t(n,e){const{data:t}=await N.put(`/accounts/${n}`,e);return t}async function Mt(n){const{data:e}=await N.delete(`/accounts/${n}`);return e}async function zt(n,e){const{data:t}=await N.put(`/accounts/${n}/remark`,e);return t}async function Ht(n,e){const{data:t}=await N.post(`/accounts/${n}/start`,e);return t}async function Kt(n){const{data:e}=await N.post(`/accounts/${n}/stop`,{});return e}async function De(n){const{data:e}=await N.post("/accounts/batch/start",n);return e}async function Fe(n){const{data:e}=await N.post("/accounts/batch/stop",n);return e}async function Wt(){const{data:n}=await N.post("/accounts/clear",{});return n}async function Yt(n,e={}){const{data:t}=await N.post(`/accounts/${n}/screenshot`,e);return t}async function Jt(){const{data:n}=await N.get("/run_stats");return n}const U=Object.create(null);U.open="0";U.close="1";U.ping="2";U.pong="3";U.message="4";U.upgrade="5";U.noop="6";const re=Object.create(null);Object.keys(U).forEach(n=>{re[U[n]]=n});const ve={type:"error",data:"parser error"},We=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Ye=typeof ArrayBuffer=="function",Je=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n&&n.buffer instanceof ArrayBuffer,xe=({type:n,data:e},t,s)=>We&&e instanceof Blob?t?s(e):$e(e,s):Ye&&(e instanceof ArrayBuffer||Je(e))?t?s(e):$e(new Blob([e]),s):s(U[n]+(e||"")),$e=(n,e)=>{const t=new FileReader;return t.onload=function(){const s=t.result.split(",")[1];e("b"+(s||""))},t.readAsDataURL(n)};function Me(n){return n instanceof Uint8Array?n:n instanceof ArrayBuffer?new Uint8Array(n):new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}let _e;function Xt(n,e){if(We&&n.data instanceof Blob)return n.data.arrayBuffer().then(Me).then(e);if(Ye&&(n.data instanceof ArrayBuffer||Je(n.data)))return e(Me(n.data));xe(n,!1,t=>{_e||(_e=new TextEncoder),e(_e.encode(t))})}const ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",j=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let n=0;n{let e=n.length*.75,t=n.length,s,i=0,o,u,d,f;n[n.length-1]==="="&&(e--,n[n.length-2]==="="&&e--);const x=new ArrayBuffer(e),A=new Uint8Array(x);for(s=0;s>4,A[i++]=(u&15)<<4|d>>2,A[i++]=(d&3)<<6|f&63;return x},jt=typeof ArrayBuffer=="function",Ce=(n,e)=>{if(typeof n!="string")return{type:"message",data:Xe(n,e)};const t=n.charAt(0);return t==="b"?{type:"message",data:Gt(n.substring(1),e)}:re[t]?n.length>1?{type:re[t],data:n.substring(1)}:{type:re[t]}:ve},Gt=(n,e)=>{if(jt){const t=Qt(n);return Xe(t,e)}else return{base64:!0,data:n}},Xe=(n,e)=>{switch(e){case"blob":return n instanceof Blob?n:new Blob([n]);case"arraybuffer":default:return n instanceof ArrayBuffer?n:n.buffer}},Qe="",Zt=(n,e)=>{const t=n.length,s=new Array(t);let i=0;n.forEach((o,u)=>{xe(o,!1,d=>{s[u]=d,++i===t&&e(s.join(Qe))})})},es=(n,e)=>{const t=n.split(Qe),s=[];for(let i=0;i{const s=t.length;let i;if(s<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,s);else if(s<65536){i=new Uint8Array(3);const o=new DataView(i.buffer);o.setUint8(0,126),o.setUint16(1,s)}else{i=new Uint8Array(9);const o=new DataView(i.buffer);o.setUint8(0,127),o.setBigUint64(1,BigInt(s))}n.data&&typeof n.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}let ge;function te(n){return n.reduce((e,t)=>e+t.length,0)}function se(n,e){if(n[0].length===e)return n.shift();const t=new Uint8Array(e);let s=0;for(let i=0;iMath.pow(2,21)-1){d.enqueue(ve);break}i=A*Math.pow(2,32)+x.getUint32(4),s=3}else{if(te(t)n){d.enqueue(ve);break}}}})}const je=4;function v(n){if(n)return ns(n)}function ns(n){for(var e in v.prototype)n[e]=v.prototype[e];return n}v.prototype.on=v.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};v.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};v.prototype.off=v.prototype.removeListener=v.prototype.removeAllListeners=v.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var s,i=0;iPromise.resolve().then(e):(e,t)=>t(e,0),O=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),rs="arraybuffer";function Ge(n,...e){return e.reduce((t,s)=>(n.hasOwnProperty(s)&&(t[s]=n[s]),t),{})}const is=O.setTimeout,os=O.clearTimeout;function le(n,e){e.useNativeTimers?(n.setTimeoutFn=is.bind(O),n.clearTimeoutFn=os.bind(O)):(n.setTimeoutFn=O.setTimeout.bind(O),n.clearTimeoutFn=O.clearTimeout.bind(O))}const as=1.33;function cs(n){return typeof n=="string"?ls(n):Math.ceil((n.byteLength||n.size)*as)}function ls(n){let e=0,t=0;for(let s=0,i=n.length;s=57344?t+=3:(s++,t+=4);return t}function Ze(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function us(n){let e="";for(let t in n)n.hasOwnProperty(t)&&(e.length&&(e+="&"),e+=encodeURIComponent(t)+"="+encodeURIComponent(n[t]));return e}function hs(n){let e={},t=n.split("&");for(let s=0,i=t.length;s{this.readyState="paused",e()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||t()})),this.writable||(s++,this.once("drain",function(){--s||t()}))}else t()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const t=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};es(e,this.socket.binaryType).forEach(t),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,Zt(e,t=>{this.doWrite(t,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return this.opts.timestampRequests!==!1&&(t[this.opts.timestampParam]=Ze()),!this.supportsBinary&&!t.sid&&(t.b64=1),this.createUri(e,t)}}let et=!1;try{et=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const ps=et;function ms(){}class ys extends fs{constructor(e){if(super(e),typeof location<"u"){const t=location.protocol==="https:";let s=location.port;s||(s=t?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||s!==e.port}}doWrite(e,t){const s=this.request({method:"POST",data:e});s.on("success",t),s.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(t,s)=>{this.onError("xhr poll error",t,s)}),this.pollXhr=e}}class q extends v{constructor(e,t,s){super(),this.createRequest=e,le(this,s),this._opts=s,this._method=s.method||"GET",this._uri=t,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var e;const t=Ge(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");t.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(t);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let i in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(i)&&s.setRequestHeader(i,this._opts.extraHeaders[i])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var i;s.readyState===3&&((i=this._opts.cookieJar)===null||i===void 0||i.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(i){this.setTimeoutFn(()=>{this._onError(i)},0);return}typeof document<"u"&&(this._index=q.requestsCount++,q.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=ms,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete q.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}q.requestsCount=0;q.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",He);else if(typeof addEventListener=="function"){const n="onpagehide"in O?"pagehide":"unload";addEventListener(n,He,!1)}}function He(){for(let n in q.requests)q.requests.hasOwnProperty(n)&&q.requests[n].abort()}const _s=(function(){const n=tt({xdomain:!1});return n&&n.responseType!==null})();class gs extends ys{constructor(e){super(e);const t=e&&e.forceBase64;this.supportsBinary=_s&&!t}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new q(tt,this.uri(),e)}}function tt(n){const e=n.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||ps))return new XMLHttpRequest}catch{}if(!e)try{return new O[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const st=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class ws extends Se{get name(){return"websocket"}doOpen(){const e=this.uri(),t=this.opts.protocols,s=st?{}:Ge(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,t,s)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t{try{this.doWrite(s,o)}catch{}i&&ce(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=Ze()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}}const we=O.WebSocket||O.MozWebSocket;class vs extends ws{createSocket(e,t,s){return st?new we(e,t,s):t?new we(e,t):new we(e)}doWrite(e,t){this.ws.send(t)}}class bs extends Se{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const t=ss(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=e.readable.pipeThrough(t).getReader(),i=ts();i.readable.pipeTo(e.writable),this._writer=i.writable.getWriter();const o=()=>{s.read().then(({done:d,value:f})=>{d||(this.onPacket(f),o())}).catch(d=>{})};o();const u={type:"open"};this.query.sid&&(u.data=`{"sid":"${this.query.sid}"}`),this._writer.write(u).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let t=0;t{i&&ce(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const ks={websocket:vs,webtransport:bs,polling:gs},Es=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,As=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function be(n){if(n.length>8e3)throw"URI too long";const e=n,t=n.indexOf("["),s=n.indexOf("]");t!=-1&&s!=-1&&(n=n.substring(0,t)+n.substring(t,s).replace(/:/g,";")+n.substring(s,n.length));let i=Es.exec(n||""),o={},u=14;for(;u--;)o[As[u]]=i[u]||"";return t!=-1&&s!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=Ts(o,o.path),o.queryKey=xs(o,o.query),o}function Ts(n,e){const t=/\/{2,9}/g,s=e.replace(t,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&s.splice(0,1),e.slice(-1)=="/"&&s.splice(s.length-1,1),s}function xs(n,e){const t={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,i,o){i&&(t[i]=o)}),t}const ke=typeof addEventListener=="function"&&typeof removeEventListener=="function",ie=[];ke&&addEventListener("offline",()=>{ie.forEach(n=>n())},!1);class F extends v{constructor(e,t){if(super(),this.binaryType=rs,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(t=e,e=null),e){const s=be(e);t.hostname=s.host,t.secure=s.protocol==="https"||s.protocol==="wss",t.port=s.port,s.query&&(t.query=s.query)}else t.host&&(t.hostname=be(t.host).host);le(this,t),this.secure=t.secure!=null?t.secure:typeof location<"u"&&location.protocol==="https:",t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=t.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},t.transports.forEach(s=>{const i=s.prototype.name;this.transports.push(i),this._transportsByName[i]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=hs(this.opts.query)),ke&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},ie.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=je,t.transport=e,this.id&&(t.sid=this.id);const s=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&F.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const t=this.createTransport(e);t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",t=>this._onClose("transport close",t))}onOpen(){this.readyState="open",F.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const t=new Error("server error");t.code=e.data,this._onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let t=1;for(let s=0;s0&&t>this._maxPayload)return this.writeBuffer.slice(0,s);t+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,ce(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,t,s){return this._sendPacket("message",e,t,s),this}send(e,t,s){return this._sendPacket("message",e,t,s),this}_sendPacket(e,t,s,i){if(typeof t=="function"&&(i=t,t=void 0),typeof s=="function"&&(i=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const o={type:e,data:t,options:s};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},s=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():e()}):this.upgrading?s():e()),this}_onError(e){if(F.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),ke&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=ie.indexOf(this._offlineEventListener);s!==-1&&ie.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this._prevBufferLen=0}}}F.protocol=je;class Cs extends F{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e{s||(t.send([{type:"ping",data:"probe"}]),t.once("packet",C=>{if(!s)if(C.type==="pong"&&C.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",t),!t)return;F.priorWebsocketSuccess=t.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(A(),this.setTransport(t),t.send([{type:"upgrade"}]),this.emitReserved("upgrade",t),t=null,this.upgrading=!1,this.flush())})}else{const V=new Error("probe error");V.transport=t.name,this.emitReserved("upgradeError",V)}}))};function o(){s||(s=!0,A(),t.close(),t=null)}const u=C=>{const V=new Error("probe error: "+C);V.transport=t.name,o(),this.emitReserved("upgradeError",V)};function d(){u("transport closed")}function f(){u("socket closed")}function x(C){t&&C.name!==t.name&&o()}const A=()=>{t.removeListener("open",i),t.removeListener("error",u),t.removeListener("close",d),this.off("close",f),this.off("upgrading",x)};t.once("open",i),t.once("error",u),t.once("close",d),this.once("close",f),this.once("upgrading",x),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{s||t.open()},200):t.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const t=[];for(let s=0;sks[i]).filter(i=>!!i)),super(e,s)}};function Bs(n,e="",t){let s=n;t=t||typeof location<"u"&&location,n==null&&(n=t.protocol+"//"+t.host),typeof n=="string"&&(n.charAt(0)==="/"&&(n.charAt(1)==="/"?n=t.protocol+n:n=t.host+n),/^(https?|wss?):\/\//.test(n)||(typeof t<"u"?n=t.protocol+"//"+n:n="https://"+n),s=be(n)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const o=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+o+":"+s.port+e,s.href=s.protocol+"://"+o+(t&&t.port===s.port?"":":"+s.port),s}const Rs=typeof ArrayBuffer=="function",Os=n=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(n):n.buffer instanceof ArrayBuffer,nt=Object.prototype.toString,Ns=typeof Blob=="function"||typeof Blob<"u"&&nt.call(Blob)==="[object BlobConstructor]",Vs=typeof File=="function"||typeof File<"u"&&nt.call(File)==="[object FileConstructor]";function Be(n){return Rs&&(n instanceof ArrayBuffer||Os(n))||Ns&&n instanceof Blob||Vs&&n instanceof File}function oe(n,e){if(!n||typeof n!="object")return!1;if(Array.isArray(n)){for(let t=0,s=n.length;t=0&&n.num{delete this.acks[e];for(let d=0;d{this.io.clearTimeoutFn(o),t.apply(this,d)};u.withError=!0,this.acks[e]=u}emitWithAck(e,...t){return new Promise((s,i)=>{const o=(u,d)=>u?i(u):s(d);o.withError=!0,t.push(o),this.emit(e,...t)})}_addToQueue(e){let t;typeof e[e.length-1]=="function"&&(t=e.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((i,...o)=>s!==this._queue[0]?void 0:(i!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(i)):(this._queue.shift(),t&&t(null,...o)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:m.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(s=>String(s.id)===e)){const s=this.acks[e];delete this.acks[e],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case m.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case m.EVENT:case m.BINARY_EVENT:this.onevent(e);break;case m.ACK:case m.BINARY_ACK:this.onack(e);break;case m.DISCONNECT:this.ondisconnect();break;case m.CONNECT_ERROR:this.destroy();const s=new Error(e.data.message);s.data=e.data.data,this.emitReserved("connect_error",s);break}}onevent(e){const t=e.data||[];e.id!=null&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const s of t)s.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let s=!1;return function(...i){s||(s=!0,t.packet({type:m.ACK,id:e,data:i}))}}onack(e){const t=this.acks[e.id];typeof t=="function"&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:m.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let s=0;s0&&n.jitter<=1?n.jitter:0,this.attempts=0}H.prototype.duration=function(){var n=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),t=Math.floor(e*this.jitter*n);n=(Math.floor(e*10)&1)==0?n-t:n+t}return Math.min(n,this.max)|0};H.prototype.reset=function(){this.attempts=0};H.prototype.setMin=function(n){this.ms=n};H.prototype.setMax=function(n){this.max=n};H.prototype.setJitter=function(n){this.jitter=n};class Te extends v{constructor(e,t){var s;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(t=e,e=void 0),t=t||{},t.path=t.path||"/socket.io",this.opts=t,le(this,t),this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor((s=t.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new H({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this._readyState="closed",this.uri=e;const i=t.parser||Fs;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=t.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(t=this.backoff)===null||t===void 0||t.setMin(e),this)}randomizationFactor(e){var t;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(t=this.backoff)===null||t===void 0||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(t=this.backoff)===null||t===void 0||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Ss(this.uri,this.opts);const t=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const i=P(t,"open",function(){s.onopen(),e&&e()}),o=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),e?e(d):this.maybeReconnectOnOpen()},u=P(t,"error",o);if(this._timeout!==!1){const d=this._timeout,f=this.setTimeoutFn(()=>{i(),o(new Error("timeout")),t.close()},d);this.opts.autoUnref&&f.unref(),this.subs.push(()=>{this.clearTimeoutFn(f)})}return this.subs.push(i),this.subs.push(u),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(P(e,"ping",this.onping.bind(this)),P(e,"data",this.ondata.bind(this)),P(e,"error",this.onerror.bind(this)),P(e,"close",this.onclose.bind(this)),P(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(t){this.onclose("parse error",t)}}ondecoded(e){ce(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let s=this.nsps[e];return s?this._autoConnect&&!s.active&&s.connect():(s=new rt(this,e,t),this.nsps[e]=s),s}_destroy(e){const t=Object.keys(this.nsps);for(const s of t)if(this.nsps[s].active)return;this._close()}_packet(e){const t=this.encoder.encode(e);for(let s=0;se()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,t){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},t);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Q={};function ae(n,e){typeof n=="object"&&(e=n,n=void 0),e=e||{};const t=Bs(n,e.path||"/socket.io"),s=t.source,i=t.id,o=t.path,u=Q[i]&&o in Q[i].nsps,d=e.forceNew||e["force new connection"]||e.multiplex===!1||u;let f;return d?f=new Te(s,e):(Q[i]||(Q[i]=new Te(s,e)),f=Q[i]),t.query&&!e.query&&(e.query=t.queryKey),f.socket(t.path,e)}Object.assign(ae,{Manager:Te,Socket:rt,io:ae,connect:ae});let ne=null;function Ms(){return ne||(ne=ae({transports:["websocket","polling"],withCredentials:!0}),ne)}const zs={class:"page"},Hs={class:"stat-value"},Ks={class:"stat-value"},Ws={class:"stat-value"},Ys={class:"stat-value"},Js={class:"stat-value"},Xs={class:"stat-value"},Qs={class:"stat-suffix app-muted"},js={class:"upgrade-actions"},Gs={class:"panel-head"},Zs={class:"panel-actions"},en={class:"toolbar"},tn={class:"toolbar-left"},sn={class:"app-muted"},nn={class:"toolbar-middle"},rn={class:"toolbar-right"},on={key:1,class:"grid"},an={class:"card-top"},cn={class:"card-main"},ln={class:"card-title"},un={class:"card-name"},hn={class:"card-sub app-muted"},dn={key:0},fn={key:1},pn={class:"progress"},mn={class:"progress-meta app-muted"},yn={class:"card-controls"},_n={class:"card-buttons"},gn={__name:"AccountsPage",setup(n){const e=Lt(),t=Ms(),s=I(!1),i=I(!1),o=J({today_completed:0,today_failed:0,current_running:0,today_items:0,today_attachments:0}),u=J({}),d=I([]),f=J({}),x=I("应读"),A=I(!0),C=I(!1),V=I(!1),K=I(!1),S=J({username:"",password:"",remark:""}),b=J({id:"",username:"",password:"",remark:"",originalRemark:""}),Oe=[{label:"应读",value:"应读"},{label:"未读",value:"未读"},{label:"注册前未读",value:"注册前未读"}],L=z(()=>Object.values(u).sort((a,r)=>String(a.username||"").localeCompare(String(r.username||""),"zh-CN"))),ue=z(()=>L.value.length),it=z(()=>e.isVip?999:3),Ne=z(()=>d.value.length),ot=z(()=>ue.value>0&&Ne.value===ue.value),at=z(()=>!e.isVip);function W(a){const r=u[a.id]||{};u[a.id]={...r,...a}}function he(a){for(const r of Object.keys(u))delete u[r];for(const r of a||[])W(r)}function ct(){for(const a of L.value)f[a.id]||(f[a.id]="应读")}Pt(L,ct,{immediate:!0});function lt(a){a?d.value=L.value.map(r=>r.id):d.value=[]}function G(a){return e.isVip?!0:(y.warning(`${a}是VIP专属功能`),K.value=!0,!1)}function ut(a){const r=Number(a.total_items||0),_=Number(a.progress_items||0);return r?Math.max(0,Math.min(100,Math.round(_/r*100))):0}function ht(a=""){const r=String(a);return r.includes("已完成")||r.includes("完成")?"success":r.includes("失败")||r.includes("错误")||r.includes("异常")||r.includes("登录失败")?"danger":r.includes("排队")||r.includes("运行")||r.includes("截图")?"warning":"info"}async function Y(){i.value=!0;try{const a=await Jt();o.today_completed=Number(a?.today_completed||0),o.today_failed=Number(a?.today_failed||0),o.current_running=Number(a?.current_running||0),o.today_items=Number(a?.today_items||0),o.today_attachments=Number(a?.today_attachments||0)}catch(a){a?.response?.status===401&&(window.location.href="/login")}finally{i.value=!1}}async function Ve(){s.value=!0;try{const a=await Dt({refresh:!0});he(a)}catch(a){a?.response?.status===401&&(window.location.href="/login")}finally{s.value=!1}}async function dt(a){try{await Ht(a.id,{browse_type:f[a.id]||"应读",enable_screenshot:!0})}catch(r){const _=r?.response?.data;y.error(_?.error||"启动失败")}}async function ft(a){try{await Kt(a.id)}catch(r){const _=r?.response?.data;y.error(_?.error||"停止失败")}}async function pt(a){try{await Yt(a.id,{browse_type:f[a.id]||"应读"}),y.success("已提交截图")}catch(r){const _=r?.response?.data;y.error(_?.error||"截图失败")}}async function mt(a){try{await X.confirm(`确定要删除账号「${a.username}」吗?`,"删除账号",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"})}catch{return}try{const r=await Mt(a.id);r?.success?(delete u[a.id],d.value=d.value.filter(_=>_!==a.id),y.success("已删除"),await Y()):y.error(r?.error||"删除失败")}catch(r){const _=r?.response?.data;y.error(_?.error||"删除失败")}}function yt(){S.username="",S.password="",S.remark="",C.value=!0}async function _t(){const a=S.username.trim();if(!a||!S.password.trim()){y.error("用户名和密码不能为空");return}try{await Ft({username:a,password:S.password,remember:!0,remark:S.remark.trim()}),y.success("添加成功"),C.value=!1,await Y()}catch(r){const _=r?.response?.data;y.error(_?.error||"添加失败")}}function gt(a){b.id=a.id,b.username=a.username,b.password="",b.remark=String(a.remark||""),b.originalRemark=String(a.remark||""),V.value=!0}async function wt(){if(b.id){if(!b.password.trim()){y.error("请输入新密码");return}try{const a=await $t(b.id,{password:b.password,remember:!0});a?.account&&W(a.account);const r=b.remark.trim();r!==b.originalRemark&&(await zt(b.id,{remark:r}),W({id:b.id,remark:r})),y.success("已更新"),V.value=!1}catch(a){const r=a?.response?.data;y.error(r?.error||"更新失败")}}}async function vt(){if(G("批量操作")){if(d.value.length===0){y.warning("请先选择账号");return}try{const a=await De({account_ids:d.value,browse_type:x.value,enable_screenshot:A.value});y.success(`已启动 ${a?.started_count||0} 个账号`)}catch(a){const r=a?.response?.data;y.error(r?.error||"操作失败")}}}async function bt(){if(G("批量操作")){if(d.value.length===0){y.warning("请先选择账号");return}try{const a=await Fe({account_ids:d.value});y.success(`已停止 ${a?.stopped_count||0} 个账号`)}catch(a){const r=a?.response?.data;y.error(r?.error||"操作失败")}}}async function kt(){if(G("全部启动")){if(L.value.length===0){y.warning("没有账号");return}try{await X.confirm("确定要启动全部账号吗?","全部启动",{confirmButtonText:"启动",cancelButtonText:"取消",type:"warning"})}catch{return}try{const a=await De({account_ids:L.value.map(r=>r.id),browse_type:x.value,enable_screenshot:A.value});y.success(`已启动 ${a?.started_count||0} 个账号`)}catch(a){const r=a?.response?.data;y.error(r?.error||"操作失败")}}}async function Et(){if(G("全部停止")){if(L.value.length===0){y.warning("没有账号");return}try{await X.confirm("确定要停止全部账号吗?","全部停止",{confirmButtonText:"停止",cancelButtonText:"取消",type:"warning"})}catch{return}try{const a=await Fe({account_ids:L.value.map(r=>r.id)});y.success(`已停止 ${a?.stopped_count||0} 个账号`)}catch(a){const r=a?.response?.data;y.error(r?.error||"操作失败")}}}async function At(){if(L.value.length===0){y.warning("没有账号");return}try{await X.confirm("确定要清空所有账号吗?此操作不可恢复!","清空账号",{confirmButtonText:"继续",cancelButtonText:"取消",type:"warning"}),await X.confirm("再次确认:真的要删除所有账号吗?","二次确认",{confirmButtonText:"删除",cancelButtonText:"取消",type:"warning"})}catch{return}try{const a=await Wt();if(a?.success){he([]),d.value=[],y.success("已清空所有账号"),await Y();return}y.error(a?.error||"操作失败")}catch(a){const r=a?.response?.data;y.error(r?.error||"操作失败")}}function Tt(){const a=w=>{he(w)},r=w=>{W(w)},_=w=>{w?.account_id&&W({id:w.account_id,detail_status:w.stage||"",total_items:w.total_items,progress_items:w.browsed_items,total_attachments:w.total_attachments,progress_attachments:w.viewed_attachments,elapsed_seconds:w.elapsed_seconds,elapsed_display:w.elapsed_display})};return t.on("accounts_list",a),t.on("account_update",r),t.on("task_progress",_),t.connected||t.connect(),()=>{t.off("accounts_list",a),t.off("account_update",r),t.off("task_progress",_)}}let de=null,fe=null;return qt(async()=>{e.vipInfo||e.refreshVipInfo().catch(()=>{window.location.href="/login"}),de=Tt(),await Ve(),await Y(),fe=window.setInterval(Y,1e4)}),Ut(()=>{de&&de(),fe&&window.clearInterval(fe)}),(a,r)=>{const _=E("el-card"),w=E("el-col"),xt=E("el-row"),k=E("el-button"),Le=E("el-alert"),Pe=E("el-checkbox"),qe=E("el-option"),Ue=E("el-select"),Ct=E("el-switch"),St=E("el-skeleton"),Bt=E("el-empty"),Rt=E("el-checkbox-group"),Ot=E("el-tag"),Nt=E("el-progress"),$=E("el-input"),M=E("el-form-item"),Ie=E("el-form"),pe=E("el-dialog");return R(),D("div",zs,[c(xt,{gutter:12,class:"stats-row"},{default:h(()=>[c(w,{xs:12,sm:8,md:4},{default:h(()=>[c(_,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[16]||(r[16]=p("div",{class:"stat-label app-muted"},"今日完成",-1)),p("div",Hs,T(o.today_completed),1)]),_:1})]),_:1}),c(w,{xs:12,sm:8,md:4},{default:h(()=>[c(_,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[17]||(r[17]=p("div",{class:"stat-label app-muted"},"今日失败",-1)),p("div",Ks,T(o.today_failed),1)]),_:1})]),_:1}),c(w,{xs:12,sm:8,md:4},{default:h(()=>[c(_,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[18]||(r[18]=p("div",{class:"stat-label app-muted"},"运行中",-1)),p("div",Ws,T(o.current_running),1)]),_:1})]),_:1}),c(w,{xs:12,sm:8,md:4},{default:h(()=>[c(_,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[19]||(r[19]=p("div",{class:"stat-label app-muted"},"浏览内容",-1)),p("div",Ys,T(o.today_items),1)]),_:1})]),_:1}),c(w,{xs:12,sm:8,md:4},{default:h(()=>[c(_,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[20]||(r[20]=p("div",{class:"stat-label app-muted"},"查看附件",-1)),p("div",Js,T(o.today_attachments),1)]),_:1})]),_:1}),c(w,{xs:12,sm:8,md:4},{default:h(()=>[c(_,{shadow:"never",class:"stat-card","body-style":{padding:"14px"}},{default:h(()=>[r[21]||(r[21]=p("div",{class:"stat-label app-muted"},"账号数",-1)),p("div",Xs,[g(T(ue.value),1),p("span",Qs,"/ "+T(It(e).isVip?"∞":it.value),1)])]),_:1})]),_:1})]),_:1}),at.value?(R(),Z(Le,{key:0,type:"info","show-icon":"",closable:!1,class:"upgrade-banner",title:"升级 VIP,解锁更多功能:无限账号 · 优先排队 · 定时任务 · 批量操作"},{default:h(()=>[p("div",js,[c(k,{type:"primary",plain:"",onClick:r[0]||(r[0]=l=>K.value=!0)},{default:h(()=>[...r[22]||(r[22]=[g("了解VIP特权",-1)])]),_:1})])]),_:1})):me("",!0),c(_,{shadow:"never",class:"panel","body-style":{padding:"14px"}},{default:h(()=>[p("div",Gs,[r[25]||(r[25]=p("div",{class:"panel-title"},"账号管理",-1)),p("div",Zs,[c(k,{loading:s.value,onClick:Ve},{default:h(()=>[...r[23]||(r[23]=[g("刷新",-1)])]),_:1},8,["loading"]),c(k,{type:"primary",onClick:yt},{default:h(()=>[...r[24]||(r[24]=[g("添加账号",-1)])]),_:1})])]),p("div",en,[p("div",tn,[c(Pe,{"model-value":ot.value,onChange:lt},{default:h(()=>[...r[26]||(r[26]=[g("全选",-1)])]),_:1},8,["model-value"]),p("span",sn,"已选 "+T(Ne.value)+" 个",1)]),p("div",nn,[c(Ue,{modelValue:x.value,"onUpdate:modelValue":r[1]||(r[1]=l=>x.value=l),size:"small",style:{width:"120px"}},{default:h(()=>[(R(),D(ee,null,ye(Oe,l=>c(qe,{key:l.value,label:l.label,value:l.value},null,8,["label","value"])),64))]),_:1},8,["modelValue"]),c(Ct,{modelValue:A.value,"onUpdate:modelValue":r[2]||(r[2]=l=>A.value=l),"inline-prompt":"","active-text":"截图","inactive-text":"不截图"},null,8,["modelValue"])]),p("div",rn,[c(k,{type:"primary",onClick:vt},{default:h(()=>[...r[27]||(r[27]=[g("批量启动",-1)])]),_:1}),c(k,{onClick:bt},{default:h(()=>[...r[28]||(r[28]=[g("批量停止",-1)])]),_:1}),c(k,{type:"success",plain:"",onClick:kt},{default:h(()=>[...r[29]||(r[29]=[g("全部启动",-1)])]),_:1}),c(k,{type:"danger",plain:"",onClick:Et},{default:h(()=>[...r[30]||(r[30]=[g("全部停止",-1)])]),_:1}),c(k,{type:"danger",text:"",onClick:At},{default:h(()=>[...r[31]||(r[31]=[g("清空",-1)])]),_:1})])]),s.value||i.value?(R(),Z(St,{key:0,rows:5,animated:""})):(R(),D(ee,{key:1},[L.value.length===0?(R(),Z(Bt,{key:0,description:"暂无账号,点击右上角添加"})):(R(),D("div",on,[(R(!0),D(ee,null,ye(L.value,l=>(R(),Z(_,{key:l.id,shadow:"never",class:"account-card","body-style":{padding:"14px"}},{default:h(()=>[p("div",an,[c(Rt,{modelValue:d.value,"onUpdate:modelValue":r[3]||(r[3]=B=>d.value=B),class:"card-check"},{default:h(()=>[c(Pe,{value:l.id},null,8,["value"])]),_:2},1032,["modelValue"]),p("div",cn,[p("div",ln,[p("span",un,T(l.username),1),c(Ot,{size:"small",type:ht(l.status),effect:"light"},{default:h(()=>[g(T(l.status),1)]),_:2},1032,["type"])]),p("div",hn,[g(T(l.remark||"—")+" ",1),l.detail_status?(R(),D("span",dn," · "+T(l.detail_status),1)):me("",!0),l.elapsed_display?(R(),D("span",fn," · "+T(l.elapsed_display),1)):me("",!0)])])]),p("div",pn,[c(Nt,{percentage:ut(l),"stroke-width":10,"show-text":!1},null,8,["percentage"]),p("div",mn,[p("span",null,"内容 "+T(l.progress_items||0)+"/"+T(l.total_items||0),1),p("span",null,"附件 "+T(l.progress_attachments||0)+"/"+T(l.total_attachments||0),1)])]),p("div",yn,[c(Ue,{modelValue:f[l.id],"onUpdate:modelValue":B=>f[l.id]=B,size:"small",style:{width:"130px"}},{default:h(()=>[(R(),D(ee,null,ye(Oe,B=>c(qe,{key:B.value,label:B.label,value:B.value},null,8,["label","value"])),64))]),_:1},8,["modelValue","onUpdate:modelValue"]),p("div",_n,[c(k,{size:"small",type:"primary",disabled:l.is_running,onClick:B=>dt(l)},{default:h(()=>[...r[32]||(r[32]=[g("启动",-1)])]),_:1},8,["disabled","onClick"]),c(k,{size:"small",disabled:!l.is_running,onClick:B=>ft(l)},{default:h(()=>[...r[33]||(r[33]=[g("停止",-1)])]),_:1},8,["disabled","onClick"]),c(k,{size:"small",disabled:l.is_running,onClick:B=>pt(l)},{default:h(()=>[...r[34]||(r[34]=[g("截图",-1)])]),_:1},8,["disabled","onClick"]),c(k,{size:"small",disabled:l.is_running,onClick:B=>gt(l)},{default:h(()=>[...r[35]||(r[35]=[g("编辑",-1)])]),_:1},8,["disabled","onClick"]),c(k,{size:"small",type:"danger",text:"",onClick:B=>mt(l)},{default:h(()=>[...r[36]||(r[36]=[g("删除",-1)])]),_:1},8,["onClick"])])])]),_:2},1024))),128))]))],64))]),_:1}),c(pe,{modelValue:C.value,"onUpdate:modelValue":r[8]||(r[8]=l=>C.value=l),title:"添加账号",width:"min(560px, 92vw)"},{footer:h(()=>[c(k,{onClick:r[7]||(r[7]=l=>C.value=!1)},{default:h(()=>[...r[37]||(r[37]=[g("取消",-1)])]),_:1}),c(k,{type:"primary",onClick:_t},{default:h(()=>[...r[38]||(r[38]=[g("添加",-1)])]),_:1})]),default:h(()=>[c(Ie,{"label-position":"top"},{default:h(()=>[c(M,{label:"账号"},{default:h(()=>[c($,{modelValue:S.username,"onUpdate:modelValue":r[4]||(r[4]=l=>S.username=l),placeholder:"请输入账号",autocomplete:"off"},null,8,["modelValue"])]),_:1}),c(M,{label:"密码"},{default:h(()=>[c($,{modelValue:S.password,"onUpdate:modelValue":r[5]||(r[5]=l=>S.password=l),type:"password","show-password":"",placeholder:"请输入密码",autocomplete:"off"},null,8,["modelValue"])]),_:1}),c(M,{label:"备注(可选,最多200字)"},{default:h(()=>[c($,{modelValue:S.remark,"onUpdate:modelValue":r[6]||(r[6]=l=>S.remark=l),type:"textarea",rows:3,maxlength:"200","show-word-limit":"",placeholder:"例如:部门/用途"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),c(pe,{modelValue:V.value,"onUpdate:modelValue":r[13]||(r[13]=l=>V.value=l),title:"编辑账号",width:"min(560px, 92vw)"},{footer:h(()=>[c(k,{onClick:r[12]||(r[12]=l=>V.value=!1)},{default:h(()=>[...r[39]||(r[39]=[g("取消",-1)])]),_:1}),c(k,{type:"primary",onClick:wt},{default:h(()=>[...r[40]||(r[40]=[g("保存",-1)])]),_:1})]),default:h(()=>[c(Ie,{"label-position":"top"},{default:h(()=>[c(M,{label:"账号"},{default:h(()=>[c($,{modelValue:b.username,"onUpdate:modelValue":r[9]||(r[9]=l=>b.username=l),disabled:""},null,8,["modelValue"])]),_:1}),c(M,{label:"新密码(必填)"},{default:h(()=>[c($,{modelValue:b.password,"onUpdate:modelValue":r[10]||(r[10]=l=>b.password=l),type:"password","show-password":"",placeholder:"请输入新密码",autocomplete:"off"},null,8,["modelValue"])]),_:1}),c(M,{label:"备注(可选,最多200字)"},{default:h(()=>[c($,{modelValue:b.remark,"onUpdate:modelValue":r[11]||(r[11]=l=>b.remark=l),type:"textarea",rows:3,maxlength:"200","show-word-limit":"",placeholder:"例如:部门/用途"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),c(pe,{modelValue:K.value,"onUpdate:modelValue":r[15]||(r[15]=l=>K.value=l),title:"VIP 特权",width:"min(560px, 92vw)"},{footer:h(()=>[c(k,{type:"primary",onClick:r[14]||(r[14]=l=>K.value=!1)},{default:h(()=>[...r[41]||(r[41]=[g("我知道了",-1)])]),_:1})]),default:h(()=>[c(Le,{type:"info",closable:!1,title:"升级 VIP 后可解锁:无限账号、优先排队、定时任务、批量操作。","show-icon":""}),r[42]||(r[42]=p("div",{class:"vip-body"},[p("div",{class:"vip-tip app-muted"},"升级方式:请通过“反馈”联系管理员开通(与后台一致)。")],-1))]),_:1},8,["modelValue"])])}}},bn=Vt(gn,[["__scopeId","data-v-0cf21db0"]]);export{bn as default};