const $ = new Env('万达电影')
$._mi_ = 'senku_wanda_mi_'
$.desc = []
$.signCode = '17787285'
$.questionCode = '15884027'
const date = tTime(new Date().getTime())

function getKey() {
    const ts = new Date().getTime()
    const key = 'Wanda1_3B3AA12B0145E1982F282BEDD8A3305B89A9811280C0B8CC3A6A60D81022E4903' + ts
    return {'key': key, 'ts': ts}
}

const mx_api = {
    "ver": "v1.0.0",
    "sCode": "Wanda",
    "_mi_": `${$.getdata($._mi_)}`,
    "width": 1280,
    "json": true,
    "cCode": "1_3",
    "check": '',
    "ts": 0,
    "heigth": 720,
    "appId": "3"
}

!(async () => {
    await sign()
    await signRecord()
    await question_()
    await question()
    await answer()
    await drawprize_ans()
    await drawprize_ans()
    if ($.signRecord.data.remainMedal >= 50) {
        await lottery()
    }
    await showmsg()
})()
    .catch((e) => $.logErr(e))
    .finally(() => $.done())


function sign() {
    return new Promise((resolve) => {
        const signVal = getKey()['key'] + '/activityWholeSign/wholeSignUp.apiactivityCode=' + $.signCode + '&signDate=' + date
        mx_api['ts'] = getKey()['ts']
        mx_api['check'] = hex_md5(signVal)
        const url = {
            url: 'https://activity-api-mx.wandafilm.com/activityWholeSign/wholeSignUp.api',
            headers: {
                'MX-API': JSON.stringify(mx_api),
            },
            body: 'activityCode=' + $.signCode + '&signDate=' + date
        }
        $.post(url, (err, resp, data) => {
            try {
                $.sign = JSON.parse(data)
            } catch (e) {
                $.logErr(e, resp)
            } finally {
                resolve()
            }
        })
    })
}

function signRecord() {
    return new Promise((resolve) => {
        const signRecordVal = getKey()['key'] + '/activityWholeSign/getSignRecord.apiactivityCode=' + $.signCode
        mx_api['ts'] = getKey()['ts']
        mx_api['check'] = hex_md5(signRecordVal)
        const url = {
            url: 'https://activity-api-mx.wandafilm.com/activityWholeSign/getSignRecord.api',
            headers: {
                'MX-API': JSON.stringify(mx_api),
            },
            body: 'activityCode=' + $.signCode
        }
        $.post(url, (err, resp, data) => {
            try {
                $.signRecord = JSON.parse(data)
            } catch (e) {
                $.logErr(e, resp)
            } finally {
                resolve()
            }
        })
    })
}

function lottery() {
    return new Promise((resolve) => {
        const signVal = getKey()['key'] + '/activityWholeSign/prize/lottery.apiactivityCode=' + $.signCode + '&vcode=&requestId='
        mx_api['ts'] = getKey()['ts']
        mx_api['check'] = hex_md5(signVal)
        const url = {
            url: 'https://activity-api-mx.wandafilm.com/activityWholeSign/prize/lottery.api',
            headers: {
                'MX-API': JSON.stringify(mx_api),
            },
            body: 'activityCode=' + $.signCode + '&vcode=&requestId='
        }
        $.post(url, (err, resp, data) => {
            try {
                $.lottery = JSON.parse(data)
                console.log(data)
            } catch (e) {
                $.logErr(e, resp)
            } finally {
                resolve()
            }
        })
    })
}

function question_() {
    return new Promise((resolve) => {
        const questionVal = getKey()['key'] + '/question/qustion/strength.apiactivityCode=' + $.questionCode
        mx_api['ts'] = getKey()['ts']
        mx_api['check'] = hex_md5(questionVal)
        const url = {
            url: 'https://activity-api-mx.wandafilm.com/question/qustion/strength.api',
            headers: {
                'MX-API': JSON.stringify(mx_api),
            },
            body: 'activityCode=' + $.questionCode
        }
        $.post(url, (err, resp, data) => {
            try {
                $.log(`尝试性报名答题`)
            } catch (e) {
                $.logErr(e, resp)
            } finally {
                resolve()
            }
        })
    })
}

// 获取题目答案
function question() {
    return new Promise((resolve) => {
        const questionVal = getKey()['key'] + '/question/question_list.apiactivityCode=' + $.questionCode
        mx_api['ts'] = getKey()['ts']
        mx_api['check'] = hex_md5(questionVal)
        const url = {
            url: 'https://activity-api-mx.wandafilm.com/question/question_list.api',
            headers: {
                'MX-API': JSON.stringify(mx_api),
            },
            body: 'activityCode=' + $.questionCode
        }
        $.post(url, (err, resp, data) => {
            try {
                const res = JSON.parse(data)
                $.answer = res.data.questionList[0].movie.nameCN
            } catch (e) {
                $.logErr(e, resp)
            } finally {
                resolve()
            }
        })
    })
}

// 答题
function answer() {
    return new Promise((resolve) => {
        const answerVal = getKey()['key'] + '/question/qustion/answer.apiactivityCode=' + $.questionCode + '&answer=%7b%221%22%3a%22' + escape(`${$.answer}`).toLowerCase() + '%22%7d'
        mx_api['ts'] = getKey()['ts']
        mx_api['check'] = hex_md5(answerVal)
        const url = {
            url: 'https://activity-api-mx.wandafilm.com/question/qustion/answer.api',
            headers: {
                'MX-API': JSON.stringify(mx_api),
            },
            body: 'activityCode=' + $.questionCode + '&answer=%7B%221%22%3A%22' + encodeURI(`${$.answer}`) + '%22%7D'
        }
        $.post(url, (err, resp, data) => {
            try {
                $.answer = JSON.parse(data)
            } catch (e) {
                $.logErr(e, resp)
            } finally {
                resolve()
            }
        })
    })
}

// 答题后抽奖
function drawprize_ans() {
    return new Promise((resolve) => {
        const drawprizeVal = getKey()['key'] + '/question/prize/lottery.apiactivityCode=' + $.questionCode
        mx_api['ts'] = getKey()['ts']
        mx_api['check'] = hex_md5(drawprizeVal)
        const url = {
            url: 'https://activity-api-mx.wandafilm.com/question/prize/lottery.api',
            headers: {
                'MX-API': JSON.stringify(mx_api),
            },
            body: 'activityCode=' + $.questionCode
        }
        $.post(url, (err, resp, data) => {
            try {
                const res = JSON.parse(data)
                $.desc.push(`答题抽奖:${res.data.prize.prizeName}`)
            } catch (e) {
                $.logErr(e, resp)
            } finally {
                resolve()
            }
        })
    })
}

function showmsg() {
    return new Promise((resolve) => {
        $.subt = `签到:${$.sign.code == 1 ? `成功` : $.sign.msg}`

        if ($.signRecord.code == 1) {
            const totalMedal = $.signRecord.data.totalMedal
            const remainMedal = $.signRecord.data.remainMedal
            $.desc.push(`总计获得${totalMedal}能量,剩余可用${remainMedal}能量`)
        }
        $.subt += ` 答题详情:${$.answer.code == 1 ? `答案:${$.answer.data.answer},获得:${$.answer.data.remainChance}次抽奖` : $.answer.msg}`
        $.lottery ? $.desc.push(`签到抽奖:${$.lottery.data.prize.prizeName}`) : ``
        $.msg($.name, $.subt, $.desc.join('\n'))
        resolve()
    })
}

function tTime(timestamp) {
    const date = new Date(timestamp)
    const Y = date.getFullYear() + '-'
    const M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
    const D = (date.getDate() + 1 < 10 ? '0' + date.getDate() : date.getDate())
    return Y + M + D
}

function hex_md5(r) {
    return rstr2hex(rstr_md5(str2rstr_utf8(r)))
}

function b64_md5(r) {
    return rstr2b64(rstr_md5(str2rstr_utf8(r)))
}

function any_md5(r, t) {
    return rstr2any(rstr_md5(str2rstr_utf8(r)), t)
}

function hex_hmac_md5(r, t) {
    return rstr2hex(rstr_hmac_md5(str2rstr_utf8(r), str2rstr_utf8(t)))
}

function b64_hmac_md5(r, t) {
    return rstr2b64(rstr_hmac_md5(str2rstr_utf8(r), str2rstr_utf8(t)))
}

function any_hmac_md5(r, t, d) {
    return rstr2any(rstr_hmac_md5(str2rstr_utf8(r), str2rstr_utf8(t)), d)
}

function md5_vm_test() {
    return "900150983cd24fb0d6963f7d28e17f72" == hex_md5("abc").toLowerCase()
}

function rstr_md5(r) {
    return binl2rstr(binl_md5(rstr2binl(r), 8 * r.length))
}

function rstr_hmac_md5(r, t) {
    var d = rstr2binl(r);
    d.length > 16 && (d = binl_md5(d, 8 * r.length));
    for (var n = Array(16), _ = Array(16), m = 0; m < 16; m++) n[m] = 909522486 ^ d[m], _[m] = 1549556828 ^ d[m];
    var f = binl_md5(n.concat(rstr2binl(t)), 512 + 8 * t.length);
    return binl2rstr(binl_md5(_.concat(f), 640))
}

function rstr2hex(r) {
    for (var t, d = hexcase ? "0123456789ABCDEF" : "0123456789abcdef", n = "", _ = 0; _ < r.length; _++) t = r.charCodeAt(_), n += d.charAt(t >>> 4 & 15) + d.charAt(15 & t);
    return n
}

function rstr2b64(r) {
    for (var t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d = "", n = r.length, _ = 0; _ < n; _ += 3) for (var m = r.charCodeAt(_) << 16 | (_ + 1 < n ? r.charCodeAt(_ + 1) << 8 : 0) | (_ + 2 < n ? r.charCodeAt(_ + 2) : 0), f = 0; f < 4; f++) 8 * _ + 6 * f > 8 * r.length ? d += b64pad : d += t.charAt(m >>> 6 * (3 - f) & 63);
    return d
}

function rstr2any(r, t) {
    var d, n, _, m, f, h = t.length, e = Array(Math.ceil(r.length / 2));
    for (d = 0; d < e.length; d++) e[d] = r.charCodeAt(2 * d) << 8 | r.charCodeAt(2 * d + 1);
    var a = Math.ceil(8 * r.length / (Math.log(t.length) / Math.log(2))), i = Array(a);
    for (n = 0; n < a; n++) {
        for (f = Array(), m = 0, d = 0; d < e.length; d++) m = (m << 16) + e[d], _ = Math.floor(m / h), m -= _ * h, (f.length > 0 || _ > 0) && (f[f.length] = _);
        i[n] = m, e = f
    }
    var o = "";
    for (d = i.length - 1; d >= 0; d--) o += t.charAt(i[d]);
    return o
}

function str2rstr_utf8(r) {
    for (var t, d, n = "", _ = -1; ++_ < r.length;) t = r.charCodeAt(_), d = _ + 1 < r.length ? r.charCodeAt(_ + 1) : 0, 55296 <= t && t <= 56319 && 56320 <= d && d <= 57343 && (t = 65536 + ((1023 & t) << 10) + (1023 & d), _++), t <= 127 ? n += String.fromCharCode(t) : t <= 2047 ? n += String.fromCharCode(192 | t >>> 6 & 31, 128 | 63 & t) : t <= 65535 ? n += String.fromCharCode(224 | t >>> 12 & 15, 128 | t >>> 6 & 63, 128 | 63 & t) : t <= 2097151 && (n += String.fromCharCode(240 | t >>> 18 & 7, 128 | t >>> 12 & 63, 128 | t >>> 6 & 63, 128 | 63 & t));
    return n
}

function str2rstr_utf16le(r) {
    for (var t = "", d = 0; d < r.length; d++) t += String.fromCharCode(255 & r.charCodeAt(d), r.charCodeAt(d) >>> 8 & 255);
    return t
}

function str2rstr_utf16be(r) {
    for (var t = "", d = 0; d < r.length; d++) t += String.fromCharCode(r.charCodeAt(d) >>> 8 & 255, 255 & r.charCodeAt(d));
    return t
}

function rstr2binl(r) {
    for (var t = Array(r.length >> 2), d = 0; d < t.length; d++) t[d] = 0;
    for (d = 0; d < 8 * r.length; d += 8) t[d >> 5] |= (255 & r.charCodeAt(d / 8)) << d % 32;
    return t
}

function binl2rstr(r) {
    for (var t = "", d = 0; d < 32 * r.length; d += 8) t += String.fromCharCode(r[d >> 5] >>> d % 32 & 255);
    return t
}

function binl_md5(r, t) {
    r[t >> 5] |= 128 << t % 32, r[14 + (t + 64 >>> 9 << 4)] = t;
    for (var d = 1732584193, n = -271733879, _ = -1732584194, m = 271733878, f = 0; f < r.length; f += 16) {
        var h = d, e = n, a = _, i = m;
        d = md5_ff(d, n, _, m, r[f + 0], 7, -680876936), m = md5_ff(m, d, n, _, r[f + 1], 12, -389564586), _ = md5_ff(_, m, d, n, r[f + 2], 17, 606105819), n = md5_ff(n, _, m, d, r[f + 3], 22, -1044525330), d = md5_ff(d, n, _, m, r[f + 4], 7, -176418897), m = md5_ff(m, d, n, _, r[f + 5], 12, 1200080426), _ = md5_ff(_, m, d, n, r[f + 6], 17, -1473231341), n = md5_ff(n, _, m, d, r[f + 7], 22, -45705983), d = md5_ff(d, n, _, m, r[f + 8], 7, 1770035416), m = md5_ff(m, d, n, _, r[f + 9], 12, -1958414417), _ = md5_ff(_, m, d, n, r[f + 10], 17, -42063), n = md5_ff(n, _, m, d, r[f + 11], 22, -1990404162), d = md5_ff(d, n, _, m, r[f + 12], 7, 1804603682), m = md5_ff(m, d, n, _, r[f + 13], 12, -40341101), _ = md5_ff(_, m, d, n, r[f + 14], 17, -1502002290), n = md5_ff(n, _, m, d, r[f + 15], 22, 1236535329), d = md5_gg(d, n, _, m, r[f + 1], 5, -165796510), m = md5_gg(m, d, n, _, r[f + 6], 9, -1069501632), _ = md5_gg(_, m, d, n, r[f + 11], 14, 643717713), n = md5_gg(n, _, m, d, r[f + 0], 20, -373897302), d = md5_gg(d, n, _, m, r[f + 5], 5, -701558691), m = md5_gg(m, d, n, _, r[f + 10], 9, 38016083), _ = md5_gg(_, m, d, n, r[f + 15], 14, -660478335), n = md5_gg(n, _, m, d, r[f + 4], 20, -405537848), d = md5_gg(d, n, _, m, r[f + 9], 5, 568446438), m = md5_gg(m, d, n, _, r[f + 14], 9, -1019803690), _ = md5_gg(_, m, d, n, r[f + 3], 14, -187363961), n = md5_gg(n, _, m, d, r[f + 8], 20, 1163531501), d = md5_gg(d, n, _, m, r[f + 13], 5, -1444681467), m = md5_gg(m, d, n, _, r[f + 2], 9, -51403784), _ = md5_gg(_, m, d, n, r[f + 7], 14, 1735328473), n = md5_gg(n, _, m, d, r[f + 12], 20, -1926607734), d = md5_hh(d, n, _, m, r[f + 5], 4, -378558), m = md5_hh(m, d, n, _, r[f + 8], 11, -2022574463), _ = md5_hh(_, m, d, n, r[f + 11], 16, 1839030562), n = md5_hh(n, _, m, d, r[f + 14], 23, -35309556), d = md5_hh(d, n, _, m, r[f + 1], 4, -1530992060), m = md5_hh(m, d, n, _, r[f + 4], 11, 1272893353), _ = md5_hh(_, m, d, n, r[f + 7], 16, -155497632), n = md5_hh(n, _, m, d, r[f + 10], 23, -1094730640), d = md5_hh(d, n, _, m, r[f + 13], 4, 681279174), m = md5_hh(m, d, n, _, r[f + 0], 11, -358537222), _ = md5_hh(_, m, d, n, r[f + 3], 16, -722521979), n = md5_hh(n, _, m, d, r[f + 6], 23, 76029189), d = md5_hh(d, n, _, m, r[f + 9], 4, -640364487), m = md5_hh(m, d, n, _, r[f + 12], 11, -421815835), _ = md5_hh(_, m, d, n, r[f + 15], 16, 530742520), n = md5_hh(n, _, m, d, r[f + 2], 23, -995338651), d = md5_ii(d, n, _, m, r[f + 0], 6, -198630844), m = md5_ii(m, d, n, _, r[f + 7], 10, 1126891415), _ = md5_ii(_, m, d, n, r[f + 14], 15, -1416354905), n = md5_ii(n, _, m, d, r[f + 5], 21, -57434055), d = md5_ii(d, n, _, m, r[f + 12], 6, 1700485571), m = md5_ii(m, d, n, _, r[f + 3], 10, -1894986606), _ = md5_ii(_, m, d, n, r[f + 10], 15, -1051523), n = md5_ii(n, _, m, d, r[f + 1], 21, -2054922799), d = md5_ii(d, n, _, m, r[f + 8], 6, 1873313359), m = md5_ii(m, d, n, _, r[f + 15], 10, -30611744), _ = md5_ii(_, m, d, n, r[f + 6], 15, -1560198380), n = md5_ii(n, _, m, d, r[f + 13], 21, 1309151649), d = md5_ii(d, n, _, m, r[f + 4], 6, -145523070), m = md5_ii(m, d, n, _, r[f + 11], 10, -1120210379), _ = md5_ii(_, m, d, n, r[f + 2], 15, 718787259), n = md5_ii(n, _, m, d, r[f + 9], 21, -343485551), d = safe_add(d, h), n = safe_add(n, e), _ = safe_add(_, a), m = safe_add(m, i)
    }
    return Array(d, n, _, m)
}

function md5_cmn(r, t, d, n, _, m) {
    return safe_add(bit_rol(safe_add(safe_add(t, r), safe_add(n, m)), _), d)
}

function md5_ff(r, t, d, n, _, m, f) {
    return md5_cmn(t & d | ~t & n, r, t, _, m, f)
}

function md5_gg(r, t, d, n, _, m, f) {
    return md5_cmn(t & n | d & ~n, r, t, _, m, f)
}

function md5_hh(r, t, d, n, _, m, f) {
    return md5_cmn(t ^ d ^ n, r, t, _, m, f)
}

function md5_ii(r, t, d, n, _, m, f) {
    return md5_cmn(d ^ (t | ~n), r, t, _, m, f)
}

function safe_add(r, t) {
    var d = (65535 & r) + (65535 & t), n = (r >> 16) + (t >> 16) + (d >> 16);
    return n << 16 | 65535 & d
}

function bit_rol(r, t) {
    return r << t | r >>> 32 - t
}

var hexcase = 0, b64pad = "";

// prettier-ignore
function Env(t, s) {
    return new class {
        constructor(t, s) {
            this.name = t, this.data = null, this.dataFile = "box.dat", this.logs = [], this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, s), this.log("", `\ud83d\udd14${this.name}, \u5f00\u59cb!`)
        }

        isNode() {
            return "undefined" != typeof module && !!module.exports
        }

        isQuanX() {
            return "undefined" != typeof $task
        }

        isSurge() {
            return "undefined" != typeof $httpClient
        }

        isLoon() {
            return "undefined" != typeof $loon
        }

        loaddata() {
            if (!this.isNode) return {};
            {
                this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
                const t = this.path.resolve(this.dataFile), s = this.path.resolve(process.cwd(), this.dataFile),
                    e = this.fs.existsSync(t), i = !e && this.fs.existsSync(s);
                if (!e && !i) return {};
                {
                    const i = e ? t : s;
                    try {
                        return JSON.parse(this.fs.readFileSync(i))
                    } catch {
                        return {}
                    }
                }
            }
        }

        writedata() {
            if (this.isNode) {
                this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path");
                const t = this.path.resolve(this.dataFile), s = this.path.resolve(process.cwd(), this.dataFile),
                    e = this.fs.existsSync(t), i = !e && this.fs.existsSync(s), o = JSON.stringify(this.data);
                e ? this.fs.writeFileSync(t, o) : i ? this.fs.writeFileSync(s, o) : this.fs.writeFileSync(t, o)
            }
        }

        lodash_get(t, s, e) {
            const i = s.replace(/\[(\d+)\]/g, ".$1").split(".");
            let o = t;
            for (const t of i) if (o = Object(o)[t], void 0 === o) return e;
            return o
        }

        lodash_set(t, s, e) {
            return Object(t) !== t ? t : (Array.isArray(s) || (s = s.toString().match(/[^.[\]]+/g) || []), s.slice(0, -1).reduce((t, e, i) => Object(t[e]) === t[e] ? t[e] : t[e] = Math.abs(s[i + 1]) >> 0 == +s[i + 1] ? [] : {}, t)[s[s.length - 1]] = e, t)
        }

        getdata(t) {
            let s = this.getval(t);
            if (/^@/.test(t)) {
                const [, e, i] = /^@(.*?)\.(.*?)$/.exec(t), o = e ? this.getval(e) : "";
                if (o) try {
                    const t = JSON.parse(o);
                    s = t ? this.lodash_get(t, i, "") : s
                } catch (t) {
                    s = ""
                }
            }
            return s
        }

        setdata(t, s) {
            let e = !1;
            if (/^@/.test(s)) {
                const [, i, o] = /^@(.*?)\.(.*?)$/.exec(s), h = this.getval(i),
                    a = i ? "null" === h ? null : h || "{}" : "{}";
                try {
                    const s = JSON.parse(a);
                    this.lodash_set(s, o, t), e = this.setval(JSON.stringify(s), i), console.log(`${i}: ${JSON.stringify(s)}`)
                } catch {
                    const s = {};
                    this.lodash_set(s, o, t), e = this.setval(JSON.stringify(s), i), console.log(`${i}: ${JSON.stringify(s)}`)
                }
            } else e = $.setval(t, s);
            return e
        }

        getval(t) {
            return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null
        }

        setval(t, s) {
            return this.isSurge() || this.isLoon() ? $persistentStore.write(t, s) : this.isQuanX() ? $prefs.setValueForKey(t, s) : this.isNode() ? (this.data = this.loaddata(), this.data[s] = t, this.writedata(), !0) : this.data && this.data[s] || null
        }

        initGotEnv(t) {
            this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar))
        }

        get(t, s = (() => {
        })) {
            t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? $httpClient.get(t, (t, e, i) => {
                !t && e && (e.body = i, e.statusCode = e.status, s(t, e, i))
            }) : this.isQuanX() ? $task.fetch(t).then(t => {
                const {statusCode: e, statusCode: i, headers: o, body: h} = t;
                s(null, {status: e, statusCode: i, headers: o, body: h}, h)
            }, t => s(t)) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, s) => {
                try {
                    const e = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString();
                    this.ckjar.setCookieSync(e, null), s.cookieJar = this.ckjar
                } catch (t) {
                    this.logErr(t)
                }
            }).then(t => {
                const {statusCode: e, statusCode: i, headers: o, body: h} = t;
                s(null, {status: e, statusCode: i, headers: o, body: h}, h)
            }, t => s(t)))
        }

        post(t, s = (() => {
        })) {
            if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) $httpClient.post(t, (t, e, i) => {
                !t && e && (e.body = i, e.statusCode = e.status, s(t, e, i))
            }); else if (this.isQuanX()) t.method = "POST", $task.fetch(t).then(t => {
                const {statusCode: e, statusCode: i, headers: o, body: h} = t;
                s(null, {status: e, statusCode: i, headers: o, body: h}, h)
            }, t => s(t)); else if (this.isNode()) {
                this.initGotEnv(t);
                const {url: e, ...i} = t;
                this.got.post(e, i).then(t => {
                    const {statusCode: e, statusCode: i, headers: o, body: h} = t;
                    s(null, {status: e, statusCode: i, headers: o, body: h}, h)
                }, t => s(t))
            }
        }

        msg(s = t, e = "", i = "", o) {
            this.isSurge() || this.isLoon() ? $notification.post(s, e, i) : this.isQuanX() && $notify(s, e, i), this.logs.push("", "==============\ud83d\udce3\u7cfb\u7edf\u901a\u77e5\ud83d\udce3=============="), this.logs.push(s), e && this.logs.push(e), i && this.logs.push(i)
        }

        log(...t) {
            t.length > 0 ? this.logs = [...this.logs, ...t] : console.log(this.logs.join(this.logSeparator))
        }

        logErr(t, s) {
            const e = !this.isSurge() && !this.isQuanX() && !this.isLoon();
            e ? $.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.stack) : $.log("", `\u2757\ufe0f${this.name}, \u9519\u8bef!`, t.message)
        }

        wait(t) {
            return new Promise(s => setTimeout(s, t))
        }

        done(t = null) {
            const s = (new Date).getTime(), e = (s - this.startTime) / 1e3;
            this.log("", `\ud83d\udd14${this.name}, \u7ed3\u675f! \ud83d\udd5b ${e} \u79d2`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t)
        }
    }(t, s)
}
