(()=>{var e={21(e,t,r){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==r.g&&r.g.crypto&&(n=r.g.crypto),!n)try{n=r(477)}catch(e){}var o=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),i={},s=i.lib={},c=s.Base={extend:function(e){var t=a(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=s.WordArray=c.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,o=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a>>2]>>>24-a%4*8&255;t[n+a>>>2]|=i<<24-(n+a)%4*8}else for(var s=0;s>>2]=r[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-o%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},p=l.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>24-o%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},h=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,o=n.words,a=n.sigBytes,i=this.blockSize,s=4*i,c=a/s;c=t?e.ceil(c):e.max((0|c)-this._minBufferSize,0);var l=c*i,f=e.min(4*l,a);if(l){for(var p=0;p>>6-i%4*2,u=s|c;o[a>>>2]|=u<<24-a%4*8,a++}return r.create(o,a)}o.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var o=[],a=0;a>>2]>>>24-a%4*8&255,s=t[a+1>>>2]>>>24-(a+1)%4*8&255,c=t[a+2>>>2]>>>24-(a+2)%4*8&255,u=i<<16|s<<8|c,l=0;l<4&&a+.75*l>>6*(3-l)&63));var f=n.charAt(64);if(f)for(;o.length%4;)o.push(f);return o.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;on&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),i=o.words,s=a.words,u=0;u>>7)^(h<<14|h>>>18)^h>>>3,m=u[d-2],v=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[d]=y+u[d-7]+v+u[d-16]}var b=s&l^~s&f,g=n&o^n&a^o&a,w=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),S=(s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25),k=p+S+b+c[d]+u[d],O=w+g;p=f,f=l,l=s,s=i+k|0,i=a,a=o,o=n,n=k+O|0}r[0]=r[0]+n|0,r[1]=r[1]+o|0,r[2]=r[2]+a|0,r[3]=r[3]+i|0,r[4]=r[4]+s|0,r[5]=r[5]+l|0,r[6]=r[6]+f|0,r[7]=r[7]+p|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,o=8*t.sigBytes;return r[o>>>5]|=128<<24-o%32,r[14+(o+64>>>9<<4)]=e.floor(n/4294967296),r[15+(o+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=a._createHelper(l),t.HmacSHA256=a._createHmacHelper(l)}(Math),n.SHA256)},477(){}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),(()=>{"use strict";var e="95598_log_debug",t="95598_username",n="95598_password",o="95598_recent_elc_fee",a="95598_notify_type",i="95598_service_mode",s="95598_silent_mode",c="95598_bizrt",u="95598_llm_base_url",l="95598_llm_api_key",f="95598_llm_wire_api",p="95598_llm_model",d="95598_llm_max_tokens",h="95598_llm_timeout_ms",y=["account","username","userName","loginAccount","realName","mobile","phone","address","consNo","consNoSrc","consNo_dst","acctId","userId","password","token","acctoken","access_token","refresh_token","encryptKey","sign","ticket","loginKey","Authorization"],m="网上国网",v="3.1.4",b="2026-05-06",g="https://api.120399.xyz",w="https://www.95598.cn",S="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36",k="https://www.95598.cn/osgweb/login",O="https://www.95598.cn/osgweb/login",j="",T="",_="responses",C="gpt-5.4-mini",P=256,E=3e4,N="/oauth2/outer/c02/f02",A="/oauth2/oauth/authorize",x="/oauth2/outer/getWebToken",$="/osg-web0004/open/c44/f06",I="/osg-open-bc0001/member/c04/f01",U="/osg-open-bc0001/member/c04/f02",B="/osg-open-bc0001/member/c04/f03",R="/osg-open-bc0001/member/arg/020070013",L="/osg-open-uc0001/member/c9/f02",G="/osg-open-bc0001/member/c05/f01",M="/osg-web0004/member/c24/f01",q={contentType:"application/json;charset=UTF-8",accept:"application/json;charset=UTF-8",interfaceVersion:"1.0",source:"0901",wsgwType:"web"},D="SGAPP",z="32101",F={member:"0902",devciceIp:"",devciceId:"",tenant:"state_grid"},K={optSys:"android",pushId:"000000",addressProvince:"110100",addressRegion:"110101",addressCity:"330100"},H={serviceCode:"0101183"},W={channelCode:"0902",funcCode:"WEBA1007200",serviceCode:"0101143"},Q={channelCode:"0902",clearCache:"11",funcCode:"WEBALIPAY_01",promotCode:"1",promotType:"1",serviceCode:"BCP_000026",source:"app",params4:"010103"},Y={channelCode:"0902",clearCache:"11",funcCode:"WEBALIPAY_01",promotCode:"1",promotType:"1",serviceCode:"BCP_000026",source:"app",params4:"010102"},J={channelCode:"0902",clearCache:"09",funcCode:"WEBALIPAY_01",promotType:"1",serviceCode:"BCP_000026",source:"app"},X={acctId:"acctid01",channelCode:"SGAPP",funcCode:"A10079078",promotCode:"1",promotType:"1",provinceCode:"32101",serialNo:"",srvCode:"123",userName:"acctid01",serviceCode:"0101798",source:"app"};const V=(()=>{const e=e=>e in globalThis;switch(!0){case e("$task"):return"Quantumult X";case e("$loon"):return"Loon";case e("$rocket"):return"Shadowrocket";case e("Egern"):return"Egern";case Boolean(globalThis.$environment?.["surge-version"]):return"Surge";case Boolean(globalThis.$environment?.["stash-version"]):return"Stash";case e("Cloudflare"):return"Worker";case Boolean(globalThis.process?.versions?.node):return"Node.js";default:return}})();class Z{static#e=new Map([]);static#t=[];static#r=new Map([]);static clear=()=>{};static count=(e="default")=>{switch(Z.#e.has(e)){case!0:Z.#e.set(e,Z.#e.get(e)+1);break;case!1:Z.#e.set(e,0)}Z.log(`${e}: ${Z.#e.get(e)}`)};static countReset=(e="default")=>{switch(Z.#e.has(e)){case!0:Z.#e.set(e,0),Z.log(`${e}: ${Z.#e.get(e)}`);break;case!1:Z.warn(`Counter "${e}" doesn’t exist`)}};static debug=(...e)=>{Z.#n<4||(e=e.map(e=>`🅱️ ${e}`),Z.log(...e))};static error(...e){if(!(Z.#n<1)){switch(V){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":case"Quantumult X":default:e=e.map(e=>`❌ ${e}`);break;case"Worker":case"Node.js":e=e.map(e=>`❌ ${e?.stack??e}`)}Z.log(...e)}}static exception=(...e)=>Z.error(...e);static group=e=>Z.#t.unshift(e);static groupEnd=()=>Z.#t.shift();static info(...e){Z.#n<3||(e=e.map(e=>`ℹ️ ${e}`),Z.log(...e))}static#n=3;static get logLevel(){switch(Z.#n){case 0:return"OFF";case 1:return"ERROR";case 2:return"WARN";case 3:default:return"INFO";case 4:return"DEBUG";case 5:return"ALL"}}static set logLevel(e){switch(typeof e){case"string":e=e.toLowerCase();break;case"number":break;default:e="warn"}switch(e){case 0:case"off":Z.#n=0;break;case 1:case"error":Z.#n=1;break;case 2:case"warn":case"warning":default:Z.#n=2;break;case 3:case"info":Z.#n=3;break;case 4:case"debug":Z.#n=4;break;case 5:case"all":Z.#n=5}}static log=(...e)=>{0!==Z.#n&&(e=e.flatMap(e=>{switch(typeof e){case"object":return[JSON.stringify(e)];case"bigint":case"number":case"boolean":return[e.toString()];case"string":return e.split(/\r?\n/u);default:return[e]}}),Z.#t.forEach(t=>{e=e.map(e=>` ${e}`),e.unshift(`▼ ${t}:`)}),e=["",...e],console.log(e.join("\n")))};static time=(e="default")=>Z.#r.set(e,Date.now());static timeEnd=(e="default")=>Z.#r.delete(e);static timeLog=(e="default")=>{const t=Z.#r.get(e);t?Z.log(`${e}: ${Date.now()-t}ms`):Z.warn(`Timer "${e}" doesn’t exist`)};static warn(...e){Z.#n<2||(e=e.map(e=>`⚠️ ${e}`),Z.log(...e))}}class ee{static escape(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,e=>t[e])}static get(e={},t="",r=void 0){Array.isArray(t)||(t=ee.toPath(t));const n=t.reduce((e,t)=>Object(e)[t],e);return void 0===n?r:n}static merge(e,...t){if(null==e)return e;for(const r of t)if(null!=r)for(const t of Object.keys(r)){const n=r[t],o=e[t];switch(!0){case ee.#o(n)&&ee.#o(o):e[t]=ee.merge(o,n);break;case n instanceof Map&&o instanceof Map:if(n.size>0)for(const[e,t]of n)o.set(e,t);break;case n instanceof Set&&o instanceof Set:if(n.size>0)for(const e of n)o.add(e);break;case Array.isArray(n)&&0===n.length&&void 0!==o:case n instanceof Map&&0===n.size&&void 0!==o:case n instanceof Set&&0===n.size&&void 0!==o:break;case void 0!==n:e[t]=n}}return e}static#o(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}static omit(e={},t=[]){return Array.isArray(t)||(t=[t.toString()]),t.forEach(t=>ee.unset(e,t)),e}static pick(e={},t=[]){Array.isArray(t)||(t=[t.toString()]);const r=Object.entries(e).filter(([e,r])=>t.includes(e));return Object.fromEntries(r)}static set(e,t,r){return Array.isArray(t)||(t=ee.toPath(t)),t.slice(0,-1).reduce((e,r,n)=>Object(e[r])===e[r]?e[r]:e[r]=/^\d+$/.test(t[n+1])?[]:{},e)[t[t.length-1]]=r,e}static toPath(e){return e.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean)}static unescape(e){const t={"&":"&","<":"<",">":">",""":'"',"'":"'"};return e.replace(/&|<|>|"|'/g,e=>t[e])}static unset(e={},t=""){Array.isArray(t)||(t=ee.toPath(t));const r=t.reduce((e,r,n)=>n===t.length-1?(delete e[r],!0):Object(e)[r],e);return r}}class te{static parse(e){let t={};switch(typeof e){case"string":{const r=e.replace(/^\?/,"");if(!r)break;const n=Object.fromEntries(r.split("&").filter(Boolean).map(e=>{const[t="",r=""]=e.split("=",2),n=te.#a(t).replace(/\[([^\[\]]+)\]/g,".$1");return[n,te.#a(r).replace(/\"/g,"")]}));Object.keys(n).forEach(e=>ee.set(t,e,n[e]));break}case"object":switch(e){case null:break;default:{const r={};Object.keys(e).forEach(t=>ee.set(r,t,e[t])),t=r;break}}break;case"undefined":t={}}return t}static stringify(e={}){if(!e||"object"!=typeof e)return"";const t=[];return Object.keys(e).forEach(r=>te.#i(e,r,t)),0===t.length?"":t.map(([e,t])=>`${te.#s(te.#c(e))}=${te.#s(t)}`).join("&")}static#i(e,t,r){const n=ee.get(e,t);void 0!==n&&(null!==n?Array.isArray(n)?n.forEach((n,o)=>{void 0!==n&&te.#i(e,`${t}[${o}]`,r)}):te.#o(n)?Object.keys(n).forEach(n=>te.#i(e,`${t}.${n}`,r)):r.push([t,String(n)]):r.push([t,""]))}static#c(e){const[t,...r]=ee.toPath(e);return r.reduce((e,t)=>/^\d+$/.test(t)?`${e}[${t}]`:`${e}.${t}`,t)}static#o(e){if(null===e||"object"!=typeof e||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}static#s(e){return encodeURIComponent(e)}static#a(e){return decodeURIComponent(e.replace(/\+/g," "))}}Z.debug("☑️ $argument"),globalThis.$argument=te.parse(globalThis.$argument),globalThis.$argument.LogLevel&&(Z.logLevel=globalThis.$argument.LogLevel),Z.debug("✅ $argument",`$argument: ${JSON.stringify(globalThis.$argument)}`);const re={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",304:"Not Modified",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Content Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"};function ne(e={}){switch(V){case"Surge":e.policy&&ee.set(e,"headers.X-Surge-Policy",e.policy),Z.log("🚩 执行结束!",`🕛 ${(new Date).getTime()/1e3-$script.startTime} 秒`),$done(e);break;case"Loon":e.policy&&(e.node=e.policy),Z.log("🚩 执行结束!",`🕛 ${(new Date-$script.startTime)/1e3} 秒`),$done(e);break;case"Stash":e.policy&&ee.set(e,"headers.X-Stash-Selected-Proxy",encodeURI(e.policy)),Z.log("🚩 执行结束!",`🕛 ${(new Date-$script.startTime)/1e3} 秒`),$done(e);break;case"Egern":case"Shadowrocket":Z.log("🚩 执行结束!"),$done(e);break;case"Quantumult X":switch(e.policy&&ee.set(e,"opts.policy",e.policy),e=ee.pick(e,["status","url","headers","body","bodyBytes"]),typeof e.status){case"number":e.status=`HTTP/1.1 ${e.status} ${re[e.status]}`;break;case"string":case"undefined":break;default:throw new TypeError(`${Function.name}: 参数类型错误, status 必须为数字或字符串`)}e.body instanceof ArrayBuffer?(e.bodyBytes=e.body,e.body=void 0):ArrayBuffer.isView(e.body)?(e.bodyBytes=e.body.buffer.slice(e.body.byteOffset,e.body.byteLength+e.body.byteOffset),e.body=void 0):e.body&&(e.bodyBytes=void 0),Z.log("🚩 执行结束!"),$done(e);break;case"Worker":default:Z.log("🚩 执行结束!");break;case"Node.js":Z.log("🚩 执行结束!"),process.exit(1)}}function oe(e=`ℹ️ ${V} 通知`,t="",r="",n={}){const o=ae(n);switch(V){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":default:$notification.post(e,t,r,o);break;case"Quantumult X":$notify(e,t,r,o);case"Worker":case"Node.js":}Z.group("📣 系统通知"),Z.log(e,t,r,JSON.stringify(o,null,2)),Z.groupEnd()}const ae=e=>{const t={};switch(typeof e){case void 0:break;case"string":case"number":case"boolean":switch(V){case"Surge":case"Stash":case"Egern":default:t.url=e;break;case"Loon":case"Shadowrocket":t.openUrl=e;break;case"Quantumult X":t["open-url"]=e;case"Worker":case"Node.js":}break;case"object":{const r=e.open||e["open-url"]||e.url||e.openUrl,n=e.copy||e["update-pasteboard"]||e.updatePasteboard,o=e.media||e["media-url"]||e.mediaUrl;switch(V){case"Surge":case"Stash":case"Egern":case"Shadowrocket":default:if(r&&(t.action="open-url",t.url=r),n&&(t.action="clipboard",t.text=n),o)switch(!0){case o.startsWith("http"):t["media-url"]=o;break;case o.startsWith("data:"):{const r=/^data:(?\w+\/\w+);base64,(?.+)/,{MIME:n,Base64:a}=o.match(r).groups;t["media-base64"]=a,t["media-base64-mime"]=e.mime||n;break}default:switch(t["media-base64"]=o,!0){case o.startsWith("CiVQREYt"):case o.startsWith("JVBERi0"):t["media-base64-mime"]="application/pdf";break;case o.startsWith("R0lGODdh"):case o.startsWith("R0lGODlh"):t["media-base64-mime"]="image/gif";break;case o.startsWith("iVBORw0KGgo"):t["media-base64-mime"]="image/png";break;case o.startsWith("/9j/"):t["media-base64-mime"]="image/jpg";break;case o.startsWith("Qk02U"):t["media-base64-mime"]="image/bmp"}}e["auto-dismiss"]&&(t["auto-dismiss"]=e["auto-dismiss"]),e.sound&&(t.sound=e.sound);break;case"Loon":r&&(t.openUrl=r),o?.startsWith("http")&&(t.mediaUrl=o);break;case"Quantumult X":r&&(t["open-url"]=r),o?.startsWith("http")&&(t["media-url"]=o),n&&(t["update-pasteboard"]=n);case"Worker":case"Node.js":}break}default:Z.error("不支持的通知参数类型: "+typeof e,"")}return t};function ie(e,t){const r=t?new Date(t):new Date,n={YY:r.getFullYear().toString().substring(3),yyyy:r.getFullYear().toString(),MM:(r.getMonth()+1).toString().padStart(2,"0"),dd:r.getDate().toString().padStart(2,"0"),HH:r.getHours().toString().padStart(2,"0"),mm:r.getMinutes().toString().padStart(2,"0"),sss:r.getMilliseconds().toString().padStart(3,"0"),ss:r.getSeconds().toString().padStart(2,"0"),S:`${Math.floor(r.getMonth()/3)+1}`};for(const[t,r]of Object.entries(n))e=e.replace(t,r);return e}function se(e=1e3){return new Promise(t=>setTimeout(t,e))}async function ce(e,t={}){switch(typeof e){case"object":e={...t,...e};break;case"string":e={...t,url:e};break;default:throw new TypeError(`${Function.name}: 参数类型错误, resource 必须为对象或字符串`)}e.method||(e.method="GET",(e.body??e.bodyBytes)&&(e.method="POST")),delete e.headers?.Host,delete e.headers?.[":authority"],delete e.headers?.["Content-Length"],delete e.headers?.["content-length"];const r=e.method.toLocaleLowerCase();if(e.timeout||(e.timeout=5),e.timeout&&(e.timeout=Number.parseInt(e.timeout,10),e.timeout>500&&(e.timeout=Math.round(e.timeout/1e3))),e.timeout)switch(V){case"Loon":case"Quantumult X":case"Worker":case"Node.js":e.timeout=1e3*e.timeout}switch(V){case"Loon":case"Surge":case"Stash":case"Egern":case"Shadowrocket":if(e.policy)switch(V){case"Loon":e.node=e.policy;break;case"Stash":ee.set(e,"headers.X-Stash-Selected-Proxy",encodeURI(e.policy));break;case"Shadowrocket":ee.set(e,"headers.X-Surge-Proxy",e.policy)}switch("boolean"==typeof e.redirection&&(e["auto-redirect"]=e.redirection),e.bodyBytes&&!e.body&&(e.body=e.bodyBytes,e.bodyBytes=void 0),(e.headers?.Accept||e.headers?.accept)?.split(";")?.[0]){case"application/protobuf":case"application/x-protobuf":case"application/vnd.google.protobuf":case"application/vnd.apple.flatbuffer":case"application/grpc":case"application/grpc-web":case"application/grpc+proto":case"application/octet-stream":e["binary-mode"]=!0}return new Promise((t,n)=>{globalThis.$httpClient[r](e,(r,o,a)=>{r?n(r):(o.ok=/^2\d\d$/.test(o.status),o.statusCode=o.status,o.statusText=re[o.status],a&&(o.body=a,1==e["binary-mode"]&&(o.bodyBytes=a)),t(o))})});case"Quantumult X":return e.policy&&ee.set(e,"opts.policy",e.policy),"boolean"==typeof e["auto-redirect"]&&ee.set(e,"opts.redirection",e["auto-redirect"]),e.body instanceof ArrayBuffer?(e.bodyBytes=e.body,e.body=void 0):ArrayBuffer.isView(e.body)?(e.bodyBytes=e.body.buffer.slice(e.body.byteOffset,e.body.byteLength+e.body.byteOffset),e.body=void 0):e.body&&(e.bodyBytes=void 0),Promise.race([globalThis.$task.fetch(e).then(e=>{switch(e.ok=/^2\d\d$/.test(e.statusCode),e.status=e.statusCode,e.statusText=re[e.status],(e.headers?.["Content-Type"]??e.headers?.["content-type"])?.split(";")?.[0]){case"application/protobuf":case"application/x-protobuf":case"application/vnd.google.protobuf":case"application/vnd.apple.flatbuffer":case"application/grpc":case"application/grpc-web":case"application/grpc+proto":case"application/octet-stream":e.body=e.bodyBytes}return e.bodyBytes=void 0,e},e=>Promise.reject(e.error)),new Promise((t,r)=>{setTimeout(()=>{r(new Error(`${Function.name}: 请求超时, 请检查网络后重试`))},e.timeout)})]);case"Worker":case"Node.js":{switch(globalThis.fetch||(globalThis.fetch=require("node-fetch")),e["auto-cookie"]){case void 0:case"true":case!0:case"1":case 1:default:globalThis.fetch?.cookieJar||(globalThis.fetch=require("fetch-cookie").default(globalThis.fetch));case"false":case!1:case"0":case 0:case"-1":case-1:}e.redirect=e.redirection?"follow":"manual";const{url:t,...r}=e;return Promise.race([globalThis.fetch(t,r).then(async e=>{const t=await e.arrayBuffer();let r;try{r=e.headers.raw()}catch{r=Array.from(e.headers.entries()).reduce((e,[t,r])=>(e[t]=e[t]?[...e[t],r]:[r],e),{})}return{ok:e.ok??/^2\d\d$/.test(e.status),status:e.status,statusCode:e.status,statusText:e.statusText,body:new TextDecoder("utf-8").decode(t),bodyBytes:t,headers:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,"set-cookie"!==e.toLowerCase()?t.toString():t]))}}).catch(e=>Promise.reject(e.message)),new Promise((t,r)=>{setTimeout(()=>{r(new Error(`${Function.name}: 请求超时, 请检查网络后重试`))},e.timeout)})])}default:throw new Error(`${Function.name}: 当前平台不支持`)}}class ue{static data=null;static dataFile="box.dat";static#u=/^@(?[^.]+)(?:\.(?.*))?$/;static getItem(e,t=null){let r=t;switch(e.startsWith("@")){case!0:{const{key:t,path:n}=e.match(ue.#u)?.groups;e=t;let o=ue.getItem(e,{});"object"!=typeof o&&(o={}),r=ee.get(o,n);try{r=JSON.parse(r)}catch{}break}default:switch(V){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":r=$persistentStore.read(e);break;case"Quantumult X":r=$prefs.valueForKey(e);break;case"Worker":ue.data=ue.data??{},r=ue.data[e];break;case"Node.js":ue.data=ue.#l(ue.dataFile),r=ue.data?.[e];break;default:r=ue.data?.[e]||null}try{r=JSON.parse(r)}catch{}}return r??t}static setItem(e=new String,t=new String){let r=!1;if("object"==typeof t)t=JSON.stringify(t);else t=String(t);switch(e.startsWith("@")){case!0:{const{key:n,path:o}=e.match(ue.#u)?.groups;e=n;let a=ue.getItem(e,{});"object"!=typeof a&&(a={}),ee.set(a,o,t),r=ue.setItem(e,a);break}default:switch(V){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":r=$persistentStore.write(t,e);break;case"Quantumult X":r=$prefs.setValueForKey(t,e);break;case"Worker":ue.data=ue.data??{},ue.data[e]=t,r=!0;break;case"Node.js":ue.data=ue.#l(ue.dataFile),ue.data[e]=t,ue.#f(ue.dataFile),r=!0;break;default:r=ue.data?.[e]||null}}return r}static removeItem(e){let t=!1;switch(e.startsWith("@")){case!0:{const{key:r,path:n}=e.match(ue.#u)?.groups;e=r;let o=ue.getItem(e);"object"!=typeof o&&(o={}),ee.unset(o,n),t=ue.setItem(e,o);break}default:switch(V){case"Surge":t=$persistentStore.write(null,e);break;case"Loon":case"Stash":case"Egern":case"Shadowrocket":default:t=!1;break;case"Quantumult X":t=$prefs.removeValueForKey(e);break;case"Worker":ue.data=ue.data??{},delete ue.data[e],t=!0;break;case"Node.js":ue.data=ue.#l(ue.dataFile),delete ue.data[e],ue.#f(ue.dataFile),t=!0}}return t}static clear(){let e=!1;switch(V){case"Surge":case"Loon":case"Stash":case"Egern":case"Shadowrocket":default:e=!1;break;case"Quantumult X":e=$prefs.removeAllValues();break;case"Worker":ue.data={},e=!0;break;case"Node.js":ue.data=ue.#l(ue.dataFile),ue.data={},ue.#f(ue.dataFile),e=!0}return e}static#l=e=>{if("Node.js"!==V)return{};{this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(e),r=this.path.resolve(process.cwd(),e),n=this.fs.existsSync(t),o=!n&&this.fs.existsSync(r);if(!n&&!o)return{};{const e=n?t:r;try{return JSON.parse(this.fs.readFileSync(e))}catch(e){return{}}}}};static#f=(e=this.dataFile)=>{if("Node.js"===V){this.fs=this.fs?this.fs:require("fs"),this.path=this.path?this.path:require("path");const t=this.path.resolve(e),r=this.path.resolve(process.cwd(),e),n=this.fs.existsSync(t),o=!n&&this.fs.existsSync(r),a=JSON.stringify(this.data);n?this.fs.writeFileSync(t,a):o?this.fs.writeFileSync(r,a):this.fs.writeFileSync(t,a)}}}const le=globalThis.$argument??{};class fe{constructor(e){switch(typeof e){case"string":{if(0===e.length)break;e.startsWith("?")&&(e=e.slice(1));const t=e.split("&").map(e=>e.split("="));t.forEach(([e,t])=>{this.#p.push(e?decodeURIComponent(e):e),this.#d.push(t?decodeURIComponent(t):t)});break}case"object":if(Array.isArray(e))Object.entries(e).forEach(([e,t])=>{this.#p.push(e),this.#d.push(t)});else if(Symbol.iterator in Object(e))for(const[t,r]of e)this.#p.push(t),this.#d.push(r)}this.#h(this.#p,this.#d)}#y="";#p=[];#d=[];#m(e){return encodeURIComponent(e).replace(/%2C/g,",").replace(/%21/g,"!").replace(/%27/g,"'").replace(/%28/g,"(").replace(/%29/g,")").replace(/%2A/g,"*")}#h(e,t){0===e.length?this.#y="":this.#y=e.map((e,r)=>{switch(typeof t[r]){case"object":return`${this.#m(e)}=${this.#m(JSON.stringify(t[r]))}`;case"boolean":case"number":case"string":return`${this.#m(e)}=${this.#m(t[r])}`;default:return this.#m(e)}}).join("&")}append(e,t){this.#p.push(e),this.#d.push(t),this.#h(this.#p,this.#d)}delete(e,t){for(;this.#p.indexOf(e)>-1;)this.#d.splice(this.#p.indexOf(e),1),this.#p.splice(this.#p.indexOf(e),1);this.#h(this.#p,this.#d)}entries(){return this.#p.map((e,t)=>[e,this.#d[t]])}get(e){return this.#d[this.#p.indexOf(e)]}getAll(e){return this.#d.filter((t,r)=>this.#p[r]===e)}has(e,t){return this.#p.indexOf(e)>-1}keys(){return this.#p}set(e,t){if(-1===this.#p.indexOf(e))this.append(e,t);else{let r=!0;const n=[];this.#p=this.#p.filter((o,a)=>o!==e?(n.push(this.#d[a]),!0):!!r&&(r=!1,n.push(t),!0)),this.#d=n,this.#h(this.#p,this.#d)}}sort(){const e=this.entries().sort();this.#p=[],this.#d=[],e.forEach(e=>{this.#p.push(e[0]),this.#d.push(e[1])}),this.#h(this.#p,this.#d)}toString=()=>this.#y;values=()=>this.#d.values()}class pe{constructor(e,t){switch(typeof e){case"string":{const r=/^(blob:|file:)?[a-zA-z]+:\/\/.*/.test(e),n=!!t&&/^(blob:|file:)?[a-zA-z]+:\/\/.*/.test(t);if(r)this.href=e;else{if(!n)throw new TypeError('URL string is not valid. If using a relative url, a second argument needs to be passed representing the base URL. Example: new URL("relative/path", "http://www.example.com");');this.href=t+e}break}case"object":break;default:throw new TypeError("Invalid argument type.")}}#v={hash:"",host:"",hostname:"",href:"",password:"",pathname:"",port:Number.NaN,protocol:"",search:"",searchParams:new fe(""),username:""};static#b=/^(?([^:\/?#]+):)?(?:\/\/(?[^\/?#]*))?(?[^?#]*)(?\?([^#]*))?(?#(.*))?$/;static#g=/^(?(?[^:]*)(:(?[^@]*))?@)?(?[^:]+)(:(?\d+))?$/;get hash(){return this.#v.hash}set hash(e){0!==e.length&&(e.startsWith("#")&&(e=e.slice(1)),this.#v.hash=`#${encodeURIComponent(e)}`)}get host(){return this.port.length>0?`${this.hostname}:${this.port}`:this.hostname}set host(e){[this.hostname,this.port]=e.split(":",2)}get hostname(){return encodeURIComponent(this.#v.hostname)}set hostname(e){this.#v.hostname=e??""}get href(){let e="";return this.username.length>0&&(e+=this.username,this.password.length>0&&(e+=`:${this.password}`),e+="@"),`${this.protocol}//${e}${this.host}${this.pathname}${this.search}${this.hash}`}set href(e){(e.startsWith("blob:")||e.startsWith("file:"))&&(e=e.slice(5));const t=e.match(pe.#b);if(!t)throw new TypeError("Invalid URL format.");this.protocol=t.groups.scheme??"";const r=t.groups.authority.match(pe.#g);this.username=r.groups.username??"",this.password=r.groups.password??"",this.hostname=r.groups.hostname??"",this.port=r.groups.port??"",this.pathname=t.groups.path??"",this.search=t.groups.query??"",this.hash=t.groups.hash??""}get origin(){return`${this.protocol}//${this.host}`}get password(){return encodeURIComponent(this.#v.password)}set password(e){this.username.length>0&&(this.#v.password=e??"")}get pathname(){return`/${this.#v.pathname}`}set pathname(e){e=`${e}`,e.startsWith("/")&&(e=e.slice(1)),this.#v.pathname=e}get port(){if(Number.isNaN(this.#v.port))return"";const e=this.#v.port.toString();return"ftp:"===this.protocol&&"21"===e||"http:"===this.protocol&&"80"===e||"https:"===this.protocol&&"443"===e?"":e}set port(e){if(""===e)this.#v.port=Number.NaN;else{const t=Number.parseInt(e,10);t>=0&&t<65535&&(this.#v.port=t)}}get protocol(){return`${this.#v.protocol}:`}set protocol(e){e.endsWith(":")&&(e=e.slice(0,-1)),this.#v.protocol=e}get search(){return this.#v.search=this.searchParams.toString(),this.#v.search.length>0?`?${this.#v.search}`:""}set search(e){e=`${e}`,e.startsWith("?")&&(e=e.slice(1)),this.#v.search=e,this.#v.searchParams=new fe(this.#v.search)}get searchParams(){return this.#v.searchParams}get username(){return encodeURIComponent(this.#v.username)}set username(e){this.#v.username=e??""}static parse=(e,t)=>new pe(e,t);toString=()=>this.href;toJSON=()=>JSON.stringify({hash:this.hash,host:this.host,hostname:this.hostname,href:this.href,origin:this.origin,password:this.password,pathname:this.pathname,port:this.port,protocol:this.protocol,search:this.search,searchParams:this.searchParams,username:this.username})}function de(e){return de="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},de(e)}function he(e){if("string"!=typeof e)return e;try{return JSON.parse(e)}catch(t){return e}}function ye(e){if("string"==typeof e)return e;try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:"--";return null==e||""===e?t:String(e)}function be(e){return Array.isArray(e)?e:[]}function ge(e){return"".concat((null==e?void 0:e.message)||(null==e?void 0:e.error)||e||"Unknown error")}function we(){return globalThis}function Se(e){var t=new Date;t.setDate(t.getDate()-Number(e||0));var r=t.getFullYear(),n="".concat(t.getMonth()+1).padStart(2,"0"),o="".concat(t.getDate()).padStart(2,"0");return"".concat(r,"-").concat(n,"-").concat(o)}function ke(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Boolean(t)&&"".concat(e.url||"").includes(t)}function Oe(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=Number(null==e?void 0:e.code),n=ge((null==e?void 0:e.message)||e);return new Set([10010,30010,10015,10108,10009,10207,10005,20103]).has(r)||10004===r&&"请求异常【GC117】"===n||"请求异常【010011】"===n||10002===r&&"WEB渠道KeyCode已失效"===n||t&&10002===r&&"Token 为空!"===n}function je(e){return!(!e||"object"!==de(e)||!Oe(e,!0))||/(无效|失效|过期|重新获取|请求异常|Token 为空|WEB渠道KeyCode已失效)/.test(ge(e))}function Te(e){return function(e){if(Array.isArray(e))return _e(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return _e(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_e(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(Ce()){var o=[t].concat(Te(n)).flat().filter(Boolean);return o.map(xe).find(function(e){return void 0!==e&&""!==e})}var a=r.map(function(e){return null==le?void 0:le[e]}).find(function(e){return void 0!==e});return void 0!==a?a:$e(e)}function Ue(){return{debugEnabled:me(Ie(e,"SGCC_DEBUG",["debug"])),silentMode:me(Ie(s,"SGCC_SILENT",["silent"])),serviceMode:me(Ie(i,"SGCC_SERVICE",["service"]))||Ee(),username:ve(Ie(t,"SGCC_USERNAME",["username"]),""),password:ve(Ie(n,"SGCC_PASSWORD",["password"]),""),showRecentUsage:me(Ie(o,"SGCC_SHOW_RECENT_USAGE",["show_recent_usage"])),notifyAllAccounts:me(Ie(a,"SGCC_NOTIFY_ALL_ACCOUNTS",["notify_all_accounts"])),cachedBizrt:$e(c),serviceRequestParams:Ae(),llm:(r=ve(Ie(u,"SGCC_LLM_BASE_URL",["llm_base_url"]),j),y=ve(Ie(l,"SGCC_LLM_API_KEY",["llm_api_key"]),T),m=ve(Ie(f,"SGCC_LLM_WIRE_API",["llm_wire_api"]),_),v=ve(Ie(p,"SGCC_LLM_MODEL",["llm_model"]),C),b=Ie(d,"SGCC_LLM_MAX_TOKENS",["llm_max_tokens"]),g=Ie(h,"SGCC_LLM_TIMEOUT_MS",["llm_timeout_ms"]),{baseUrl:r,apiKey:y,wireApi:"chat_completions"===m?"chat_completions":"responses",model:v,maxTokens:Number(b)>0?Number(b):P,timeoutMs:Number(g)>0?Number(g):E})};var r,y,m,v,b,g}function Be(e){ue.setItem(c,e)}function Re(e){var t,r=new Date;return function(e){var t=["1. 本脚本仅供学习、研究与个人自动化测试使用,请勿用于任何商业、批量或违法用途。","2. 本项目为非官方实现,与网上国网或相关运营主体不存在任何隶属、授权或担保关系。","3. 脚本依赖第三方接口、加密网关与目标站点返回结构,随时可能因接口调整、风控策略或网络波动而失效。","4. 开发者不对脚本可用性、稳定性、时效性、准确性及由此带来的任何直接或间接损失承担责任。","5. 请自行评估账号安全与使用风险,敏感凭据请仅在受信任环境中配置,并妥善保管。","6. 若相关平台规则、接口协议或法律法规发生变化,请立即停止使用并以官方渠道信息为准。","","当前时间: ".concat(ie("yyyy-MM-dd HH:mm:ss",e.getTime())),"当前版本: ".concat(v),"最后更新: ".concat(b)];Z.log.apply(Z,["免责声明"].concat(t))}(r),t=e.debugEnabled,Z.logLevel=t?"debug":"info",function(e){Z.debug("调试模式: ".concat(e.debugEnabled?"开启":"关闭")),Z.debug("服务模式: ".concat(e.serviceMode?"开启":"关闭")),Z.debug("登录账号: ".concat(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"****",o="".concat(e||"");return o?o.length<=t+r?o:"".concat(o.slice(0,t)).concat(n).concat(o.slice(-r)):""}(e.username)||"未配置")),Z.debug("显示近日电量: ".concat(e.showRecentUsage?"是":"否")),Z.debug("通知全部户号: ".concat(e.notifyAllAccounts?"是":"否")),Z.debug("已有缓存登录态: ".concat(e.cachedBizrt?"是":"否"))}(e),{settings:e,startTime:r}}var Le=r(793),Ge=r(754);const Me=15e3,qe=/^[a-zA-Z0-9]{24}$/;function De(e){const t=function(){if(!Ce())return null;if("function"==typeof globalThis.require)return globalThis.require;try{return Function('return typeof require !== "undefined" ? require : null')()}catch{return null}}();if(!t)throw new Error(`当前环境无法加载 Node 模块: ${e}`);return t(e)}function ze(e=[]){if(!Ce()||"undefined"==typeof process)return"";for(const t of e){const e=process.env?.[t];if(null!=e&&""!==`${e}`.trim())return`${e}`.trim()}return""}function Fe(e,t,r){const n=`${e||""}`.trim(),o=[t,r].filter(Boolean).join("\n").trim();return{title:n,body:o,fullText:[n,o].filter(Boolean).join("\n\n")}}function Ke(e){const t=`${e||""}`.trim();return t?/^https?:\/\//i.test(t)?t:`https://api.day.app/${t}`:""}function He(e){return`${e||""}`.replace(/\/+$/g,"")}function We(e){return`${e||""}`.replace(/[\n\r]/g,"
")}function Qe(e={}){const t=new URLSearchParams;for(const[r,n]of Object.entries(e))null!=n&&""!==n&&t.append(r,`${n}`);return t.toString()}async function Ye(e,t){const r=await ce({url:e,method:"post",headers:{"content-type":"application/json; charset=utf-8"},body:JSON.stringify(t),timeout:Me}),n=(()=>{try{return JSON.parse(r.body||"{}")}catch{return{}}})();return{response:r,data:n}}async function Je(e,t){const r=await ce({url:e,method:"post",headers:{"content-type":"application/x-www-form-urlencoded"},body:Qe(t),timeout:Me}),n=(()=>{try{return JSON.parse(r.body||"{}")}catch{return{}}})();return{response:r,data:n}}function Xe(){return{pushUrl:Ke(ze(["BARK_PUSH"])),sound:ze(["BARK_SOUND"]),group:ze(["BARK_GROUP"]),icon:ze(["BARK_ICON"])}}function Ve(){return{botToken:ze(["TG_BOT_TOKEN"]),userId:ze(["TG_USER_ID"]),apiHost:ze(["TG_API_HOST"])||"api.telegram.org",proxyHost:ze(["TG_PROXY_HOST"]),proxyPort:ze(["TG_PROXY_PORT"]),proxyAuth:ze(["TG_PROXY_AUTH"])}}function Ze(){return{pushKey:ze(["PUSH_KEY"])}}function et(){return{token:ze(["DD_BOT_TOKEN"]),secret:ze(["DD_BOT_SECRET"])}}function tt(){return{key:ze(["QYWX_KEY"])}}function rt(){const e=ze(["QYWX_AM"]);return{raw:e,parts:e?e.split(","):[]}}function nt(){return{pushKey:ze(["IGOT_PUSH_KEY"])}}function ot(){return{token:ze(["PUSH_PLUS_TOKEN"]),user:ze(["PUSH_PLUS_USER"])}}function at(){return{appToken:ze(["WP_APP_TOKEN"]),topicIds:ze(["WP_TOPICIDS"]),uids:ze(["WP_UIDS"]),url:ze(["WP_URL"])}}function it(){return{url:He(ze(["GOTIFY_URL"])),token:ze(["GOTIFY_TOKEN"]),priority:ze(["GOTIFY_PRIORITY"])||"0"}}function st(){return{url:He(ze(["GOBOT_URL"])),token:ze(["GOBOT_TOKEN"]),target:ze(["GOBOT_QQ"])}}function ct(){return{host:He(ze(["BncrHost"])),token:ze(["BncrToken"])}}function ut(){return!!Ce()&&Boolean(Xe().pushUrl||Ve().botToken&&Ve().userId||Ze().pushKey||et().token||tt().key||rt().raw||nt().pushKey||ot().token||at().appToken||it().url&&it().token||st().url||ct().host&&ct().token)}function lt(e){const{Buffer:t}=De("buffer");return t.byteLength(`${e||""}`)}function ft(e){return`${e||""}`.split(";").map(e=>e.trim()).filter(Boolean)}const pt=[{name:"Bark",handler:async function(e,t,r){const n=Xe();if(!n.pushUrl)return!1;const o=Fe(e,t,r),a={title:o.title,body:o.body,group:n.group||"95598"};n.sound&&(a.sound=n.sound),n.icon&&(a.icon=n.icon);const{response:i,data:s}=await Ye(n.pushUrl,a);if(!i.ok||200!==Number(s.code))throw new Error(s.message||"Bark 通知发送失败");return!0}},{name:"Telegram",handler:async function(e,t,r){const n=Ve();if(!n.botToken||!n.userId)return!1;const o=Fe(e,t,r),a=`https://${n.apiHost}/bot${n.botToken}/sendMessage`,i=JSON.stringify({chat_id:n.userId,text:o.fullText,disable_web_page_preview:!0}),s=await async function(e){if(!e.proxyHost||!e.proxyPort)return null;const t=De("tunnel"),r=t.default||t,n=e.proxyHost.replace(/^https?:\/\//i,"");return r.httpsOverHttp({proxy:{host:n,port:Number(e.proxyPort),proxyAuth:e.proxyAuth||void 0}})}(n),c=s?await async function(e,t,r){const n=De("https"),{URL:o}=De("url"),a=new o(e);return new Promise((e,o)=>{const i=n.request({protocol:a.protocol,hostname:a.hostname,port:a.port||443,path:`${a.pathname}${a.search}`,method:"POST",headers:{"content-type":"application/json","content-length":lt(t)},agent:r,timeout:Me},t=>{let r="";t.setEncoding("utf8"),t.on("data",e=>{r+=e}),t.on("end",()=>{let n={};try{n=JSON.parse(r||"{}")}catch{n={}}e({ok:Number(t.statusCode||0)>=200&&Number(t.statusCode||0)<300,data:n})})});i.on("timeout",()=>{i.destroy(new Error("Telegram 代理请求超时"))}),i.on("error",o),i.write(t),i.end()})}(a,i,s):await async function(e,t){const r=await ce({url:e,method:"post",headers:{"content-type":"application/json"},body:t,timeout:Me});return{ok:r.ok,data:(()=>{try{return JSON.parse(r.body||"{}")}catch{return{}}})()}}(a,i);if(!c.ok||!0!==c.data?.ok){if(400===c.data?.error_code)throw new Error("Telegram 通知发送失败,请确认 bot 已与目标用户建立会话且用户 ID 正确");if(401===c.data?.error_code)throw new Error("Telegram 通知发送失败,bot token 无效");throw new Error(c.data?.description||"Telegram 通知发送失败")}return!0}},{name:"ServerChan",handler:async function(e,t,r){const n=Ze();if(!n.pushKey)return!1;const o=Fe(e,t,r),a=o.body.replace(/[\n\r]/g,"\n\n"),i=n.pushKey.includes("SCT")?`https://sctapi.ftqq.com/${n.pushKey}.send`:`https://sc.ftqq.com/${n.pushKey}.send`,{response:s,data:c}=await Je(i,{text:o.title,desp:a}),u=s.ok&&(0===Number(c.errno)||0===Number(c?.data?.errno));if(!u)throw new Error(c.errmsg||c?.data?.errmsg||"server 酱通知发送失败");return!0}},{name:"DingTalk",handler:async function(e,t,r){const n=et();if(!n.token)return!1;const o=Fe(e,t,r);let a=`https://oapi.dingtalk.com/robot/send?access_token=${n.token}`;if(n.secret){const e=Date.now(),t=`${e}\n${n.secret}`,r=Ge.stringify(Le(t,n.secret));a+=`×tamp=${e}&sign=${encodeURIComponent(r)}`}const{response:i,data:s}=await Ye(a,{msgtype:"text",text:{content:` ${o.fullText}`}});if(!i.ok||0!==Number(s.errcode))throw new Error(s.errmsg||"钉钉通知发送失败");return!0}},{name:"QywxBot",handler:async function(e,t,r){const n=tt();if(!n.key)return!1;const o=Fe(e,t,r),{response:a,data:i}=await Ye(`https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=${n.key}`,{msgtype:"text",text:{content:` ${o.fullText}`}});if(!a.ok||0!==Number(i.errcode))throw new Error(i.errmsg||"企业微信机器人通知发送失败");return!0}},{name:"QywxApp",handler:async function(e,t,r){const n=rt();if(!n.raw||n.parts.length<4)return!1;const[o,a,i,s]=n.parts,c=Fe(e,t,r),u=await Ye("https://qyapi.weixin.qq.com/cgi-bin/gettoken",{corpid:o,corpsecret:a}),l=u.data?.access_token;if(!u.response.ok||!l)throw new Error(u.data?.errmsg||"企业微信应用 access_token 获取失败");const f=function(e,t){const r=function(e){return e[4]||"1"}(e);switch(r){case"0":return{msgtype:"textcard",textcard:{title:t.title,description:t.body,url:"https://github.com/Yuheng0101/X",btntxt:"更多"}};case"1":return{msgtype:"text",text:{content:t.fullText}};default:return{msgtype:"mpnews",mpnews:{articles:[{title:t.title,thumb_media_id:r,author:"网上国网脚本",content_source_url:"",content:`${We(t.body)}`,digest:t.body}]}}}}(n.parts,c),p=await Ye(`https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=${l}`,{touser:i||"@all",agentid:s,safe:"0",...f});if(!p.response.ok||0!==Number(p.data.errcode))throw new Error(p.data.errmsg||"企业微信应用消息发送失败");return!0}},{name:"IGot",handler:async function(e,t,r){const n=nt();if(!n.pushKey)return!1;if(!qe.test(n.pushKey))throw new Error("IGOT_PUSH_KEY 格式无效");const o=Fe(e,t,r),{response:a,data:i}=await Je(`https://push.hellyw.com/${n.pushKey.toLowerCase()}`,{title:o.title,content:o.body});if(!a.ok||0!==Number(i.ret))throw new Error(i.errMsg||"iGot 通知发送失败");return!0}},{name:"PushPlus",handler:async function(e,t,r){const n=ot();if(!n.token)return!1;const o=Fe(e,t,r),{response:a,data:i}=await Ye("https://www.pushplus.plus/send",{token:n.token,title:o.title,content:We(o.body),topic:n.user});if(!a.ok||200!==Number(i.code))throw new Error(i.msg||"PushPlus 通知发送失败");return!0}},{name:"WxPusher",handler:async function(e,t,r){const n=at();if(!n.appToken)return!1;const o=Fe(e,t,r),a=`${o.title}\n\n${We(o.body)}`,{response:i,data:s}=await Ye("http://wxpusher.zjiecode.com/api/send/message",{appToken:n.appToken,content:`${o.title}\n\n${a}`,summary:o.title,contentType:2,topicIds:ft(n.topicIds),uids:ft(n.uids),url:n.url});if(!i.ok||1e3!==Number(s.code))throw new Error(s.msg||"WxPusher 通知发送失败");return!0}},{name:"Gotify",handler:async function(e,t,r){const n=it();if(!n.url||!n.token)return!1;const o=Fe(e,t,r),{response:a,data:i}=await Je(`${n.url}/message?token=${n.token}`,{title:o.title,message:o.body,priority:n.priority});if(!a.ok||!i.id)throw new Error(i.message||"gotify 通知发送失败");return!0}},{name:"GoCqhttp",handler:async function(e,t,r){const n=st();if(!n.url)return!1;const o=Fe(e,t,r),a=`${n.url}?access_token=${n.token||""}&${n.target||""}`,{response:i,data:s}=await Ye(a,{message:`${o.title}\n${o.body}`});if(!i.ok||0!==Number(s.retcode))throw new Error(s.errmsg||"go-cqhttp 通知发送失败");return!0}},{name:"Bncr",handler:async function(e,t,r){const n=ct();if(!n.host||!n.token)return!1;const o=Fe(e,t,r),{response:a,data:i}=await Je(`${n.host}/api/qinglongMessage`,{title:o.title,message:o.body,token:n.token});if(!a.ok||200!==Number(i.code))throw new Error(i.msg||"Bncr 通知发送失败");return!0}}];async function dt(e,t,r){if(!ut())return!1;const n=await Promise.allSettled(pt.map(async n=>{try{const o=await n.handler(e,t,r);return o&&Z.debug(`${n.name} 通知发送成功`),o}catch(e){return Z.warn(`${n.name} 通知失败: ${ge(e)}`),!1}}));return n.some(e=>"fulfilled"===e.status&&!0===e.value)}function ht(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return yt(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?yt(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r3?(o=h===n)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((o=r<2&&dn||n>h)&&(a[4]=r,a[5]=n,p.n=h,s=0))}if(o||r>1)return i;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==i)break}catch(t){a=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,o,a),!0),u}var i={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(vt(t={},n,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,vt(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,vt(f,"constructor",u),vt(u,"constructor",c),c.displayName="GeneratorFunction",vt(u,o,"GeneratorFunction"),vt(f),vt(f,o,"Generator"),vt(f,n,function(){return this}),vt(f,"toString",function(){return"[object Generator]"}),(mt=function(){return{w:a,m:p}})()}function vt(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}vt=function(e,t,r,n){function a(t,r){vt(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},vt(e,t,r,n)}function bt(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function gt(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){bt(a,n,o,i,s,"next",e)}function s(e){bt(a,n,o,i,s,"throw",e)}i(void 0)})}}function wt(e,t,r,n){return St.apply(this,arguments)}function St(){return St=gt(mt().m(function e(t,r,n,o){var a,i,s,c,u=arguments;return mt().w(function(e){for(;;)switch(e.n){case 0:if(a=u.length>4&&void 0!==u[4]?u[4]:{},!t.silentMode||/\u274c/.test("".concat(n||""))){e.n=1;break}return i=["============== 静默通知 ==============",r],n&&i.push(n),o&&i.push(o),Z.log.apply(Z,i),e.a(2);case 1:if(!Ce()||!ut()){e.n=4;break}return e.n=2,dt(r,n,o);case 2:if(s=e.v,!s){e.n=3;break}return e.a(2);case 3:Z.warn("已检测到外部通知配置,但本次发送未成功,已回退到默认系统通知输出");case 4:c=a&&Object.keys(a).length>0?a:void 0,oe(r,n,o,c);case 5:return e.a(2)}},e)})),St.apply(this,arguments)}function kt(e){return Ot.apply(this,arguments)}function Ot(){return Ot=gt(mt().m(function e(t){var r,n,o,a,i,s,c,u,l,f;return mt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=t.result,n=t.settings,!n.serviceMode){e.n=1;break}return a=ye(null!==(o=r.data)&&void 0!==o?o:r.body,null,2),i={status:Pe()?"HTTP/1.1 200":200,headers:{"content-type":"application/json;charset=utf8"},body:a},e.a(2,ne(Pe()?i:{response:i}));case 1:if(!(Array.isArray(r.notifyList)&&r.notifyList.length>0)){e.n=9;break}s=ht(r.notifyList),e.p=2,s.s();case 3:if((c=s.n()).done){e.n=5;break}return u=c.value,e.n=4,wt(n,r.title,"",u);case 4:e.n=3;break;case 5:e.n=7;break;case 6:e.p=6,f=e.v,s.e(f);case 7:return e.p=7,s.f(),e.f(7);case 8:return e.a(2,ne());case 9:return l=Array.isArray(r.body)?r.body.join("\n"):r.body,e.n=10,wt(n,r.title,r.subt,l);case 10:ne();case 11:return e.a(2)}},e,null,[[2,6,7,8]])})),Ot.apply(this,arguments)}function jt(e){return jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jt(e)}function Tt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function _t(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=be(e.powerUserList);if(t||r.length<=1)return r;var n=r.filter(function(e){return"1"===e.isDefault});return n.length>1&&(n=n.filter(function(e){return"01"===e.elecTypeCode})),n.length?n:r.slice(0,1)}function Et(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.map(function(e){return t=e.value,Number(t).toFixed(2);var t}),r=t.reduce(function(e,t){return Math.max(e,t.length)},0);return e.map(function(e,n){return _t(_t({},e),{},{formattedValue:t[n].padStart(r," ")})})}function Nt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=Et(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return be(e.sevenEleList).map(function(e){return{day:ve(e.day,""),value:Number(e.dayElePq||0)}}).filter(function(e){return e.day&&Number.isFinite(e.value)&&e.value>0}).slice(-5).reverse()}(r)),a=(null==n?void 0:n.dataInfo)||{},i=be((null==n?void 0:n.mothEleList)||(null==n?void 0:n.monthEleList)),s=i[i.length-1]||{},c=Number(t.sumMoney||0),u=Number(t.historyOwe||0)>0||c<0,l=Number(r.totalPq||0);return{consNo:ve(e.consNo_dst||e.consNo,""),consName:ve(e.consName_dst||e.consName,""),orgName:ve(e.orgName,""),address:ve(e.elecAddr_dst||e.elecAddr,""),rawBalance:ve(t.sumMoney,""),balance:Math.abs(c),isOwe:u,billDate:ve(t.date,"--"),currentUsage:ve(t.totalPq,""),estimatedDays:ve(t.dayNum,""),prepayBalance:ve(t.prepayBal,""),annualUsage:ve(a.totalEleNum,""),annualCost:ve(a.totalEleCost,""),previousMonthUsage:ve(s.monthEleNum,""),previousMonthCost:ve(s.monthEleCost,""),stepUsage:"",recentTotalUsage:Number.isFinite(l)&&l>0?l:"",recentUsageList:o}}function At(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.map(function(e){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="";return(e.currentUsage||e.rawBalance)&&(e.currentUsage&&(r+="本期电量: ".concat(e.currentUsage,"度")),e.rawBalance&&(r+="".concat(r?" ":"","账户余额: ").concat(e.isOwe?"-":"").concat(e.balance,"元"))),r+="".concat(r?"\n":"","截至日期: ").concat(e.billDate),e.annualUsage&&e.annualCost&&(r+="\n年度用电: ".concat(e.annualUsage,"度 累计花费: ").concat(e.annualCost,"元")),t.showRecentUsage||(e.estimatedDays?r+="\n预计可用: ".concat(e.estimatedDays,"天"):e.prepayBalance&&(r+="\n预存电费: ".concat(e.prepayBalance,"元"))),e.consNo&&(r+="\n户号信息: ".concat(e.consNo).concat(e.consName?"|".concat(e.consName):"")),e.orgName&&(r+="\n供电单位: ".concat(e.orgName)),e.address&&(r+="\n用电地址: ".concat(e.address)),e.recentTotalUsage&&(r+="\n五日用电: ".concat(e.recentTotalUsage,"度")),t.showRecentUsage&&e.recentUsageList.forEach(function(e){r+="\n".concat(e.day,"用电: ").concat(e.formattedValue,"度⚡")}),r}(e,t)})}function xt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(function(e){return{consNo:e.consNo,consName:e.consName,orgName:e.orgName,address:e.address,balance:e.balance,isOwe:e.isOwe,billDate:e.billDate,currentUsage:e.currentUsage,estimatedDays:e.estimatedDays,prepayBalance:e.prepayBalance,annualUsage:e.annualUsage,annualCost:e.annualCost,previousMonthUsage:e.previousMonthUsage,previousMonthCost:e.previousMonthCost,recentTotalUsage:e.recentTotalUsage,recentUsageList:e.recentUsageList}})}function $t(e){return $t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$t(e)}function It(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var c=n&&n.prototype instanceof s?n:s,u=Object.create(c.prototype);return Ut(u,"_invoke",function(r,n,o){var a,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,c=e,p.n=r,i}};function d(r,n){for(s=r,c=n,t=0;!f&&u&&!o&&t3?(o=h===n)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((o=r<2&&dn||n>h)&&(a[4]=r,a[5]=n,p.n=h,s=0))}if(o||r>1)return i;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==i)break}catch(t){a=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,o,a),!0),u}var i={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Ut(t={},n,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Ut(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,Ut(f,"constructor",u),Ut(u,"constructor",c),c.displayName="GeneratorFunction",Ut(u,o,"GeneratorFunction"),Ut(f),Ut(f,o,"Generator"),Ut(f,n,function(){return this}),Ut(f,"toString",function(){return"[object Generator]"}),(It=function(){return{w:a,m:p}})()}function Ut(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ut=function(e,t,r,n){function a(t,r){Ut(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},Ut(e,t,r,n)}function Bt(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Rt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Lt(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r=200&&Number(e)<300}function Jt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"json";if("text"===t)return"string"==typeof e?e:"".concat(null!=e?e:"");if("json"!==t||"string"!=typeof e)return e;try{return e?JSON.parse(e):null}catch(t){return e}}function Xt(){var e,t,r,n,o,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=Number(null!==(e=null!==(t=a.status)&&void 0!==t?t:a.statusCode)&&void 0!==e?e:0),c=a.headers||{},u=null!==(r=null!==(n=null!==(o=a.data)&&void 0!==o?o:a.body)&&void 0!==n?n:a.bodyBytes)&&void 0!==r?r:"";return{data:Jt(u,i.responseType),status:s,statusCode:s,statusText:a.statusText||"",headers:c,config:i,request:a.request,raw:a,ok:(i.validateStatus||Yt)(s)}}var Vt=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};qt(this,e),Ft(this,"defaults",void 0),Ft(this,"interceptors",void 0),this.defaults=Lt({headers:{Accept:"application/json, text/plain, */*"},validateStatus:Yt,throwHttpErrors:!0},t),this.interceptors={request:new Wt,response:new Wt}}return zt(e,[{key:"mergeConfig",value:function(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n="string"==typeof r?{url:r}:r,o=Lt(Lt(Lt({},this.defaults),n),{},{headers:Qt(this.defaults.headers,n.headers)});return o.method=(e=o.method,"".concat(e||"get").toLowerCase()),o.baseURL&&o.url&&(t=o.url,!/^[a-z][a-z\d+\-.]*:\/\//i.test("".concat(t||"")))&&(o.url=function(e,t){return e?t?"".concat("".concat(e).replace(/\/+$/g,""),"/").concat("".concat(t).replace(/^\/+/g,"")):e:t||""}(o.baseURL,o.url)),o.url=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new URLSearchParams;Object.entries(t||{}).filter(function(e){var t=Gt(e,2),r=t[1];return null!=r&&""!==r}).flatMap(function(e){var t=Gt(e,2),r=t[0],n=t[1];return Array.isArray(n)?n.map(function(e){return[r,e]}):[[r,n]]}).forEach(function(e){var t=Gt(e,2),n=t[0],o=t[1];return r.append(n,"".concat(o))});var n=r.toString();return n?"".concat(e).concat("".concat(e).includes("?")?"&":"?").concat(n):e}(o.url||"",o.params),o}},{key:"dispatchRequest",value:(t=It().m(function e(t){var r,n,o,a;return It().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=t.adapter||this.defaults.adapter,"function"==typeof r){e.n=1;break}throw Ht("No available adapter","ERR_NOT_SUPPORT",t);case 1:return e.p=1,o=Xt,e.n=2,r(t);case 2:if(n=o(e.v,t),n.ok||!1===t.throwHttpErrors){e.n=3;break}throw Ht("Request failed with status code ".concat(n.status),"ERR_BAD_RESPONSE",t,n.request,n);case 3:return e.a(2,n);case 4:if(e.p=4,a=e.v,null==a||!a.isAxiosError){e.n=5;break}throw a;case 5:throw Ht((null==a?void 0:a.message)||a||"Network Error","ERR_NETWORK",t);case 6:return e.a(2)}},e,this,[[1,4]])}),r=function(){var e=this,r=arguments;return new Promise(function(n,o){var a=t.apply(e,r);function i(e){Bt(a,n,o,i,s,"next",e)}function s(e){Bt(a,n,o,i,s,"throw",e)}i(void 0)})},function(e){return r.apply(this,arguments)})},{key:"request",value:function(e){var t=[];return this.interceptors.request.forEach(function(e){t.unshift(e.onFulfilled,e.onRejected)}),t.push(this.dispatchRequest.bind(this),void 0),this.interceptors.response.forEach(function(e){t.push(e.onFulfilled,e.onRejected)}),Array.from({length:Math.ceil(t.length/2)}).reduce(function(e,r,n){return e.then(t[2*n],t[2*n+1])},Promise.resolve(this.mergeConfig(e)))}},{key:"create",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new e(Lt(Lt(Lt({},this.defaults),t),{},{headers:Qt(this.defaults.headers,t.headers)}))}}]);var t,r}();["get","delete","head","options"].forEach(function(e){Vt.prototype[e]=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(Lt(Lt({},r),{},{method:e,url:t}))}}),["post","put","patch"].forEach(function(e){Vt.prototype[e]=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.request(Lt(Lt({},n),{},{method:e,url:t,data:r}))}});var Zt=["params"];function er(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var c=n&&n.prototype instanceof s?n:s,u=Object.create(c.prototype);return tr(u,"_invoke",function(r,n,o){var a,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,c=e,p.n=r,i}};function d(r,n){for(s=r,c=n,t=0;!f&&u&&!o&&t3?(o=h===n)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((o=r<2&&dn||n>h)&&(a[4]=r,a[5]=n,p.n=h,s=0))}if(o||r>1)return i;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==i)break}catch(t){a=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,o,a),!0),u}var i={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(tr(t={},n,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,tr(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,tr(f,"constructor",u),tr(u,"constructor",c),c.displayName="GeneratorFunction",tr(u,o,"GeneratorFunction"),tr(f),tr(f,o,"Generator"),tr(f,n,function(){return this}),tr(f,"toString",function(){return"[object Generator]"}),(er=function(){return{w:a,m:p}})()}function tr(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}tr=function(e,t,r,n){function a(t,r){tr(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},tr(e,t,r,n)}function rr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function nr(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&void 0!==arguments[0]?arguments[0]:{},t=Number(e.status||e.statusCode||0);return!![408,429].includes(t)||t>=500}function pr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t="".concat(e).toLowerCase();return y.some(function(e){return t.includes(e.toLowerCase())})}(t)?e?"*********":e:Array.isArray(e)?e.map(function(e){return pr(e)}):e&&"object"===ur(e)?Object.fromEntries(Object.entries(e).map(function(e){var t=sr(e,2),r=t[0],n=t[1];return[r,pr(n,r)]})):e}function dr(e){if(null==e||""===e)return"";var t="string"==typeof e?he(e):e;return"string"==typeof t?t:ye(t,null,2)}function hr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==e.data&&null!==e.data?"string"==typeof e.data?e.data:ye(e.data,null,2):""}function yr(e){if(null==e||""===e)return"";var t="string"==typeof e?he(e):e,r=pr(t);return"string"==typeof r?r:ye(r,null,2)}function mr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return void 0!==e.data&&null!==e.data?"string"==typeof e.data?e.data:ye(pr(e.data),null,2):""}function vr(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Z.debug(["接口响应: ".concat(r.method||"get"," ").concat(r.url||""),"请求头: ".concat(ye(pr(r.headers||{}),null,2)),"请求体: ".concat(yr(null!==(e=r.data)&&void 0!==e?e:r.body)),"状态码: ".concat(n.status||n.statusCode||"UNKNOWN"),"响应体: ".concat(mr(n))].join("\n")),["接口响应: ".concat(r.method||"get"," ").concat(r.url||""),"请求头: ".concat(ye(r.headers||{},null,2)),"请求体: ".concat(dr(null!==(t=r.data)&&void 0!==t?t:r.body)),"状态码: ".concat(n.status||n.statusCode||"UNKNOWN"),"响应体: ".concat(hr(n))].join("\n")}function br(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;Z.debug(["接口异常: ".concat(r.method||"get"," ").concat(r.url||""),"请求头: ".concat(ye(pr(r.headers||{}),null,2)),"请求体: ".concat(yr(null!==(e=r.data)&&void 0!==e?e:r.body)),"异常信息: ".concat(ge(n))].join("\n")),["接口异常: ".concat(r.method||"get"," ").concat(r.url||""),"请求头: ".concat(ye(r.headers||{},null,2)),"请求体: ".concat(dr(null!==(t=r.data)&&void 0!==t?t:r.body)),"异常信息: ".concat(ge(n))].join("\n")}function gr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.fromEntries(Object.entries(e||{}).filter(function(e){var t=sr(e,2),r=t[1];return null!=r}))}function wr(e){return Sr.apply(this,arguments)}function Sr(){return Sr=ir(er().m(function e(t){var r;return er().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,t.arrayBuffer();case 1:return r=e.v,e.a(2,{body:new TextDecoder("utf-8").decode(r),bodyBytes:r})}},e)})),Sr.apply(this,arguments)}function kr(){return Or.apply(this,arguments)}function Or(){return Or=ir(er().m(function e(){var t,r,n,o,a,i,s,c,u,l,f,p,d,h,y,m,v,b,g=arguments;return er().w(function(e){for(;;)switch(e.p=e.n){case 0:return n=g.length>0&&void 0!==g[0]?g[0]:{},o=new AbortController,a=Number(n.timeout||0),i=a>0?setTimeout(function(){return o.abort()},a>500?a:1e3*a):null,s="".concat(n.method||"get").toUpperCase(),c=null!==(t=null!==(r=n.data)&&void 0!==r?r:n.body)&&void 0!==t?t:n.bodyBytes,u=lr(),l=u||n.url,f=u?"POST":s,p=u?{"content-type":"application/json"}:gr(n.headers),d=u?JSON.stringify({url:n.url,method:s,headers:gr(n.headers),body:["GET","HEAD"].includes(s)?void 0:c,redirection:n.redirection,autoRedirect:n["auto-redirect"]}):["GET","HEAD"].includes(s)?void 0:c,e.p=1,e.n=2,globalThis.fetch(l,{method:f,headers:p,body:d,redirect:!1===n.redirection||!1===n["auto-redirect"]?"manual":"follow",signal:o.signal});case 2:return h=e.v,e.n=3,wr(h);case 3:return y=e.v,m=y.body,v=y.bodyBytes,e.a(2,{ok:h.ok,status:h.status,statusCode:h.status,statusText:h.statusText,headers:Object.fromEntries(h.headers.entries()),body:m,bodyBytes:v});case 4:throw e.p=4,b=e.v,new Error("AbortError"===(null==b?void 0:b.name)?"浏览器 fetch 请求超时":ge(b));case 5:return e.p=5,i&&clearTimeout(i),e.f(5);case 6:return e.a(2)}},e,null,[[1,4,5,6]])})),Or.apply(this,arguments)}function jr(){return Tr.apply(this,arguments)}function Tr(){return Tr=ir(er().m(function e(){var t,r,n,o,a,i,s,c,u,l,f,p,d,h=arguments;return er().w(function(e){for(;;)if(0===e.n)return t=h.length>0&&void 0!==h[0]?h[0]:{},r=t.url,n=t.method,o=t.headers,a=t.data,i=t.body,s=t.bodyBytes,c=t.timeout,u=t.policy,l=t.redirection,f=t.opts,p=t["auto-redirect"],d=t["auto-cookie"],e.a(2,ce({url:r,method:n,headers:o,body:null!=a?a:i,bodyBytes:s,timeout:c,policy:u,redirection:l,"auto-redirect":p,"auto-cookie":d,opts:f}))},e)})),Tr.apply(this,arguments)}function _r(){return Cr.apply(this,arguments)}function Cr(){return Cr=ir(er().m(function e(){var t,r=arguments;return er().w(function(e){for(;;)if(0===e.n)return t=r.length>0&&void 0!==r[0]?r[0]:{},e.a(2,Ne()||lr()?kr(t):jr(t))},e)})),Cr.apply(this,arguments)}function Pr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Number(e.__retryAttempt||0);return Number.isFinite(t)&&t>=0?Math.floor(t):0}function Er(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return!e.__skipRetry&&Pr(e)<3}function Nr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(e.params,function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n1&&void 0!==a[1]?a[1]:{},n=a.length>2&&void 0!==a[2]?a[2]:"",r.url&&Er(r)){e.n=1;break}return e.a(2,null);case 1:return o=Pr(r)+1,Z.warn("网络请求失败,第 ".concat(o," 次将在 ").concat(500,"ms 后重试: ").concat(r.url,"; ").concat(n)),e.n=2,se(500);case 2:return e.a(2,t.request(Nr(r)))}},e)})),xr.apply(this,arguments)}function $r(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Vt(e)}(nr({adapter:_r,throwHttpErrors:!1,timeout:10},t)),e.interceptors.response.use(function(){var t=ir(er().m(function t(r){var n;return er().w(function(t){for(;;)switch(t.n){case 0:if(vr(r.config||{},r),!fr(r)){t.n=2;break}return t.n=1,Ar(e,r.config,"HTTP ".concat(r.status||r.statusCode||"UNKNOWN"));case 1:if(n=t.v,!n){t.n=2;break}return t.a(2,n);case 2:return t.a(2,r)}},t)}));return function(e){return t.apply(this,arguments)}}(),function(){var t=ir(er().m(function t(r){var n,o;return er().w(function(t){for(;;)switch(t.n){case 0:return n=(null==r?void 0:r.config)||{},br(n,r),t.n=1,Ar(e,n,ge(r));case 1:if(o=t.v,!o){t.n=2;break}return t.a(2,o);case 2:throw r;case 3:return t.a(2)}},t)}));return function(e){return t.apply(this,arguments)}}()),e}$r();function Ir(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var c=n&&n.prototype instanceof s?n:s,u=Object.create(c.prototype);return Ur(u,"_invoke",function(r,n,o){var a,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,c=e,p.n=r,i}};function d(r,n){for(s=r,c=n,t=0;!f&&u&&!o&&t3?(o=h===n)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((o=r<2&&dn||n>h)&&(a[4]=r,a[5]=n,p.n=h,s=0))}if(o||r>1)return i;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==i)break}catch(t){a=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,o,a),!0),u}var i={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Ur(t={},n,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Ur(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,Ur(f,"constructor",u),Ur(u,"constructor",c),c.displayName="GeneratorFunction",Ur(u,o,"GeneratorFunction"),Ur(f),Ur(f,o,"Generator"),Ur(f,n,function(){return this}),Ur(f,"toString",function(){return"[object Generator]"}),(Ir=function(){return{w:a,m:p}})()}function Ur(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Ur=function(e,t,r,n){function a(t,r){Ur(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},Ur(e,t,r,n)}function Br(e){return Br="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Br(e)}function Rr(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Lr(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){Rr(a,n,o,i,s,"next",e)}function s(e){Rr(a,n,o,i,s,"throw",e)}i(void 0)})}}function Gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Mr(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return ke(e,$)&&"11401"==="".concat(t)&&/RK001|网络连接超时/.test("".concat(r))}function Fr(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(null===(e=t.headers)||void 0===e?void 0:e.timestamp)||Date.now(),n=q;return Mr({"Content-Type":n.contentType,Accept:n.accept,version:n.interfaceVersion,source:n.source,timestamp:r,wsgwType:n.wsgwType},t.headers)}function Kr(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(null===(e=we())||void 0===e?void 0:e.riskContext)||{},o=Mr(Mr({},t),{},{headers:Mr(Mr({},r),n.deviceToken?{deviceTokenTX:n.deviceToken}:{})});return o}function Hr(e){return Wr.apply(this,arguments)}function Wr(){return Wr=Lr(Ir().m(function e(t){var r,n,o,a;return Ir().w(function(e){for(;;)switch(e.n){case 0:return r=Fr(t),n=Kr(t,r),e.n=1,Dr.request({url:"/s1",method:"post",headers:{"content-type":"application/json"},data:JSON.stringify({yuheng:n})});case 1:return o=e.v,a=o.data,a.data.url="".concat(w).concat(a.data.url),a.data.body=JSON.stringify(a.data.data),delete a.data.data,e.a(2,a.data)}},e)})),Wr.apply(this,arguments)}function Qr(e){return Yr.apply(this,arguments)}function Yr(){return Yr=Lr(Ir().m(function e(t){var r,n,o,a,i,s;return Ir().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Dr.request({url:"/s2",method:"post",headers:{"content-type":"application/json"},data:JSON.stringify({yuheng:t})});case 1:if(r=e.v,n=r.data,o=n.data||{},a=o.code,i=o.message,s=o.data,"1"!=="".concat(a)){e.n=2;break}return e.a(2,s);case 2:if(!zr(t.config,a,i)){e.n=3;break}throw new Error(["⚠️账号触发登录风控, 请次日再次尝试","可能原因:","1. 账号或密码填写有误","2. 验证码校验次数过多","3. 登录次数过多","建议处理:","1. 先打开“网上国网”App,或登录 https://www.95598.cn/ 手动确认账号密码是否正确。","2. 如果手动登录也失败,请先修正账号信息后再运行脚本。","3. 如果手动登录正常,建议今天不要继续频繁重试,等待明天再试。"].join("\n"));case 3:if(!Oe({code:a,message:i},!0)){e.n=4;break}throw new Error("登录态失效: ".concat(i||a));case 4:if(!(ke(t.config,A)&&s&&a)){e.n=5;break}throw new Error("重新获取: ".concat(i));case 5:throw new Error([a,i].filter(Boolean).join(": ")||"解密响应失败");case 6:return e.a(2)}},e)})),Yr.apply(this,arguments)}function Jr(e){return Xr.apply(this,arguments)}function Xr(){return Xr=Lr(Ir().m(function e(t){var r,n,o,a,i,s,c=arguments;return Ir().w(function(e){for(;;)switch(e.p=e.n){case 0:return r=c.length>1&&void 0!==c[1]?c[1]:{},e.p=1,e.n=2,Hr(t);case 2:return n=e.v,ke(t,A)&&(n.body=n.body.replace(/^\"|\"$/g,"")),e.n=3,Dr.request(Mr(Mr({},n),{},{data:n.body}));case 3:if(o=e.v,o.ok){e.n=4;break}throw new Error(ye(o.data)||"请求失败");case 4:if(a=o.data,!a.code||!Oe(a,r.hasToken)){e.n=5;break}throw new Error(a.message||"登录态失效");case 5:return i={config:Mr({},t),data:a},ke(t,N)&&(i.config.headers={encryptKey:n.encryptKey}),e.n=6,Qr(i);case 6:return e.a(2,e.v);case 7:throw e.p=7,s=e.v,Z.debug("网关请求失败: ".concat(ye(t,null,2))),new Error(ge(s));case 8:return e.a(2)}},e,null,[[1,7]])})),Xr.apply(this,arguments)}function Vr(e){return Zr.apply(this,arguments)}function Zr(){return Zr=Lr(Ir().m(function e(t){var r,n;return Ir().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Dr.request({url:"/s4",method:"post",headers:{"content-type":"application/json"},data:JSON.stringify({yuheng:t})});case 1:return n=e.v,e.a(2,(null===(r=n.data)||void 0===r?void 0:r.data)||n.data)}},e)})),Zr.apply(this,arguments)}function en(e){return en="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},en(e)}function tn(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var c=n&&n.prototype instanceof s?n:s,u=Object.create(c.prototype);return rn(u,"_invoke",function(r,n,o){var a,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,c=e,p.n=r,i}};function d(r,n){for(s=r,c=n,t=0;!f&&u&&!o&&t3?(o=h===n)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((o=r<2&&dn||n>h)&&(a[4]=r,a[5]=n,p.n=h,s=0))}if(o||r>1)return i;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==i)break}catch(t){a=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,o,a),!0),u}var i={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(rn(t={},n,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,rn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,rn(f,"constructor",u),rn(u,"constructor",c),c.displayName="GeneratorFunction",rn(u,o,"GeneratorFunction"),rn(f),rn(f,o,"Generator"),rn(f,n,function(){return this}),rn(f,"toString",function(){return"[object Generator]"}),(tn=function(){return{w:a,m:p}})()}function rn(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}rn=function(e,t,r,n){function a(t,r){rn(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},rn(e,t,r,n)}function nn(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function on(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){nn(a,n,o,i,s,"next",e)}function s(e){nn(a,n,o,i,s,"throw",e)}i(void 0)})}}function an(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function sn(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:null;return{params:{uscInfo:{devciceIp:F.devciceIp,tenant:F.tenant,member:F.member,devciceId:F.devciceId},quInfo:{optSys:K.optSys,pushId:K.pushId,addressProvince:K.addressProvince,password:t,addressRegion:K.addressRegion,account:e,addressCity:K.addressCity}},complexSliderRet:r?r.complexSliderRet:void 0,complexSliderType:r?r.complexSliderType:void 0}}function pn(e){return/RK007|RK008|RK1003/.test(ge(e))}function dn(e){var t=ge(e).match(/RK(?:007|008|1003)/);return t?t[0]:""}function hn(e){var t=ge(e);return/操作过于频繁|code["']?\s*[:=]\s*-?100\b/.test(t)}function yn(e){var t=ge(e);return/RK1003/.test(t)?"clickImg":/RK008/.test(t)?"clickWord":"blockPuzzle"}function mn(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(null===(e=r.srvrt)||void 0===e?void 0:e.resultMessage)||(null===(t=r.data)||void 0===t||null===(t=t.srvrt)||void 0===t?void 0:t.resultMessage)||r.resultMessage||r.message||"登录失败: 请检查账号和密码是否正确"}function vn(){var e,t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.redirect_url||r.redirectUrl||(null===(e=r.data)||void 0===e?void 0:e.redirect_url)||(null===(t=r.data)||void 0===t?void 0:t.redirectUrl)||"",o="".concat(n).match(/[?&]code=([^&]+)/);return o?decodeURIComponent(o[1]):r.code||r.authorizeCode||""}var bn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),un(this,"settings",void 0),un(this,"globalScope",we()),un(this,"bizrt",{}),un(this,"requestKey",{}),un(this,"authorizeCode",""),un(this,"accessToken",""),un(this,"refreshPromise",null),un(this,"riskContext",{}),un(this,"lastCaptchaSolve",null),un(this,"lastCaptchaRequest",null),this.settings=t,this.bizrt=he(t.cachedBizrt)||{},this.globalScope.bizrt=this.bizrt},t=[{key:"hasValidSession",value:function(){var e,t;return Boolean((null===(e=this.bizrt)||void 0===e?void 0:e.token)&&Array.isArray(null===(t=this.bizrt)||void 0===t?void 0:t.userInfo)&&this.bizrt.userInfo.length>0)}},{key:"getUserInfo",value:function(){var e;return Array.isArray(null===(e=this.bizrt)||void 0===e?void 0:e.userInfo)&&this.bizrt.userInfo[0]||{}}},{key:"buildHeaders",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sn(sn({},this.requestKey),e)}},{key:"buildTokenHeaders",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sn(sn({},this.requestKey),{},{token:null===(e=this.bizrt)||void 0===e?void 0:e.token},t)}},{key:"buildAuthorizedHeaders",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sn(sn({},this.requestKey),{},{token:null===(e=this.bizrt)||void 0===e?void 0:e.token,acctoken:this.accessToken},t)}},{key:"cacheRiskCtx",value:function(e){this.riskContext={deviceToken:(null==e?void 0:e.tdcItoken)||(null==e?void 0:e.deviceToken)||"",tdcItoken:(null==e?void 0:e.tdcItoken)||"",collect:(null==e?void 0:e.collect)||"",info:(null==e?void 0:e.info)||null},this.globalScope.riskContext=this.riskContext,Z.debug("[风控] 已缓存 ChaosVM 风控上下文")}},{key:"clearRiskCtx",value:function(){this.riskContext={},this.globalScope.riskContext={}}},{key:"initRiskCtx",value:(p=on(tn().m(function e(){var t,r,n,o;return tn().w(function(e){for(;;)switch(e.n){case 0:return t=S,r=k,n=O,e.n=1,Vr({ua:t,href:r,referer:n,ip:""});case 1:return o=e.v,this.cacheRiskCtx(o),e.a(2,o)}},e,this)})),function(){return p.apply(this,arguments)})},{key:"clearSession",value:function(){this.bizrt={},this.requestKey={},this.authorizeCode="",this.accessToken="",this.globalScope.bizrt={},this.clearRiskCtx(),ue.removeItem(c)}},{key:"getKeyCode",value:(f=on(tn().m(function e(){return tn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Jr({url:"/api".concat(N),method:"post",headers:{}});case 1:return this.requestKey=e.v,Z.debug("获取 keyCode 成功: ".concat(ye(this.requestKey,null,2))),e.a(2,this.requestKey)}},e,this)})),function(){return f.apply(this,arguments)})},{key:"_sendLogin",value:(l=on(tn().m(function e(){var t,r,n,o,a=arguments;return tn().w(function(e){for(;;)switch(e.n){case 0:return t=a.length>0&&void 0!==a[0]?a[0]:null,e.n=1,Jr({url:"/api".concat($),method:"post",headers:this.buildHeaders(),data:fn(this.settings.username,this.settings.password,t)});case 1:if(r=e.v,n=null==r?void 0:r.bizrt,Array.isArray(null==n?void 0:n.userInfo)&&0!==n.userInfo.length){e.n=2;break}throw o=new Error(mn(r)),o.raw=r,o;case 2:return this.bizrt=n,this.globalScope.bizrt=n,Be(ye(n)),e.a(2,this.bizrt)}},e,this)})),function(){return l.apply(this,arguments)})},{key:"login",value:(u=on(tn().m(function e(){var t,r,n,o,a;return tn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.n=1,this.initRiskCtx().catch(function(e){return Z.warn("[风控] ChaosVM 准备失败,将继续尝试登录:",ge(e))});case 1:return e.p=1,e.n=2,this._sendLogin(null);case 2:case 7:return e.a(2,e.v);case 3:if(e.p=3,o=e.v,!hn(o)){e.n=4;break}throw Z.warn("[登录] 命中 -100 操作过于频繁,停止重试"),o;case 4:if(pn(o)){e.n=5;break}throw o;case 5:return t=dn(o),r=yn(o),Z.debug("[验证码] ".concat(t,"/").concat(r," 走主策略")),e.p=6,e.n=7,this._sendLogin({complexSliderRet:0,complexSliderType:r});case 8:if(e.p=8,a=e.v,!hn(a)){e.n=9;break}throw Z.warn("[登录] 命中 -100 操作过于频繁,停止重试"),a;case 9:if(pn(a)){e.n=10;break}throw a;case 10:throw n=dn(a)||t,Z.warn("[登录] ".concat(n," 主策略未通过,且当前不支持真实求解,放弃本次登录")),a;case 11:return e.a(2)}},e,this,[[6,8],[1,3]])})),function(){return u.apply(this,arguments)})},{key:"getAuthorizeCode",value:(s=on(tn().m(function e(){var t;return tn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Jr({url:"/api".concat(A),method:"post",headers:this.buildTokenHeaders()},{hasToken:!0});case 1:if(t=e.v,this.authorizeCode=vn(t),this.authorizeCode){e.n=2;break}throw new Error("授权码获取失败: 接口未返回有效的 authorize code");case 2:return e.a(2,this.authorizeCode)}},e,this)})),function(){return s.apply(this,arguments)})},{key:"getAccessToken",value:(i=on(tn().m(function e(){var t;return tn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,Jr({url:"/api".concat(x),method:"post",headers:this.buildTokenHeaders({authorizecode:this.authorizeCode})},{hasToken:!0});case 1:if(t=e.v,this.accessToken=null==t?void 0:t.access_token,this.accessToken){e.n=2;break}throw new Error("Web Token 获取失败: 接口未返回 access_token");case 2:return e.a(2,this.accessToken)}},e,this)})),function(){return i.apply(this,arguments)})},{key:"refreshCredentials",value:(a=on(tn().m(function e(){var t=this;return tn().w(function(e){for(;;)switch(e.n){case 0:return this.refreshPromise||(this.refreshPromise=on(tn().m(function e(){return tn().w(function(e){for(;;)switch(e.n){case 0:return Z.warn("检测到凭证失效,正在自动重新登录刷新凭证"),t.clearSession(),e.n=1,t.getKeyCode();case 1:return e.n=2,t.login();case 2:return e.n=3,t.getAuthorizeCode();case 3:return e.n=4,t.getAccessToken();case 4:return e.a(2)}},e)}))().finally(function(){t.refreshPromise=null})),e.n=1,this.refreshPromise;case 1:return e.a(2)}},e,this)})),function(){return a.apply(this,arguments)})},{key:"requestAuthorized",value:(o=on(tn().m(function e(t){var r,n;return tn().w(function(e){for(;;)switch(e.p=e.n){case 0:return r="function"==typeof t?t:function(){return t},e.p=1,e.n=2,Jr(r(),{hasToken:!0});case 2:return e.a(2,e.v);case 3:if(e.p=3,n=e.v,je(n)){e.n=4;break}throw n;case 4:return e.n=5,this.refreshCredentials();case 5:return e.a(2,Jr(r(),{hasToken:!0}))}},e,this,[[1,3]])})),function(e){return o.apply(this,arguments)})},{key:"ensureLogin",value:(n=on(tn().m(function e(){var t;return tn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.n=1,this.getKeyCode();case 1:if(this.hasValidSession()){e.n=2;break}return e.n=2,this.login();case 2:return e.p=2,e.n=3,this.getAuthorizeCode();case 3:return e.n=4,this.getAccessToken();case 4:e.n=7;break;case 5:if(e.p=5,t=e.v,je(t)){e.n=6;break}throw t;case 6:return e.n=7,this.refreshCredentials();case 7:return e.a(2)}},e,this,[[2,5]])})),function(){return n.apply(this,arguments)})}],t&&cn(e.prototype,t),r&&cn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,n,o,a,i,s,u,l,f,p}();function gn(e){return gn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gn(e)}function wn(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var c=n&&n.prototype instanceof s?n:s,u=Object.create(c.prototype);return Sn(u,"_invoke",function(r,n,o){var a,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,c=e,p.n=r,i}};function d(r,n){for(s=r,c=n,t=0;!f&&u&&!o&&t3?(o=h===n)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((o=r<2&&dn||n>h)&&(a[4]=r,a[5]=n,p.n=h,s=0))}if(o||r>1)return i;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==i)break}catch(t){a=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,o,a),!0),u}var i={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Sn(t={},n,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Sn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,Sn(f,"constructor",u),Sn(u,"constructor",c),c.displayName="GeneratorFunction",Sn(u,o,"GeneratorFunction"),Sn(f),Sn(f,o,"Generator"),Sn(f,n,function(){return this}),Sn(f,"toString",function(){return"[object Generator]"}),(wn=function(){return{w:a,m:p}})()}function Sn(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Sn=function(e,t,r,n){function a(t,r){Sn(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},Sn(e,t,r,n)}function kn(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function On(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){kn(a,n,o,i,s,"next",e)}function s(e){kn(a,n,o,i,s,"throw",e)}i(void 0)})}}function jn(e,t){for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};return e.proNo||e.provinceId||e.provinceNo||e.codeValue||z}function Nn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"02"==="".concat(e.consType||e.constType||e.elecTypeCode)?"02":"01"}function An(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.realName||e.nickname||e.loginAccount||e.userName||""}function xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.userId||e.accountId||e.acctId||""}function $n(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.consNo_dst||e.consNo||e.consNoSrc||""}function In(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.consNo||e.consNo_dst||e.consNoSrc||""}function Un(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.orgNo||e.orgNo_dst||""}function Bn(){return ie("yyyy")}function Rn(){return String(Number(ie("yyyy"))-1)}function Ln(){return(new Date).getMonth()}function Gn(e,t){return{serviceCode:H.serviceCode,source:D,target:z,uscInfo:{member:F.member,devciceIp:F.devciceIp,devciceId:F.devciceId,tenant:F.tenant},quInfo:{userId:xn(e)},token:t}}function Mn(e,t){return _n(_n({},Gn(e,t)),{},{Channels:"web"})}var qn=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Cn(this,"authService",void 0),this.authService=t},t=[{key:"getBindInfo",value:(f=On(wn().m(function e(){var t,r,n=this;return wn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.authService.requestAuthorized(function(){var e=n.authService.getUserInfo();return{url:"/api".concat(L),method:"post",headers:n.authService.buildAuthorizedHeaders(),data:Mn(e,n.authService.bizrt.token)}});case 1:return r=e.v,e.a(2,r.bizrt||(null===(t=r.data)||void 0===t?void 0:t.bizrt)||r||{})}},e,this)})),function(){return f.apply(this,arguments)})},{key:"getBalanceInfo",value:(l=On(wn().m(function e(t){var r,n,o,a=this;return wn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.authService.requestAuthorized(function(){var e=a.authService.getUserInfo();return{url:"/api".concat(G),method:"post",headers:a.authService.buildAuthorizedHeaders(),data:{data:{srvCode:"",serialNo:"",channelCode:W.channelCode,funcCode:W.funcCode,acctId:xn(e),userName:An(e),promotType:"1",promotCode:"1",userAccountId:xn(e),list:[{consNoSrc:$n(t),proCode:En(t),sceneType:t.constType||t.consType||"",consNo:In(t),orgNo:Un(t)}]},serviceCode:W.serviceCode,source:D,target:En(t)}}});case 1:return o=e.v,e.a(2,(null===(r=o.list)||void 0===r?void 0:r[0])||(null===(n=o.data)||void 0===n||null===(n=n.list)||void 0===n?void 0:n[0])||o||{})}},e,this)})),function(e){return l.apply(this,arguments)})},{key:"getDailyUsage",value:(u=On(wn().m(function e(t){return wn().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getDailyUsageByDays(t,6))},e,this)})),function(e){return u.apply(this,arguments)})},{key:"getDailyUsageByDays",value:(c=On(wn().m(function e(t){var r,n=this,o=arguments;return wn().w(function(e){for(;;)if(0===e.n)return r=o.length>1&&void 0!==o[1]?o[1]:6,e.a(2,this.authService.requestAuthorized(function(){var e=n.authService.getUserInfo();return{url:"/api".concat(M),method:"post",headers:n.authService.buildAuthorizedHeaders(),data:{params1:Gn(e,n.authService.bizrt.token),params3:{data:{acctId:xn(e),consNo:$n(t),consType:Nn(t),endTime:Se(1),orgNo:Un(t),queryYear:Bn(),proCode:En(t),provinceCode:En(t),serialNo:"",srvCode:"",startTime:Se(r),userName:An(e),funcCode:Q.funcCode,channelCode:Q.channelCode,clearCache:Q.clearCache,promotCode:Q.promotCode,promotType:Q.promotType},serviceCode:Q.serviceCode,source:Q.source,target:En(t)},params4:Q.params4}}}))},e,this)})),function(e){return c.apply(this,arguments)})},{key:"getMonthlyUsage",value:(s=On(wn().m(function e(t){return wn().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getMonthlyUsageByYear(t,Bn()))},e,this)})),function(e){return s.apply(this,arguments)})},{key:"getMonthlyUsageByYear",value:(i=On(wn().m(function e(t){var r,n=this,o=arguments;return wn().w(function(e){for(;;)if(0===e.n)return r=o.length>1&&void 0!==o[1]?o[1]:Bn(),e.a(2,this.authService.requestAuthorized(function(){var e=n.authService.getUserInfo();return{url:"/api".concat(M),method:"post",headers:n.authService.buildAuthorizedHeaders(),data:{params1:Gn(e,n.authService.bizrt.token),params3:{data:{acctId:xn(e),consNo:$n(t),consType:Nn(t),orgNo:Un(t),proCode:En(t),provinceCode:En(t),queryYear:r,serialNo:"",srvCode:"",userName:An(e),funcCode:Y.funcCode,channelCode:Y.channelCode,clearCache:Y.clearCache,promotCode:Y.promotCode,promotType:Y.promotType},serviceCode:Y.serviceCode,source:Y.source,target:En(t)},params4:Y.params4}}}))},e,this)})),function(e){return i.apply(this,arguments)})},{key:"getLastYearUsage",value:(a=On(wn().m(function e(t){return wn().w(function(e){for(;;)if(0===e.n)return e.a(2,this.getMonthlyUsageByYear(t,Rn()))},e,this)})),function(e){return a.apply(this,arguments)})},{key:"getSegmentDate",value:(o=On(wn().m(function e(t,r){var n,o,a=this;return wn().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,this.authService.requestAuthorized(function(){return{url:"/api".concat(R),method:"post",headers:a.authService.buildAuthorizedHeaders(),data:{data:{acctId:X.acctId,channelCode:X.channelCode,consNo:$n(t),funcCode:X.funcCode,promotCode:X.promotCode,promotType:X.promotType,provinceCode:X.provinceCode,serialNo:X.serialNo,srvCode:X.srvCode,userName:X.userName,year:r},serviceCode:X.serviceCode,source:X.source,target:En(t)}}});case 1:return n=e.v,o=Array.isArray(n.billList)?n.billList:[],e.a(2,o[o.length-1]||null)}},e,this)})),function(e,t){return o.apply(this,arguments)})},{key:"getStepUsage",value:(n=On(wn().m(function e(t){var r,n,o,a,i,s,c,u,l=this,f=arguments;return wn().w(function(e){for(;;)switch(e.n){case 0:if(r=f.length>1&&void 0!==f[1]?f[1]:Ln(),n=Number(Bn()),o=r<=9?"".concat(n,"-0").concat(r):"".concat(n,"-").concat(r),"32101"!==En(t)){e.n=2;break}return e.n=1,this.getSegmentDate(t,n);case 1:u=e.v,e.n=3;break;case 2:u=null;case 3:return a=u,i=a?"".concat(n,"-").concat(r):o,s="33101"==="".concat(Un(t)||t.provinceId||"")?"01"===Nn(t)?U:I:B,e.n=4,this.authService.requestAuthorized(function(){var e=l.authService.getUserInfo();return{url:"/api".concat(s),method:"post",headers:l.authService.buildAuthorizedHeaders(),data:{data:{channelCode:J.channelCode,funcCode:J.funcCode,promotType:J.promotType,clearCache:J.clearCache,consNo:$n(t),promotCode:En(t),orgNo:Un(t),queryDate:i,provinceCode:En(t),consType:t.constType||t.consSortCode||t.consType||"",userAccountId:xn(e),serialNo:"",srvCode:"",calcId:null==a?void 0:a.calcId,userName:An(e),acctId:xn(e)},serviceCode:J.serviceCode,source:J.source,target:En(t)}}});case 4:if(c=e.v,!"".concat(c.rtnCode)||"1"==="".concat(c.rtnCode)){e.n=5;break}throw new Error(c.rtnMsg||"阶梯用电查询失败");case 5:return e.a(2,c.list||{})}},e,this)})),function(e){return n.apply(this,arguments)})}],t&&jn(e.prototype,t),r&&jn(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,r,n,o,a,i,s,c,u,l,f}();function Dn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){u=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(u)throw o}}return s}}(e,t)||Fn(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Fn(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(s)throw a}}}}function Fn(e,t){if(e){if("string"==typeof e)return Kn(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Kn(e,t):void 0}}function Kn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r3?(o=h===n)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((o=r<2&&dn||n>h)&&(a[4]=r,a[5]=n,p.n=h,s=0))}if(o||r>1)return i;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==i)break}catch(t){a=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,o,a),!0),u}var i={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(Wn(t={},n,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Wn(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,Wn(f,"constructor",u),Wn(u,"constructor",c),c.displayName="GeneratorFunction",Wn(u,o,"GeneratorFunction"),Wn(f),Wn(f,o,"Generator"),Wn(f,n,function(){return this}),Wn(f,"toString",function(){return"[object Generator]"}),(Hn=function(){return{w:a,m:p}})()}function Wn(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}Wn=function(e,t,r,n){function a(t,r){Wn(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},Wn(e,t,r,n)}function Qn(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function Yn(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){Qn(a,n,o,i,s,"next",e)}function s(e){Qn(a,n,o,i,s,"throw",e)}i(void 0)})}}var Jn=["eleBill","dayElecQuantity","dayElecQuantity31","monthElecQuantity","lastYearElecQuantity","stepElecQuantity"];function Xn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).length>0}(e)||Boolean(e[t])}function Vn(){return((new Date).getMonth()+11)%12}function Zn(e,t){return eo.apply(this,arguments)}function eo(){return eo=Yn(Hn().m(function e(t,r){var n;return Hn().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,r();case 1:return e.a(2,e.v);case 2:return e.p=2,n=e.v,Z.warn("".concat(t," 查询失败,服务模式将兼容为缺省字段: ").concat((null==n?void 0:n.message)||n)),e.a(2,void 0)}},e,null,[[0,2]])})),eo.apply(this,arguments)}function to(e,t){return[["eleBill",function(){return e.getBalanceInfo(t)}],["dayElecQuantity",function(){return e.getDailyUsageByDays(t,6)}],["dayElecQuantity31",function(){return e.getDailyUsageByDays(t,32)}],["monthElecQuantity",function(){return e.getMonthlyUsage(t)}],["lastYearElecQuantity",function(){return e.getLastYearUsage(t)}],["stepElecQuantity",Yn(Hn().m(function r(){return Hn().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,r.n=1,e.getStepUsage(t);case 1:return r.a(2,r.v);case 2:return r.p=2,r.v,r.a(2,e.getStepUsage(t,Vn()))}},r,null,[[0,2]])}))]]}function ro(e,t){return no.apply(this,arguments)}function no(){return no=Yn(Hn().m(function e(t,r){var n,o,a,i,s,c,u,l,f,p,d=arguments;return Hn().w(function(e){for(;;)switch(e.p=e.n){case 0:a=d.length>2&&void 0!==d[2]?d[2]:{},i={userInfo:r},s=zn(to(t,r)),e.p=1,s.s();case 2:if((c=s.n()).done){e.n=6;break}if(u=Dn(c.value,2),l=u[0],f=u[1],Xn(a,l)){e.n=3;break}return e.a(3,5);case 3:return e.n=4,Zn(l,f);case 4:i[l]=e.v;case 5:e.n=2;break;case 6:e.n=8;break;case 7:e.p=7,p=e.v,s.e(p);case 8:return e.p=8,s.f(),e.f(8);case 9:return i.arrearsOfFees=Number((null===(n=i.eleBill)||void 0===n?void 0:n.historyOwe)||"0")>0||Number((null===(o=i.eleBill)||void 0===o?void 0:o.sumMoney)||"0")<0,e.a(2,Object.fromEntries(Object.entries(i).filter(function(e){var t=Dn(e,2),r=t[0],n=t[1];return!Jn.includes(r)||void 0!==n})))}},e,null,[[1,7,8,9]])})),no.apply(this,arguments)}function oo(e,t,r){return ao.apply(this,arguments)}function ao(){return ao=Yn(Hn().m(function e(t,r,n){var o,a,i,s,c,u,l,f,p,d,h;return Hn().w(function(e){for(;;)switch(e.p=e.n){case 0:o=[],a=zn(r),e.p=1,a.s();case 2:if((i=a.n()).done){e.n=5;break}return s=i.value,e.n=3,Promise.all([t.getBalanceInfo(s),t.getDailyUsage(s),t.getMonthlyUsage(s)]);case 3:c=e.v,u=Dn(c,3),l=u[0],f=u[1],p=u[2],o.push(Nt(s,l,f,p));case 4:e.n=2;break;case 5:e.n=7;break;case 6:e.p=6,h=e.v,a.e(h);case 7:return e.p=7,a.f(),e.f(7);case 8:return d=At(o,{showRecentUsage:n.showRecentUsage}),e.a(2,{title:m,subt:"",body:d[0]||"",notifyList:d,data:xt(o)})}},e,null,[[1,6,7,8]])})),ao.apply(this,arguments)}function io(e,t,r){return so.apply(this,arguments)}function so(){return so=Yn(Hn().m(function e(t,r,n){var o,a,i,s,c,u;return Hn().w(function(e){for(;;)switch(e.p=e.n){case 0:o=[],a=zn(r),e.p=1,a.s();case 2:if((i=a.n()).done){e.n=5;break}return s=i.value,c=o,e.n=3,ro(t,s,n.serviceRequestParams);case 3:c.push.call(c,e.v);case 4:e.n=2;break;case 5:e.n=7;break;case 6:e.p=6,u=e.v,a.e(u);case 7:return e.p=7,a.f(),e.f(7);case 8:return e.a(2,{title:m,subt:"",body:"",notifyList:[],data:o})}},e,null,[[1,6,7,8]])})),so.apply(this,arguments)}function co(e){return uo.apply(this,arguments)}function uo(){return uo=Yn(Hn().m(function e(t){var r,n,o,a,i;return Hn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t.username&&t.password){e.n=1;break}throw new Error("请先配置网上国网账号和密码");case 1:return r=new bn(t),e.p=2,e.n=3,r.ensureLogin();case 3:return n=new qn(r),e.n=4,n.getBindInfo();case 4:if(o=e.v,a=Pt(o,t.serviceMode||t.notifyAllAccounts),a.length){e.n=5;break}throw new Error("未查询到绑定的用电户号");case 5:return e.a(2,t.serviceMode?io(n,a,t):oo(n,a,t));case 6:throw e.p=6,i=e.v,je(i)&&(Z.warn("检测到登录态失效,已清理缓存登录态"),r.clearSession()),i;case 7:return e.a(2)}},e,null,[[2,6]])})),uo.apply(this,arguments)}function lo(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var c=n&&n.prototype instanceof s?n:s,u=Object.create(c.prototype);return fo(u,"_invoke",function(r,n,o){var a,s,c,u=0,l=o||[],f=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,c=e,p.n=r,i}};function d(r,n){for(s=r,c=n,t=0;!f&&u&&!o&&t3?(o=h===n)&&(c=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((o=r<2&&dn||n>h)&&(a[4]=r,a[5]=n,p.n=h,s=0))}if(o||r>1)return i;throw f=!0,n}return function(o,l,h){if(u>1)throw TypeError("Generator is already running");for(f&&1===l&&d(l,h),s=l,c=h;(t=s<2?e:c)||!f;){a||(s?s<3?(s>1&&(p.n=-1),d(s,c)):p.n=c:p.v=c);try{if(u=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,c)))throw TypeError("iterator result is not an object");if(!t.done)return t;c=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(c=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(f=p.n<0)?c:r.call(n,p))!==i)break}catch(t){a=e,s=1,c=t}finally{u=1}}return{value:t,done:f}}}(r,o,a),!0),u}var i={};function s(){}function c(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(fo(t={},n,function(){return this}),t),f=u.prototype=s.prototype=Object.create(l);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,fo(e,o,"GeneratorFunction")),e.prototype=Object.create(f),e}return c.prototype=u,fo(f,"constructor",u),fo(u,"constructor",c),c.displayName="GeneratorFunction",fo(u,o,"GeneratorFunction"),fo(f),fo(f,o,"Generator"),fo(f,n,function(){return this}),fo(f,"toString",function(){return"[object Generator]"}),(lo=function(){return{w:a,m:p}})()}function fo(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}fo=function(e,t,r,n){function a(t,r){fo(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},fo(e,t,r,n)}function po(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function ho(e){return{title:m,subt:"❌ 脚本执行出现错误",body:ge(e)}}function yo(){var e;return e=lo().m(function e(){var t,r,n,o;return lo().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=Re(Ue()),r=t.settings,e.p=1,e.n=2,co(r);case 2:n=e.v,e.n=4;break;case 3:e.p=3,o=e.v,Z.error(o),Z.error(ye(o,null,2)),n=ho(o);case 4:return e.p=4,e.n=5,kt({result:n,settings:r});case 5:return e.f(4);case 6:return e.a(2)}},e,null,[[1,3,4,6]])}),yo=function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){po(a,n,o,i,s,"next",e)}function s(e){po(a,n,o,i,s,"throw",e)}i(void 0)})},yo.apply(this,arguments)}!function(){yo.apply(this,arguments)}()})()})();