/*! ThunderX BY LUOCHENZHIMU */
/*! Last updated on 2018/12/17 */
/*! https://www.luochenzhimu.com */
module.exports = function (e) {
    var t = {};

    function n(i) {
        if (t[i]) return t[i].exports;
        var a = t[i] = {i, l: !1, exports: {}};
        return e[i].call(a.exports, a, a.exports, n), a.l = !0, a.exports
    }

    return n.m = e, n.c = t, n.d = function (e, t, i) {
        n.o(e, t) || Object.defineProperty(e, t, {enumerable: !0, get: i})
    }, n.r = function (e) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
    }, n.t = function (e, t) {
        if (1 & t && (e = n(e)), 8 & t) return e;
        if (4 & t && "object" == typeof e && e && e.__esModule) return e;
        var i = Object.create(null);
        if (n.r(i), Object.defineProperty(i, "default", {
            enumerable: !0,
            value: e
        }), 2 & t && "string" != typeof e) for (var a in e) n.d(i, a, function (t) {
            return e[t]
        }.bind(null, a));
        return i
    }, n.n = function (e) {
        var t = e && e.__esModule ? function () {
            return e.default
        } : function () {
            return e
        };
        return n.d(t, "a", t), t
    }, n.o = function (e, t) {
        return Object.prototype.hasOwnProperty.call(e, t)
    }, n.p = "", n(n.s = 750)
}([function (e, t, n) {
    "use strict";

    function i(e, t, n, i, a, o, r, s) {
        var l, u = "function" == typeof e ? e.options : e;
        if (t && (u.render = t, u.staticRenderFns = n, u._compiled = !0), i && (u.functional = !0), o && (u._scopeId = "data-v-" + o), r ? (l = function (e) {
            (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), a && a.call(this, e), e && e._registeredComponents && e._registeredComponents.add(r)
        }, u._ssrRegister = l) : a && (l = s ? function () {
            a.call(this, this.$root.$options.shadowRoot)
        } : a), l) if (u.functional) {
            u._injectStyles = l;
            var d = u.render;
            u.render = function (e, t) {
                return l.call(t), d(e, t)
            }
        } else {
            var c = u.beforeCreate;
            u.beforeCreate = c ? [].concat(c, l) : [l]
        }
        return {exports: e, options: u}
    }

    n.d(t, "a", function () {
        return i
    })
}, function (e, t, n) {
    e.exports = n(12)(64)
}, function (e, t) {
    e.exports = require("path")
}, function (e, t) {
    e.exports = require("electron")
}, function (e, t, n) {
    e.exports = n(12)(127)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.default = function (e) {
        return require(e)
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(7), a = n(18), o = n(19), r = n(24), s = n(25);
    !function (e) {
        let t;
        !function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.Success = 0] = "Success", e[e.FunctionNotExist = 1] = "FunctionNotExist", e[e.ParamaterError = 2] = "ParamaterError", e[e.CallFailed = 3] = "CallFailed"
        }(t = e.NativeCallErrorCode || (e.NativeCallErrorCode = {}));

        class n {
            constructor(e, t, n) {
                this.maxId = e, this.minId = t, this.invalidId = n
            }

            generateId() {
                return this.minId === this.maxId ? this.invalidId : this.minId++
            }

            isInvalidId(e) {
                return e === this.invalidId
            }
        }

        e.IdGenerator = n;
        const l = 0;
        e.idGenerator = new n(1e7, 1, l);

        class u {
            constructor() {
                this.jsCallbacks = new Map, this.eventJsCallbakcs = new Map, this.jsRegisterFunctions = new Map, this.targetCommunitorInfo = s.CommonIPCRenderer.rendererCommunicator.getCommunicatorInfoByContext(r.CommonIPCBase.mainRendererContext), this.bindMsgListeners(), this.notifyNativeCallReady()
            }

            CallNativeFunction(t, ...n) {
                do {
                    if (i.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("funcName is empty");
                        break
                    }
                    a.information("funcName = ", t), this.printArgs(n);
                    let r = l;
                    for (let t = 0; t < n.length; ++t) if (i.isFunction(n[t])) {
                        let i = e.idGenerator.generateId(), a = n[t];
                        this.jsCallbacks.set(i, a), t === n.length - 1 ? (r = i, n.pop()) : n[t] = i
                    }
                    s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                        name: o.CommonIPCMessage.msgNCCallNativeFunction,
                        args: [t, r].concat(n)
                    })
                } while (0)
            }

            AttachNativeEvent(t, n) {
                let o = void 0;
                do {
                    if (i.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("eventName is empty");
                        break
                    }
                    if (i.isNullOrUndefined(n)) {
                        a.error("callback is empty");
                        break
                    }
                    let r = e.idGenerator.generateId();
                    if (e.idGenerator.isInvalidId(r)) {
                        a.error("id error");
                        break
                    }
                    if (this.eventJsCallbakcs.has(t)) this.eventJsCallbakcs.get(t).set(r, n); else {
                        let e = new Map;
                        e.set(r, n), this.eventJsCallbakcs.set(t, e)
                    }
                    o = r
                } while (0);
                return o
            }

            DetachNativeEvent(e, t) {
                do {
                    if (i.isNullOrUndefined(e) || 0 === e.length) {
                        a.error("eventName is empty");
                        break
                    }
                    if (i.isNullOrUndefined(t)) {
                        a.error("callback is empty");
                        break
                    }
                    if (!this.eventJsCallbakcs.has(e)) {
                        a.error(`event: ${e} doesnot have listener`);
                        break
                    }
                    if (!this.eventJsCallbakcs.get(e).has(t)) {
                        a.error(`event: ${e} doesnot have the listener of id=${t}`);
                        break
                    }
                    this.eventJsCallbakcs.get(e).delete(t)
                } while (0)
            }

            CheckNativeFunction(t, n) {
                do {
                    if (i.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("funcName is empty");
                        break
                    }
                    if (i.isNullOrUndefined(n)) {
                        a.error("callback is empty");
                        break
                    }
                    a.information("funcName = ", t);
                    let r = e.idGenerator.generateId();
                    this.jsCallbacks.set(r, n), s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                        name: o.CommonIPCMessage.msgNCCheckNativeFunction,
                        args: [t, r]
                    })
                } while (0)
            }

            RegisterJSFunction(e, n) {
                let o = t.ParamaterError;
                do {
                    if (i.isNullOrUndefined(e) || 0 === e.length) {
                        a.error("funcName is empty");
                        break
                    }
                    if (i.isNullOrUndefined(n)) {
                        a.error("jsFunc is empty");
                        break
                    }
                    this.jsRegisterFunctions.set(e, n), o = t.Success
                } while (0);
                return o
            }

            bindMsgListeners() {
                s.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCallJsFunctionById, e => {
                    this.handleCallJsFunctionById(e.msg.args)
                }), s.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCallJsFunctionByName, e => {
                    this.handleCallJsFunctionByName(e.msg.args)
                }), s.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCNativeFireEvent, e => {
                    this.handleNativeFireEvent(e.msg.args)
                })
            }

            handleCallJsFunctionById(t) {
                do {
                    let n = t[0];
                    if (!i.isNumber(n)) {
                        a.error(`id error id = ${n}`);
                        break
                    }
                    if (e.idGenerator.isInvalidId(n)) {
                        a.error(`id = ${n} invalid`);
                        break
                    }
                    if (!this.jsCallbacks.has(n)) {
                        a.error(`jsCallbacks[${n}] is null`);
                        break
                    }
                    t.splice(0, 1), this.jsCallbacks.get(n).apply(null, t)
                } while (0)
            }

            handleCallJsFunctionByName(e) {
                do {
                    let t = e[0];
                    if (!i.isString(t)) {
                        a.error(`funcName error funcName = ${t}`);
                        break
                    }
                    if (!this.jsRegisterFunctions.has(t)) {
                        a.error(`jsRegisterFunctions[${t}] is null`);
                        break
                    }
                    e.splice(0, 1), this.jsRegisterFunctions.get(t).apply(null, e)
                } while (0)
            }

            handleNativeFireEvent(e) {
                do {
                    let t = e[0];
                    if (!i.isString(t)) {
                        a.warning(`eventName error eventName = ${t}`);
                        break
                    }
                    if (!this.eventJsCallbakcs.has(t)) {
                        a.warning(`eventJsCallbakcs[${t}] is null`);
                        break
                    }
                    e.shift(), this.eventJsCallbakcs.get(t).forEach((t, n, o) => {
                        a.information(`value = ${t}, key = ${n}, map = ${o}`), i.isNullOrUndefined(t) || t.apply(null, e)
                    })
                } while (0)
            }

            notifyNativeCallReady() {
                s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                    name: o.CommonIPCMessage.msgNCNativeCallReady,
                    args: [s.CommonIPCRenderer.rendererCommunicator.getCommunicatorInfo()]
                })
            }

            printArgs(e) {
                for (let t in e) a.information(`index ${t} = `, e[t])
            }
        }

        e.NativeCallImpl = u, e.nativeCall = new u
    }(t.NativeCallModule || (t.NativeCallModule = {}))
}, function (e, t) {
    e.exports = require("util")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, n, i, a, o, r, s, l, u, d, c, h, f, p, g, k, m, T;
        !function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Create = 1] = "Create", e[e.InvaldParam = 2] = "InvaldParam", e[e.InvaldLink = 3] = "InvaldLink", e[e.InvaldConfig = 4] = "InvaldConfig", e[e.Timeout = 5] = "Timeout", e[e.VerifyData = 6] = "VerifyData", e[e.Forbidden = 7] = "Forbidden", e[e.RangeDispatch = 8] = "RangeDispatch", e[e.FilePathOverRanging = 9] = "FilePathOverRanging", e[e.FileCreate = 201] = "FileCreate", e[e.FileWrite = 202] = "FileWrite", e[e.FileRead = 203] = "FileRead", e[e.FileRename = 204] = "FileRename", e[e.FileFull = 205] = "FileFull", e[e.BtUploadExist = 601] = "BtUploadExist", e[e.ForbinddenResource = 701] = "ForbinddenResource", e[e.ForbinddenAccount = 702] = "ForbinddenAccount", e[e.ForbinddenArea = 703] = "ForbinddenArea", e[e.ForbinddenCopyright = 704] = "ForbinddenCopyright", e[e.ForbinddenReaction = 705] = "ForbinddenReaction", e[e.ForbinddenPorn = 706] = "ForbinddenPorn"
        }(t = e.TaskError || (e.TaskError = {})), function (e) {
            e[e.Unkown = -1] = "Unkown", e[e.Success = 0] = "Success", e[e.QueryFailed = 1] = "QueryFailed", e[e.ServerError = 2] = "ServerError", e[e.ResourceNotFound = 3] = "ResourceNotFound", e[e.AuthorizingFailed = 4] = "AuthorizingFailed", e[e.ForbidByCopyright = 5] = "ForbidByCopyright", e[e.ForbidByPorNoGraphy = 6] = "ForbidByPorNoGraphy", e[e.ForbidByReactionary = 7] = "ForbidByReactionary", e[e.ForbidByOtherFilter = 8] = "ForbidByOtherFilter"
        }(n = e.DcdnStatusCode || (e.DcdnStatusCode = {})), function (e) {
            e[e.Begin = -1] = "Begin", e[e.Unkown = 0] = "Unkown", e[e.StandBy = 1] = "StandBy", e[e.PreDownloading = 2] = "PreDownloading", e[e.StartWaiting = 3] = "StartWaiting", e[e.StartPending = 4] = "StartPending", e[e.Started = 5] = "Started", e[e.StopPending = 6] = "StopPending", e[e.Stopped = 7] = "Stopped", e[e.Succeeded = 8] = "Succeeded", e[e.Failed = 9] = "Failed", e[e.Seeding = 10] = "Seeding", e[e.DestroyPending = 11] = "DestroyPending", e[e.End = 12] = "End"
        }(i = e.TaskStatus || (e.TaskStatus = {})), function (e) {
            e[e.Begin = -1] = "Begin", e[e.StandBy = 0] = "StandBy", e[e.Stopped = 1] = "Stopped", e[e.Started = 2] = "Started", e[e.Complete = 3] = "Complete", e[e.Forbidden = 4] = "Forbidden", e[e.Error = 5] = "Error", e[e.End = 6] = "End"
        }(a = e.BtFileStatus || (e.BtFileStatus = {})), function (e) {
            e[e.DispatchStrategyNone = 0] = "DispatchStrategyNone", e[e.DispatchStrategyOrigin = 1] = "DispatchStrategyOrigin", e[e.DispatchStrategyP2s = 2] = "DispatchStrategyP2s", e[e.DispatchStrategyP2p = 4] = "DispatchStrategyP2p", e[e.DispatchStrategyAll = -1] = "DispatchStrategyAll"
        }(o = e.DispatchStrategy || (e.DispatchStrategy = {})), function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.P2sp = 1] = "P2sp", e[e.Bt = 2] = "Bt", e[e.Emule = 3] = "Emule", e[e.Group = 4] = "Group", e[e.Magnet = 5] = "Magnet"
        }(r = e.TaskType || (e.TaskType = {})), function (e) {
            e.Unkown = "Unkown", e.Downloading = "Downloading", e.Completed = "Completed", e.Recycle = "Recycle"
        }(s = e.CategroyViewID || (e.CategroyViewID = {})), function (e) {
            e[e.Unknow = 0] = "Unknow", e[e.TaskCreated = 1] = "TaskCreated", e[e.InsertToCategoryView = 2] = "InsertToCategoryView", e[e.RemoveFromCategoryView = 3] = "RemoveFromCategoryView", e[e.StatusChanged = 4] = "StatusChanged", e[e.DetailChanged = 5] = "DetailChanged", e[e.ChannelInfoChanged = 6] = "ChannelInfoChanged", e[e.DcdnStatusChanged = 7] = "DcdnStatusChanged", e[e.TaskDescriptionChanged = 8] = "TaskDescriptionChanged", e[e.TaskUserRead = 9] = "TaskUserRead", e[e.TaskRenamed = 10] = "TaskRenamed", e[e.TaskMovedEnd = 11] = "TaskMovedEnd", e[e.BtSubFileDetailChanged = 12] = "BtSubFileDetailChanged", e[e.BtSubFileForbidden = 13] = "BtSubFileForbidden", e[e.BtSubFileDcdnStatusChanged = 14] = "BtSubFileDcdnStatusChanged", e[e.TaskCategoryMovedEnd = 15] = "TaskCategoryMovedEnd", e[e.GroupTaskSubFileDetailChanged = 16] = "GroupTaskSubFileDetailChanged", e[e.TaskDestroying = 17] = "TaskDestroying", e[e.TaskDestroyed = 18] = "TaskDestroyed"
        }(l = e.TaskEventType || (e.TaskEventType = {})), function (e) {
            e[e.NumberStrart = 0] = "NumberStrart", e[e.TaskId = 1] = "TaskId", e[e.VirtualId = 2] = "VirtualId", e[e.SrcTotal = 3] = "SrcTotal", e[e.SrcUsing = 4] = "SrcUsing", e[e.FileSize = 5] = "FileSize", e[e.ReceivedSize = 6] = "ReceivedSize", e[e.DownloadSize = 7] = "DownloadSize", e[e.CreateTime = 8] = "CreateTime", e[e.CompletionTime = 9] = "CompletionTime", e[e.DownloadingPeriod = 10] = "DownloadingPeriod", e[e.Progress = 11] = "Progress", e[e.RecycleTime = 12] = "RecycleTime", e[e.FileCreated = 13] = "FileCreated", e[e.Forbidden = 14] = "Forbidden", e[e.CategoryId = 15] = "CategoryId", e[e.UserRead = 16] = "UserRead", e[e.OpenOnComplete = 17] = "OpenOnComplete", e[e.GroupTaskId = 18] = "GroupTaskId", e[e.DownloadSubTask = 19] = "DownloadSubTask", e[e.NameType = 20] = "NameType", e[e.OwnerProduct = 21] = "OwnerProduct", e[e.FileIndex = 22] = "FileIndex", e[e.NumberEnd = 23] = "NumberEnd", e[e.BooleanStart = 24] = "BooleanStart", e[e.Destroyed = 25] = "Destroyed", e[e.Background = 26] = "Background", e[e.BooleanEnd = 27] = "BooleanEnd", e[e.StringStart = 28] = "StringStart", e[e.TaskName = 29] = "TaskName", e[e.SavePath = 30] = "SavePath", e[e.RelativePath = 31] = "RelativePath", e[e.TaskUrl = 32] = "TaskUrl", e[e.RefUrl = 33] = "RefUrl", e[e.Cid = 34] = "Cid", e[e.Gcid = 35] = "Gcid", e[e.Cookie = 36] = "Cookie", e[e.ProductInfo = 37] = "ProductInfo", e[e.Origin = 38] = "Origin", e[e.Description = 39] = "Description", e[e.UserData = 40] = "UserData", e[e.StringEnd = 41] = "StringEnd", e[e.ObjectStart = 42] = "ObjectStart", e[e.ObjectEnd = 43] = "ObjectEnd", e[e.CategoryViewId = 44] = "CategoryViewId", e[e.TaskType = 45] = "TaskType", e[e.ErrorCode = 46] = "ErrorCode"
        }(u = e.TaskAttribute || (e.TaskAttribute = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown", e[e.SrcTotal = 1] = "SrcTotal", e[e.SrcUsing = 2] = "SrcUsing", e[e.FileSize = 4] = "FileSize", e[e.ReceivedSize = 8] = "ReceivedSize", e[e.DownloadSize = 16] = "DownloadSize", e[e.CompletionTime = 32] = "CompletionTime", e[e.DownloadingPeriod = 64] = "DownloadingPeriod", e[e.Progress = 128] = "Progress", e[e.RecycleTime = 256] = "RecycleTime", e[e.FileCreated = 512] = "FileCreated", e[e.Forbidden = 1024] = "Forbidden", e[e.UserRead = 2048] = "UserRead", e[e.OpenOnComplete = 4096] = "OpenOnComplete", e[e.DownloadSubTask = 8192] = "DownloadSubTask", e[e.TaskName = 16384] = "TaskName", e[e.SavePath = 32768] = "SavePath", e[e.Cid = 65536] = "Cid", e[e.Gcid = 131072] = "Gcid", e[e.UserData = 262144] = "UserData", e[e.CategoryViewId = 524288] = "CategoryViewId", e[e.ErrorCode = 1048576] = "ErrorCode", e[e.TaskSpeed = 2097152] = "TaskSpeed", e[e.ChannelInfo = 4194304] = "ChannelInfo"
        }(d = e.TaskDetailChangedFlags || (e.TaskDetailChangedFlags = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown"
        }(c = e.BtSubFileDetailChangedFlags || (e.BtSubFileDetailChangedFlags = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown"
        }(h = e.GroupTaskSubFileDetailChangedFlags || (e.GroupTaskSubFileDetailChangedFlags = {})), function (e) {
            e[e.NumberStrart = 0] = "NumberStrart", e[e.TaskId = 1] = "TaskId", e[e.FileStatus = 2] = "FileStatus", e[e.DownloadSize = 3] = "DownloadSize", e[e.FileSize = 4] = "FileSize", e[e.EnableDcdn = 5] = "EnableDcdn", e[e.ErrorCode = 6] = "ErrorCode", e[e.DcdnStatus = 7] = "DcdnStatus", e[e.RealIndex = 8] = "RealIndex", e[e.FileOffset = 9] = "FileOffset", e[e.Visible = 10] = "Visible", e[e.Download = 11] = "Download", e[e.NumberEnd = 12] = "NumberEnd", e[e.StringStart = 13] = "StringStart", e[e.FinalName = 14] = "FinalName", e[e.RelativePath = 15] = "RelativePath", e[e.FileName = 16] = "FileName", e[e.FilePath = 17] = "FilePath", e[e.Cid = 18] = "Cid", e[e.Gcid = 19] = "Gcid", e[e.StringEnd = 20] = "StringEnd"
        }(f = e.BtFileAttribute || (e.BtFileAttribute = {})), function (e) {
            e[e.P2spUrl = 0] = "P2spUrl", e[e.BtInfoId = 1] = "BtInfoId", e[e.EmuleFileHash = 2] = "EmuleFileHash", e[e.MagnetUrl = 3] = "MagnetUrl", e[e.GroupTaskName = 4] = "GroupTaskName"
        }(p = e.KeyType || (e.KeyType = {})), function (e) {
            e[e.NameInclude = 1] = "NameInclude", e[e.BtDisplayNameInclude = 2] = "BtDisplayNameInclude"
        }(g = e.SearchKeyType || (e.SearchKeyType = {})), function (e) {
            e[e.All = 0] = "All", e[e.CommonForeground = 1] = "CommonForeground", e[e.CommonBackground = 2] = "CommonBackground", e[e.Temporary = 3] = "Temporary", e[e.PreDownload = 4] = "PreDownload", e[e.PrivateForeground = 5] = "PrivateForeground"
        }(k = e.KeyFilter || (e.KeyFilter = {})), function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.LoadTaskBasic = 0] = "LoadTaskBasic", e[e.Create = 1] = "Create", e[e.Recycle = 2] = "Recycle", e[e.Recover = 3] = "Recover", e[e.ReDownload = 4] = "ReDownload", e[e.MoveThoughCategory = 5] = "MoveThoughCategory"
        }(m = e.TaskInsertReason || (e.TaskInsertReason = {})), function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.ContextMenu = 0] = "ContextMenu", e[e.Button = 1] = "Button", e[e.TaskDetail = 2] = "TaskDetail", e[e.DownloadMagnet = 3] = "DownloadMagnet", e[e.ToolbarButton = 4] = "ToolbarButton", e[e.SelectDownloadLists = 5] = "SelectDownloadLists", e[e.DeleteTask = 6] = "DeleteTask"
        }(T = e.TaskStopReason || (e.TaskStopReason = {}))
    }(t.DownloadKernel || (t.DownloadKernel = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(20), o = n(2), r = n(7).promisify, s = n(1).default.getLogger("Thunder.base.fs-utilities");
    !function (e) {
        function t(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const n = r(a.access);
                    try {
                        yield n(e), t = !0
                    } catch (e) {
                        s.information(e)
                    }
                }
                return t
            })
        }

        function l(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const n = r(a.mkdir);
                    try {
                        yield n(e), t = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function u(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const n = r(a.rmdir);
                    try {
                        yield n(e), t = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function d(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const n = r(a.unlink);
                    try {
                        yield n(e), t = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function c(e) {
            return i(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const n = r(a.readdir);
                    try {
                        t = yield n(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function h(e) {
            return i(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const n = r(a.lstat);
                    try {
                        t = yield n(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function f(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                if (void 0 !== e && void 0 !== t) {
                    let i = o.join(e, t), a = yield h(i);
                    n = null !== a && a.isDirectory() ? yield p(i) : yield d(i)
                }
                return n
            })
        }

        function p(e) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                if (void 0 !== e) {
                    if (yield t(e)) {
                        n = !0;
                        let t = yield c(e);
                        for (let i = 0; i < t.length; i++) n = (yield f(e, t[i])) && n;
                        (n || 0 === t.length) && (n = (yield u(e)) && n)
                    }
                }
                return n
            })
        }

        function g(e) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                return s.information("mkdirsAW", e), void 0 !== e && ((yield t(e)) ? n = !0 : o.dirname(e) === e ? n = !1 : (yield g(o.dirname(e))) && (n = yield l(e))), n
            })
        }

        function k(e, n) {
            return i(this, void 0, void 0, function* () {
                let i;
                if (e.toLowerCase() !== n.toLowerCase() && (yield t(e))) {
                    let t = a.createReadStream(e), o = a.createWriteStream(n);
                    i = new Promise(e => {
                        t.pipe(o).on("finish", () => {
                            e(!0)
                        })
                    })
                } else i = new Promise(e => {
                    e(!1)
                });
                return i
            })
        }

        e.readFileAW = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const n = r(a.readFile);
                    try {
                        t = yield n(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }, e.writeFileAW = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                if (void 0 !== e && null !== t) {
                    const i = r(a.writeFile);
                    try {
                        yield i(e, t), n = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return n
            })
        }, e.existsAW = t, e.mkdirAW = l, e.rmdirAW = u, e.unlinkAW = d, e.readdirAW = c, e.lstatAW = h, e.rmdirsAW = p, e.mkdirsAW = g, e.renameAW = function (e, t) {
            return i(this, void 0, void 0, function* () {
                if (void 0 !== e && void 0 !== t) {
                    const n = r(a.rename);
                    try {
                        yield n(e, t)
                    } catch (e) {
                        s.warning(e)
                    }
                }
            })
        }, e.copyFileAW = k, e.copyDirsAW = function e(n, a) {
            return i(this, void 0, void 0, function* () {
                let i = !1, r = yield h(n);
                if (r.isDirectory()) {
                    i = yield g(a);
                    let s = yield c(n);
                    for (let l = 0; l < s.length; l++) {
                        let u = o.join(n, s[l]), d = o.join(a, s[l]);
                        (i = yield t(u)) && (i = (r = yield h(u)).isDirectory() ? yield e(u, d) : yield k(u, d))
                    }
                }
                return i
            })
        }, e.mkdtempAW = function () {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                const t = r(a.mkdtemp), i = (yield Promise.resolve().then(() => n(16))).tmpdir();
                try {
                    e = yield t(`${i}${o.sep}`)
                } catch (e) {
                    s.warning(e)
                }
                return e
            })
        }
    }(t.FileSystemAWNS || (t.FileSystemAWNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(1), s = n(9), l = n(17), u = r.default.getLogger("Thunder.Util"),
        d = "Thunder Network\\Thunder7.9\\";

    function c(e) {
        let t = e;
        return 0 === e.indexOf('"') && e.lastIndexOf('"') === e.length - 1 ? t = e.substring(1, e.length - 1) : 0 === e.indexOf("'") && e.lastIndexOf("'") === e.length - 1 && (t = e.substring(1, e.length - 1)), t
    }

    !function (e) {
        function t() {
            let e = l.ThunderHelper.getSystemTempPath(), t = l.ThunderHelper.getLogicalDriveStrings(), n = 0;
            for (let i = 0; i < t.length; i++) {
                let a = l.ThunderHelper.getDriveInfo(t[i]);
                3 === a.type && n < a.freeBytes && t[i] !== e && (n = a.freeBytes, e = t[i])
            }
            return e.substring(0, 1) + ":\\迅雷下载"
        }

        e.formatSize = function (e, t) {
            t = t || 2;
            let n = "0B";
            if ("number" == typeof e && e > 0) {
                let i = ["B", "KB", "MB", "GB", "TB"], a = 0, o = e;
                for (; o >= 1e3 && !(a >= 4);) o /= 1024, a += 1;
                n = -1 === String(o).indexOf(".") ? o + i[a] : o.toFixed(t) + i[a]
            }
            return n
        }, e.isDigital = function (e) {
            let t = !1;
            return /^\d+$/.test(e) && (t = !0), t
        }, e.isAlpha = function (e) {
            let t = !1;
            return /[A-Za-z]/.test(e) && (t = !0), t
        }, e.isUpperCase = function (e) {
            let t = !1;
            return /[A-Z]/.test(e) && (t = !0), t
        }, e.isLowerCase = function (e) {
            let t = !1;
            return /[a-z]/.test(e) && (t = !0), t
        }, e.isChinese = function (e) {
            let t = !1;
            return /[\u4E00-\u9FA5]/.test(e) && (t = !0), t
        }, e.replaceNonDigital = function (e) {
            return e.replace(/[^\d]/g, "")
        }, e.replaceNonAlpha = function (e) {
            return e.replace(/[^A-Za-z]/g, "")
        }, e.replaceNonWord = function (e) {
            return e.replace(/[^\W]/g, "")
        }, e.getDefaultDownloadDir = t, e.getMaxFreeDriver = function () {
            return t().substring(0, 1)
        }, e.deepCopy = function (e) {
            let t = JSON.stringify(e), n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                u.warning(e)
            }
            return n
        }, e.swap = function (e, t, n) {
            do {
                if (t < 0 || t >= e.length) break;
                if (n < 0 || n >= e.length) break;
                if (t === n) break;
                e[t] = e.splice(n, 1, e[t])[0]
            } while (0);
            return e
        }, e.compareNocase = function (e, t) {
            let n = !1;
            do {
                if (void 0 === e && void 0 === t) {
                    n = !0;
                    break
                }
                if (void 0 === e || void 0 === t) break;
                if ("string" != typeof e || "string" != typeof t) break;
                n = e.toLowerCase() === t.toLowerCase()
            } while (0);
            return n
        }, e.parseCommandLine = function (e) {
            let t = 0, n = "", i = !1, a = [], o = e.length;
            for (let r = 0; r < o; r++) {
                let s = e[r];
                if ('"' !== s && "'" !== s || ("" === n ? (i = !0, n = s) : n === s && (i = !1, n = "")), " " !== s || i || r === o - 1) {
                    if (r === o - 1) {
                        let n = e.substring(t);
                        "" !== n.trim() && a.push(c(n))
                    }
                } else {
                    let n = e.substring(t, r);
                    "" !== n.trim() && a.push(c(n)), t = r + 1
                }
            }
            return a
        }, e.getThunderTempPath = function (e, t) {
            return i(this, void 0, void 0, function* () {
                const i = yield Promise.resolve().then(() => n(16));
                let a = o.join(i.tmpdir(), d);
                return t && (a = o.join(a, t)), void 0 !== e && e && (yield s.FileSystemAWNS.mkdirsAW(a)), a
            })
        }, e.setQueryString = function (e, t) {
            return Object.keys(t).forEach((n, i) => {
                e += 0 === i ? "?" : "&", e += `${n}=${t[n]}`
            }), e
        }, e.getQueryString = function (e, t) {
            return e && t && e.match(new RegExp(`(^${t}|[?|&]${t})=([^&#]+)`)) ? RegExp.$2 : ""
        }, e.isClipboardTextFormatAvailable = function () {
            let e = !1, t = a.clipboard.availableFormats();
            for (let n of t) if ("text/plain" === n) {
                e = !0;
                break
            }
            return e
        }, e.keywordsHighLight = function (e, t, n) {
            if (!e) return "";
            if (!t) return e;
            if (0 === e.length) return e;
            if (0 === t.length) return e;
            let i = /\\/, a = t.split(" ");
            if (0 === (a = a.filter(e => e.trim().length > 0)).length) return e;
            for (let t = 0; t < a.length; t++) if (a[t].search(i) > 0) return e;
            n = void 0 === n || null === n ? "#FF0000" : n;
            let o = "", r = ["\\[", "\\^", "\\*", "\\(", "\\)", "\\|", "\\?", "\\$", "\\.", "\\+"], s = "", l = "|";
            for (let e = 0; e < a.length; e++) {
                for (let t = 0; t < r.length; t++) {
                    let n = new RegExp(r[t], "g");
                    a[e] = a[e].replace(n, r[t])
                }
                e === a.length - 1 && (l = ""), s = s.concat(a[e], l)
            }
            let u = new RegExp(s, "gi");
            return o = e.replace(u, e => '<span style= "color:' + n + '">' + e + "</span>")
        }, e.isDef = function (e) {
            return void 0 !== e && null !== e
        }, e.isUndef = function (e) {
            return void 0 === e || null === e
        }, e.setStyle = function (e, t) {
            Object.entries(t).forEach(([t, n]) => {
                e.style[t] = n
            })
        }, e.setCSSProperties = function (e, t) {
            Object.entries(t).forEach(([t, n]) => {
                e.style.setProperty(t, n)
            })
        }, e.versionCompare = function (e, t) {
            let n = e.split("."), i = t.split("."), a = 0;
            for (let e = 0; e < n.length; e++) {
                if (Number(n[e]) - Number(i[e]) > 0) {
                    a = 1;
                    break
                }
                if (Number(n[e]) - Number(i[e]) < 0) {
                    a = -1;
                    break
                }
            }
            return a
        }, e.throttle = function (e, t) {
            let n, i = 0;
            return (...a) => {
                const o = Date.now();
                clearTimeout(n), o - i > t ? (e(...a), i = o) : n = setTimeout(() => {
                    e(...a), i = o
                }, t)
            }
        }
    }(t.ThunderUtil || (t.ThunderUtil = {}))
}, function (e, t, n) {
    "use strict";
    var i = n(71), a = n(118), o = Object.prototype.toString;

    function r(e) {
        return "[object Array]" === o.call(e)
    }

    function s(e) {
        return null !== e && "object" == typeof e
    }

    function l(e) {
        return "[object Function]" === o.call(e)
    }

    function u(e, t) {
        if (null !== e && void 0 !== e) if ("object" != typeof e && (e = [e]), r(e)) for (var n = 0, i = e.length; n < i; n++) t.call(null, e[n], n, e); else for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && t.call(null, e[a], a, e)
    }

    e.exports = {
        isArray: r, isArrayBuffer: function (e) {
            return "[object ArrayBuffer]" === o.call(e)
        }, isBuffer: a, isFormData: function (e) {
            return "undefined" != typeof FormData && e instanceof FormData
        }, isArrayBufferView: function (e) {
            return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && e.buffer instanceof ArrayBuffer
        }, isString: function (e) {
            return "string" == typeof e
        }, isNumber: function (e) {
            return "number" == typeof e
        }, isObject: s, isUndefined: function (e) {
            return void 0 === e
        }, isDate: function (e) {
            return "[object Date]" === o.call(e)
        }, isFile: function (e) {
            return "[object File]" === o.call(e)
        }, isBlob: function (e) {
            return "[object Blob]" === o.call(e)
        }, isFunction: l, isStream: function (e) {
            return s(e) && l(e.pipe)
        }, isURLSearchParams: function (e) {
            return "undefined" != typeof URLSearchParams && e instanceof URLSearchParams
        }, isStandardBrowserEnv: function () {
            return ("undefined" == typeof navigator || "ReactNative" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document
        }, forEach: u, merge: function e() {
            var t = {};

            function n(n, i) {
                "object" == typeof t[i] && "object" == typeof n ? t[i] = e(t[i], n) : t[i] = n
            }

            for (var i = 0, a = arguments.length; i < a; i++) u(arguments[i], n);
            return t
        }, extend: function (e, t, n) {
            return u(t, function (t, a) {
                e[a] = n && "function" == typeof t ? i(t, n) : t
            }), e
        }, trim: function (e) {
            return e.replace(/^\s*/, "").replace(/\s*$/, "")
        }
    }
}, function (e, t) {
    e.exports = vendor_f06ab6e95552376989e1
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(5), o = n(1).default.getLogger("XLStat");
    let r = a.default(i.join(__rootDir, "../bin/ThunderHelper.node"));

    function s(e = "") {
        let t;
        if ("string" == typeof e) t = e; else if (l(e) && "object" == typeof e) {
            let n = [];
            for (let t in e) l(e[t]) && n.push(t + "=" + encodeURIComponent(e[t]));
            t = n.join(",")
        }
        return t
    }

    function l(e) {
        return void 0 !== e && null !== e
    }

    !function (e) {
        function t(e) {
            do {
                if (void 0 === e) break;
                r.trackClick(e, 0)
            } while (0)
        }

        e.trackEvent = function (e, t = "", n = "", i = 0, a = 0, l = 0, u = 0, d = "", c = 0) {
            let h = 0;
            do {
                if (void 0 === e) {
                    h = 1;
                    break
                }
                let f = s(d);
                h = r.trackEvent(e, t, n, i, a, l, u, f, c), o.information(e, t, n, i, a, l, u, f, c)
            } while (0);
            return h
        }, e.trackClick = t, e.trackShow = function (e) {
            t(e)
        }, e.setUserID = function (e = 0, t = 0) {
            r.setUserID(e, t)
        }
    }(t.XLStatNS || (t.XLStatNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.channelRMNewTaskReadyForSetTaskData = "RM_NEWTASK_READYRORSETTASKDATA", e.channelRMNewTaskSetTaskData = "RM_NEWTASK_SETTASKDATA", e.channelRMPreNewTaskSetTaskData = "RM_PRENEWTASK_SETTASKDATA", e.channelRMNewTaskCreateNewTask = "RM_NEWTASK_CREATENEWTASK", e.channelRMNewTaskSetBTInfo = "RM_NEWTASK_SETBTINFO", e.channelRMNewTaskDownloadTorrent = "RM_NEW_TASK_DOWNLOAD_TORRENT", e.channelRMNewTaskCreateBtTask = "RM_NEWTASK_CRATEBTTASK", e.channelRMNewTaskCancleMagnet = "RM_NEWTASK_CANCLE_MAGNET", e.channelRMImportTorrent = "RM_NEWTASK_IMPORT_TORRENT", e.channelRMGetConfigValueResolve = "RM_GET_CONFIG_VALUE_RESOLVE", e.channelRMGetConfigValueReject = "RM_GET_CONFIG_VALUE_REJECT", e.channelMRTrayMenuClick = "MR_TRAY_MENU_CLICK", e.channelMRNewTaskMagnetTaskCreated = "MR_NEW_TASK_MAGNET_TASK_CREATED", e.channelMRNewTaskDownloadTorrentResult = "MR_NEW_TASK_DOWNLOAD_TORRENT_RESULT", e.channelMRNewTaskCreateNewTaskResult = "MR_NEWTASK_CREATENEWTASK_RESULT", e.channelMRNewTaskCreateBtTaskResult = "RM_NEWTASK_CRATEBTTASK_RESULT", e.channelMRGetConfigValue = "MR_GET_CONFIG_VALUE", e.channelMRSetConfigValue = "MR_SET_CONFIG_VALUE", e.channelRMCommitPlanTask = "RM_PLANTASK_COMMIT", e.channelRMPerformePlanTask = "RM_PLANTASK_PERFORME", e.channelRMProcessSend = "RM_RENDER_PROCESS_INFO", e.channelRMGetPrivateSpaceInfo = "RM_RENDER_GET_PRIVATE_SPACE_INFO", e.channelMRGetPrivateSpaceInfoResult = "MR_RENDER_GET_PRIVATE_SPACE_INFO_RESULT", e.channelRMFileCopy = "RM_FILE_COPY", e.channelRMFileMove = "RM_FILE_MOVE", e.channelMRFileCopyResult = "MR_FILE_COPY_RESULT", e.channelMRFileMoveResult = "MR_FILE_MOVE_RESULT", e.channelRMGetSutitleByCid = "RM_RENDER_GET_SUBTITLE_BY_CID", e.channelMRGetSutitleByCidResult = "MR_RENDER_GET_SUBTITLE_BY_CID_RESULT", e.channelRMGetSutitleByName = "RM_RENDER_GET_SUBTITLE_BY_NAME", e.channelMRGetSutitleByNameResult = "MR_RENDER_GET_SUBTITLE_BY_NAME_RESULT", e.channelRMDownloadSutitle = "RM_RENDER_DOWNLOAD_SUBTITLE", e.channelMRDownloadSutitleSuc = "MR_RENDER_DOWNLOAD_SUBTITLE_SUCCESS", e.channelMRDownloadSutitleFail = "MR_RENDER_DOWNLOAD_SUBTITLE_FAIL", e.channelRMGetDisplayName = "RM_RENDER_GET_SUBTITLE_DISPLAYNAME", e.channelMRGetDisplayNameResult = "MR_RENDER_GET_SUBTITLE_DISPLAYNAME_RESULT", e.channelMRBringWindowToTop = "MR_RENDER_BRING_WINDOW_TO_TOP", e.channelRMDownloadXmp = "RM_RENDER_DOWNLOAD_XMP", e.channelMRFixXmpSuc = "MR_RENDER_FIX_XMP_SUC", e.channelMRFixXMPFail = "MR_RENDER_FIX_XMP_FAIL", e.channelRMDownloadXmpEx = "RM_RENDER_DOWNLOAD_XMP_EX", e.channelRMSetPosition = "RM_SET_POSITION", e.channelRMSetFoucs = "RM_SET_FOCUS", e.channelRMCreateAddressDropWnd = "RM_CREATE_ADDRESS_DROPWND", e.channelRMRefreshAddressDropWnd = "RM_REFRESH_ADDRESS_DROPWND", e.channelRMSelectAddressDropItem = "RM_SELECT_ADDRESS_DROPITEM", e.channelRMCreateSearchWindow = "RM_CREATE_SEARCH_WINDOW", e.channelRMAddressKeyDown = "RM_ADDRESS_BAR_KEYDOWN", e.channelMRFWAddressKeyDown = "MR_ADDRESS_FW_BAR_KEYDOWN", e.channelMRFWSelectAddressDropItem = "MR_FW_SELECT_ADDRESS_DROPITEM", e.channelRMAddressDropWndKeyDown = "RM_ADDRESS_DROPWND_KEYDOWN", e.channelMRSearchWindowVisibleChange = "MR_SEARCH_WINDOW_VISIBLE_CHANGE", e.channelRMShowSearchWindow = "RM_SEARCH_WINDOW_SHOW", e.channelRMHideSearchWindow = "RM_SEARCH_WINDOW_HIDE", e.channelRMClickMouse = "RM_CLICK_MOUSE", e.channelMRSearchBarFocusChange = "MR_SEARCHBAR_FOCUS_CHANGE", e.channelMRFWAddressDropWndKeyDown = "MR_FW_ADDRESS_DROPWND_KEYDOWN", e.channelMRClickAddressDropItem = "MR_CLICK_ADDRESS_DROPITEM", e.channelMRMainWndMax = "MR_MAINWINDOW_MAX", e.channelMRMainWndMin = "MR_MAINWINDOW_MIN", e.channelMRMainWndRestore = "MR_MAINWINDOW_RESTORE", e.channelRMGetBrowserStartType = "RM_GET_BROWSER_START_TYPE", e.channelMRGetBrowserStartTypeResult = "MR_GET_BROWSER_START_TYPE_RESULT", e.channelRMExecute = "RM_SHELL_EXECUTE", e.channelMRExecuteResult = "MR_SHELL_EXECUTE_RESULT", e.channelMRAdTipsClick = "MR_AD_TIPS_CLICK", e.channelMRNotificationMsg = "MR_NOTIFICATION_MSG", e.channelRMSetProgressBar = "RM_SET_PROGRESS_BAR", e.channelRMRoundWindow = "RM_ROUND_WINDOW"
    }(t.ThunderChannelList || (t.ThunderChannelList = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(7), a = n(1), o = n(6), r = a.default.getLogger("Thunder.PromiseNativeCall"), s = i.promisify;
    t.default = function (...e) {
        return r.verbose(...e), s(o.NativeCallModule.nativeCall.CallNativeFunction.bind(o.NativeCallModule.nativeCall))(...e)
    }
}, function (e, t) {
    e.exports = require("os")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(5).default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.getDriveInfo = function (e) {
            return a.getDriveInfo(e)
        }, e.getFreePartitionSpace = function (e) {
            return a.getFreePartitionSpace(e)
        }, e.getLogicalDriveStrings = function () {
            return a.getLogicalDriveStrings()
        }, e.getPartitionSpace = function (e) {
            return a.getPartitionSpace(e)
        }, e.getSystemTempPath = function () {
            return a.getSystemTempPath()
        }, e.getTaskTypeFromUrl = function (e) {
            return a.getTaskTypeFromUrl(e)
        }, e.extractIcon = function (e, t) {
            return a.extractIcon(e, t)
        }, e.isWindow7 = function () {
            return 1 === a.isWin7()
        }, e.compareStr = function (e, t) {
            return a.compareStr(e, t)
        }, e.getTickCount = function () {
            return a.getTickCount()
        }
    }(t.ThunderHelper || (t.ThunderHelper = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.information = function (...e) {
    }, t.error = function (...e) {
    }, t.warning = function (...e) {
    }, t.critical = function (...e) {
    }, t.verbose = function (...e) {
    }, "development" === process.env.LOGGER_ENV && (t.information = function (...e) {
        console.log("information", e)
    }, t.error = function (...e) {
        console.log("error", e)
    }, t.warning = function (...e) {
        console.log("warning", e)
    }, t.critical = function (...e) {
        console.log("critical", e)
    }, t.verbose = function (...e) {
        console.log("verbose", e)
    })
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.msgIPCCommunicatorForward = "ipc_communicator_forward", e.msgIPCSendToMain = "ipc_send_to_main", e.msgIPCSendToRenderer = "ipc_send_to_renderer", e.msgIPCRendererConnect = "ipc_renderer_connect", e.msgIPCRendererDisconnect = "ipc_renderer_disconnect", e.msgNCCallNativeFunction = "nc_call_native_function", e.msgNCCheckNativeFunction = "nc_check_native_function", e.msgNCCallJsFunctionById = "nc_call_js_function_by_id", e.msgNCCallJsFunctionByName = "nc_call_js_function_by_name", e.msgNCNativeFireEvent = "nc_native_fire_event", e.msgNCNativeCallReady = "nc_native_call_ready"
    }(t.CommonIPCMessage || (t.CommonIPCMessage = {}))
}, function (e, t) {
    e.exports = require("fs")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.NONE = 0] = "NONE", e[e.PAGE = 1] = "PAGE", e[e.FRAME = 2] = "FRAME", e[e.LINK = 4] = "LINK", e[e.MEDIA = 8] = "MEDIA", e[e.SELECTION = 16] = "SELECTION", e[e.EDITABLE = 32] = "EDITABLE"
    }(t.MenuNodeType || (t.MenuNodeType = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.UNDO = 1] = "UNDO", e[e.REDO = 2] = "REDO", e[e.CUT = 4] = "CUT", e[e.COPY = 8] = "COPY", e[e.PASTE = 16] = "PASTE", e[e.DELETE = 32] = "DELETE", e[e.SELECT_ALL = 64] = "SELECT_ALL", e[e.TRANSLATE = 128] = "TRANSLATE"
    }(t.MenuEditableState || (t.MenuEditableState = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.IMAGE = 1] = "IMAGE", e[e.VIDEO = 2] = "VIDEO", e[e.AUDIO = 3] = "AUDIO", e[e.FILE = 4] = "FILE", e[e.PLUGIN = 5] = "PLUGIN"
    }(t.MenuMediaType || (t.MenuMediaType = {})), function (e) {
        e[e.HWND_NOTOPMOST = -2] = "HWND_NOTOPMOST", e[e.HWND_TOPMOST = -1] = "HWND_TOPMOST", e[e.HWND_TOP = 0] = "HWND_TOP", e[e.HWND_BOTTOM = 1] = "HWND_BOTTOM"
    }(t.OptionOfhwndInAfter || (t.OptionOfhwndInAfter = {})), function (e) {
        e[e.SWP_ASYNCWINDOWPOS = 16384] = "SWP_ASYNCWINDOWPOS", e[e.SWP_DEFERERASE = 8192] = "SWP_DEFERERASE", e[e.SWP_DRAWFRAME = 32] = "SWP_DRAWFRAME", e[e.SWP_FRAMECHANGED = 32] = "SWP_FRAMECHANGED", e[e.SWP_HIDEWINDOW = 128] = "SWP_HIDEWINDOW", e[e.SWP_NOACTIVATE = 16] = "SWP_NOACTIVATE", e[e.SWP_NOCOPYBITS = 256] = "SWP_NOCOPYBITS", e[e.SWP_NOMOVE = 2] = "SWP_NOMOVE", e[e.SWP_NOOWNERZORDER = 512] = "SWP_NOOWNERZORDER", e[e.SWP_NOREDRAW = 8] = "SWP_NOREDRAW", e[e.SWP_NOREPOSITION = 512] = "SWP_NOREPOSITION", e[e.SWP_NOSENDCHANGING = 1024] = "SWP_NOSENDCHANGING", e[e.SWP_NOSIZE = 1] = "SWP_NOSIZE", e[e.SWP_NOZORDER = 4] = "SWP_NOZORDER", e[e.SWP_SHOWWINDOW = 64] = "SWP_SHOWWINDOW"
    }(t.Uflags || (t.Uflags = {})), function (e) {
        e[e.WS_BORDER = 8388608] = "WS_BORDER", e[e.WS_CAPTION = 12582912] = "WS_CAPTION", e[e.WS_CHILD = 1073741824] = "WS_CHILD", e[e.WS_CHILDWINDOW = 1073741824] = "WS_CHILDWINDOW", e[e.WS_CLIPCHILDREN = 33554432] = "WS_CLIPCHILDREN", e[e.WS_CLIPSIBLINGS = 67108864] = "WS_CLIPSIBLINGS"
    }(t.WindowStyle || (t.WindowStyle = {})), function (e) {
        e[e.WS_EX_TOOLWINDOW = 128] = "WS_EX_TOOLWINDOW"
    }(t.ExtendedWindowStyles || (t.ExtendedWindowStyles = {})), function (e) {
        e[e.GWL_EXSTYLE = -20] = "GWL_EXSTYLE", e[e.GWL_HINSTANCE = -6] = "GWL_HINSTANCE", e[e.GWL_ID = -12] = "GWL_ID", e[e.GWL_STYLE = -16] = "GWL_STYLE", e[e.GWL_USERDATA = -21] = "GWL_USERDATA", e[e.GWL_WNDPROC = -4] = "GWL_WNDPROC"
    }(t.SetWindowType || (t.SetWindowType = {})), function (e) {
        e[e.WM_CREATE = 1] = "WM_CREATE", e[e.WM_DESTROY = 2] = "WM_DESTROY", e[e.WM_MOVE = 3] = "WM_MOVE", e[e.WM_SIZE = 5] = "WM_SIZE", e[e.WM_ACTIVATE = 6] = "WM_ACTIVATE", e[e.WM_SETFOCUS = 7] = "WM_SETFOCUS", e[e.WM_KILLFOCUS = 8] = "WM_KILLFOCUS", e[e.WM_ENABLE = 10] = "WM_ENABLE", e[e.WM_DPICHANGED = 736] = "WM_DPICHANGED"
    }(t.WindowMessages || (t.WindowMessages = {})), function (e) {
        e[e.SW_HIDE = 0] = "SW_HIDE", e[e.SW_SHOWMAXIMIZED = 3] = "SW_SHOWMAXIMIZED", e[e.SW_SHOW = 5] = "SW_SHOW"
    }(t.showCmd || (t.showCmd = {})), function (e) {
        e[e.Success = 0] = "Success", e[e.FunctionUnExist = 1] = "FunctionUnExist", e[e.ParamError = 2] = "ParamError", e[e.CallFailed = 3] = "CallFailed"
    }(t.NativeFunctionErrorCode || (t.NativeFunctionErrorCode = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(20), o = n(1), r = n(60), s = n(9), l = n(23), u = o.default.getLogger("Config");

    class d {
        constructor() {
            this.isInit = !1, this.configData = {}, this.configPath = void 0, this.eventContainer = new r.default
        }

        init(e) {
            return i(this, void 0, void 0, function* () {
                if (!this.isInit) {
                    if (this.configPath = e, yield s.FileSystemAWNS.existsAW(e)) {
                        let t = yield s.FileSystemAWNS.readFileAW(e);
                        if (t) {
                            let e = null;
                            try {
                                e = JSON.parse(t.toString())
                            } catch (e) {
                                u.warning(e)
                            }
                            this.mergeConfigData(e), this.isInit = !0, this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventConfigInitFinished)
                        }
                    } else this.isInit = !0, this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventConfigInitFinished)
                }
            })
        }

        getValue(e, t, n) {
            let i = n;
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let a = this.configData[e];
                if (!a) {
                    let a = {};
                    a[t] = n, this.configData[e] = a, this.fireValueChangedEvent(e, t, void 0, i);
                    break
                }
                t in a ? i = a[t] : (a[t] = n, this.fireValueChangedEvent(e, t, void 0, i))
            } while (0);
            return i
        }

        setValue(e, t, n) {
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let i = void 0, a = this.configData[e];
                if (a) i = a[t], a[t] = n; else {
                    let i = {};
                    i[t] = n, this.configData[e] = i
                }
                i !== n && this.fireValueChangedEvent(e, t, i, n)
            } while (0)
        }

        isInitConfigFinished() {
            return this.isInit
        }

        save() {
            return i(this, void 0, void 0, function* () {
                if (this.isInit) {
                    let e = JSON.stringify(this.configData, void 0, 2);
                    yield s.FileSystemAWNS.writeFileAW(this.configPath, e)
                }
            })
        }

        saveSync() {
            if (this.isInit) {
                let e = JSON.stringify(this.configData, void 0, 2);
                a.writeFileSync(this.configPath, e)
            }
        }

        attachListener(e, t) {
            do {
                if (e === l.NodeEventMesssageNS.eventConfigInitFinished) {
                    if (this.isInit) {
                        t(this.isInit);
                        break
                    }
                    this.eventContainer.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }

        detachListener(e, t) {
            this.eventContainer.detachListener(e, t)
        }

        mergeConfigData(e) {
            if (e) if (null === this.configData) this.configData = e; else for (let t in e) {
                let n = e[t];
                if (!n) break;
                for (let e in n) {
                    let i = n[e], a = this.configData[t];
                    if (a) a[e] = i; else {
                        let n = {};
                        n[e] = i, this.configData[t] = n
                    }
                }
            }
        }

        fireValueChangedEvent(e, t, n, i) {
            this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventConfigValueChanged, e, t, n, i)
        }
    }

    t.Config = d;
    const c = new d;
    !function (e) {
        e.init = function (e) {
            return i(this, void 0, void 0, function* () {
                yield c.init(e)
            })
        }, e.isInitConfigFinished = function () {
            return c.isInitConfigFinished()
        }, e.save = function () {
            return i(this, void 0, void 0, function* () {
                yield c.save()
            })
        }, e.saveSync = function () {
            c.saveSync()
        }, e.getValue = function (e, t, n) {
            return c.getValue(e, t, n)
        }, e.setValue = function (e, t, n) {
            c.setValue(e, t, n)
        }, e.attachListener = function (e, t) {
            c.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            c.detachListener(e, t)
        }
    }(t.ConfigNS || (t.ConfigNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.eventPluginLoderPluginReady = "event_plugin_loader_plugin_ready", e.eventDownloadItemActive = "event_download_item_active", e.eventDetailSwitch2Index = "event_detail_switch_to_index", e.eventDownloadSwitchCategory = "event_download_switch_category", e.eventBringMainWindowToTop = "event_bring_main_window_to_top", e.eventDownloadContextMenuClick = "event_download_context_menu_click", e.eventOnCommand = "event_on_command", e.eventDownloadKernelInitEnd = "event_dk_init_end", e.eventTaskDataBaseLoadEnd = "event_dk_task_data_base_load_end", e.eventGlobalDownloadSpeedChanged = "event_dk_global_download_speed_changed", e.eventGlobalUploadSpeedChanged = "event_dk_global_upload_speed_changed", e.eventConfigInitFinished = "event_config_init_finished", e.eventConfigValueChanged = "event_config_value_changed", e.eventBHOConfigInitFinished = "event_bho_config_init_finished", e.eventBHOConfigValueChanged = "event_bho_config_value_changed", e.eventShowHomePage = "event_show_home_page", e.eventShowSearchTaskPage = "event_show_searchtask_page", e.eventConfigBrowserInitFinished = "event_config_browser_init_finished", e.eventDownloadContextMenuPopup = "event_download_context_menu_popup", e.eventDownloadContextMenuEnd = "event_download_context_menu_end", e.eventEmbeddedBrowserWndClick = "event_embedded_browser_wnd_click", e.eventLoginWndCreate = "event_login_wnd_create", e.eventLoginWndShow = "event_login_wnd_show", e.eventLoginWndShowResult = "event_login_wnd_show_result", e.eventLoginWndClose = "event_login_wnd_close", e.eventRetryLoginWndCreate = "event_retry_login_wnd_create", e.eventModifierUserinfoWndCreate = "event_modifier-userinfo-wnd-create"
    }(t.NodeEventMesssageNS || (t.NodeEventMesssageNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(7), o = n(18), r = n(19);
    !function (e) {
        e.mainProcessContext = "main-process", e.mainRendererContext = "main-renderer", e.mainPageWebviewRendererContext = "main-page-webview-renderer", e.newTaskRendererContext = "new-task-renderer", e.preNewTaskRendererContext = "pre-new-task-renderer", e.loginRendererContext = "login-renderer";

        class t {
            constructor() {
                this.isConnected = !1, this.isOnIPCEvent = !1, this.rendererInfos = [], this.listeners = new Map, t.intervalIPCModuleMsgs = [r.CommonIPCMessage.msgIPCRendererConnect, r.CommonIPCMessage.msgIPCRendererDisconnect]
            }

            onMessage(e, t) {
                do {
                    if (!a.isString(e) || 0 === e.length) {
                        o.error("msgName is null");
                        break
                    }
                    if (a.isNullOrUndefined(t)) {
                        o.error("listener is null");
                        break
                    }
                    this.listeners.has(e) ? this.listeners.get(e).push(t) : this.listeners.set(e, [t])
                } while (0)
            }

            getCommunicatorInfo() {
                return this.currInfo
            }

            getAllRenderer() {
                return this.rendererInfos
            }

            getCommunicatorInfoById(e) {
                for (let t of this.rendererInfos) if (t.id === e) return t;
                return null
            }

            getCommunicatorInfoByContext(e) {
                for (let t of this.rendererInfos) if (t.context === e) return t;
                return null
            }

            startListenIPCMessage(e) {
                this.isOnIPCEvent || (this.isOnIPCEvent = !0, e && this.ListenSendToMainMsg(), this.ListenSendToRendererMsg(e))
            }

            ListenSendToMainMsg() {
                i.ipcMain.on(r.CommonIPCMessage.msgIPCSendToMain, (e, t) => {
                    let n = void 0;
                    do {
                        if (a.isNullOrUndefined(t)) {
                            o.error("msgInfo is empty");
                            break
                        }
                        if (!this.isConnected) {
                            o.warning("hasnot been connected yet");
                            break
                        }
                        let i = t.msg.name;
                        if (this.isIPCModuleIntervalMsg(i)) {
                            o.information(`IPC module interval msg : ${i}`);
                            let a = this.handleIPCModuleIntervalMsg(e.sender, t);
                            if (n = a[1], !a[0]) break;
                            o.information("need to dispatch msg:" + i)
                        }
                        a.isNullOrUndefined(n) ? n = this.NotifyListener(t) : this.NotifyListener(t)
                    } while (0);
                    a.isNullOrUndefined(n) || (e.returnValue = n)
                })
            }

            ListenSendToRendererMsg(e) {
                (e ? i.ipcMain : i.ipcRenderer).on(r.CommonIPCMessage.msgIPCSendToRenderer, (t, n) => {
                    let i = void 0;
                    do {
                        if (a.isNullOrUndefined(n)) {
                            o.error("msgInfo is empty");
                            break
                        }
                        if (!this.isConnected) {
                            o.warning("hasnot been connected yet");
                            break
                        }
                        let r = n.msg.name;
                        if (this.isIPCModuleIntervalMsg(r)) {
                            o.information(`IPC module interval msg : ${r}`);
                            let e = this.handleIPCModuleIntervalMsg(t.sender, n);
                            if (i = e[1], !e[0]) break;
                            o.information("need to dispatch msg:" + r)
                        }
                        e ? (o.information("is main, handle forward msg"), this.handleForwardRendererToRendererMsg(n)) : (o.information("is renderer, handle business msg"), a.isNullOrUndefined(i) ? i = this.NotifyListener(n) : this.NotifyListener(n))
                    } while (0);
                    a.isNullOrUndefined(i) || (t.returnValue = i)
                })
            }

            isIPCModuleIntervalMsg(e) {
                for (let n of t.intervalIPCModuleMsgs) if (e === n) return !0;
                return !1
            }

            handleIPCModuleIntervalMsg(e, t) {
                let n = [!1, void 0];
                do {
                    let i = t.msg.name;
                    if (i === r.CommonIPCMessage.msgIPCRendererConnect) {
                        n = [!0, this.handleRendererConnectMsg(e, t)];
                        break
                    }
                    if (i === r.CommonIPCMessage.msgIPCRendererDisconnect) {
                        n = [!0, this.handleRendererDisconnectMsg(e, t)];
                        break
                    }
                } while (0);
                return n
            }

            handleRendererConnectMsg(e, t) {
                o.verbose(e), o.verbose(t)
            }

            handleRendererDisconnectMsg(e, t) {
                o.verbose(e), o.verbose(t)
            }

            handleForwardRendererToRendererMsg(e) {
                this.sendForwardRendererToRendererMsg(e)
            }

            sendForwardRendererToRendererMsg(e) {
                o.verbose(e)
            }

            NotifyListener(e) {
                let t = void 0, n = e.msg.name;
                if (this.listeners.has(n)) {
                    let i = this.listeners.get(n), a = !0;
                    for (let n of i) a ? (a = !1, t = n(e)) : n(e)
                }
                return t
            }
        }

        e.Communicator = t
    }(t.CommonIPCBase || (t.CommonIPCBase = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(7), o = n(18), r = n(19), s = n(24);
    !function (e) {
        class t extends s.CommonIPCBase.Communicator {
            constructor() {
                super()
            }

            initialize(e) {
                this.currInfo = {id: void 0, context: e, isMainCommunicator: !1}
            }

            connect() {
                this.isConnected ? o.warning("has been connected") : (this.sendConnectMsgToMain(), this.isConnected = !0, this.startListenIPCMessage(!1))
            }

            disconnect() {
                this.isConnected ? (this.isConnected = !1, this.sendDisconnectMsgToMain()) : o.warning("hasnot been connected yet")
            }

            sendMessageToMain(e) {
                this.sendIPCMsgToMain(e)
            }

            sendMessageToMainSync(e) {
                return this.sendIPCMsgToMain(e, !0)
            }

            sendMessageToRenderer(e, t) {
                this.sendIPCMsgToRenderer(e, t)
            }

            handleRendererConnectMsg(e, t) {
                do {
                    if (a.isNullOrUndefined(t)) {
                        o.error("msgInfo is null");
                        break
                    }
                    let e = t.msg.args[0];
                    if (a.isNullOrUndefined(e)) {
                        o.error("connectRendererInfo is null");
                        break
                    }
                    o.information(`Renderer: new renderer will connect, id = ${e.id}, context = ${e.context}`), this.rendererInfos.push(e)
                } while (0)
            }

            handleRendererDisconnectMsg(e, t) {
                do {
                    if (a.isNullOrUndefined(t)) {
                        o.error("msgInfo is null");
                        break
                    }
                    let e = t.msg.args[0];
                    if (a.isNullOrUndefined(e)) {
                        o.error("disconnectRendererInfo is null");
                        break
                    }
                    o.information(`renderer will disconnect, id = ${e.id}, context = ${e.context}`);
                    for (let t = 0; t < this.rendererInfos.length; ++t) if (this.rendererInfos[t] === e) {
                        this.rendererInfos.splice(t, 1);
                        break
                    }
                } while (0)
            }

            sendConnectMsgToMain() {
                let e = this.sendMessageToMainSync({name: r.CommonIPCMessage.msgIPCRendererConnect, args: []});
                this.currInfo.id = e[0], this.rendererInfos = e[1]
            }

            sendDisconnectMsgToMain() {
                this.sendMessageToMain({name: r.CommonIPCMessage.msgIPCRendererDisconnect, args: []})
            }

            sendIPCMsgToMain(e, t = !1) {
                let n = void 0;
                do {
                    if (a.isNullOrUndefined(e)) {
                        o.error("msg is null");
                        break
                    }
                    n = (t ? i.ipcRenderer.sendSync : i.ipcRenderer.send)(r.CommonIPCMessage.msgIPCSendToMain, {
                        msg: e,
                        senderInfo: this.currInfo
                    })
                } while (0);
                return n
            }

            sendIPCMsgToRenderer(e, t) {
                do {
                    if (a.isNullOrUndefined(e)) {
                        o.error("rendererId is null");
                        break
                    }
                    if (a.isNullOrUndefined(t)) {
                        o.error("msg is null");
                        break
                    }
                    let n = [e].concat(t.args);
                    t.args = n, i.ipcRenderer.send(r.CommonIPCMessage.msgIPCSendToRenderer, {
                        msg: t,
                        senderInfo: this.currInfo
                    })
                } while (0)
            }
        }

        e.RendererCommunicator = t, e.rendererCommunicator = new t
    }(t.CommonIPCRenderer || (t.CommonIPCRenderer = {}))
}, function (e, t) {
    e.exports = require("crypto")
}, function (e, t, n) {
    e.exports = n(117)
}, function (e, t, n) {
    "use strict";
    var i = n(11), a = n(72), o = n(74), r = n(52), s = n(75), l = n(76).http, u = n(76).https, d = n(29), c = n(94),
        h = n(130), f = n(44), p = n(73);
    e.exports = function (e) {
        return new Promise(function (t, n) {
            var g, k = e.data, m = e.headers;
            if (m["User-Agent"] || m["user-agent"] || (m["User-Agent"] = "axios/" + h.version), k && !i.isStream(k)) {
                if (Buffer.isBuffer(k)) ; else if (i.isArrayBuffer(k)) k = new Buffer(new Uint8Array(k)); else {
                    if (!i.isString(k)) return n(f("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", e));
                    k = new Buffer(k, "utf-8")
                }
                m["Content-Length"] = k.length
            }
            var T = void 0;
            e.auth && (T = (e.auth.username || "") + ":" + (e.auth.password || ""));
            var v = d.parse(e.url), y = v.protocol || "http:";
            if (!T && v.auth) {
                var S = v.auth.split(":");
                T = (S[0] || "") + ":" + (S[1] || "")
            }
            T && delete m.Authorization;
            var w = "https:" === y, b = w ? e.httpsAgent : e.httpAgent, C = {
                path: o(v.path, e.params, e.paramsSerializer).replace(/^\?/, ""),
                method: e.method,
                headers: m,
                agent: b,
                auth: T
            };
            e.socketPath ? C.socketPath = e.socketPath : (C.hostname = v.hostname, C.port = v.port);
            var N, D = e.proxy;
            if (!D && !1 !== D) {
                var I = y.slice(0, -1) + "_proxy", _ = process.env[I] || process.env[I.toUpperCase()];
                if (_) {
                    var x = d.parse(_);
                    if (D = {host: x.hostname, port: x.port}, x.auth) {
                        var A = x.auth.split(":");
                        D.auth = {username: A[0], password: A[1]}
                    }
                }
            }
            if (D && (C.hostname = D.host, C.host = D.host, C.headers.host = v.hostname + (v.port ? ":" + v.port : ""), C.port = D.port, C.path = y + "//" + v.hostname + (v.port ? ":" + v.port : "") + C.path, D.auth)) {
                var E = new Buffer(D.auth.username + ":" + D.auth.password, "utf8").toString("base64");
                C.headers["Proxy-Authorization"] = "Basic " + E
            }
            e.transport ? N = e.transport : 0 === e.maxRedirects ? N = w ? s : r : (e.maxRedirects && (C.maxRedirects = e.maxRedirects), N = w ? u : l), e.maxContentLength && e.maxContentLength > -1 && (C.maxBodyLength = e.maxContentLength);
            var M = N.request(C, function (i) {
                if (!M.aborted) {
                    clearTimeout(g), g = null;
                    var o = i;
                    switch (i.headers["content-encoding"]) {
                        case"gzip":
                        case"compress":
                        case"deflate":
                            o = o.pipe(c.createUnzip()), delete i.headers["content-encoding"]
                    }
                    var r = i.req || M, s = {
                        status: i.statusCode,
                        statusText: i.statusMessage,
                        headers: i.headers,
                        config: e,
                        request: r
                    };
                    if ("stream" === e.responseType) s.data = o, a(t, n, s); else {
                        var l = [];
                        o.on("data", function (t) {
                            l.push(t), e.maxContentLength > -1 && Buffer.concat(l).length > e.maxContentLength && n(f("maxContentLength size of " + e.maxContentLength + " exceeded", e, null, r))
                        }), o.on("error", function (t) {
                            M.aborted || n(p(t, e, null, r))
                        }), o.on("end", function () {
                            var i = Buffer.concat(l);
                            "arraybuffer" !== e.responseType && (i = i.toString("utf8")), s.data = i, a(t, n, s)
                        })
                    }
                }
            });
            M.on("error", function (t) {
                M.aborted || n(p(t, e, null, M))
            }), e.timeout && !g && (g = setTimeout(function () {
                M.abort(), n(f("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", M))
            }, e.timeout)), e.cancelToken && e.cancelToken.promise.then(function (e) {
                M.aborted || (M.abort(), n(e))
            }), i.isStream(k) ? k.pipe(M) : M.end(k)
        })
    }
}, function (e, t) {
    e.exports = require("url")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.OK = 0] = "OK", e[e.Cancel = 1] = "Cancel", e[e.Close = 2] = "Close"
        }(t = e.Action || (e.Action = {}))
    }(t.MessageBoxNS || (t.MessageBoxNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(1), s = n(60), l = n(9), u = n(23), d = n(82), c = n(8), h = n(92), f = n(756),
        p = n(37), g = n(114), k = n(93), m = n(14), T = n(153), v = n(149), y = n(7), S = n(138),
        w = p.DownloadKernelEventManager.getEventManager(),
        b = g.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        C = k.DownloadKernelCategoryManager.getCategoryManager(), N = T.ToastNotifyManagerNS.getToastNotifyManger(),
        D = r.default.getLogger("DownloadKernel.TaskManager");

    class I {
        constructor() {
            this.isLoadStorageFinish = !1, this.isInitDkFinish = !1, this.isEnableP2pChannel = !0, this.isEnableP2sChannel = !0, this.lastGlobalStat = {
                size: 0,
                recvdBytes: 0,
                sentBytes: 0
            }, this.totalDownloadSpeed = 0, this.totalUploadSpeed = 0, this.eventContainer = new s.default, this.tasks = new Map, this.startTasks = []
        }

        createTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !0, i = !1, a = new f.Task;
                switch (e) {
                    case c.DownloadKernel.TaskType.P2sp: {
                        let n = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        t.taskBaseInfo.taskName = n, a.createP2spTask(t.isBackground, t.taskBaseInfo, t.p2spTaskInfo, t.privateSpace), t.taskBaseInfo.groupTaskId && t.taskBaseInfo.groupTaskId > 0 && (i = !0)
                    }
                        break;
                    case c.DownloadKernel.TaskType.Bt: {
                        let n = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        t.taskBaseInfo.taskName = n, yield a.createBtTask(t.isBackground, t.taskBaseInfo, t.btTaskInfo, t.privateSpace)
                    }
                        break;
                    case c.DownloadKernel.TaskType.Emule: {
                        let n = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        t.taskBaseInfo.taskName = n, a.createEmuleTask(t.isBackground, t.taskBaseInfo, t.emuleTaskInfo, t.privateSpace), t.taskBaseInfo.groupTaskId && t.taskBaseInfo.groupTaskId > 0 && (i = !0)
                    }
                        break;
                    case c.DownloadKernel.TaskType.Group: {
                        let n = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        if (n !== t.taskBaseInfo.taskName) {
                            t.taskBaseInfo.taskName = n;
                            let e = o.join(t.taskBaseInfo.savePath, n);
                            for (let n = 0; n < t.groupTaskInfo.subTaskList.length; ++n) t.groupTaskInfo.subTaskList[n].p2spTaskInfo ? t.groupTaskInfo.subTaskList[n].taskBaseInfo.savePath = e : t.groupTaskInfo.subTaskList[n].emuleTaskInfo && (t.groupTaskInfo.subTaskList[n].taskBaseInfo.savePath = e)
                        }
                        yield this.createGroupTask(a, t.taskBaseInfo, t.groupTaskInfo, t.privateSpace)
                    }
                        break;
                    case c.DownloadKernel.TaskType.Magnet:
                        a.createMagnetTask(t.isBackground, t.taskBaseInfo, t.magnetTaskInfo, t.privateSpace);
                        break;
                    default:
                        n = !1
                }
                return n ? (this.addTask(a), t.isBackground || i || this.insertToCategoryView(a, c.DownloadKernel.TaskInsertReason.Create), w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskCreated, [a])) : a = null, a
            })
        }

        createBatchTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = h.ThunderKernel.beginTransaction(), i = void 0, a = void 0;
                if (t) {
                    i = t.getId();
                    let e = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath);
                    e && (a = e.length + 1)
                }
                let r = new Map, s = void 0, l = [];
                for (let n = 0; n < e.length; ++n) {
                    let u = !0, d = new f.Task, h = e[n];
                    h.taskBaseInfo.groupTaskId = i;
                    let p = h.taskType, g = o.join(h.taskBaseInfo.savePath, h.taskBaseInfo.taskName);
                    this.setGroupTaskRelativePath(d, h.taskBaseInfo.savePath, a);
                    let k = r.get(g);
                    y.isNumber(k) || (k = 0);
                    let m = yield this.getTaskName(p, h.taskBaseInfo.savePath, h.taskBaseInfo.taskName, k);
                    r.set(g, m.index + 1), h.taskBaseInfo.taskName = m.newName, p === c.DownloadKernel.TaskType.P2sp ? d.createP2spTask(h.isBackground, h.taskBaseInfo, h.p2spTaskInfo, h.privateSpace) : p === c.DownloadKernel.TaskType.Emule ? d.createEmuleTask(h.isBackground, h.taskBaseInfo, h.emuleTaskInfo, h.privateSpace) : u = !1, u ? (void 0 === s && (s = d.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId)), t && t.getExtraObject().addSubTask(d), this.addTask(d), h.isBackground || l.push(d)) : d = null
                }
                if (h.ThunderKernel.commitTransaction(n), !t) {
                    let e = null;
                    (e = void 0 !== s && s > -1 ? C.getCategoryView(s, c.DownloadKernel.CategroyViewID.Downloading) : b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading)) && e.insertTask(l, c.DownloadKernel.TaskInsertReason.Create), w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskCreated, l)
                }
                return l
            })
        }

        startTask(e) {
            let t = this.tasks.get(e), n = !1;
            return t ? (this.startTasks.push(e), (n = t.start()) ? this.taskStatusChanage([t]) : (D.error("task start fail! taskId", e), this.removeStartTask(e))) : D.error("task not exist! taskId", e), n
        }

        startWaitingTask(e) {
            let t = !1, n = this.tasks.get(e);
            return n && n.startWaiting() && (this.taskStatusChanage([n]), t = !0), t
        }

        startWaitingTasks(e) {
            let t = !1, n = h.ThunderKernel.beginTransaction(), i = [];
            for (let n of e) {
                let e = this.tasks.get(n);
                e && e.startWaiting() && (i.push(e), t = !0)
            }
            return h.ThunderKernel.commitTransaction(n), i.length > 0 && w.fireTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, i), t
        }

        stopTask(e, t = c.DownloadKernel.TaskStopReason.Unknown) {
            let n = this.tasks.get(e);
            n ? n.stop() ? (n.setStopReason(t), this.taskStatusChanage([n]), n.getTaskStatus() === c.DownloadKernel.TaskStatus.Stopped && n.setStopReason(c.DownloadKernel.TaskStopReason.Unknown)) : D.error("task stop fail! taskId", e) : D.error("task not exist! taskId", e)
        }

        batchStopTask(e, t = c.DownloadKernel.TaskStopReason.Unknown) {
            let n = [], i = [];
            for (let t = 0; t < e.length; ++t) {
                let a = this.tasks.get(e[t]);
                if (a) {
                    a.getTaskStatus() === c.DownloadKernel.TaskStatus.StartWaiting ? n.push(a) : i.push(a)
                }
            }
            let a = [];
            for (let e = 0; e < n.length; ++e) {
                let i = n[e];
                i.stop() && (i.setStopReason(t), a.push(i))
            }
            for (let e = 0; e < i.length; ++e) {
                let n = i[e];
                n.stop() && (n.setStopReason(t), a.push(n))
            }
            a.length > 0 && this.taskStatusChanage(a);
            for (let e = 0; e < a.length; ++e) {
                let t = a[e];
                t.getTaskStatus() === c.DownloadKernel.TaskStatus.Stopped && t.setStopReason(c.DownloadKernel.TaskStopReason.Unknown)
            }
        }

        stopTaskAW(e, t = c.DownloadKernel.TaskStopReason.Unknown) {
            return i(this, void 0, void 0, function* () {
                let n = this.tasks.get(e);
                return n ? n.stop() ? (n.setStopReason(t), this.taskStatusChanage([n]), n.getTaskStatus() === c.DownloadKernel.TaskStatus.Stopped && n.setStopReason(c.DownloadKernel.TaskStopReason.Unknown)) : D.error("task stop fail! taskId", e) : D.error("task not exist! taskId", e), this.attachTaskStopOnce(e)
            })
        }

        deleteTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = this.tasks.get(e);
                if (!n) return !1;
                n.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryViewId) === c.DownloadKernel.CategroyViewID.Downloading && (yield this.stopTaskAW(e, c.DownloadKernel.TaskStopReason.DeleteTask)), w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskDestroying, [n]), n.updateTaskStatus(c.DownloadKernel.TaskStatus.DestroyPending) && this.taskStatusChanage([n]);
                let i = this.getTaskCategoryView(n), a = [n];
                null !== i && i.removeTask(a), this.removeTask(e);
                let o = yield n.delete(t);
                return w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskDestroyed, [n], o), o
            })
        }

        deleteBatchTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = [], a = [];
                for (let t = 0; t < e.length; ++t) {
                    let i = this.tasks.get(e[t]);
                    if (!i) {
                        D.warning("deleteBatchTask task", i);
                        continue
                    }
                    let o = i.getTaskStatus();
                    o === c.DownloadKernel.TaskStatus.StartPending || o === c.DownloadKernel.TaskStatus.Started ? a.push(i) : n.push(i)
                }
                let o = !0;
                if (n.length > 0) {
                    w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskDestroying, n);
                    let e = [];
                    for (let t = 0; t < n.length; ++t) {
                        let i = n[t];
                        i.updateTaskStatus(c.DownloadKernel.TaskStatus.DestroyPending) && e.push(i)
                    }
                    e.length > 0 && w.fireTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, e);
                    let i = this.getTaskCategoryView(n[0]);
                    null !== i && i.removeTask(n);
                    let a = h.ThunderKernel.beginTransaction();
                    for (let e = 0; e < n.length; ++e) {
                        let i = n[e];
                        this.removeTask(i.getId()), o = (yield i.delete(t)) && o
                    }
                    h.ThunderKernel.commitTransaction(a), w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskDestroyed, n, o)
                }
                return a.length > 0 && (yield new Promise(e => {
                    let n = 0;
                    for (let r = 0; r < a.length; ++r) {
                        let s = a[r], l = s.getId();
                        this.stopTaskAW(l, c.DownloadKernel.TaskStopReason.DeleteTask).then(() => i(this, void 0, void 0, function* () {
                            ++n, w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskDestroying, [s]), s.updateTaskStatus(c.DownloadKernel.TaskStatus.DestroyPending) && this.taskStatusChanage([s]);
                            let i = this.getTaskCategoryView(s);
                            null !== i && i.removeTask([s]), this.removeTask(l);
                            let r = h.ThunderKernel.beginTransaction();
                            o = (yield s.delete(t)) && o, h.ThunderKernel.commitTransaction(r), w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskDestroyed, [s], o), n === a.length && e()
                        })).catch()
                    }
                })), o
            })
        }

        removeToRecycle(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.tasks.get(e);
                if (t) {
                    let n = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryViewId);
                    if (n === c.DownloadKernel.CategroyViewID.Completed) {
                        let e = [t];
                        b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed).removeTask(e)
                    } else if (yield this.stopTaskAW(e), (n = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryViewId)) === c.DownloadKernel.CategroyViewID.Completed) {
                        let e = [t];
                        b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed).removeTask(e)
                    } else {
                        let n = [t];
                        b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading).removeTask(n), this.removeStartTask(e)
                    }
                    t.moveToRecycle();
                    let i = b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Recycle), a = [];
                    a.push(t), i.insertTask(a, c.DownloadKernel.TaskInsertReason.Recycle)
                }
            })
        }

        batchRemoveToRecycle(e) {
            return i(this, void 0, void 0, function* () {
                let t = [], n = [];
                for (let i = 0; i < e.length; ++i) {
                    let a = this.tasks.get(e[i]), o = a.getTaskStatus();
                    o === c.DownloadKernel.TaskStatus.StartPending || o === c.DownloadKernel.TaskStatus.Started ? n.push(a) : t.push(a)
                }
                if (t.length > 0) {
                    this.getTaskCategoryView(t[0]).removeTask(t);
                    let e = void 0;
                    t.length > 1 && (e = h.ThunderKernel.beginTransaction()), t.forEach(e => {
                        e.moveToRecycle()
                    }), void 0 !== e && h.ThunderKernel.commitTransaction(e), b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Recycle).insertTask(t, c.DownloadKernel.TaskInsertReason.Recycle)
                }
                n.length > 0 && n.forEach(e => i(this, void 0, void 0, function* () {
                    let t = e.getId();
                    if (yield this.stopTaskAW(t), e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryViewId) === c.DownloadKernel.CategroyViewID.Completed) {
                        let t = b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed), n = [e];
                        t.removeTask(n)
                    } else {
                        b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading).removeTask([e]), this.removeStartTask(t)
                    }
                    e.moveToRecycle(), b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Recycle).insertTask([e], c.DownloadKernel.TaskInsertReason.Recycle)
                }))
            })
        }

        recoverFromRecycle(e) {
            let t = 0, n = this.tasks.get(e);
            if (n && (t = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.RecycleTime)) > 0) {
                if (n.recover()) {
                    let e = b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Recycle), t = [];
                    t.push(n), e.removeTask(t)
                }
                let e = n.getTaskStatus();
                if (e === c.DownloadKernel.TaskStatus.Succeeded || e === c.DownloadKernel.TaskStatus.Seeding) {
                    let e = b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed), t = [];
                    t.push(n), e.insertTask(t, c.DownloadKernel.TaskInsertReason.Recover)
                } else {
                    let e = b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading), t = [];
                    t.push(n), e.insertTask(t, c.DownloadKernel.TaskInsertReason.Recover)
                }
            }
            return t > 0
        }

        batchRecoverFromRecycle(e) {
            let t = [], n = [], i = [], a = h.ThunderKernel.beginTransaction();
            for (let a of e) {
                let e = this.tasks.get(a);
                if (e) {
                    if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.RecycleTime) > 0) {
                        e.recover() && t.push(e);
                        let a = e.getTaskStatus();
                        a === c.DownloadKernel.TaskStatus.Succeeded || a === c.DownloadKernel.TaskStatus.Seeding ? n.push(e) : i.push(e)
                    }
                }
            }
            if (h.ThunderKernel.commitTransaction(a), t.length > 0) {
                b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Recycle).removeTask(t)
            }
            if (n.length > 0) {
                b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed).insertTask(n, c.DownloadKernel.TaskInsertReason.Recover)
            }
            if (i.length > 0) {
                b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading).insertTask(i, c.DownloadKernel.TaskInsertReason.Recover)
            }
        }

        reDownloadTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                do {
                    let i = this.tasks.get(e);
                    if (!i) break;
                    yield this.deleteTask(e, !0);
                    let a = i.getExtraObject().getAllUserData(),
                        o = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                    switch (o > 0 && (t.taskBaseInfo.fileSize = o), i.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType)) {
                        case c.DownloadKernel.TaskType.P2sp:
                            n = yield this.redownloadP2spTask(i, t);
                            break;
                        case c.DownloadKernel.TaskType.Bt:
                            n = yield this.redownloadBtTask(i, t);
                            break;
                        case c.DownloadKernel.TaskType.Emule:
                            n = yield this.redownloadEmuleTask(i, t);
                            break;
                        case c.DownloadKernel.TaskType.Group:
                            n = yield this.redownloadGroupTask(i, t)
                    }
                    if (n) {
                        n.getExtraObject().setAllUserData(a)
                    }
                } while (0);
                return n
            })
        }

        moveTaskToPath(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1, i = this.getTaskFromTaskId(e);
                do {
                    if (!i) break;
                    let a = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath);
                    if (!t || "" === t || t === a) break;
                    let o = i.getTaskStatus();
                    o === c.DownloadKernel.TaskStatus.Started || o === c.DownloadKernel.TaskStatus.StartPending ? (n = yield this.stopTaskAW(e), n = (o = i.getTaskStatus()) === c.DownloadKernel.TaskStatus.Succeeded || o === c.DownloadKernel.TaskStatus.Seeding ? yield this.moveTask(e, t) : yield this.moveTask(e, t, !0)) : n = yield this.moveTask(e, t)
                } while (0);
                let a = [];
                return a[0] = n ? i : null, w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskMovedEnd, a), n
            })
        }

        moveCategoryTask(e, t) {
            let n = this.getTaskFromTaskId(e);
            do {
                if (!n) break;
                let e = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId);
                if (void 0 === t || e === t) break;
                let i = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryViewId), a = null;
                if (!(a = -1 === e ? b.getCategoryViewFromId(i) : C.getCategoryView(e, i))) break;
                let o = null;
                if (!(o = -1 === t ? b.getCategoryViewFromId(i) : C.getCategoryView(t, i))) break;
                let r = [];
                r.push(n), a.removeTask(r), n.setCategoryId(t), o.insertTask(r, c.DownloadKernel.TaskInsertReason.MoveThoughCategory)
            } while (0);
            let i = [];
            return i[0] = null, w.fireTaskEvent(c.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, i), !1
        }

        getTaskCount() {
            return this.tasks.size
        }

        getTaskFromTaskId(e) {
            return this.tasks.get(e)
        }

        batchFindP2spTask(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    h.ThunderKernel.batchFindP2spTask(e, n => {
                        let i = [];
                        do {
                            if (D.information("batchFindTaskAsync batchFindBtTask urls:", e, ",results:", n), !n || n.length <= 0) break;
                            for (let e = 0; e < n.length; ++e) {
                                let t = n[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && i.push(a)
                            }
                        } while (0);
                        t(i)
                    }) || t(null)
                })
            })
        }

        batchFindEmuleTask(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    h.ThunderKernel.batchFindEmuleTask(e, n => {
                        let i = [];
                        do {
                            if (D.information("batchFindTaskAsync batchFindEmuleTask fileHashs:", e, ",results:", n), !n || n.length <= 0) break;
                            for (let e = 0; e < n.length; ++e) {
                                let t = n[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && i.push(a)
                            }
                        } while (0);
                        t(i)
                    }) || t(null)
                })
            })
        }

        batchFindBtTask(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    h.ThunderKernel.batchFindBtTask(e, n => {
                        let i = [];
                        do {
                            if (D.information("batchFindTaskAsync batchFindBtTask infoIds:", e, ",results:", n), !n || n.length <= 0) break;
                            for (let e = 0; e < n.length; ++e) {
                                let t = n[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && i.push(a)
                            }
                        } while (0);
                        t(i)
                    }) || t(null)
                })
            })
        }

        batchFindMagnetTask(e) {
            let t = [];
            do {
                let n = [];
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t];
                    d.Common.isThunderPrivateUrl(i) && (i = d.Common.parseThunderPrivateUrl(i));
                    try {
                        i = decodeURI(i)
                    } catch (e) {
                        D.warning(e)
                    }
                    i && n.push(this.splitLastChar(i).toLowerCase())
                }
                if (n.length <= 0) break;
                for (let e = 0; e < n.length; ++e) {
                    let i = n[e];
                    for (let [, e]of this.tasks) if (!this.isOtherPrivateSpaceTask(e)) {
                        if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType) === c.DownloadKernel.TaskType.Magnet) {
                            let n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl);
                            d.Common.isThunderPrivateUrl(n) && (n = d.Common.parseThunderPrivateUrl(n));
                            try {
                                n = decodeURI(n)
                            } catch (e) {
                                D.warning(e)
                            }
                            if (n && i === this.splitLastChar(n).toLowerCase()) {
                                t.push(e);
                                break
                            }
                        }
                    }
                }
            } while (0);
            return t
        }

        batchFindGroupTask(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    h.ThunderKernel.batchFindGroupTask(e, n => {
                        let i = [];
                        do {
                            if (D.information("batchFindTaskAsync batchFindGroupTask taskNames:", e, ",results:", n), !n || n.length <= 0) break;
                            for (let e = 0; e < n.length; ++e) {
                                let t = n[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && i.push(a)
                            }
                        } while (0);
                        t(i)
                    }) || t(null)
                })
            })
        }

        batchFindTaskAsync(e) {
            return i(this, void 0, void 0, function* () {
                let t = [], n = [], i = [], a = [], o = [];
                for (let r = 0; r < e.length; ++r) {
                    let s = e[r], l = s.keyValue;
                    void 0 !== l && (s.keyType === c.DownloadKernel.KeyType.P2spUrl ? t.push(l) : s.keyType === c.DownloadKernel.KeyType.EmuleFileHash ? n.push(l) : s.keyType === c.DownloadKernel.KeyType.BtInfoId ? i.push(l) : s.keyType === c.DownloadKernel.KeyType.MagnetUrl ? a.push(l) : s.keyType === c.DownloadKernel.KeyType.GroupTaskName && o.push(l))
                }
                let r = [];
                if (t.length <= 0 && n.length <= 0 && i.length <= 0 && a.length <= 0 && o.length <= 0) return r;
                if (t.length > 0) {
                    let e = yield this.batchFindP2spTask(t);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (n.length > 0) {
                    let e = yield this.batchFindEmuleTask(n);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (i.length > 0) {
                    let e = yield this.batchFindBtTask(i);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (a.length > 0) {
                    let e = this.batchFindMagnetTask(a);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (o.length > 0) {
                    let e = yield this.batchFindGroupTask(o);
                    e && e.length > 0 && (r = r.concat(e))
                }
                return D.information("batchFindTaskAsync keyInfos:", e, ", ret:", r), r
            })
        }

        isLoadStorageTaskFinish() {
            return this.isLoadStorageFinish
        }

        getTotalDownloadSpeed() {
            return this.totalDownloadSpeed
        }

        getTotalUploadSpeed() {
            return this.totalUploadSpeed
        }

        getTotalDownloadSize() {
            let e = 0;
            return this.lastGlobalStat && this.lastGlobalStat.recvdBytes && (e = this.lastGlobalStat.recvdBytes), e < 0 && (e = 0), e
        }

        getTotalUploadSize() {
            let e = 0;
            return this.lastGlobalStat && this.lastGlobalStat.sentBytes && (e = this.lastGlobalStat.sentBytes), e < 0 && (e = 0), e
        }

        attachListener(e, t) {
            do {
                if (e === u.NodeEventMesssageNS.eventTaskDataBaseLoadEnd) {
                    if (this.isLoadStorageFinish) {
                        t(this.isLoadStorageFinish);
                        break
                    }
                    this.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }

        attachOnceListener(e, t) {
            this.eventContainer.attachOnceListener(e, t)
        }

        detachListener(e, t) {
            this.eventContainer.detachListener(e, t)
        }

        queryTaskInfo() {
            let e = 0, t = this.startTasks.length, n = void 0;
            t > 0 && (n = h.ThunderKernel.beginTransaction());
            for (let i = 0; i < this.startTasks.length; ++i) {
                let a = this.startTasks[i], o = this.tasks.get(a), r = !1;
                o && (r = o.queryTaskInfo(e => {
                    this.taskStatusChanage([e])
                }, (e, t) => {
                    this.taskDetailChanage([e], t)
                }, () => {
                    ++e === t && h.ThunderKernel.commitTransaction(n)
                })), r || ++e === t && h.ThunderKernel.commitTransaction(n)
            }
            h.ThunderKernel.queryGlobalInfo(0, e => {
                if (this.lastGlobalStat && e) {
                    if (void 0 !== this.lastGlobalStat.recvdBytes && void 0 !== e.recvdBytes) {
                        let t = e.recvdBytes - this.lastGlobalStat.recvdBytes;
                        t < 0 && (t = 0), this.totalDownloadSpeed !== t && (this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, t), this.totalDownloadSpeed = t)
                    } else this.totalDownloadSpeed = 0;
                    if (void 0 !== this.lastGlobalStat.sentBytes && void 0 !== e.sentBytes) {
                        let t = e.sentBytes - this.lastGlobalStat.sentBytes;
                        t < 0 && (t = 0), this.totalUploadSpeed !== t && (this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventGlobalUploadSpeedChanged, t), this.totalUploadSpeed = t)
                    } else this.totalUploadSpeed = 0;
                    e && (this.lastGlobalStat = e)
                }
            })
        }

        loadTaskBase() {
            h.ThunderKernel.loadTaskBase(e => {
                this.loadTaskBaseCallback(e).catch()
            })
        }

        setGlobalExtInfo(e) {
            return i(this, void 0, void 0, function* () {
                const {LoginHelperNS: t} = yield Promise.resolve().then(() => n(65));
                if (yield t.loginHelper.isLoginedAw()) t.loginHelper.getAllUserInfo(t => {
                    let n = "0", i = "", a = 0, o = "";
                    do {
                        if (!t) break;
                        if (o = t.userID, D.information(`stat dk userId ${t.userID}`, t), !t.vipList) break;
                        if (!t.vipList[0]) break;
                        if (D.information(`stat dk isVip ${t.vipList[0].isVip}`), "0" === (n = "1" === String(t.vipList[0].isVip) ? "1" : "0")) break;
                        D.information(`stat dk vasType ${t.vipList[0].vasType}, vipLevel ${t.vipList[0].vipLevel}`);
                        let e = {2: "normal", 3: "platinum", 5: "super"};
                        t.vipList[0].vasType && e.hasOwnProperty(String(t.vipList[0].vasType)) && (i = e[String(t.vipList[0].vasType)]), t.vipList[0].vipLevel && !isNaN(Number(t.vipList[0].vipLevel)) && (a = t.vipList[0].vipLevel)
                    } while (0);
                    h.ThunderKernel.setUserInfo(o, "");
                    let r = `isvip=${n},viptype=${i},viplevel=${a},userchannel=${e}`;
                    D.information("stat dk extinfo", r), h.ThunderKernel.setGlobalExtInfo(r, !1)
                }); else {
                    h.ThunderKernel.setUserInfo("", "");
                    let t = `isvip=0,viptype=,viplevel=0,userchannel=${e}`;
                    D.information("stat dk extinfo", t), h.ThunderKernel.setGlobalExtInfo(t, !1)
                }
            })
        }

        isDkLoaded() {
            return this.isInitDkFinish
        }

        initDownloadKernelEnd(e) {
            this.isInitDkFinish = 0 === e, this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventDownloadKernelInitEnd, e)
        }

        enableCommonP2pChannel(e) {
            this.isEnableP2pChannel = e
        }

        enableCommonP2sChannel(e) {
            this.isEnableP2sChannel = e
        }

        getTotalTaskDownloadSpeed(e, t) {
            let n = 0;
            for (let i = 0; i < this.startTasks.length; ++i) {
                let a = this.startTasks[i], o = this.getTaskFromTaskId(a);
                if (!o) continue;
                if (void 0 !== t && null !== t || (t = !0), !t && o.getIsPrivate()) continue;
                if (o.getTaskStatus() !== c.DownloadKernel.TaskStatus.Started) continue;
                let r = o.getDownloadSpeed();
                o.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background) ? e && (n += r) : n += r
            }
            return n
        }

        getTotalTaskVipSpeed(e, t) {
            let n = 0;
            for (let i = 0; i < this.startTasks.length; ++i) {
                let a = this.startTasks[i], o = this.getTaskFromTaskId(a);
                if (!o) continue;
                if (void 0 !== t && null !== t || (t = !0), !t && o.getIsPrivate()) continue;
                if (o.getTaskStatus() !== c.DownloadKernel.TaskStatus.Started) continue;
                let r = o.getVipSpeed();
                o.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background) ? e && (n += r) : n += r
            }
            return n
        }

        attachTaskStopOnce(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = this.tasks.get(e);
                    if (n) {
                        let i = n.getTaskStatus();
                        if (i === c.DownloadKernel.TaskStatus.Succeeded || i === c.DownloadKernel.TaskStatus.Seeding || i === c.DownloadKernel.TaskStatus.Stopped || i === c.DownloadKernel.TaskStatus.Failed) t(!0); else {
                            let n = 0;
                            n = w.attachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, (...i) => {
                                do {
                                    if (!i) break;
                                    if (i[0] !== c.DownloadKernel.TaskEventType.StatusChanged) break;
                                    let a = i[1];
                                    if (!a) break;
                                    for (let i = 0; i < a.length; ++i) {
                                        let o = a[i];
                                        if (!o) continue;
                                        let r = o.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId);
                                        if (e !== r) continue;
                                        let s = o.getTaskStatus();
                                        s !== c.DownloadKernel.TaskStatus.Succeeded && s !== c.DownloadKernel.TaskStatus.Seeding && s !== c.DownloadKernel.TaskStatus.Stopped || (w.detachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, n), t(!0));
                                        break
                                    }
                                } while (0)
                            })
                        }
                    } else t(!1)
                })
            })
        }

        downloadTaskSelectFiles(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    if (!t) break;
                    let i = null;
                    try {
                        i = JSON.parse(t)
                    } catch (e) {
                        D.warning(e)
                    }
                    if (null == i) break;
                    let a = this.tasks.get(e);
                    if (!a) break;
                    let o = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType);
                    if (o === c.DownloadKernel.TaskType.Bt) {
                        a.getExtraObject().setDownloadFile(i)
                    } else {
                        if (o !== c.DownloadKernel.TaskType.Group) break;
                        a.getExtraObject().setDownloadTask(i)
                    }
                    a.getTaskAttribute(c.DownloadKernel.TaskAttribute.RecycleTime) > 0 && this.recoverFromRecycle(e);
                    let r = a.getTaskStatus();
                    if (r === c.DownloadKernel.TaskStatus.Started || r === c.DownloadKernel.TaskStatus.StartPending) yield this.stopTaskAW(e, c.DownloadKernel.TaskStopReason.SelectDownloadLists), r = a.getTaskStatus(); else if (r === c.DownloadKernel.TaskStatus.StartWaiting) if (this.taskStatusChanage([a]), o === c.DownloadKernel.TaskType.Group) {
                        a.getExtraObject().updateTaskDetail()
                    } else if (o === c.DownloadKernel.TaskType.Bt) {
                        let t = a.getExtraObject(), n = t.getFileSize();
                        a.internalSetFileSize(n) && this.taskDetailChanage([a], c.DownloadKernel.TaskDetailChangedFlags.FileSize);
                        let i = [], o = t.getBtFileList();
                        for (let [, e]of o) {
                            let t = e.getBtDownloadFileInfo();
                            i.push(t)
                        }
                        w.fireTaskEvent(c.DownloadKernel.TaskEventType.BtSubFileDetailChanged, e, i)
                    }
                    if (r === c.DownloadKernel.TaskStatus.Succeeded || r === c.DownloadKernel.TaskStatus.Seeding) {
                        let e = null, t = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId);
                        if (e = void 0 !== t && t > -1 ? C.getCategoryView(t, c.DownloadKernel.CategroyViewID.Completed) : b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed)) {
                            let t = [];
                            t.push(a), e.removeTask(t)
                        }
                        let n = null;
                        if (n = void 0 !== t && t > -1 ? C.getCategoryView(t, c.DownloadKernel.CategroyViewID.Downloading) : b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading)) {
                            a.updateTaskStatus(c.DownloadKernel.TaskStatus.Stopped) && (a.setStopReason(c.DownloadKernel.TaskStopReason.SelectDownloadLists), this.taskStatusChanage([a]), a.setStopReason(c.DownloadKernel.TaskStopReason.Unknown));
                            let e = [];
                            e.push(a), n.insertTask(e, c.DownloadKernel.TaskInsertReason.ReDownload)
                        }
                    }
                    n = !0
                } while (0);
                return n
            })
        }

        getTaskCategoryView(e) {
            let t = null, n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId),
                i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryViewId);
            return t = void 0 !== n && -1 !== n ? C.getCategoryView(n, i) : b.getCategoryViewFromId(i)
        }

        loadStorageTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = !0, n = new f.Task;
                if (null !== e) switch (e.taskType) {
                    case c.DownloadKernel.TaskType.P2sp:
                        n.loadStorageP2spTask(e);
                        break;
                    case c.DownloadKernel.TaskType.Bt:
                        t = !1;
                        let i = new f.Task;
                        yield i.loadStorageBtTaskAW(e), this.addTask(i) && this.insertToCategoryView(i, c.DownloadKernel.TaskInsertReason.LoadTaskBasic);
                        break;
                    case c.DownloadKernel.TaskType.Emule:
                        n.loadStorageEmuleTask(e);
                        break;
                    case c.DownloadKernel.TaskType.Group:
                        n.loadStorageGroupTask(e);
                        break;
                    default:
                        t = !1
                }
                return t && this.addTask(n) || (n = null), n
            })
        }

        getTaskStrategy(e) {
            let t = c.DownloadKernel.DispatchStrategy.DispatchStrategyOrigin, n = this.tasks.get(e);
            if (n) {
                n.getOriginOnlyStrategy() || (this.isEnableP2pChannel && (t += c.DownloadKernel.DispatchStrategy.DispatchStrategyP2p), this.isEnableP2sChannel && (t += c.DownloadKernel.DispatchStrategy.DispatchStrategyP2s))
            }
            return t
        }

        redownloadP2spTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                if (e) {
                    let i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath),
                        o = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl),
                        r = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.RefUrl),
                        s = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Cookie), l = e.getIsPrivate(), u = null;
                    t && t.taskBaseInfo ? ((u = t.taskBaseInfo).taskName && "" !== u.taskName || (u.taskName = i), u.savePath && "" !== u.savePath || (u.savePath = a)) : u = {
                        taskName: i,
                        savePath: a
                    };
                    let d = {url: o, refUrl: r, cookie: s, useOriginResourceOnly: 0};
                    t && t.p2spTaskInfo && (d.useOriginResourceOnly = t.p2spTaskInfo.useOriginResourceOnly ? 1 : 0), n = yield this.createTask(c.DownloadKernel.TaskType.P2sp, {
                        taskBaseInfo: u,
                        p2spTaskInfo: d,
                        privateSpace: l
                    })
                }
                return n
            })
        }

        redownloadBtTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                if (e) {
                    let i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath), o = e.getIsPrivate(),
                        r = e.getExtraObject(), s = r.getSeedFilePath(), l = r.getDisplayName(), u = r.getInfoId(),
                        d = r.getTrackerUrls(), h = r.getDownloadFile(), f = r.getBtFileInfoList(), p = null;
                    t && t.taskBaseInfo ? ((p = t.taskBaseInfo).taskName && "" !== p.taskName || (p.taskName = i), p.savePath && "" !== p.savePath || (p.savePath = a)) : p = {
                        taskName: i,
                        savePath: a
                    };
                    let g = {seedFile: s, displayName: l, fileRealIndexLists: h, fileLists: f, infoId: u, tracker: d};
                    t && t.btTaskInfo && t.btTaskInfo.fileRealIndexLists && t.btTaskInfo.fileRealIndexLists.length > 0 && (g.fileRealIndexLists = t.btTaskInfo.fileRealIndexLists), n = yield this.createTask(c.DownloadKernel.TaskType.Bt, {
                        taskBaseInfo: p,
                        btTaskInfo: g,
                        privateSpace: o
                    })
                }
                return n
            })
        }

        redownloadEmuleTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                if (e) {
                    let i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath),
                        o = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl), r = e.getIsPrivate(), s = null;
                    t && t.taskBaseInfo ? ((s = t.taskBaseInfo).taskName && "" !== s.taskName || (s.taskName = i), s.savePath && "" !== s.savePath || (s.savePath = a)) : s = {
                        taskName: i,
                        savePath: a
                    };
                    let l = null;
                    t && t.emuleTaskInfo ? (l = t.emuleTaskInfo).url = o : l = {url: o}, n = yield this.createTask(c.DownloadKernel.TaskType.Emule, {
                        taskBaseInfo: s,
                        emuleTaskInfo: l,
                        privateSpace: r
                    })
                }
                return n
            })
        }

        redownloadGroupTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null;
                if (e) {
                    let i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath), o = e.getIsPrivate(),
                        r = e.getExtraObject(), s = r.getSubTaskCount(), l = [];
                    for (let e = 0; e < s; ++e) {
                        let n = r.getSubTaskByIndex(e);
                        if (n) {
                            let i = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName),
                                a = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath),
                                r = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl),
                                s = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.RefUrl),
                                u = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.Cookie),
                                d = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSubTask),
                                h = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType),
                                f = {taskBaseInfo: {taskName: i, savePath: a}, privateSpace: o};
                            if (h === c.DownloadKernel.TaskType.P2sp ? (f.taskType = h, f.p2spTaskInfo = {
                                url: r,
                                refUrl: s,
                                cookie: u,
                                downloadSubTask: d
                            }, l.push(f)) : h === c.DownloadKernel.TaskType.Emule && (f.taskType = h, f.emuleTaskInfo = {
                                url: r,
                                downloadSubTask: d
                            }, l.push(f)), t && t.groupTaskInfo && t.groupTaskInfo.subTaskList && t.groupTaskInfo.subTaskList[e]) {
                                let n = t.groupTaskInfo.subTaskList[e];
                                n.taskBaseInfo && (f.taskBaseInfo = n.taskBaseInfo, f.taskBaseInfo.taskName && "" !== f.taskBaseInfo.taskName || (f.taskBaseInfo.taskName = i), f.taskBaseInfo.savePath && "" !== f.taskBaseInfo.savePath || (f.taskBaseInfo.savePath = a)), h === c.DownloadKernel.TaskType.P2sp ? n.p2spTaskInfo && (f.p2spTaskInfo.useOriginResourceOnly = n.p2spTaskInfo.useOriginResourceOnly ? 1 : 0) : h === c.DownloadKernel.TaskType.Emule && n.emuleTaskInfo && (f.emuleTaskInfo.origin = n.emuleTaskInfo.origin)
                            }
                        }
                    }
                    let u = null;
                    t && t.taskBaseInfo ? ((u = t.taskBaseInfo).taskName && "" !== u.taskName || (u.taskName = i), u.savePath && "" !== u.savePath || (u.savePath = a)) : u = {
                        taskName: i,
                        savePath: a
                    };
                    let d = {subTaskList: l};
                    n = yield this.createTask(c.DownloadKernel.TaskType.Group, {
                        taskBaseInfo: u,
                        groupTaskInfo: d,
                        privateSpace: o
                    })
                }
                return n
            })
        }

        addTask(e) {
            let t = !1;
            if (e) {
                let n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId);
                this.tasks.set(n, e);
                let i = this.getTaskStrategy(n);
                e.setDispatchStrategy(i), t = !0
            }
            return t
        }

        removeTask(e) {
            let t = this.getTaskFromTaskId(e);
            if (t) {
                if (t.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType) === c.DownloadKernel.TaskType.Group) {
                    let e = t.getExtraObject(), n = e.getSubTaskCount();
                    for (let t = 0; t < n; ++t) {
                        let n = e.getSubTaskByIndex(t);
                        if (n) {
                            let e = n.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId);
                            this.tasks.delete(e)
                        }
                    }
                }
            }
            this.tasks.delete(e), this.removeStartTask(e)
        }

        insertToCategoryView(e, t = c.DownloadKernel.TaskInsertReason.Unknown) {
            let n = c.DownloadKernel.CategroyViewID.Downloading;
            if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.RecycleTime) > 0) n = c.DownloadKernel.CategroyViewID.Recycle; else {
                let t = e.getTaskStatus();
                t !== c.DownloadKernel.TaskStatus.Succeeded && t !== c.DownloadKernel.TaskStatus.Seeding || (n = c.DownloadKernel.CategroyViewID.Completed)
            }
            let i = null, a = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId);
            if (i = void 0 !== a && a > -1 ? C.getCategoryView(a, n) : b.getCategoryViewFromId(n)) {
                let n = [];
                n.push(e), i.insertTask(n, t)
            }
        }

        taskStatusChanage(e) {
            for (let t = 0; t < e.length; ++t) {
                let n = e[t];
                if (n.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0) {
                    let e = n, t = n.getTaskStatus();
                    t === c.DownloadKernel.TaskStatus.Succeeded || t === c.DownloadKernel.TaskStatus.Seeding ? e.onFinish() : t === c.DownloadKernel.TaskStatus.Stopped ? e.onStop() : t === c.DownloadKernel.TaskStatus.Failed && e.onFail()
                } else if (n.getType() === c.DownloadKernel.TaskType.Group) do {
                    let e = n.getExtraObject();
                    if (!e) break;
                    let t = e.getTaskStatus();
                    D.information("taskStatusChanage taskExtra.taskStatus:", t), t === c.DownloadKernel.TaskStatus.Succeeded || t === c.DownloadKernel.TaskStatus.Seeding ? this.onTaskFinish(n) : t === c.DownloadKernel.TaskStatus.Stopped ? this.onTaskStop(n) : t === c.DownloadKernel.TaskStatus.Failed && this.onTaskFailed(n)
                } while (0); else {
                    let e = n.getTaskStatus();
                    D.information("taskStatusChanage task.taskStatus:", e), e === c.DownloadKernel.TaskStatus.Succeeded || e === c.DownloadKernel.TaskStatus.Seeding ? this.onTaskFinish(n) : e === c.DownloadKernel.TaskStatus.Stopped ? this.onTaskStop(n) : e === c.DownloadKernel.TaskStatus.Failed && this.onTaskFailed(n)
                }
            }
            w.fireTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, e)
        }

        taskDetailChanage(e, t) {
            let n = new Map, i = [];
            e.forEach(e => {
                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId);
                if (t < 1) i.push(e); else {
                    let i = n.get(t);
                    i || (i = [], n.set(t, i)), i.push(e)
                }
            }), n.size > 0 && w.fireTaskEvent(c.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, n), i.length > 0 && w.fireTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, i, t)
        }

        loadTaskBaseCallback(e) {
            return i(this, void 0, void 0, function* () {
                let t = new Map, n = [];
                if (e) {
                    let i = [], a = [], o = [], r = new Map, s = new Map;
                    for (let l = 0; l < e.length; ++l) {
                        let u = e[l];
                        if (!u) continue;
                        if (-1 === u.recycleTime) continue;
                        if (u.taskStatus !== c.DownloadKernel.TaskStatus.Unkown && u.taskStatus !== c.DownloadKernel.TaskStatus.Failed && u.taskStatus !== c.DownloadKernel.TaskStatus.Succeeded && u.taskStatus !== c.DownloadKernel.TaskStatus.Seeding && (u.taskStatus = c.DownloadKernel.TaskStatus.Stopped), u.taskType === c.DownloadKernel.TaskType.Bt) {
                            n.push(u);
                            continue
                        }
                        let d = u.groupTaskId;
                        if (d > 0) {
                            let e = t.get(d);
                            e || (e = []), e.push(u), t.set(d, e)
                        }
                        let h = yield this.loadStorageTask(u);
                        if (h) {
                            if (h.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) < 1) if (u.categoryId > -1) {
                                let e = h.getTaskStatus();
                                if (e === c.DownloadKernel.TaskStatus.Succeeded || e === c.DownloadKernel.TaskStatus.Seeding) {
                                    let e = s.get(u.categoryId);
                                    e || (e = [], s.set(u.categoryId, e)), e.push(h)
                                } else {
                                    let e = r.get(u.categoryId);
                                    e || (e = [], r.set(u.categoryId, e)), e.push(h)
                                }
                            } else {
                                if (h.getTaskAttribute(c.DownloadKernel.TaskAttribute.RecycleTime) > 0) o.push(h); else {
                                    let e = h.getTaskStatus();
                                    e === c.DownloadKernel.TaskStatus.Succeeded || e === c.DownloadKernel.TaskStatus.Seeding ? a.push(h) : i.push(h)
                                }
                            }
                        }
                    }
                    if (i.length > 0) {
                        let e = b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading);
                        e && e.insertTask(i, c.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                    if (a.length > 0) {
                        let e = b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed);
                        e && e.insertTask(a, c.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                    if (o.length > 0) {
                        let e = b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Recycle);
                        e && e.insertTask(o, c.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                    for (let [e, t]of r) {
                        let n = C.getCategoryView(e, c.DownloadKernel.CategroyViewID.Downloading);
                        n ? n.insertTask(t, c.DownloadKernel.TaskInsertReason.LoadTaskBasic) : D.error("getCategoryView failed! categoryId:", e, ", categoryViewId:", c.DownloadKernel.CategroyViewID.Downloading)
                    }
                    for (let [e, t]of s) {
                        let n = C.getCategoryView(e, c.DownloadKernel.CategroyViewID.Completed);
                        n ? n.insertTask(t, c.DownloadKernel.TaskInsertReason.LoadTaskBasic) : D.error("getCategoryView failed! categoryId:", e, ", categoryViewId:", c.DownloadKernel.CategroyViewID.Completed)
                    }
                }
                for (let [e, n]of t) {
                    let t = this.getTaskFromTaskId(e);
                    if (t) {
                        let e = t.getExtraObject();
                        if (e) {
                            let i = void 0, a = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath);
                            a && (i = a.length + 1);
                            for (let t = 0; t < n.length; ++t) {
                                let a = n[t], o = a.taskId, r = this.getTaskFromTaskId(o);
                                r && (this.setGroupTaskRelativePath(r, a.savePath, i), e.addSubTask(r))
                            }
                        }
                    }
                }
                if (n.length > 0) for (let e of n) yield this.loadStorageTask(e);
                this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventTaskDataBaseLoadEnd), this.isLoadStorageFinish = !0
            })
        }

        setGroupTaskRelativePath(e, t, n) {
            if (e && t && n) {
                let i = t.substr(n, t.length);
                i ? i.length > 0 && (i += "\\") : i = "", e.updateTaskRelativePath(i)
            }
        }

        onTaskFinish(e) {
            let t = e.onFinish();
            if (!e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background)) {
                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId), n = null;
                if (n = void 0 !== t && -1 !== t ? C.getCategoryView(t, c.DownloadKernel.CategroyViewID.Downloading) : b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading)) {
                    let t = [];
                    t.push(e), n.removeTask(t)
                }
                if (0 === e.getTaskAttribute(c.DownloadKernel.TaskAttribute.RecycleTime)) {
                    let n = null;
                    if (n = void 0 !== t && -1 !== t ? C.getCategoryView(t, c.DownloadKernel.CategroyViewID.Completed) : b.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed)) {
                        let t = [];
                        t.push(e), n.insertTask(t, c.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                }
            }
            let n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId);
            return this.removeStartTask(n), t
        }

        onTaskStop(e) {
            let t = e.onStop(), n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId);
            return this.removeStartTask(n), t
        }

        onTaskFailed(e) {
            let t = e.onFail(), n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId);
            return this.removeStartTask(n), t
        }

        moveTaskFiles(e, t, n) {
            return a.ipcRenderer.send(m.ThunderChannelList.channelRMFileMove, e, t, n), new Promise(e => {
                a.ipcRenderer.once(m.ThunderChannelList.channelMRFileMoveResult, (t, i, a, o) => {
                    o === n && (i || 2 !== a && 124 !== a || (i = !0), e(i))
                })
            })
        }

        moveTask(e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    let a = this.tasks.get(e);
                    if (!a) break;
                    let r = void 0, s = void 0, u = a.getTaskStatus(),
                        d = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType),
                        h = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath);
                    if (yield S.SingleBtTaskNS.isSingleBtTask(a)) {
                        let e = void 0, n = a.getExtraObject(), i = n.getBtFileList();
                        for (let [, t]of i) {
                            e = t.getBtFileAttribute(c.DownloadKernel.BtFileAttribute.FileName);
                            break
                        }
                        let d = o.join(h, e), f = n.getInfoId() + ".torrent", p = o.join(h, f);
                        if (p += "\r\n", u === c.DownloadKernel.TaskStatus.Succeeded || u === c.DownloadKernel.TaskStatus.Seeding) r = (d += "\r\n") + p; else {
                            let e = d + ".bt.xltd";
                            (yield l.FileSystemAWNS.existsAW(e)) || (e = d + ".bt.td"), r = (e += "\r\n") + p
                        }
                        s = t
                    } else {
                        let l = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName), f = o.join(h, l),
                            p = o.join(t, l);
                        if (u === c.DownloadKernel.TaskStatus.Succeeded || u === c.DownloadKernel.TaskStatus.Seeding) d === c.DownloadKernel.TaskType.P2sp || d === c.DownloadKernel.TaskType.Emule ? (r = f, s = p) : d === c.DownloadKernel.TaskType.Bt ? (r = f, s = p) : d === c.DownloadKernel.TaskType.Group && (i = yield this.moveGroupTask(e, t, n)); else if (d === c.DownloadKernel.TaskType.P2sp) {
                            r = f + ".xltd\r\n" + (f + ".xltd.cfg\r\n"), s = t
                        } else if (d === c.DownloadKernel.TaskType.Emule) {
                            r = f + ".emule.xltd\r\n" + (f + ".xlemule.cfg\r\n"), s = t
                        } else d === c.DownloadKernel.TaskType.Bt ? (r = f, s = p) : d === c.DownloadKernel.TaskType.Group && (i = yield this.moveGroupTask(e, t, n))
                    }
                    void 0 !== r && void 0 !== s && (i = yield this.moveTaskFiles(r, s, e)), i && d !== c.DownloadKernel.TaskType.Group && (a.setSavePath(t), n && this.startTask(e), N.showNotify(T.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, v.ToastNotifyItemType.GreenNotify, "移动成功", 3e3))
                } while (0);
                return i
            })
        }

        moveGroupTask(e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    let a = this.tasks.get(e);
                    if (!a) break;
                    if (a.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType) !== c.DownloadKernel.TaskType.Group) break;
                    let r = a.getExtraObject();
                    if (!r) break;
                    if (!r.getSubTaskByIndex(0)) break;
                    let s = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath),
                        u = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName), d = o.join(s, "*"),
                        h = o.join(t, u);
                    if (i = yield this.moveTaskFiles(d, h, e)) {
                        let t = r.getSubTaskCount();
                        for (let e = 0; e < t; ++e) {
                            let t = r.getSubTaskByIndex(e);
                            if (t) {
                                let e = h, n = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath);
                                if (n === s) ; else if (n.length > s.length && n.substr(0, s.length) === s) {
                                    let t = n.slice(s.length);
                                    "\\" === t[0] && (t = t.slice(1), e = o.join(h, t))
                                }
                                t.setSavePath(e)
                            }
                        }
                        yield l.FileSystemAWNS.rmdirAW(s), a.setSavePath(h), n && this.startTask(e), N.showNotify(T.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, v.ToastNotifyItemType.GreenNotify, "移动成功", 3e3)
                    }
                } while (0);
                return i
            })
        }

        splitLastChar(e) {
            let t = e;
            return d.Common.isThunderPrivateUrl(e) && (e.lastIndexOf("==") === e.length - 2 ? t = e.substr(0, e.length - 2) : e.lastIndexOf("=") === e.length - 1 && (t = e.substr(0, e.length - 1))), t
        }

        removeStartTask(e) {
            let t = this.startTasks.indexOf(e);
            t > -1 && this.startTasks.splice(t, 1)
        }

        createGroupTask(e, t, n, a) {
            return i(this, void 0, void 0, function* () {
                let i = !1, o = h.ThunderKernel.beginTransaction();
                do {
                    if (e.createGroupTask(!1, t, n, a), !e.getExtraObject()) break;
                    yield this.createBatchTask(n.subTaskList, e), i = !0
                } while (0);
                return h.ThunderKernel.commitTransaction(o), i
            })
        }

        getTaskName(e, t, n, a) {
            return i(this, void 0, void 0, function* () {
                let i = "";
                for (; ;) {
                    if (e === c.DownloadKernel.TaskType.P2sp || e === c.DownloadKernel.TaskType.Emule) {
                        let e = o.extname(n), t = o.basename(n, e);
                        i = 0 === a ? n : t + "(" + a.toString() + ")" + e
                    } else {
                        i = 0 === a ? n : n + "(" + a.toString() + ")";
                        let e = o.join(t, i), r = yield l.FileSystemAWNS.lstatAW(e);
                        if (r && r.isDirectory()) {
                            i = n;
                            break
                        }
                    }
                    if (!(yield l.FileSystemAWNS.existsAW(o.join(t, i)))) break;
                    ++a
                }
                return {newName: i, index: a}
            })
        }

        isOtherPrivateSpaceTask(e) {
            let t = C.getCurrentPrivateCategory(), n = t ? t.getUserName() : "", i = e.getUserName();
            return !(!i || "" === i || n === i)
        }
    }

    t.TaskManager = I, function (e) {
        const t = new I;
        e.getTaskManager = function () {
            return t
        }
    }(t.DownloadKernelTaskManager || (t.DownloadKernelTaskManager = {}))
}, function (e, t, n) {
    e.exports = n(12)(14)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(34), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(3), r = n(4);
    let s = class extends r.Vue {
        onOptionsChanged() {
            this.appendContent()
        }

        appendContent() {
            this.dropdown || (this.dropdown = new o.remote.DropdownWindow), this.dropdown.clear(), this.options.forEach(e => {
                "separator" === e ? this.dropdown.append(new o.remote.DropdownWindowContent({type: "separator"})) : this.dropdown.append(new o.remote.DropdownWindowContent({
                    label: e.toString(),
                    click: () => {
                        this.$refs.select.menuVisible = !1, this.$emit("input", e, !0)
                    }
                }))
            })
        }

        handleMenuShow() {
            return a(this, void 0, void 0, function* () {
                if (void 0 === this.options || !Array.isArray(this.options) || 0 === this.options.length) return;
                this.dropdown || this.appendContent();
                let e = this.$el.getBoundingClientRect();
                const {DropDownWindowSkinNS: t} = yield Promise.resolve().then(() => n(96));
                t.setStyle(this.dropdown, {
                    windowPreference: {
                        marginLeft: 0,
                        marginRight: 0,
                        stringWidth: Math.round(e.width) - 39
                    }
                }), this.dropdown.popup({
                    window: o.remote.getCurrentWindow(),
                    x: Math.round(e.left),
                    y: Math.round(e.top + e.height + 4)
                })
            })
        }
    };
    i([r.Prop()], s.prototype, "value", void 0), i([r.Prop({default: () => []})], s.prototype, "options", void 0), i([r.Watch("options")], s.prototype, "onOptionsChanged", null), s = i([r.Component], s), t.default = s
}, function (e, t) {
    e.exports = require("events")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3);
    !function (e) {
        let t;
        !function (e) {
            e.Info = "info", e.Warning = "warning", e.Error = "error"
        }(t = e.ConfirmType || (e.ConfirmType = {})), e.confirm = function (e, t = {}) {
            let n = String(Math.random()).replace(/\D/, "");
            return i.ipcRenderer.send("message-box-confirm-create", {
                dialogConf: t,
                boxId: n
            }), i.remote.ipcMain.once(`message-box-init-${n}`, t => {
                t.sender.send("message-box-init-reply", {popType: "confirm", options: e})
            }), new Promise(e => {
                i.remote.ipcMain.once(`message-box-resolve-${n}`, (t, n, i) => {
                    e({action: n, checkboxChecked: i})
                })
            })
        }, e.pop = function (e, t = {}) {
            let n = String(Math.random()).replace(/\D/, "");
            return i.ipcRenderer.send("message-box-pop-create", {
                dialogConf: t,
                boxId: n
            }), i.remote.ipcMain.once(`message-box-init-${n}`, t => {
                t.sender.send("message-box-init-reply", {popType: "message-box", options: e})
            }), new Promise(e => {
                i.remote.ipcMain.once(`message-box-resolve-${n}`, (t, n, i) => {
                    e({action: n, formData: i})
                })
            })
        }, e.custom = function (e, t = {}, n = {}) {
            let a = String(Math.random()).replace(/\D/, "");
            return i.ipcRenderer.send("message-box-custom-create", {
                popType: e,
                dialogConf: n,
                boxId: a,
                options: t
            }), i.remote.ipcMain.once(`message-box-init-${a}`, i => {
                i.sender.send("message-box-init-reply", {popType: e, options: t, dialogConf: n})
            }), new Promise(e => {
                i.remote.ipcMain.once(`message-box-resolve-${a}`, (t, n, i) => {
                    e({action: n, args: i})
                })
            })
        }
    }(t.MessageBox || (t.MessageBox = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});

    class i {
        constructor(e, t, n = !1) {
            this.cookie = null, this.once = !1, this.callback = null, this.ref = 0, this.callback = e, this.cookie = t, this.once = n, this.ref = 1
        }

        fire(e, ...t) {
            return "function" == typeof this.callback && this.callback(e, ...t)
        }

        compare(e) {
            return this.cookie === e
        }

        addRef() {
            this.ref++
        }

        release() {
            return this.ref--, this.ref <= 0
        }
    }

    class a {
        constructor() {
            this.cookie = 0, this.listeners = new Map
        }

        attachTaskEvent(e, t) {
            this.cookie++;
            let n = new i(t, this.cookie, !1), a = this.listeners.get(e);
            return a || (a = []), a.push(n), this.listeners.set(e, a), this.cookie
        }

        attachTaskEventOnce(e, t) {
            this.cookie++;
            let n = new i(t, this.cookie, !0), a = this.listeners.get(e);
            return a || (a = []), a.push(n), this.listeners.set(e, a), this.cookie
        }

        detachTaskEvent(e, t) {
            let n = this.listeners.get(e);
            if (n) for (let e = 0; e < n.length; ++e) {
                let i = n[e];
                if (i.compare(t)) {
                    i.release() && n.splice(e, 1);
                    break
                }
            }
        }

        fireTaskEvent(e, ...t) {
            let n = this.listeners.get(e);
            if (n) {
                let i = [], a = n.length, o = 0;
                for (; o < a;) {
                    let r = n[o];
                    r.addRef();
                    let s = r.fire(e, ...t);
                    r.release() ? (n.splice(o, 1), --a) : (++o, r.once && s && i.push(r))
                }
                for (let t = 0; t < i.length; t++) {
                    let n = i[t];
                    this.detachTaskEvent(e, n.cookie)
                }
            }
        }
    }

    t.EventManager = a, function (e) {
        const t = new a;
        e.getEventManager = function () {
            return t
        }
    }(t.DownloadKernelEventManager || (t.DownloadKernelEventManager = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Default = 0] = "Default", e[e.Color = 1] = "Color", e[e.Wallpaper = 2] = "Wallpaper", e[e.Custom = 3] = "Custom"
        }(t = e.SkinType || (e.SkinType = {})), e.defaultSkinInfo = {type: t.Default, colorID: 0}
    }(t.SkinHelperNS || (t.SkinHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    t.__esModule = !0;
    var i = r(n(583)), a = r(n(595)),
        o = "function" == typeof a.default && "symbol" == typeof i.default ? function (e) {
            return typeof e
        } : function (e) {
            return e && "function" == typeof a.default && e.constructor === a.default && e !== a.default.prototype ? "symbol" : typeof e
        };

    function r(e) {
        return e && e.__esModule ? e : {default: e}
    }

    t.default = "function" == typeof a.default && "symbol" === o(i.default) ? function (e) {
        return void 0 === e ? "undefined" : o(e)
    } : function (e) {
        return e && "function" == typeof a.default && e.constructor === a.default && e !== a.default.prototype ? "symbol" : void 0 === e ? "undefined" : o(e)
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(7), o = n(1), r = n(5).default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    process.env.TL_ENABLE = "0", "console" === process.env.TL_OUTPUT ? o.default.outputLogger = o.outputLoggerConsole : o.default.outputLogger = function () {
        function e(e) {
            return function (...t) {
                r.printEtwLog(e, function (...e) {
                    return e.map(e => a.inspect(e)).join(" ").replace(/%/g, "%%")
                }(...t))
            }
        }

        return {
            [o.LogLevel.Critical]: e(o.LogLevel.Critical),
            [o.LogLevel.Error]: e(o.LogLevel.Error),
            [o.LogLevel.Warning]: e(o.LogLevel.Warning),
            [o.LogLevel.Information]: e(o.LogLevel.Information),
            [o.LogLevel.Verbose]: e(o.LogLevel.Verbose)
        }
    }()
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(16), o = (n(20), n(2)), r = n(7);
    let s = null;
    const l = n(13), u = n(3), d = n(1), c = n(5), h = n(14), f = "xdas_profile_stat";
    let p = "", g = void 0, k = null, m = void 0, T = null,
        v = c.default(o.join(__rootDir, "../bin/ThunderHelper.node")), y = new Set;

    function S() {
        return i(this, void 0, void 0, function* () {
            return new Promise(e => i(this, void 0, void 0, function* () {
                void 0 === m && (null === T && (T = new Promise(e => {
                    e(m = function (e) {
                        let t = "";
                        if (0 === e.length && "renderer" === process.type) {
                            let e = o.normalize(decodeURIComponent(window.location.href)),
                                n = e.indexOf(process.resourcesPath);
                            n = n > -1 ? n + process.resourcesPath.length + 1 : n;
                            let i = e.length - 1, a = e.indexOf("?"), r = e.indexOf("#");
                            i = a > -1 ? Math.min(a - 1, i) : i, i = r > -1 ? Math.min(r - 1, i) : i, n > -1 && i >= n && (t = e.substr(n, i - n + 1))
                        }
                        return 0 === t.length && (t = 0 !== e.length ? e : process.type), t = t.replace(/\||,|;/g, "_")
                    }(""))
                })), m = yield T), e(m)
            }))
        })
    }

    function w(e) {
        let t = "";
        do {
            if (null === e || void 0 === e) break;
            switch (typeof e) {
                case"string":
                    t = e;
                    break;
                case"object":
                    t = r.inspect(e) || "";
                    break;
                case"number":
                case"boolean":
                    t = e.toString() || ""
            }
        } while (0);
        return t
    }

    function b(e) {
        return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
    }

    function C(e) {
        return i(this, void 0, void 0, function* () {
            return new Promise(t => i(this, void 0, void 0, function* () {
                let i = void 0;
                null === s && (s = yield Promise.resolve().then(() => n(26)));
                let a = s.createHash("md5");
                null !== a && (i = a.update(e).digest("hex")), t(i)
            }))
        })
    }

    function N() {
        return new Promise(e => i(this, void 0, void 0, function* () {
            let t = "";
            t = void 0 === g ? "browser" === process.type ? function () {
                if (void 0 === g) {
                    let e = process.argv.length, t = process.argv;
                    for (let n = 0; n < e; n++) {
                        let e = t[n];
                        if (e.startsWith("-StartType:")) {
                            g = e.substring("-StartType:".length);
                            break
                        }
                    }
                    void 0 === g && (g = "")
                }
                return g
            }() : yield function () {
                return i(this, void 0, void 0, function* () {
                    return null === k && (k = new Promise(e => {
                        u.ipcRenderer.send(h.ThunderChannelList.channelRMGetBrowserStartType), u.ipcRenderer.once(h.ThunderChannelList.channelMRGetBrowserStartTypeResult, (t, n) => {
                            g = n, e(n), k = null
                        })
                    })), k
                })
            }() : g, e(t)
        }))
    }

    function D(e, t, n, a) {
        return i(this, void 0, void 0, function* () {
            let o = w(t), r = w(n), s = yield C(r), u = function (e) {
                let t = new RegExp(b("file:///"), "g"), n = new RegExp(b(process.resourcesPath + "\\"), "g"),
                    i = new RegExp(b(encodeURI(process.resourcesPath.replace(/\\/g, "/") + "/")), "g");
                return e.replace(t, "").replace(n, "").replace(i, "")
            }(w(a)), d = yield C(u), c = `${e}:${s}:${d}`;
            y.has(c) || (y.add(c), l.XLStatNS.trackEvent(f, "uncaught_exception", "", 0, 0, 0, 0, `type=${e},business_name=${yield S()},code=${o},message_hash=${s},message=${encodeURI(r)},stack_hash=${d},stack=${encodeURI(u)}`)), function (e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                })
            }().catch()
        })
    }

    function I(e) {
        console.error(e);
        let t = e || {};
        D("unhandledRejection", t.code, t instanceof Error ? t.message : t, t.stack).catch()
    }

    !function (e) {
        e.init = function (e) {
            p = e
        }, e.trackColdStartUpEvent = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = v.iSColdStartUp() ? 1 : 0, n = a.release(), i = v.performanceMonitorReporter.getProcessUptime(),
                    o = yield N(), r = `key=${e},start_type=${o},cold_start_up=${t},os_version=${n},cost_time=${i}`;
                l.XLStatNS.trackEvent(f, "cold_start_up", "", 0, 0, 0, 0, r)
            })
        }
    }(t.PerformanceMonitorStatNS || (t.PerformanceMonitorStatNS = {})), function () {
        if (process.on("uncaughtException", e => {
            console.error(e);
            let t = e || {};
            D("uncaughtException", t.code, t.message, t.stack).catch()
        }), "browser" === process.type) process.on("unhandledRejection", (e, t) => {
            I(e)
        }), u.ipcMain.on(h.ThunderChannelList.channelRMGetBrowserStartType, function (e) {
            return i(this, void 0, void 0, function* () {
                let t = yield N();
                e.sender.send(h.ThunderChannelList.channelMRGetBrowserStartTypeResult, t)
            })
        }); else if ("browser" !== process.type) {
            window.addEventListener("unhandledrejection", e => {
                I(e && e.reason || {})
            });
            let e = u.remote.getCurrentWebContents();
            null !== e && void 0 !== e && e.once("did-finish-load", () => {
                (function () {
                    return i(this, void 0, void 0, function* () {
                        do {
                            if ("browser" === process.type) break;
                            if (null === window.performance.timing || void 0 === window.performance.timing) break;
                            let e = v.iSColdStartUp() ? 1 : 0, t = a.release(), n = window.performance.timing,
                                i = n.loadEventEnd - n.navigationStart, o = n.fetchStart - n.navigationStart,
                                r = n.domainLookupEnd - n.domainLookupStart, s = n.connectEnd - n.connectStart,
                                u = n.responseStart - n.requestStart, d = n.responseEnd - n.responseStart,
                                c = n.domComplete - n.domLoading, h = yield N();
                            l.XLStatNS.trackEvent(f, "page_load_time", "", 0, 0, 0, 0, `start_type=${h},cold_start_up=${e},os_version=${t},load_time=${i},before_fetch_time=${o},domin_lookup_time=${r},connect_time=${s},first_response_time=${u},responseTime=${d},domTime=${c},process=${p}`)
                        } while (0)
                    })
                })().catch()
            })
        }
        d.default.hook("beforeLog", (e, t, ...n) => {
            e === d.LogLevel.Critical && l.XLStatNS.trackEvent(f, "critical_error", "", 0, 0, 0, 0, `module_name=${t},messages=${n}`)
        })
    }()
}, function (e, t, n) {
    e.exports = n(12)(130)
}, function (e, t, n) {
    "use strict";
    var i = n(11), a = n(120), o = {"Content-Type": "application/x-www-form-urlencoded"};

    function r(e, t) {
        !i.isUndefined(e) && i.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t)
    }

    var s, l = {
        adapter: ("undefined" != typeof XMLHttpRequest ? s = n(121) : "undefined" != typeof process && (s = n(28)), s),
        transformRequest: [function (e, t) {
            return a(t, "Content-Type"), i.isFormData(e) || i.isArrayBuffer(e) || i.isBuffer(e) || i.isStream(e) || i.isFile(e) || i.isBlob(e) ? e : i.isArrayBufferView(e) ? e.buffer : i.isURLSearchParams(e) ? (r(t, "application/x-www-form-urlencoded;charset=utf-8"), e.toString()) : i.isObject(e) ? (r(t, "application/json;charset=utf-8"), JSON.stringify(e)) : e
        }],
        transformResponse: [function (e) {
            if ("string" == typeof e) try {
                e = JSON.parse(e)
            } catch (e) {
            }
            return e
        }],
        timeout: 0,
        xsrfCookieName: "XSRF-TOKEN",
        xsrfHeaderName: "X-XSRF-TOKEN",
        maxContentLength: -1,
        validateStatus: function (e) {
            return e >= 200 && e < 300
        }
    };
    l.headers = {common: {Accept: "application/json, text/plain, */*"}}, i.forEach(["delete", "get", "head"], function (e) {
        l.headers[e] = {}
    }), i.forEach(["post", "put", "patch"], function (e) {
        l.headers[e] = i.merge(o)
    }), e.exports = l
}, function (e, t, n) {
    "use strict";
    var i = n(73);
    e.exports = function (e, t, n, a, o) {
        var r = new Error(e);
        return i(r, t, n, a, o)
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(26), o = n(20), r = n(9), s = n(1).default.getLogger("Thunder.base.tools-utilities"), l = n(2),
        u = n(5).default(l.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e) {
            return i(this, void 0, void 0, function* () {
                let t;
                return t = e && (yield r.FileSystemAWNS.existsAW(e)) ? new Promise(t => {
                    u.asyncCalcuteFileMD5(e, (e, n) => {
                        e ? (n = n.toUpperCase(), t(n)) : t(void 0)
                    })
                }) : new Promise(e => {
                    e(void 0)
                })
            })
        }

        e.genarateMd5 = function (e) {
            let t = void 0, n = a.createHash("md5");
            return null !== n && (t = n.update(e).digest("hex")), t
        }, e.matchFileMd5 = function (e, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1, a = yield t(e);
                return void 0 !== a && a === n.toUpperCase() && (s.information("check full md5 sucessful"), i = !0), i
            })
        }, e.calculateFileMd5Ex = function (e) {
            return i(this, void 0, void 0, function* () {
                let t;
                if (e && (yield r.FileSystemAWNS.existsAW(e))) {
                    let n = o.createReadStream(e), i = a.createHash("md5");
                    n.on("data", e => {
                        i.update(e)
                    }), t = new Promise(e => {
                        n.on("end", () => {
                            let t = i.digest("hex");
                            t = t.toUpperCase(), e(t)
                        })
                    })
                } else t = new Promise(e => {
                    e(void 0)
                });
                return t
            })
        }, e.calculateFileMd5 = t, e.encryptBuffer = function (e, t) {
            let n = null;
            try {
                let i = a.createCipheriv("aes-128-ecb", t, ""), o = i.update(e), r = i.final();
                n = Buffer.concat([o, r])
            } catch (e) {
                s.error("encryptBuffer", e)
            }
            return n
        }, e.decryptBuffer = function (e, t) {
            let n = null;
            try {
                let i = a.createDecipheriv("aes-128-ecb", t, ""), o = i.update(e), r = i.final();
                n = Buffer.concat([o, r])
            } catch (e) {
                s.error("decryptBuffer", e)
            }
            return n
        }, e.encryptSha1Buffer = function (e) {
            let t = null;
            try {
                t = a.createHash("sha1").update(e).digest("hex")
            } catch (e) {
                s.error("encryptSha1Buffer", e)
            }
            return t
        }, e.setForegroundWindow = function (e, t) {
            if (null !== e && null !== t) {
                let n = t.getNativeWindowHandle().readUIntLE(0, 4);
                e.setForegroundWindow(n) ? s.information("sucessful") : s.information("failed")
            }
        }
    }(t.ToolsUtilitiesAWNS || (t.ToolsUtilitiesAWNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(9), r = n(6), s = n(2);
    !function (e) {
        function t(e, t) {
            if (null !== e) {
                e.webContents.isDevToolsOpened() ? e.webContents.closeDevTools() : e.webContents.openDevTools(t)
            }
        }

        e.openDevTool = t, e.enableDevTools = function (e) {
            return i(this, void 0, void 0, function* () {
                (yield o.FileSystemAWNS.existsAW(s.resolve(__rootDir, "../../enableDevTools"))) && window.addEventListener("keyup", n => {
                    "F12" === n.key && n.ctrlKey && t(a.remote.getCurrentWindow(), e)
                }, !0)
            })
        }, e.enableDragOpenFile = function (e) {
            void 0 === e && (e = !1), document.addEventListener("dragover", e => {
                e.preventDefault()
            }, !1), document.addEventListener("drop", e => i(this, void 0, void 0, function* () {
                e.preventDefault();
                let t = e.dataTransfer, n = t.files, i = t.items;
                if (void 0 !== i && null !== i && i.length > 0) for (let e = 0; e < i.length; e++) {
                    let t = i[e];
                    "string" === t.kind && "text/uri-list" === t.type ? t.getAsString(e => {
                        r.NativeCallModule.nativeCall.CallNativeFunction("DropOpenUrl", e)
                    }) : t.kind
                }
                if (void 0 !== n && null !== n && n.length > 0) for (let e = 0; e < n.length; e++) {
                    let t = n[e].path;
                    void 0 !== t && null !== t && "" !== t && (yield o.FileSystemAWNS.existsAW(t)) && r.NativeCallModule.nativeCall.CallNativeFunction("DropOpenFile", t)
                }
            }), !1)
        }
    }(t.ThunderToolsNS || (t.ThunderToolsNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement;
        return (e._self._c || t)("td-select", e._g(e._b({
            ref: "select",
            attrs: {value: e.value, "custom-menu-enabled": ""},
            on: {"menu-show": e.handleMenuShow}
        }, "td-select", e.$attrs, !1), e.$listeners), [e._t("suffix", null, {slot: "suffix"}), e._v(" "), e._t("append", null, {slot: "append"})], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(32), a = n(211), o = n(212), r = n(740), s = n(843), l = n(845), u = n(848), d = n(849), c = n(851),
        h = n(852), f = n(853), p = n(854);
    i.default.use(a.default);
    const g = new a.default.Store({
        modules: {
            Tabs: r.default,
            DownloadListState: l.default,
            WebView: u.default,
            SettingConf: s.default,
            Community: d.default,
            PrivateSpaceState: c.default,
            UpgradeTaskState: h.default,
            BookMarks: f.default,
            Group: p.default
        }, strict: !1
    });
    t.connector = new o.default(g)
}, , , function (e, t, n) {
    e.exports = n(12)(65)
}, function (e, t) {
    e.exports = require("http")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(79), a = n(151), o = n(549), r = n(554), s = n(210), l = n(115), u = n(62), d = n(209), c = n(797),
        h = n(281), f = n(8), p = n(798), g = n(245), k = n(561), m = n(562);
    n(813), function (e) {
        const t = u.PluginHelperNS.getHelper(), n = d.ConfigHelperNS.getHelper(), T = i.UserHelperNS.getHelper(),
            v = a.DkHelperNS.getHelper(), y = c.UIHelperNS.getHelper(), S = p.TaskSceneManagerNS.getSceneManager(),
            w = s.TaskEventContainerNS.getEventContainer(), b = o.ErrorCodeHelperNS.getHelper(),
            C = r.DownloadManagerNS.getDownloadManager(), N = h.TaskManagerNS.getTaskManager(),
            D = g.KuainiaoManagerNS.getManager();

        function I(e, t) {
            v.startTask(e), C.enterAcclerate(e, t).catch()
        }

        function _(e, t) {
            let n = "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_hytq_js";
            e && (n = "https://pay.xunlei.com/pay.html?bizNo=baijin&selectBizno=supervip&timeType=1006&referfrom=v_pc_xlx_hytq_cjjs"), n = n + "&aidfrom=" + t, y.openTab(n)
        }

        e.init = function () {
            t.init(), n.init().catch(), T.init(), v.init(), y.init(), S.init(), b.init(), C.init(), D.init()
        }, e.clickVipAcclerateBtn = function (e, t, n) {
            n = n || "task", k.VipStatNS.vipButtonClick(e, t, n), t && !T.isSuperVip ? _(t, n) : I(e, l.VipDownloadDefineNS.VipTaskType.Vip)
        }, e.clickTryAcclerateBtn = function (e, t) {
            t = t || "task";
            let n = !1, i = C.getVipTaskInfo(e);
            i && (n = i.isSuper), n ? m.TryStatNS.superTryButtonClick(e, t) : m.TryStatNS.tryButtonClick(e, t), I(e, l.VipDownloadDefineNS.VipTaskType.Try)
        }, e.clickBatchAcclerateBtn = function (e, t, n) {
            n = n || "task";
            let i = !1;
            e.length > 0 && k.VipStatNS.vipButtonClick(e[0], t, n);
            for (let t of e) {
                let e = N.getTask(t);
                if (e) {
                    if (e.getTaskStatus() === f.DownloadKernel.TaskStatus.Failed) continue;
                    let n = e.getTaskExtra();
                    if (n.vipTaskStatus > l.VipDownloadDefineNS.VipTaskStatus.Init) continue;
                    if (n.vipTaskType === l.VipDownloadDefineNS.VipTaskType.Vip && !T.authority) continue;
                    I(t, n.vipTaskType), i = !0
                }
            }
            i || _(t, n)
        }, e.clickScenceText = function (e, t) {
            y.openTab(t), S.onClickScene(e)
        }, e.clickToolbarVipBtn = function () {
            y.openTab("https://vip.xunlei.com/index.html?referfrom=v_pc_xlx_ggong_taskbar_vip")
        }, e.clickTryOpenVipBtn = function (e, t, n) {
            let i = void 0;
            if ("Finished" === t) {
                n ? (m.TryStatNS.superTryOpenVipButtonClick(e, "cjjssyend"), i = "https://pay.xunlei.com/pay.html?bizNo=baijin&selectBizno=supervip&timeType=1006&referfrom=v_pc_xlx_hytq_cjjs_sy&aidfrom=syend") : (m.TryStatNS.tryOpenVipButtonClick(e, "syend"), i = "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_hytq_gs_sy&aidfrom=syend");
                let t = N.getTask(e);
                t && t.getTaskExtra().onTryFinishOpenVipClick()
            } else n ? (m.TryStatNS.superTryOpenVipButtonClick(e, "cjjssying"), i = "https://pay.xunlei.com/pay.html?bizNo=baijin&selectBizno=supervip&timeType=1006&referfrom=v_pc_xlx_hytq_cjjs_sy&aidfrom=sying") : (m.TryStatNS.tryOpenVipButtonClick(e, "sying"), i = "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_hytq_gs_sy&aidfrom=sying");
            y.openTab(i)
        }, e.openTab = function (e) {
            y.openTab(e)
        }, e.attachTaskEvent = function (e, t) {
            w.attachListener(e, t)
        }, e.detachTaskEvent = function (e, t) {
            w.detachListener(e, t)
        }, e.attachSceneEvent = function (e, t) {
            S.attachListener(e, t)
        }, e.detachSceneEvent = function (e, t) {
            S.detachListener(e, t)
        }, e.attachKuaiNiaoEvent = function (e, t) {
            D.attachListener(e, t)
        }, e.detachKuaiNiaoEvent = function (e, t) {
            D.detachListener(e, t)
        }, e.getVipTaskInfo = function (e) {
            return C.getVipTaskInfo(e)
        }, e.getSceneItem = function (e) {
            return S.getScene(e)
        }, e.getVipAccelerateMenuState = function (e) {
            let t = !1, n = !1;
            for (let i of e) {
                let e = N.getTask(i);
                if (e) {
                    if (e.getTaskStatus() === f.DownloadKernel.TaskStatus.Failed) continue;
                    if (e.getTaskExtra().vipTaskStatus > l.VipDownloadDefineNS.VipTaskStatus.Init) {
                        n = !0;
                        continue
                    }
                    t = !0
                }
            }
            let i = "会员加速";
            !t && n && (i = "已会员加速");
            let a = {enable: t, text: i};
            return JSON.stringify(a)
        }, e.onItemExpandChanged = function (e, t) {
            t ? (C.onTaskExpand(e).catch(), S.onTaskExpand(e)) : (C.onTaskUnExpand(e), S.onTaskUnExpand(e))
        }
    }(t.VipDownloadPlugin || (t.VipDownloadPlugin = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(58), o = n(1), r = n(10), s = n(59), l = o.default.getLogger("MenuSkinNS");
    !function (e) {
        function t(e, t) {
            if (l.information("setStyle", e, t), null !== e) {
                let n = {windowPreference: a.WindowPreferenceNS.getWindowPreference()};
                l.information("skinOpts", n), e.setStyle(s(n, t))
            }
        }

        e.setStyle = t, e.popEditableDefaultContextMenu = function (e, n, a) {
            let o = i.remote.getCurrentWebContents();
            o.once("context-menu", (a, s) => {
                if (l.verbose(a), s.isEditable) {
                    let a = [{
                        label: "撤销", enabled: s.editFlags.canUndo, click: () => {
                            o.undo()
                        }
                    }, {type: "separator"}, {
                        label: "剪切", enabled: s.editFlags.canCut, click: () => {
                            o.cut()
                        }
                    }, {
                        label: "复制", enabled: s.editFlags.canCopy, click: () => {
                            o.copy()
                        }
                    }, {
                        label: "粘贴",
                        enabled: s.editFlags.canPaste && r.ThunderUtil.isClipboardTextFormatAvailable(),
                        click: () => {
                            o.paste()
                        }
                    }, {
                        label: "删除", enabled: s.editFlags.canDelete, click: () => {
                            o.delete()
                        }
                    }, {type: "separator"}, {
                        label: "全选", enabled: s.editFlags.canSelectAll, click: () => {
                            o.selectAll()
                        }
                    }];
                    if (void 0 !== e && "function" == typeof e) {
                        let t = e(s);
                        void 0 !== t && t.length > 0 && (void 0 === n ? n = a.length : (n < 0 && (n = a.length + 1 + n) < 0 && (n = 0), n > a.length && (n = a.length)), a.splice(n, 0, ...t))
                    }
                    let l = i.remote.Menu.buildFromTemplate(a);
                    t(l, {}), l.popup({window: i.remote.getCurrentWindow()})
                }
            })
        }
    }(t.MenuSkinNS || (t.MenuSkinNS = {}))
}, , function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(10), o = n(21), r = n(6);
    !function (e) {
        e.getDownloadDir = function () {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    r.NativeCallModule.nativeCall.CallNativeFunction("GetDownloadDir", (t, n) => {
                        t === o.NativeFunctionErrorCode.Success ? e(n) : e(a.ThunderUtil.getDefaultDownloadDir())
                    })
                })
            })
        }, e.getConfigValueAW = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                return new Promise(i => {
                    r.NativeCallModule.nativeCall.CallNativeFunction("GetConfigValue", e, t, n, (e, t) => {
                        e === o.NativeFunctionErrorCode.Success ? i(t) : i(n)
                    })
                })
            })
        }, e.isSingleBtTask = function (e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    r.NativeCallModule.nativeCall.CallNativeFunction("IsSingleBtTask", e, (e, n) => {
                        e === o.NativeFunctionErrorCode.Success ? t(n) : t(!1)
                    })
                })
            })
        }
    }(t.NativeCallAWNS || (t.NativeCallAWNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(8);
    let o = ["apk", "avi", "chm", "doc", "exe", "flv", "ipa", "ipsw", "iso", "mkv", "mov", "mp4"];
    o.push(...["mpg", "pdf", "ppt", "rar", "rm", "rmvb", "txt", "wmv", "xls"]);
    const r = ".xv;.xlmv;.3gp;.3gp2;.3gpp;.3gpp2;.3mm;.3p2;.60d;.787;.aaf;.aep;.aepx;.aet;.aetx;.ajp;.ale;.amv;.amx;.arf;\n  .asf;.ass;.asx;.avb;.avd;.avi;.avp;.avs;.avs;.axm;.bdm;.bdmv;.bik;.bix;.bmk;.bnp;.box;.bs4;.bsf;.byu;.camproj;.camrec;.clpi;.cmmp;\n  .cmmtpl;.cmproj; .cmrec;.cpi;.cst;.cvc;.d2v;.d3v;.dat;.dav;.dce;.dck;.ddat;.dif;.dir;.divx;.dlx; .dmb;.dmsm;.dmsm3d;.dmss;.dnc;.dpg;\n  .dream;.dsy;.dv;.dv-avi;.dv4;.dvdmedia; .dvr-ms;.dvx;.dxr;.dzm;.dzp;.dzt;.edl;.evo;.eye;.f4p;.f4v;.fbr;.fbr;.fbz;.fcp; .flc;.flh;\n  .fli;.flv;.flx;.gfp;.gl;.grasp;.gts;.gvi;.gvp;.hdmov;.hkm;.ifo; .imovieproj;.imovieproject;.iva;.ivf;.ivr;.ivs;.izz;.izzy;.jts;.jtv;\n  .k3g;.lrec; .lsf;.lsx;.m15;.m1pg;.m1v;.m21;.m21;.m2a;.m2p;.m2t;.m2ts;.m2v;.m4e;.m4u;.m4v; .m75;.meta;.mgv;.mj2;.mjp;.mjpg;.mkv;.mmv;\n  .mnv;.mod;.modd;.moff;.moi;.moov;.mov; .movie;.mp21;.mp21;.mp2v;.mp4;.mp4v;.mpe;.mpeg;.mpeg4;.mpf;.mpg;.mpg2;.mpgindex; .mpl;.mpls;\n  .mpsub;.mpv;.mpv2;.mqv;.msdvd;.msh;.mswmm;.mts;.mtv;.mvb;.mvc;.mvd; .mve;.mvp;.mvy;.mxf;.mys;.ncor;.nsv;.nuv;.nvc;.ogm;.ogv;.ogx;.osp;\n  .par;.pds;.pgi; .piv;.pjs;.playlist;.pmf;.pns;.ppj;.prel;.pro;.prproj;.prtl;.psb;.psh;.pssd;.pva;.pvr;.pxv; .qt;.qtch;.qtl;.qtm;.qtz;\n  .r3d;.rcproject;.rdb;.rec;.rm;.rmd;.rmp;.rms;.rmvb;.roq; .rp;.rts;.rts;.rum;.rv;.sbk;.sbt;.scc;.scm;.scn;.screenflow;.sec;.seq;.sfd;\n  .sfvidcap;.smi;.smil;.smk;.sml;.smv;.spl;.srt;.ssa;.ssm;.stl;.str;.stx;.sub;.svi;.swf;.swi; .swt;.tda3mt;.tivo;.tix;.tod;.tp;.tp0;.tpd;\n  .tpr;.trp;.ts;.tts;.tvs;.vc1;.vcpf;.vcr; .vcv;.vdo;.vdr;.veg;.vem;.vf;.vfw;.vfz;.vgz;.vid;.viewlet;.viv;.vivo;.vlab;.vob; .vp3;.vp6;.vp7;\n  .vpj;.vro;.vs4;.vse;.vsp;.w32;.wcp;.webm;.wlmp;.wm;.wmd;.wmmp; .wmv;.wmx;.wp3;.wpl;.wtv;.wvx;.xfl;.xvid;.yuv;.zm1;.zm2;.zm3;.zmv;",
        s = ".exe;.com;.bat;.msi;.apk;.ipa;.iso;.mds;.bin;.img;.ipsw;",
        l = ".txt;.html;.htm;.shtml;.xhtml;.chm;.hlp;.inf;.rtf;.tex;.ltx;.doc;.docx;.wps;.ppt;.pptx;.odf;.pdf;.xls;.xlsx;.docm;.\n  dot;.dotm;.dotx;.email;.rp;.pps;.et;.ett;.xlt;.dbf;.prn;.csv;.mht;.mhtml;.xml;.wpt;.dps;.dpt;.pot;.ppsx;.epub;.mobi;.lit;.wdl;.ceb;.abm;\n  .pdg;.umb;.ibooks;",
        u = ".aiff;.cue;.m3u;.au;.cdda;.raw;.wav;.flac;.tak;.mp3;.aac;.wma;.m4a;.mid;.mka;.mp2;.mpa;.mpc;.ape;.ofr;\n  .ogg;.ra;.wv;.tta;.ac3;.dts;.nsf;.mod;.s3m;.xm;.it;.vst;",
        d = ".psd;.tga;.gif;.jpeg;.jpg;.jp2;.bmp;.ico;.pcx;.png;.pbm;.pgm;.ppm;.pnm;.pgf;.arw;.cr2;.crw;.dcr;.dng;.erf;.kdc;.mef;\n  .mos;.mrw;.nef;.nrw;.orf;.pef;.ptx;.r3d;.raf;.raw;.rw2;.srf;.srw;.x3f;.ras;.tiff;.tif;.wbmp;.ilbm;.lbm;.iff;.ico;",
        c = ".zip;.zipx;.rar;.7z;.isz;.cab;.arj;.ace;.alz;.uue;.tar;.gz; .gzip;.tgz;.tpz;.bzip2;.bz2;.bz;.tbz;.tbz2;.xz;.txz;\n  .lzh;.lha;.zt;.az; .xpi;.jar;.wim;.swm;.rpm;.xar;.deb;.dmg;.hfs;.cpio;.lzma;.lzma86;.split;",
        h = ".torrent;",
        f = ".3gp;.asf;.avi;.divx;.f4v;.flv;.mkv;.mov;.movie;.mp4;.mpeg;.mpeg4;.mpg;.mpg2;.rm;.rmvb;.rp;.swf;.tp;.tp0;.ts;.wmv",
        p = ".exe;.com;.bat;.msi", g = ".wav;.flac;.MP3;.AAC;.WMA;.M4A;.MID;.APE;.OGG;.RA;.mod",
        k = ".psd;.tga;.gif;.jpeg;.jpg;.jp2;.bmp;.ico;.pcx;.pdf;.png;.pbm;.pgm;.ppm;.pnm;.pgf;.arw;.cr2;.crw;.dcr;.dng;.erf;.kdc;\n  .mef;.mos;.mrw;.nef;.nrw;.orf;.pef;.ptx;.r3d;.raf;.raw;.rw2;.srf;.srw;.x3f;.ras;.tiff;.tif;.wbmp;.ilbm;.lbm;.iff;.ico",
        m = ".txt;.html;.htm;.shtml;.xhtml;.chm;.hlp;.inf;.rtf;.tex;.ltx;.doc;.docx;.wps;.ppt;.pptx;.odf;.pdf;.xls;.xlsx;.docm;.dot;.dotm;.dotx;.email;.rp;.pps",
        T = ".rar;.tar;.zip;.gzip;.cab;.uue;.arj;.bz2;.lzh;.jar;.ace;.iso;.7-zip;.7z";
    !function (e) {
        let t;

        function n(e) {
            let n = t.Unkown, a = i.extname(e);
            return void 0 === a || "" === a || a.length < 2 ? n = t.Unkown : f.indexOf(a) > -1 ? n = t.Video : p.indexOf(a) > -1 ? n = t.Software : m.indexOf(a) > -1 ? n = t.Doc : g.indexOf(a) > -1 ? n = t.Music : k.indexOf(a) > -1 ? n = t.Pic : T.indexOf(a) > -1 && (n = t.Zip), a.length > 1 && ".z" === a.slice(0, 2) && /[0-9]+/.test(a.substring(2)) && (n = t.Zip), n
        }

        e.getTaskIcon = function (e, t) {
            let n = "";
            do {
                if (t === a.DownloadKernel.TaskType.Bt) {
                    n = "xlx-icon-type-bt-file";
                    break
                }
                if (t === a.DownloadKernel.TaskType.Group) {
                    n = "xlx-icon-type-group";
                    break
                }
                n = "xlx-icon-type-unknown";
                let f = i.extname(e);
                if ("" === f || f.length < 2) break;
                let p = (f = f.toLowerCase()).substring(1);
                if (o.indexOf(p) > -1) {
                    n = "doc" === f ? "xlx-icon-type-word" : "xlx-icon-type-" + p;
                    break
                }
                if (r.indexOf(f) > -1) {
                    n = "xlx-icon-type-video";
                    break
                }
                if (s.indexOf(f) > -1) {
                    n = "xlx-icon-type-install", [".mds", ".bin", ".img"].indexOf(f) > -1 && (n = "xlx-icon-type-iso");
                    break
                }
                if (l.indexOf(f) > -1) {
                    if (n = "xlx-icon-type-doc", [".htm", ".html", ".mht"].indexOf(f) > -1) {
                        n = "xlx-icon-type-link";
                        break
                    }
                    if ("docx" === f) {
                        n = "xlx-icon-type-word";
                        break
                    }
                    if ("xlsx" === f) {
                        n = "xlx-icon-type-xls";
                        break
                    }
                    if ("pptx" === f) {
                        n = "xlx-icon-type-ppt";
                        break
                    }
                    break
                }
                if (u.indexOf(f) > -1) {
                    n = "xlx-icon-type-music";
                    break
                }
                if (d.indexOf(f) > -1) {
                    n = "xlx-icon-type-pic";
                    break
                }
                if (c.indexOf(f) > -1) {
                    n = "xlx-icon-type-rar";
                    break
                }
                if (h.indexOf(f) > -1) {
                    n = "xlx-icon-type-bt-link";
                    break
                }
            } while (0);
            return n
        }, function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Video = 1] = "Video", e[e.Software = 2] = "Software", e[e.Doc = 3] = "Doc", e[e.Music = 4] = "Music", e[e.Pic = 5] = "Pic", e[e.Zip = 6] = "Zip", e[e.Bt = 7] = "Bt"
        }(t = e.FileExtType || (e.FileExtType = {})), e.getTaskFileType = function (e, n) {
            let a = t.Unkown;
            return void 0 === n && void 0 !== e && (n = i.extname(e)), void 0 === n || "" === n || n.length < 2 ? a = t.Unkown : r.indexOf(n) > -1 ? a = t.Video : s.indexOf(n) > -1 ? a = t.Software : l.indexOf(n) > -1 ? a = t.Doc : u.indexOf(n) > -1 ? a = t.Music : d.indexOf(n) > -1 ? a = t.Pic : c.indexOf(n) > -1 ? a = t.Zip : h.indexOf(n) > -1 && (a = t.Bt), n.length > 1 && ".z" === n.slice(0, 2) && /[0-9]+/.test(n.substring(2)) && (a = t.Zip), a
        }, e.getGroupFileType = n, e.getDefaultGroupPrefix = function (e) {
            let i = "任务组";
            do {
                if (void 0 === e || null === e || 0 === e.length) break;
                let a = [];
                for (let e = 0; e < 7; e++) a[e] = 0;
                for (let t of e) {
                    let e = n(t);
                    a[e] = a[e] + 1
                }
                let o = t.Unkown;
                for (let e = 1; e < a.length; e++) a[e] > a[o] && (o = e);
                o === t.Video ? i = "视频任务组" : o === t.Software ? i = "程序任务组" : o === t.Music ? i = "音乐任务组" : o === t.Pic ? i = "图片任务组" : o === t.Doc ? i = "文档任务组" : o === t.Zip && (i = "压缩包任务组")
            } while (0);
            return i
        }, e.compareVersion = function (e, t) {
            let n = -2;
            do {
                if (null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                let i = 0, a = 0, o = 0, r = 0, s = 0, l = 0, u = 0, d = 0, c = e.split(/\./);
                if (null === c || void 0 === c || c.length < 3) break;
                if (i = Number(c[0]), a = Number(c[1]), o = Number(c[2]), null !== c[3] && void 0 !== c[3] && "" !== c[3] && (r = Number(c[3])), null === (c = t.split(/\./)) || void 0 === c || c.length < 3) break;
                if (s = Number(c[0]), l = Number(c[1]), u = Number(c[2]), null !== c[3] && void 0 !== c[3] && "" !== c[3] && (d = Number(c[3])), s > i) {
                    n = 1;
                    break
                }
                if (s < i) {
                    n = -1;
                    break
                }
                if (l > a) {
                    n = 1;
                    break
                }
                if (l < a) {
                    n = -1;
                    break
                }
                if (u > o) {
                    n = 1;
                    break
                }
                if (u < o) {
                    n = -1;
                    break
                }
                if (0 !== r) {
                    if (d > r) {
                        n = 1;
                        break
                    }
                    if (d < r) {
                        n = -1;
                        break
                    }
                }
                n = 0
            } while (0);
            return n
        }
    }(t.TaskUtilHelper || (t.TaskUtilHelper = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(86), a = n(69);
    !function (e) {
        e.getWindowPreference = function (e = !1) {
            let t = a.default(), n = {};
            return t && t.colors && "string" == typeof t.colors.colorPrimaryControl1 && (n.hoverBackgroundColor = e ? parseInt(i.ColorUtilNS.rgbaStringToHexWith0xBegin(t.colors.colorPrimaryControl1), 16) : i.ColorUtilNS.rgbaStringToHexWith0xBegin(t.colors.colorPrimaryControl1)), n
        }
    }(t.WindowPreferenceNS || (t.WindowPreferenceNS = {}))
}, function (e, t, n) {
    (function (e) {
        var n = 200, i = "__lodash_hash_undefined__", a = 800, o = 16, r = 9007199254740991, s = "[object Arguments]",
            l = "[object AsyncFunction]", u = "[object Function]", d = "[object GeneratorFunction]",
            c = "[object Null]", h = "[object Object]", f = "[object Proxy]", p = "[object Undefined]",
            g = /^\[object .+?Constructor\]$/, k = /^(?:0|[1-9]\d*)$/, m = {};
        m["[object Float32Array]"] = m["[object Float64Array]"] = m["[object Int8Array]"] = m["[object Int16Array]"] = m["[object Int32Array]"] = m["[object Uint8Array]"] = m["[object Uint8ClampedArray]"] = m["[object Uint16Array]"] = m["[object Uint32Array]"] = !0, m[s] = m["[object Array]"] = m["[object ArrayBuffer]"] = m["[object Boolean]"] = m["[object DataView]"] = m["[object Date]"] = m["[object Error]"] = m[u] = m["[object Map]"] = m["[object Number]"] = m[h] = m["[object RegExp]"] = m["[object Set]"] = m["[object String]"] = m["[object WeakMap]"] = !1;
        var T = "object" == typeof global && global && global.Object === Object && global,
            v = "object" == typeof self && self && self.Object === Object && self,
            y = T || v || Function("return this")(), S = "object" == typeof t && t && !t.nodeType && t,
            w = S && "object" == typeof e && e && !e.nodeType && e, b = w && w.exports === S, C = b && T.process,
            N = function () {
                try {
                    return C && C.binding && C.binding("util")
                } catch (e) {
                }
            }(), D = N && N.isTypedArray;

        function I(e, t) {
            return "__proto__" == t ? void 0 : e[t]
        }

        var _, x, A, E = Array.prototype, M = Function.prototype, P = Object.prototype, F = y["__core-js_shared__"],
            O = M.toString, U = P.hasOwnProperty,
            L = (_ = /[^.]+$/.exec(F && F.keys && F.keys.IE_PROTO || "")) ? "Symbol(src)_1." + _ : "", B = P.toString,
            K = O.call(Object),
            V = RegExp("^" + O.call(U).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
            R = b ? y.Buffer : void 0, W = y.Symbol, j = y.Uint8Array, H = R ? R.allocUnsafe : void 0,
            G = (x = Object.getPrototypeOf, A = Object, function (e) {
                return x(A(e))
            }), z = Object.create, q = P.propertyIsEnumerable, $ = E.splice, X = W ? W.toStringTag : void 0,
            J = function () {
                try {
                    var e = Se(Object, "defineProperty");
                    return e({}, "", {}), e
                } catch (e) {
                }
            }(), Y = R ? R.isBuffer : void 0, Q = Math.max, Z = Date.now, ee = Se(y, "Map"), te = Se(Object, "create"),
            ne = function () {
                function e() {
                }

                return function (t) {
                    if (!Me(t)) return {};
                    if (z) return z(t);
                    e.prototype = t;
                    var n = new e;
                    return e.prototype = void 0, n
                }
            }();

        function ie(e) {
            var t = -1, n = null == e ? 0 : e.length;
            for (this.clear(); ++t < n;) {
                var i = e[t];
                this.set(i[0], i[1])
            }
        }

        function ae(e) {
            var t = -1, n = null == e ? 0 : e.length;
            for (this.clear(); ++t < n;) {
                var i = e[t];
                this.set(i[0], i[1])
            }
        }

        function oe(e) {
            var t = -1, n = null == e ? 0 : e.length;
            for (this.clear(); ++t < n;) {
                var i = e[t];
                this.set(i[0], i[1])
            }
        }

        function re(e) {
            var t = this.__data__ = new ae(e);
            this.size = t.size
        }

        function se(e, t) {
            var n = Ie(e), i = !n && De(e), a = !n && !i && xe(e), o = !n && !i && !a && Fe(e), r = n || i || a || o,
                s = r ? function (e, t) {
                    for (var n = -1, i = Array(e); ++n < e;) i[n] = t(n);
                    return i
                }(e.length, String) : [], l = s.length;
            for (var u in e) !t && !U.call(e, u) || r && ("length" == u || a && ("offset" == u || "parent" == u) || o && ("buffer" == u || "byteLength" == u || "byteOffset" == u) || we(u, l)) || s.push(u);
            return s
        }

        function le(e, t, n) {
            (void 0 === n || Ne(e[t], n)) && (void 0 !== n || t in e) || ce(e, t, n)
        }

        function ue(e, t, n) {
            var i = e[t];
            U.call(e, t) && Ne(i, n) && (void 0 !== n || t in e) || ce(e, t, n)
        }

        function de(e, t) {
            for (var n = e.length; n--;) if (Ne(e[n][0], t)) return n;
            return -1
        }

        function ce(e, t, n) {
            "__proto__" == t && J ? J(e, t, {configurable: !0, enumerable: !0, value: n, writable: !0}) : e[t] = n
        }

        ie.prototype.clear = function () {
            this.__data__ = te ? te(null) : {}, this.size = 0
        }, ie.prototype.delete = function (e) {
            var t = this.has(e) && delete this.__data__[e];
            return this.size -= t ? 1 : 0, t
        }, ie.prototype.get = function (e) {
            var t = this.__data__;
            if (te) {
                var n = t[e];
                return n === i ? void 0 : n
            }
            return U.call(t, e) ? t[e] : void 0
        }, ie.prototype.has = function (e) {
            var t = this.__data__;
            return te ? void 0 !== t[e] : U.call(t, e)
        }, ie.prototype.set = function (e, t) {
            var n = this.__data__;
            return this.size += this.has(e) ? 0 : 1, n[e] = te && void 0 === t ? i : t, this
        }, ae.prototype.clear = function () {
            this.__data__ = [], this.size = 0
        }, ae.prototype.delete = function (e) {
            var t = this.__data__, n = de(t, e);
            return !(n < 0 || (n == t.length - 1 ? t.pop() : $.call(t, n, 1), --this.size, 0))
        }, ae.prototype.get = function (e) {
            var t = this.__data__, n = de(t, e);
            return n < 0 ? void 0 : t[n][1]
        }, ae.prototype.has = function (e) {
            return de(this.__data__, e) > -1
        }, ae.prototype.set = function (e, t) {
            var n = this.__data__, i = de(n, e);
            return i < 0 ? (++this.size, n.push([e, t])) : n[i][1] = t, this
        }, oe.prototype.clear = function () {
            this.size = 0, this.__data__ = {hash: new ie, map: new (ee || ae), string: new ie}
        }, oe.prototype.delete = function (e) {
            var t = ye(this, e).delete(e);
            return this.size -= t ? 1 : 0, t
        }, oe.prototype.get = function (e) {
            return ye(this, e).get(e)
        }, oe.prototype.has = function (e) {
            return ye(this, e).has(e)
        }, oe.prototype.set = function (e, t) {
            var n = ye(this, e), i = n.size;
            return n.set(e, t), this.size += n.size == i ? 0 : 1, this
        }, re.prototype.clear = function () {
            this.__data__ = new ae, this.size = 0
        }, re.prototype.delete = function (e) {
            var t = this.__data__, n = t.delete(e);
            return this.size = t.size, n
        }, re.prototype.get = function (e) {
            return this.__data__.get(e)
        }, re.prototype.has = function (e) {
            return this.__data__.has(e)
        }, re.prototype.set = function (e, t) {
            var i = this.__data__;
            if (i instanceof ae) {
                var a = i.__data__;
                if (!ee || a.length < n - 1) return a.push([e, t]), this.size = ++i.size, this;
                i = this.__data__ = new oe(a)
            }
            return i.set(e, t), this.size = i.size, this
        };
        var he, fe = function (e, t, n) {
            for (var i = -1, a = Object(e), o = n(e), r = o.length; r--;) {
                var s = o[he ? r : ++i];
                if (!1 === t(a[s], s, a)) break
            }
            return e
        };

        function pe(e) {
            return null == e ? void 0 === e ? p : c : X && X in Object(e) ? function (e) {
                var t = U.call(e, X), n = e[X];
                try {
                    e[X] = void 0;
                    var i = !0
                } catch (e) {
                }
                var a = B.call(e);
                i && (t ? e[X] = n : delete e[X]);
                return a
            }(e) : function (e) {
                return B.call(e)
            }(e)
        }

        function ge(e) {
            return Pe(e) && pe(e) == s
        }

        function ke(e) {
            return !(!Me(e) || L && L in e) && (Ae(e) ? V : g).test(function (e) {
                if (null != e) {
                    try {
                        return O.call(e)
                    } catch (e) {
                    }
                    try {
                        return e + ""
                    } catch (e) {
                    }
                }
                return ""
            }(e))
        }

        function me(e) {
            if (!Me(e)) return function (e) {
                var t = [];
                if (null != e) for (var n in Object(e)) t.push(n);
                return t
            }(e);
            var t = be(e), n = [];
            for (var i in e) ("constructor" != i || !t && U.call(e, i)) && n.push(i);
            return n
        }

        function Te(e, t, n, i, a) {
            e !== t && fe(t, function (o, r) {
                if (Me(o)) a || (a = new re), function (e, t, n, i, a, o, r) {
                    var s = I(e, n), l = I(t, n), u = r.get(l);
                    if (u) return void le(e, n, u);
                    var d = o ? o(s, l, n + "", e, t, r) : void 0, c = void 0 === d;
                    if (c) {
                        var f = Ie(l), p = !f && xe(l), g = !f && !p && Fe(l);
                        d = l, f || p || g ? Ie(s) ? d = s : Pe(y = s) && _e(y) ? d = function (e, t) {
                            var n = -1, i = e.length;
                            t || (t = Array(i));
                            for (; ++n < i;) t[n] = e[n];
                            return t
                        }(s) : p ? (c = !1, d = function (e, t) {
                            if (t) return e.slice();
                            var n = e.length, i = H ? H(n) : new e.constructor(n);
                            return e.copy(i), i
                        }(l, !0)) : g ? (c = !1, k = l, m = !0 ? (T = k.buffer, v = new T.constructor(T.byteLength), new j(v).set(new j(T)), v) : k.buffer, d = new k.constructor(m, k.byteOffset, k.length)) : d = [] : function (e) {
                            if (!Pe(e) || pe(e) != h) return !1;
                            var t = G(e);
                            if (null === t) return !0;
                            var n = U.call(t, "constructor") && t.constructor;
                            return "function" == typeof n && n instanceof n && O.call(n) == K
                        }(l) || De(l) ? (d = s, De(s) ? d = function (e) {
                            return function (e, t, n, i) {
                                var a = !n;
                                n || (n = {});
                                var o = -1, r = t.length;
                                for (; ++o < r;) {
                                    var s = t[o], l = i ? i(n[s], e[s], s, n, e) : void 0;
                                    void 0 === l && (l = e[s]), a ? ce(n, s, l) : ue(n, s, l)
                                }
                                return n
                            }(e, Oe(e))
                        }(s) : (!Me(s) || i && Ae(s)) && (d = function (e) {
                            return "function" != typeof e.constructor || be(e) ? {} : ne(G(e))
                        }(l))) : c = !1
                    }
                    var k, m, T, v;
                    var y;
                    c && (r.set(l, d), a(d, l, i, o, r), r.delete(l));
                    le(e, n, d)
                }(e, t, r, n, Te, i, a); else {
                    var s = i ? i(I(e, r), o, r + "", e, t, a) : void 0;
                    void 0 === s && (s = o), le(e, r, s)
                }
            }, Oe)
        }

        function ve(e, t) {
            return Ce(function (e, t, n) {
                return t = Q(void 0 === t ? e.length - 1 : t, 0), function () {
                    for (var i = arguments, a = -1, o = Q(i.length - t, 0), r = Array(o); ++a < o;) r[a] = i[t + a];
                    a = -1;
                    for (var s = Array(t + 1); ++a < t;) s[a] = i[a];
                    return s[t] = n(r), function (e, t, n) {
                        switch (n.length) {
                            case 0:
                                return e.call(t);
                            case 1:
                                return e.call(t, n[0]);
                            case 2:
                                return e.call(t, n[0], n[1]);
                            case 3:
                                return e.call(t, n[0], n[1], n[2])
                        }
                        return e.apply(t, n)
                    }(e, this, s)
                }
            }(e, t, Be), e + "")
        }

        function ye(e, t) {
            var n, i, a = e.__data__;
            return ("string" == (i = typeof(n = t)) || "number" == i || "symbol" == i || "boolean" == i ? "__proto__" !== n : null === n) ? a["string" == typeof t ? "string" : "hash"] : a.map
        }

        function Se(e, t) {
            var n = function (e, t) {
                return null == e ? void 0 : e[t]
            }(e, t);
            return ke(n) ? n : void 0
        }

        function we(e, t) {
            var n = typeof e;
            return !!(t = null == t ? r : t) && ("number" == n || "symbol" != n && k.test(e)) && e > -1 && e % 1 == 0 && e < t
        }

        function be(e) {
            var t = e && e.constructor;
            return e === ("function" == typeof t && t.prototype || P)
        }

        var Ce = function (e) {
            var t = 0, n = 0;
            return function () {
                var i = Z(), r = o - (i - n);
                if (n = i, r > 0) {
                    if (++t >= a) return arguments[0]
                } else t = 0;
                return e.apply(void 0, arguments)
            }
        }(J ? function (e, t) {
            return J(e, "toString", {
                configurable: !0, enumerable: !1, value: (n = t, function () {
                    return n
                }), writable: !0
            });
            var n
        } : Be);

        function Ne(e, t) {
            return e === t || e != e && t != t
        }

        var De = ge(function () {
            return arguments
        }()) ? ge : function (e) {
            return Pe(e) && U.call(e, "callee") && !q.call(e, "callee")
        }, Ie = Array.isArray;

        function _e(e) {
            return null != e && Ee(e.length) && !Ae(e)
        }

        var xe = Y || function () {
            return !1
        };

        function Ae(e) {
            if (!Me(e)) return !1;
            var t = pe(e);
            return t == u || t == d || t == l || t == f
        }

        function Ee(e) {
            return "number" == typeof e && e > -1 && e % 1 == 0 && e <= r
        }

        function Me(e) {
            var t = typeof e;
            return null != e && ("object" == t || "function" == t)
        }

        function Pe(e) {
            return null != e && "object" == typeof e
        }

        var Fe = D ? function (e) {
            return function (t) {
                return e(t)
            }
        }(D) : function (e) {
            return Pe(e) && Ee(e.length) && !!m[pe(e)]
        };

        function Oe(e) {
            return _e(e) ? se(e, !0) : me(e)
        }

        var Ue, Le = (Ue = function (e, t, n) {
            Te(e, t, n)
        }, ve(function (e, t) {
            var n = -1, i = t.length, a = i > 1 ? t[i - 1] : void 0, o = i > 2 ? t[2] : void 0;
            for (a = Ue.length > 3 && "function" == typeof a ? (i--, a) : void 0, o && function (e, t, n) {
                if (!Me(n)) return !1;
                var i = typeof t;
                return !!("number" == i ? _e(n) && we(t, n.length) : "string" == i && t in n) && Ne(n[t], e)
            }(t[0], t[1], o) && (a = i < 3 ? void 0 : a, i = 1), e = Object(e); ++n < i;) {
                var r = t[n];
                r && Ue(e, r, n, a)
            }
            return e
        }));

        function Be(e) {
            return e
        }

        e.exports = Le
    }).call(this, n(87)(e))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(35);
    t.default = class {
        constructor() {
            this.emitter = null, this.emitter = new i.EventEmitter
        }

        attachOnceListener(e, t) {
            this.emitter.once(e, t)
        }

        attachListener(e, t) {
            this.emitter.addListener(e, t)
        }

        detachListener(e, t) {
            this.emitter.removeListener(e, t)
        }

        fireEvent(e, ...t) {
            return this.emitter.emit(e, ...t)
        }

        setMaxListeners(e) {
            this.emitter.setMaxListeners(e)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(1), s = n(60), l = n(8), u = n(37), d = n(67), c = n(23), h = n(14), f = n(547),
        p = n(114), g = n(10), k = n(17), m = n(9), T = r.default.getLogger("DownloadMgr"),
        v = u.DownloadKernelEventManager.getEventManager(),
        y = p.DownloadKernelCategoryViewManager.getCategoryViewManager(), S = [{
            type: "task",
            title: "新建下载任务",
            program: process.execPath,
            args: "-task:newtask -window:bringtotop",
            iconPath: `${__rootDir}/static/icon/jumplist_newtask.ico`,
            iconIndex: 0,
            description: "新建下载任务"
        }, {
            type: "task",
            title: "开始所有任务",
            program: process.execPath,
            args: "-task:startall",
            iconPath: `${__rootDir}/static/icon/jumplist_startalltask.ico`,
            iconIndex: 0,
            description: "开始所有任务"
        }, {
            type: "task",
            program: process.execPath,
            args: "-task:pauseall",
            iconPath: `${__rootDir}/static/icon/jumplist_pausealltask.ico`,
            iconIndex: 0,
            title: "暂停所有任务",
            description: "暂停所有任务"
        }, {
            type: "task",
            program: process.execPath,
            args: "-shell:exit",
            iconPath: `${__rootDir}/static/icon/jumplist_exit.ico`,
            iconIndex: 0,
            title: "退出迅雷",
            description: "退出迅雷"
        }];
    const w = new class extends s.default {
        constructor() {
            super(...arguments), this.completedList = [], this.recentList = [], this.tracked = !1, this.needSelectNext = !1, this.currentCategoryId = -1
        }

        setNeedSelectNext(e) {
            this.needSelectNext = e
        }

        getNeedSelectNext() {
            return this.needSelectNext
        }

        getCurrentCategoryId() {
            return this.currentCategoryId
        }

        setCurrentCategoryId(e) {
            this.currentCategoryId = e
        }

        trackWin7NewTrait() {
            this.trackTaskComplete(), d.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                let t = f.DownloadProgressNS.getDownloadDetails().progress;
                a.ipcRenderer.send(h.ThunderChannelList.channelRMSetProgressBar, t)
            })
        }

        trackTaskComplete() {
            a.remote.app.getJumpListSettings();
            do {
                if (this.tracked) break;
                this.tracked = !0, d.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                    this.initCompeltedList(), this.getJumplistGroup(), this.updateJumpList().catch(), this.attachCompletedCategoryViewChange()
                })
            } while (0)
        }

        updateJumpList() {
            return i(this, void 0, void 0, function* () {
                let e = [];
                e.push({type: "tasks", items: S});
                let t = [];
                if (this.recentList.length > 0) {
                    let e = k.ThunderHelper.isWindow7();
                    for (let n of this.recentList) {
                        let i = n.savePath, a = n.taskName;
                        void 0 !== a && a.indexOf(".") === a.length - 1 && (a = a.substring(0, a.length - 1));
                        let r = "", s = r = n.taskType === l.DownloadKernel.TaskType.Group ? i : o.join(i, a);
                        if (n.taskType === l.DownloadKernel.TaskType.Bt) s = `${__rootDir}/static/icon/jumplist_bttask.ico`; else do {
                            if (!e) break;
                            let t = yield g.ThunderUtil.getThunderTempPath(!0, "JumpIcon"), i = n.cid + ".ico";
                            "" === n.cid && (i = a + ".ico");
                            let l = o.join(t, i);
                            if (yield m.FileSystemAWNS.existsAW(l)) {
                                s = l;
                                break
                            }
                            k.ThunderHelper.extractIcon(r, l) && (s = l)
                        } while (0);
                        t.push({type: "task", title: a, iconPath: s, iconIndex: 0, args: "", program: r})
                    }
                } else t.push({type: "task", title: "最近没有完成任务", program: ""});
                t.length > 0 && (T.information("jumpRecentList", t), e.push({
                    name: "最近完成的任务",
                    items: t,
                    type: "custom"
                })), T.information("categories", e);
                try {
                    a.remote.app.setJumpList(e)
                } catch (e) {
                    T.warning("setJumpList error ", e)
                }
            })
        }

        sortCompletedList() {
            this.completedList.sort((e, t) => {
                let n = e.completionTime;
                return t.completionTime - n
            })
        }

        getJumplistGroup() {
            do {
                this.sortCompletedList();
                let e = a.remote.app.getJumpListSettings();
                T.information("getJumpListSettings", e);
                let t = e.removedItems;
                if (!t || 0 === t.length) {
                    T.information("update jumplist removedItems null");
                    break
                }
                if (0 === this.completedList.length) break;
                T.information("update jumplist removedItems", t);
                for (let e of t) for (let t = 0; t < this.completedList.length; t++) {
                    let n = this.completedList[t], i = n.savePath, a = n.taskName;
                    void 0 !== a && a.indexOf(".") === a.length - 1 && (a = a.substring(0, a.length - 1));
                    let r = "";
                    if (r = n.taskType === l.DownloadKernel.TaskType.Group ? i : o.join(i, a), e.iconPath && r.toLowerCase() === e.iconPath.toLowerCase()) {
                        this.completedList.splice(t, 1);
                        break
                    }
                }
            } while (0);
            let e = this.completedList.length > 4 ? 4 : this.completedList.length;
            this.recentList = this.completedList.slice(0, e), T.information("getJumplistGroup", this.recentList)
        }

        initCompeltedList() {
            let e = y.getCategoryViewFromId(l.DownloadKernel.CategroyViewID.Completed).getTasks();
            for (let [, t]of e) this.completedList.push(t.getTaskBaseInfo())
        }

        attachCompletedCategoryViewChange() {
            v.attachTaskEvent(l.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (!e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== l.DownloadKernel.CategroyViewID.Completed) break;
                    let t = e[3];
                    if (0 === t.length) break;
                    let n = t.map(e => e.getTaskBaseInfo());
                    this.completedList.push(...n), this.getJumplistGroup(), this.updateJumpList().catch()
                } while (0)
            }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== l.DownloadKernel.CategroyViewID.Completed) break;
                    let t = e[3];
                    if (0 === t.length) break;
                    let n = this.completedList.map(e => e.taskId);
                    for (let e of t) {
                        let t = n.indexOf(e.getId());
                        -1 !== t && (this.completedList.splice(t, 1), n.splice(t, 1))
                    }
                    this.getJumplistGroup(), this.updateJumpList().catch()
                } while (0)
            })
        }
    };
    t.default = w
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});

    class i {
        constructor() {
            this.mThunderVersionStr = void 0, this.mThunderVersionNumber = void 0, this.mNativeCall = null
        }

        init() {
            global.AsyncGetNativeCallModuleObj && global.AsyncGetNativeCallModuleObj(e => {
                this.mNativeCall = e.nativeCall, this.loadThunderVersion()
            })
        }

        get thunderVersionNumber() {
            return this.mThunderVersionNumber
        }

        get thunderVersionString() {
            return this.mThunderVersionStr
        }

        get clientName() {
            return "xl_pc"
        }

        get pluginVersion() {
            return "1.0"
        }

        get currentTime() {
            return Math.floor((new Date).getTime() / 1e3)
        }

        get nativeCall() {
            return this.mNativeCall
        }

        loadThunderVersion() {
            this.mNativeCall && this.mNativeCall.CallNativeFunction("GetThunderVersion", (e, t) => {
                if (0 === e) {
                    this.mThunderVersionStr = t, this.mThunderVersionNumber = 0;
                    let e = this.mThunderVersionStr.split(".");
                    if (e && 4 === e.length) {
                        let t = Number(e[0]).valueOf(), n = Number(e[1]).valueOf(), i = Number(e[2]).valueOf(), a = 128;
                        this.mThunderVersionNumber = a * Math.pow(2, 24) + t * Math.pow(2, 16) + n * Math.pow(2, 8) + i
                    }
                }
            })
        }
    }

    t.PluginHelper = i, function (e) {
        const t = new i;
        e.getHelper = function () {
            return t
        }
    }(t.PluginHelperNS || (t.PluginHelperNS = {}))
}, , , function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(16), o = n(3), r = n(765), s = n(2), l = n(7), u = n(1), d = n(9), c = n(45), h = n(66), f = n(200),
        p = n(5), g = n(23), k = n(720), m = p.default(s.join(__rootDir, "../bin/ThunderHelper.node")),
        T = u.default.getLogger("login-helper");
    !function (e) {
        e.loginUIHelper = new class {
            constructor() {
            }

            createLoginWnd(e, t, n, i, a) {
                o.ipcRenderer.send(g.NodeEventMesssageNS.eventLoginWndCreate, e, t, n, i, a)
            }

            closeLoginWnd(e) {
                o.ipcRenderer.send(g.NodeEventMesssageNS.eventLoginWndClose, e)
            }

            updateLoginWnd(e, t, n, i, a) {
                o.ipcRenderer.send(g.NodeEventMesssageNS.eventLoginWndShow, e, t, n, i, a), o.ipcRenderer.once(g.NodeEventMesssageNS.eventLoginWndShowResult, (e, t) => {
                    t && k.activityObj.attachListenerEvent()
                })
            }

            createPersonalInfoWnd(e) {
                const t = "development" === o.remote.process.env.RUN_ENV ? "http://localhost:9080/personal-info-renderer/" : `file:///${__dirname}/../personal-info-renderer/index.html`;
                let n = o.remote.getCurrentWindow(), i = n.getBounds(), a = n.getContentSize();
                (i.x < 0 || i.y < 0) && (i.width >= a[0] && i.height >= a[1] ? (i.x = i.x + Math.round((i.width - a[0]) / 2), i.y = i.y + Math.round((i.height - a[1]) / 2) - 1) : (i.x = -1, i.y = -1)), T.information("updatePersonalInfoWnd:", i, a, e);
                let r = new o.remote.BrowserWindow({
                    x: i.x,
                    y: i.y + 48,
                    width: 270,
                    height: 370,
                    frame: !1,
                    resizable: !1,
                    parent: n,
                    show: !1,
                    modal: !1
                });
                return r.loadURL(t), r
            }

            createRetryLoginWnd(e, t) {
                o.ipcRenderer.send(g.NodeEventMesssageNS.eventRetryLoginWndCreate, e, t)
            }

            createModifierUserInfoWnd(e) {
                o.ipcRenderer.send(g.NodeEventMesssageNS.eventModifierUserinfoWndCreate, e)
            }
        }, e.loginSDKHelper = new class {
            constructor() {
                this.curUserInfo = null, this.key = "XUNLEIACCOUNT123", this.loginInfo = null, this.loginDataDir = s.join(__profilesDir, "xlaccount/"), this.loginDataPath = s.join(__profilesDir, "xlaccount/accountdata.dat"), this.deviceId = "", T.information("loginSDKHelper obj create")
            }

            init() {
                return i(this, void 0, void 0, function* () {
                    let e = yield d.FileSystemAWNS.existsAW(`${this.loginDataPath}`);
                    e || (e = yield d.FileSystemAWNS.mkdirsAW(`${this.loginDataDir}`)) && (yield d.FileSystemAWNS.writeFileAW(`${this.loginDataPath}`, "")), yield this.loadLoginDataFromFile(), yield this.getDeviceID(), yield k.activityObj.getActiveConfig()
                })
            }

            getDeviceID() {
                return i(this, void 0, void 0, function* () {
                    let e = "";
                    do {
                        if (null !== this.deviceId && void 0 !== this.deviceId && "" !== this.deviceId) {
                            e = this.deviceId;
                            break
                        }
                        let t = "", n = "", i = "SYSTEM_CONFIG", a = "DEVICEID", o = m.getPublicUserDataPath(),
                            r = s.join(o, "Thunder Network/Thunder"), l = s.join(r, "/xlconfig.ini");
                        if ("" !== o && ((yield d.FileSystemAWNS.mkdirsAW(r)) && (n = m.readINI(l, i, a)), T.information("得到文件保存 peeridMd5Str:", n)), "" === n) {
                            let e = m.getPeerID();
                            n = c.ToolsUtilitiesAWNS.genarateMd5(e), T.information("重新计算 peeridStr:", e, ";peeridMd5Str:", n), (yield d.FileSystemAWNS.mkdirsAW(r)) && m.writeINI(l, i, a, n)
                        }
                        let u = m.getDmideCode(), h = c.ToolsUtilitiesAWNS.genarateMd5(u);
                        T.information("dmideCodeStr:", u, ";dmideCodeMd5Str:", h), t = h + n, e = c.ToolsUtilitiesAWNS.genarateMd5(t), this.deviceId = e
                    } while (0);
                    return T.information("deviceIDMd5Str:", e), e
                })
            }

            getInitData() {
                let e = s.join(__rootDir, "../../Thunder.exe"), t = m.getFileVersion(e),
                    n = k.activityObj.getActivityInfo(), i = n.activityEnable, o = n.activityCssPath;
                return T.information("getInitData:", n), JSON.stringify({
                    appid: "0",
                    package: "com.xunlei.thunderx",
                    appkey: "4af30ad6c6b0c02c4d8df3ded2cb79b8",
                    platform: "pc-xdas",
                    osversion: a.release(),
                    thunderVersion: t,
                    activityEnable: i,
                    activityCssPath: o
                })
            }

            saveData(e, t, n) {
                return i(this, void 0, void 0, function* () {
                    T.information("SaveData type:", e, ";key:", t, ";data:", n);
                    let i = !1;
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(n) || "" === n) break;
                        if ("memory" === e) {
                            l.isNullOrUndefined(this.curUserInfo) && (this.curUserInfo = {});
                            try {
                                this.curUserInfo[t] = JSON.parse(n)
                            } catch (e) {
                                T.information(e)
                            }
                            i = !0
                        } else if ("file" === e) {
                            l.isNullOrUndefined(this.loginInfo) && (this.loginInfo = {});
                            try {
                                this.loginInfo[t] = JSON.parse(n);
                                let e = JSON.stringify(this.loginInfo);
                                T.information("SaveData bufStr:", e);
                                let a = new Buffer(e), o = c.ToolsUtilitiesAWNS.encryptBuffer(a, this.key);
                                i = yield d.FileSystemAWNS.writeFileAW(this.loginDataPath, o)
                            } catch (e) {
                                T.information(e)
                            }
                        } else i = !0
                    } while (0);
                    return h.NativeCallHostModule.nativeCallHost.fireNativeEvent("onChangeLoginData", e, t, n), i
                })
            }

            loadData(e, t) {
                let n = null;
                do {
                    if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t)) break;
                    if ("memory" === e) {
                        if (l.isNullOrUndefined(this.curUserInfo) || l.isNullOrUndefined(this.curUserInfo[t]) || "" === this.curUserInfo[t]) break;
                        n = JSON.stringify(this.curUserInfo[t])
                    } else {
                        if ("file" !== e) break;
                        if (l.isNullOrUndefined(this.loginInfo) || l.isNullOrUndefined(this.loginInfo[t]) || "" === this.loginInfo[t]) break;
                        n = JSON.stringify(this.loginInfo[t])
                    }
                } while (0);
                return T.information("loadData:data = ", n), n
            }

            loadLoginDataFromFile() {
                return i(this, void 0, void 0, function* () {
                    do {
                        let e = yield d.FileSystemAWNS.readFileAW(`${this.loginDataPath}`);
                        if (l.isNullOrUndefined(e) || "" === e.toString()) {
                            T.information("loadLoginDataFromFile no buf data");
                            break
                        }
                        let t = "";
                        try {
                            if (t = c.ToolsUtilitiesAWNS.decryptBuffer(e, this.key).toString(), l.isNullOrUndefined(t) || "" === t) {
                                T.information("loadLoginDataFromFile decryption bufStr is null");
                                break
                            }
                            this.loginInfo = JSON.parse(t), T.information("loadLoginDataFromFile decryption this.loginInfo:", this.loginInfo)
                        } catch (e) {
                            yield d.FileSystemAWNS.unlinkAW(this.loginDataPath);
                            break
                        }
                    } while (0)
                })
            }
        }, e.loginHelper = new class {
            constructor() {
                this.curUserInfo = null, this.curLoginInfo = null, this.dir = s.join(__profilesDir, "Community/UserImages"), T.information("loginHelper obj create")
            }

            getCurInternetState() {
                return m.getCurInternetState()
            }

            getUserHeaderAw(e) {
                return i(this, void 0, void 0, function* () {
                    T.information("enter getUserHeaderAw");
                    let t = "";
                    do {
                        if (null === e || void 0 === e || "" === e) break;
                        let n = e + ".jpg", i = s.join(this.dir, n);
                        (yield d.FileSystemAWNS.existsAW(i)) && (t = `file:///${i}`)
                    } while (0);
                    return T.information("leave getUserHeaderAw:", t, e), t
                })
            }

            getUserHeader(e) {
                T.information("enter getUserHeader");
                let t = "";
                do {
                    if (null === e || void 0 === e || "" === e) break;
                    let n = e + ".jpg", i = s.join(this.dir, n);
                    m.queryFileExists(i) && (t = `file:///${i}`)
                } while (0);
                return T.information("leave getUserHeader:", t, e), t
            }

            updateHeaderAw(e, t) {
                return i(this, void 0, void 0, function* () {
                    let n = "";
                    do {
                        if (T.information("enter updateHeaderAw:", e, t), null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                        let i = t + ".jpg", a = s.join(this.dir, i);
                        (yield f.AxiosNS.downloadFileAW(e, a)) && (n = `file:///${a}?_=${Date.now()}`)
                    } while (0);
                    return T.information("leave updateHeaderAw:", n), n
                })
            }

            getUserInfo(...e) {
                void 0 !== r.xlQuickLogin && r.xlQuickLogin.getUserInfo(...e)
            }

            getSessionIDAw() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        r.xlQuickLogin.getUserInfo("sessionid", t => {
                            e(t)
                        })
                    })
                })
            }

            getUserInfoAw() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        r.xlQuickLogin.getUserInfo(t => {
                            e(t)
                        })
                    })
                })
            }

            getUserInfoEx(e, t) {
                r.xlQuickLogin.getAllUserInfo(n => {
                    this.curUserInfo = n, null !== this.curUserInfo && void 0 !== this.curUserInfo && "" !== this.curUserInfo ? r.xlQuickLogin.getUserInfo(n => {
                        this.curLoginInfo = n, T.information(this.curLoginInfo);
                        let i = "";
                        if (null === e || 0 === e || 3 === e) {
                            let e = {}, t = this.getUserInfoStr();
                            e[1] = t;
                            let n = this.getVipInfoStr();
                            e[2] = n, i = JSON.stringify(e)
                        } else if (1 === e) {
                            let e = this.getUserInfoStr();
                            i = JSON.stringify(e)
                        } else if (2 === e) {
                            let e = this.getVipInfoStr();
                            i = JSON.stringify(e)
                        }
                        t(i)
                    }) : t("")
                })
            }

            getAllUserInfo(...e) {
                void 0 !== r.xlQuickLogin && r.xlQuickLogin.getAllUserInfo(...e)
            }

            getAllUserInfoAw() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        r.xlQuickLogin.getAllUserInfo(t => {
                            e(t)
                        })
                    })
                })
            }

            getUserInfoByKeyAw(e, t) {
                return i(this, void 0, void 0, function* () {
                    return new Promise(n => {
                        null !== t && void 0 !== t && "vip_xl" === t ? r.xlQuickLogin.getAllUserInfo(t => {
                            let i = "";
                            do {
                                if (null === t || void 0 === t) break;
                                if (null === t.vipList || void 0 === t.vipList) break;
                                if (null === t.vipList[0] || void 0 === t.vipList[0]) break;
                                i = t.vipList[0][e]
                            } while (0);
                            n(i)
                        }) : r.xlQuickLogin.getAllUserInfo(e, e => {
                            n(e)
                        })
                    })
                })
            }

            isLogined(...e) {
                void 0 !== r.xlQuickLogin && void 0 !== e && r.xlQuickLogin.isLogined(...e)
            }

            isLoginedAw() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        r.xlQuickLogin.isLogined(t => {
                            e(t)
                        })
                    })
                })
            }

            showLoginDlg(e, t) {
                T.information(e), null !== t && void 0 !== t || (t = !0), h.NativeCallHostModule.nativeCallHost.fireNativeEvent("onShowLoginWnd", e, t)
            }

            logout() {
                void 0 !== r.xlQuickLogin && (T.information("调用 logout 接口"), r.xlQuickLogin.logout())
            }

            logIn(e) {
                void 0 !== r.xlQuickLogin && "function" == typeof r.xlQuickLogin.retryLogin && (T.information("enter xlQuickLogin.retryLogin"), r.xlQuickLogin.retryLogin())
            }

            switchAccount(e) {
                void 0 !== r.xlQuickLogin && "function" == typeof r.xlQuickLogin.switchAccount && r.xlQuickLogin.switchAccount()
            }

            isAutologin(...e) {
                void 0 !== r.xlQuickLogin && "function" == typeof r.xlQuickLogin.isAutologin && r.xlQuickLogin.isAutologin(...e)
            }

            channel(e) {
                void 0 !== r.xlQuickLogin && "function" == typeof r.xlQuickLogin.channel && r.xlQuickLogin.channel(e)
            }

            getUserInfoStr() {
                return {
                    username: this.curLoginInfo.userName,
                    usernewno: this.curUserInfo.userNewNo,
                    userid: this.curUserInfo.userID,
                    sessionid: this.curLoginInfo.sessionid,
                    nickName: this.curUserInfo.nickName,
                    account: this.curUserInfo.account,
                    rank: this.curUserInfo.rank,
                    order: this.curUserInfo.order,
                    isSubAccount: this.curUserInfo.isSubAccount,
                    country: this.curUserInfo.country,
                    province: this.curUserInfo.province,
                    city: this.curUserInfo.city,
                    birthday: this.curUserInfo.birthday,
                    sex: this.curUserInfo.sex,
                    mobile: this.curUserInfo.mobile,
                    isSpecialNum: this.curUserInfo.isSpecialNum,
                    role: this.curUserInfo.role,
                    todayScore: this.curUserInfo.todayScore,
                    personalSign: this.curUserInfo.personalSign
                }
            }

            getVipInfoStr() {
                let e = this.curUserInfo.vipList[0];
                return {
                    vasid: e.vasid,
                    isVip: e.isVip,
                    vipLevel: e.vipLevel,
                    expireDate: e.expireDate,
                    vasType: e.vasType,
                    payId: e.payId,
                    payName: e.payName,
                    vipGrow: e.vipGrow,
                    vipDayGrow: e.vipDayGrow,
                    isAutoDeduct: e.isAutoDeduct,
                    isRemind: e.isRemind,
                    isYear: e.isYear,
                    register: e.register
                }
            }
        }
    }(t.LoginHelperNS || (t.LoginHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(7), a = n(18), o = n(19), r = n(25), s = 0;
    !function (e) {
        class t {
            constructor() {
                this.nativeCallInfoList = [], this.webviewInfoId = -1
            }

            initialize() {
                this.bindMsgListeners()
            }

            addDelegate(e) {
                this.delegate = e
            }

            removeDelegate() {
                this.delegate = null
            }

            callJsFunctionById(e, t, ...n) {
                a.information(`funcId = ${t}`);
                do {
                    if (!i.isNumber(e)) {
                        a.error(`nativeCallId = ${e} error`);
                        break
                    }
                    if (!i.isNumber(t)) {
                        a.error(`funcId = ${t} error`);
                        break
                    }
                    if (this.isInvalidId(t)) {
                        a.error(`funcId = ${t} invalid`);
                        break
                    }
                    let r = o.CommonIPCMessage.msgNCCallJsFunctionById, s = [t].concat(n);
                    this.isWebviewInfo(e) ? this.sendMsgToWebviewNativeCall(r, s) : this.sendMsgToNativeCall(e, r, s)
                } while (0)
            }

            callJsFunctionByName(e, t, ...n) {
                a.information(`funcName = ${t}`);
                do {
                    if (!i.isNumber(e)) {
                        a.error(`nativeCallId = ${e} error`);
                        break
                    }
                    if (i.isNullOrUndefined(t) || 0 === t.length) {
                        a.error(`funcName = ${t} error`);
                        break
                    }
                    let r = o.CommonIPCMessage.msgNCCallJsFunctionByName, s = [t].concat(n);
                    this.isWebviewInfo(e) ? this.sendMsgToWebviewNativeCall(r, s) : this.sendMsgToNativeCall(e, r, s)
                } while (0)
            }

            fireNativeEvent(e, ...t) {
                a.information(`eventName = ${e}`);
                do {
                    if (i.isNullOrUndefined(e) || 0 === e.length) {
                        a.error(`eventName = ${e} error`);
                        break
                    }
                    let n = o.CommonIPCMessage.msgNCNativeFireEvent, r = [e].concat(t);
                    this.sendMsgToWebviewNativeCall(n, r);
                    for (let e of this.nativeCallInfoList) this.sendMsgToNativeCall(e.id, n, r)
                } while (0)
            }

            bindMsgListeners() {
                this.bindWebviewMsgListeners(), this.bindIPCMsgListeners()
            }

            bindWebviewMsgListeners() {
                const e = document.querySelector("webview");
                i.isNullOrUndefined(e) ? a.error("webview is null") : e.addEventListener("ipc-message", e => {
                    do {
                        if (e.channel === o.CommonIPCMessage.msgNCCallNativeFunction) {
                            this.handleWebviewCallNativeFunction(e.args[0]);
                            break
                        }
                        if (e.channel === o.CommonIPCMessage.msgNCCheckNativeFunction) {
                            this.handleWebviewCheckNativeFunction(e.args[0]);
                            break
                        }
                    } while (0)
                })
            }

            bindIPCMsgListeners() {
                r.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCallNativeFunction, e => {
                    this.handleCallNativeFunction(e)
                }), r.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCheckNativeFunction, e => {
                    this.handleCheckNativeFunction(e)
                }), r.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCNativeCallReady, e => {
                    this.handleNativeCallReady(e.msg.args)
                })
            }

            handleCallNativeFunction(e) {
                do {
                    if (i.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (i.isNullOrUndefined(e)) {
                        a.error("msgInfo is null");
                        break
                    }
                    let t = e.senderInfo;
                    if (i.isNullOrUndefined(t)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    let n = e.msg.args;
                    if (i.isNullOrUndefined(n)) {
                        a.error("args is null");
                        break
                    }
                    let o = n[0];
                    if (!i.isString(o) || 0 === o.length) {
                        a.error(`funcName = ${o} error`);
                        break
                    }
                    let r = n[1];
                    if (!i.isNumber(r)) {
                        a.error(`callbackId = ${r} error`);
                        break
                    }
                    n.splice(0, 2), this.appendNativeCallInfoList(t), this.delegate.onJsCallNativeFunction(t.id, o, r, n)
                } while (0)
            }

            handleCheckNativeFunction(e) {
                do {
                    if (i.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (i.isNullOrUndefined(e)) {
                        a.error("msgInfo is null");
                        break
                    }
                    let t = e.senderInfo;
                    if (i.isNullOrUndefined(t)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    let n = e.msg.args;
                    if (i.isNullOrUndefined(n)) {
                        a.error("args is null");
                        break
                    }
                    let o = n[0];
                    if (!i.isString(o) || 0 === o.length) {
                        a.error(`funcName = ${o} error`);
                        break
                    }
                    let r = n[1];
                    if (!i.isNumber(r)) {
                        a.error(`callbackId = ${r} error`);
                        break
                    }
                    this.appendNativeCallInfoList(t), n.splice(0, 2), this.delegate.onJsCheckNativeFunction(t.id, o, r)
                } while (0)
            }

            handleNativeCallReady(e) {
                do {
                    if (i.isNullOrUndefined(e)) {
                        a.error("args is null");
                        break
                    }
                    let t = e[0];
                    if (i.isNullOrUndefined(t)) {
                        a.error(`info = ${t} error`);
                        break
                    }
                    this.appendNativeCallInfoList(t)
                } while (0)
            }

            handleWebviewCallNativeFunction(e) {
                do {
                    if (i.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (i.isNullOrUndefined(e)) {
                        a.error("args is null");
                        break
                    }
                    let t = e[0];
                    if (!i.isString(t) || 0 === t.length) {
                        a.error(`funcName = ${t} error`);
                        break
                    }
                    let n = e[1];
                    if (!i.isNumber(n)) {
                        a.error(`callbackId = ${n} error`);
                        break
                    }
                    e.splice(0, 2), this.delegate.onJsCallNativeFunction(this.webviewInfoId, t, n, e)
                } while (0)
            }

            handleWebviewCheckNativeFunction(e) {
                do {
                    if (i.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (i.isNullOrUndefined(e)) {
                        a.error("args is null");
                        break
                    }
                    let t = e[0];
                    if (!i.isString(t) || 0 === t.length) {
                        a.error(`funcName = ${t} error`);
                        break
                    }
                    let n = e[1];
                    if (!i.isNumber(n)) {
                        a.error(`callbackId = ${n} error`);
                        break
                    }
                    e.splice(0, 2), this.delegate.onJsCheckNativeFunction(this.webviewInfoId, t, n)
                } while (0)
            }

            appendNativeCallInfoList(e) {
                let t = !0;
                for (let n of this.nativeCallInfoList) if (n.id === e.id) {
                    t = !1;
                    break
                }
                t && this.nativeCallInfoList.push(e)
            }

            findNativeCallInfo(e) {
                for (let t of this.nativeCallInfoList) if (t.id === e) return t;
                return null
            }

            isWebviewInfo(e) {
                return e === this.webviewInfoId
            }

            sendMsgToWebviewNativeCall(e, t) {
                const n = document.querySelector("webview");
                do {
                    if (i.isNullOrUndefined(n)) {
                        a.error("webview is null");
                        break
                    }
                    if (i.isNullOrUndefined(n.send)) {
                        a.error("webview.send is null");
                        break
                    }
                    n.send(e, t)
                } while (0)
            }

            sendMsgToNativeCall(e, t, n) {
                do {
                    let o = this.findNativeCallInfo(e);
                    if (i.isNullOrUndefined(o)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    r.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(o.id, {name: t, args: n})
                } while (0)
            }

            isInvalidId(e) {
                return e === s
            }
        }

        e.NativeCallHost = t, e.nativeCallHost = new t
    }(t.NativeCallHostModule || (t.NativeCallHostModule = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(5), r = n(1), s = n(9), l = n(92), u = n(31), d = n(93), c = n(35), h = n(719), f = n(6);
    !function (e) {
        const t = u.DownloadKernelTaskManager.getTaskManager(),
            n = d.DownloadKernelCategoryManager.getCategoryManager(),
            p = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
            g = r.default.getLogger("DownloadKernelManager");
        let k = void 0, m = !1, T = new c.EventEmitter;

        function v(e, t) {
            l.ThunderKernel.initDataBase(e, t)
        }

        function y(e, t, n, i) {
            l.ThunderKernel.initDownloadSdk(e, t, n, i)
        }

        T.setMaxListeners(0), e.init = function () {
            return i(this, void 0, void 0, function* () {
                let e = a.join(__rootDir, "../../Thunder.exe"), i = p.getFileVersion(e);
                y(a.join(__rootDir, "../bin/SDK"), "xzcGMudGh1bmRlclg7MA^^SDK==edee53fd0b15e8d65dbfe7824f5f^a23", i, e => {
                    t.initDownloadKernelEnd(e)
                }), (yield s.FileSystemAWNS.existsAW(__profilesDir)) || (yield s.FileSystemAWNS.mkdirsAW(__profilesDir)), v(a.join(__profilesDir, "TaskDb.dat"), e => {
                    0 === e && (n.init(), t.loadTaskBase(), setInterval(() => {
                        t.queryTaskInfo()
                    }, 1e3), setTimeout(() => {
                        let e = p.getInstallChannel();
                        t.setGlobalExtInfo(e).catch(), f.NativeCallModule.nativeCall.AttachNativeEvent("onLoginStatusChange", (n, i) => {
                            g.information(`stat dk onLoginStatusChange oldStatus ${n}, newState ${i}`), t.setGlobalExtInfo(e).catch()
                        })
                    }, 3e3))
                }), yield h.BTExtraTrackNS.initBtTaskTrackers()
            })
        }, e.getPeerId = function () {
            return i(this, void 0, void 0, function* () {
                let e = void 0;
                return e = k && "" !== k ? k : new Promise(e => {
                    m ? T.once("OnGetGlobalPeerId", t => {
                        e(t)
                    }) : l.ThunderKernel.queryGlobalInfo(1, (t, n) => {
                        g.information("getPeerId queryGlobalInfo glPeerId:", n), m = !1, k = n, e(n), T.emit("OnGetGlobalPeerId", n)
                    }) ? m = !0 : e("")
                })
            })
        }, e.initDataBase = v, e.initDownloadSdk = y, e.uninitialize = function () {
        }, e.startBatchOperationJournal = function () {
        }, e.endBatchOperationJournal = function () {
        }, e.getDownloadSdkVersion = function () {
            let e = a.join(__rootDir, "../bin/SDK/DownloadSDKServer.exe");
            return p.getFileVersion(e)
        }, e.setDownloadSpeedLimit = function (e) {
            return l.ThunderKernel.setDownloadSpeedLimit(e)
        }, e.setUploadSpeedLimit = function (e) {
            return l.ThunderKernel.setUploadSpeedLimit(e)
        }, e.setCacheSize = function (e) {
            return l.ThunderKernel.setCacheSize(e)
        }, e.enableCommonP2pChannel = function (e) {
            t.enableCommonP2pChannel(e)
        }, e.enableCommonP2sChannel = function (e) {
            t.enableCommonP2pChannel(e)
        }, e.getTotalDownloadSpeed = function () {
            return t.getTotalDownloadSpeed()
        }, e.getTotalUploadSpeed = function () {
            return t.getTotalUploadSpeed()
        }, e.getTotalDownloadSize = function () {
            return t.getTotalDownloadSize()
        }, e.getTotalUploadSize = function () {
            return t.getTotalUploadSize()
        }, e.getTotalTaskDownloadSpeed = function (e, n) {
            return t.getTotalTaskDownloadSpeed(e, n)
        }, e.getTotalTaskVipSpeed = function (e, n) {
            return t.getTotalTaskVipSpeed(e, n)
        }, e.attachListener = function (e, n) {
            t.attachListener(e, n)
        }, e.attachOnceListener = function (e, n) {
            t.attachOnceListener(e, n)
        }, e.detachListener = function (e, n) {
            t.detachListener(e, n)
        }, e.importUnfinishedTask = function (e, t, n) {
            l.ThunderKernel.importTask(e, t, n)
        }
    }(t.DownloadKernelManager || (t.DownloadKernelManager = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(8), r = n(17);
    let s = null;
    const l = n(1).default.getLogger("url.helper");
    !function (e) {
        function t(e) {
            let t = !0;
            if ("string" == typeof e) if (40 === e.length || 32 === e.length) {
                for (let n = 0; n < e.length; n++) if (e.charCodeAt(n) > 127) {
                    t = !1;
                    break
                }
            } else t = !1; else t = !1;
            return t
        }

        function u(e, n = !0) {
            n = void 0 === n || n;
            let i = !1;
            do {
                if ("string" != typeof e || "" === e) break;
                let a = e.trim();
                if ("" === a) break;
                if (r.ThunderHelper.getTaskTypeFromUrl(a) === o.DownloadKernel.TaskType.Unkown) {
                    if (!n) break;
                    t(a) && (i = !0)
                } else i = !0;
                i || a.match(/^file:\/\/\//) && (i = !0)
            } while (0);
            return i
        }

        e.isMagnetCode = t, e.fixMagnetUrl = function (e) {
            let n = "";
            do {
                if ("string" != typeof e || "" === e) break;
                if ("" === (n = e.trim())) break;
                r.ThunderHelper.getTaskTypeFromUrl(n) === o.DownloadKernel.TaskType.Unkown && t(n) && (n = "magnet:?xt=urn:btih:" + n)
            } while (0);
            return n
        }, e.isUrlValid = u, e.isBirdKey = function (e) {
            return e ? e.match(/#X([0-9a-zA-Z]{8}){1,2}#/g) : null
        }, e.isCustomProtocol = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                null === s && (s = yield Promise.resolve().then(() => n(29)));
                let i = s.parse(e);
                do {
                    if (null === i || void 0 === i) break;
                    let e = i.protocol;
                    if ("magnet:" === e) {
                        t = !0;
                        break
                    }
                    if ("thunder:" === e) {
                        t = !0;
                        break
                    }
                    if ("ed2k:" === e) {
                        t = !0;
                        break
                    }
                } while (0);
                return t
            })
        }, e.isP2spOrEmuleUrl = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = e.trim();
                if ("" === n) break;
                let i = r.ThunderHelper.getTaskTypeFromUrl(n);
                if (i === o.DownloadKernel.TaskType.P2sp || i === o.DownloadKernel.TaskType.Emule) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.isSupportUrl = function (e) {
            e = e.toLowerCase();
            let t = !1;
            do {
                if ("http://" === e.substr(0, "http://".length)) {
                    t = !0;
                    break
                }
                if ("https://" === e.substr(0, "https://".length)) {
                    t = !0;
                    break
                }
                if ("ftp://" === e.substr(0, "ftp://".length)) {
                    t = !0;
                    break
                }
                if ("ed2k://" === e.substr(0, "ed2k://".length)) {
                    t = !0;
                    break
                }
                if ("thunder://" === e.substr(0, "thunder://".length)) {
                    t = !0;
                    break
                }
                if ("magnet:?" === e.substr(0, "magnet:?".length)) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        };
        let d = ".edu;.gov;.mil;.hk;.tw;.com.tw;.com.tw;.aero;.biz;.coop;.info;.museum;.name;.pro;";
        d += ".com;.cn;.xin;.net;.top;.xyz;.wang;.shop;.site;.club;.cc;.fun;.online;.biz;.red;.link;.ltd;.mobi;.info;.org;", d += ".com.cn;.net.cn;.org.cn;.gov.cn;.name;.vip;.work;.tv;.co;.kim;.group;.tech;.store;.ren;.ink;.pub;.live;.wiki;.design;";
        const c = (d += ".me").split(";");

        function h(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e || "" === e) break;
                if (-1 !== c.indexOf(e)) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function f(e) {
            let t = null;
            do {
                if (void 0 === e || null === e) break;
                if ("" === (e = e.trim())) break;
                let n = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(e);
                if (null === n) break;
                l.information("url parse result ", n), t = {};
                let i = ["url", "scheme", "slash", "host", "port", "path", "query", "hash"];
                for (let e = 0; e < i.length; e++) t[i[e]] = n[e];
                l.information("url parse", t)
            } while (0);
            return t
        }

        e.isUsualDomainSuffix = h, e.urlParse = f, e.isUrl = function (e) {
            let t = !1, n = e;
            do {
                if (void 0 === e || null === e) break;
                if (u(e, !1)) {
                    t = !0;
                    break
                }
                if (e.trim().match(/^file:\/\/\//)) {
                    t = !0;
                    break
                }
                let i = f(e);
                if (null === i) {
                    l.information("url parse failed");
                    break
                }
                if (void 0 === i.host || null === i.host) break;
                if (void 0 !== i.scheme) {
                    t = !0;
                    break
                }
                let o = i.host.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
                if (o) {
                    if (l.information("url parse is ip", o), Number(o[1]) <= 0 || Number(o[1]) > 255) {
                        t = !1;
                        break
                    }
                    if (Number(o[2]) < 0 || Number(o[2]) > 255) {
                        t = !1;
                        break
                    }
                    if (Number(o[4]) < 0 || Number(o[4]) > 255) {
                        t = !1;
                        break
                    }
                    if (Number(o[4]) < 0 || Number(o[4]) > 255) {
                        t = !1;
                        break
                    }
                    t = !0, void 0 === i.scheme && void 0 !== i.port && (n = `http://${e}`);
                    break
                }
                if (i.host.match(/\.{2,}/)) {
                    l.information("url parse has multi dot"), t = !1;
                    break
                }
                let r = a.extname(i.host);
                if ("" === r) break;
                if (h(r)) {
                    t = !0;
                    break
                }
            } while (0);
            return l.information("url parse isUrl", t), {ret: t, suggest: n}
        }, e.isFileNameValid = function (e) {
            let t = !1;
            do {
                if (void 0 === e) break;
                if (null === e) break;
                if ("" === (e = e.trim())) break;
                if ("." === e[0]) break;
                if (e.match(/[\/\\"<>\?\*|]/)) break;
                t = !0
            } while (0);
            return t
        }, e.isSuffixNeedDownload = function (e) {
            let t = !0;
            do {
                if (void 0 === e) break;
                if ("" === e || "." === e) break;
                if (e = e.toLowerCase(), -1 !== ["txt", "url", "html", "htm", "mht", "nfo"].indexOf(e)) {
                    t = !1;
                    break
                }
            } while (0);
            return t
        }
    }(t.URLHelperNS || (t.URLHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(1).default.getLogger("GetSkinInfo");
    let r;
    (function () {
        return i(this, void 0, void 0, function* () {
            if ("renderer" === process.type) {
                o.information("renderer process");
                const e = yield Promise.resolve().then(() => n(15)), t = yield Promise.resolve().then(() => n(6));
                e.default("GetSkinInfo").then(e => {
                    r = e, o.information("send OnChangeSkin", e)
                }).catch(e => {
                    o.warning(e)
                }), t.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSkin", e => {
                    r = e, o.information("send OnChangeSkin", e)
                })
            } else "browser" === process.type && (o.information("main process"), a.ipcMain.on("OnChangeSkin", (e, t) => {
                o.information("OnChangeSkin", t), r = t
            }))
        })
    })().catch(e => {
        o.information(e)
    }), t.default = function () {
        return r
    }
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(47), a = n(33);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\components\\select-native.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    e.exports = function (e, t) {
        return function () {
            for (var n = new Array(arguments.length), i = 0; i < n.length; i++) n[i] = arguments[i];
            return e.apply(t, n)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = n(44);
    e.exports = function (e, t, n) {
        var a = n.config.validateStatus;
        n.status && a && !a(n.status) ? t(i("Request failed with status code " + n.status, n.config, null, n.request, n)) : e(n)
    }
}, function (e, t, n) {
    "use strict";
    e.exports = function (e, t, n, i, a) {
        return e.config = t, n && (e.code = n), e.request = i, e.response = a, e
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);

    function a(e) {
        return encodeURIComponent(e).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]")
    }

    e.exports = function (e, t, n) {
        if (!t) return e;
        var o;
        if (n) o = n(t); else if (i.isURLSearchParams(t)) o = t.toString(); else {
            var r = [];
            i.forEach(t, function (e, t) {
                null !== e && void 0 !== e && (i.isArray(e) ? t += "[]" : e = [e], i.forEach(e, function (e) {
                    i.isDate(e) ? e = e.toISOString() : i.isObject(e) && (e = JSON.stringify(e)), r.push(a(t) + "=" + a(e))
                }))
            }), o = r.join("&")
        }
        return o && (e += (-1 === e.indexOf("?") ? "?" : "&") + o), e
    }
}, function (e, t) {
    e.exports = require("https")
}, function (e, t, n) {
    var i = n(29), a = n(52), o = n(75), r = n(126), s = n(113).Writable, l = n(127)("follow-redirects"),
        u = {GET: !0, HEAD: !0, OPTIONS: !0, TRACE: !0}, d = Object.create(null);

    function c(e, t) {
        s.call(this), e.headers = e.headers || {}, this._options = e, this._redirectCount = 0, this._requestBodyLength = 0, this._requestBodyBuffers = [], t && this.on("response", t);
        var n = this;
        if (this._onNativeResponse = function (e) {
            n._processResponse(e)
        }, !e.pathname && e.path) {
            var i = e.path.indexOf("?");
            i < 0 ? e.pathname = e.path : (e.pathname = e.path.substring(0, i), e.search = e.path.substring(i))
        }
        this._performRequest()
    }

    function h(e) {
        var t = {maxRedirects: 21, maxBodyLength: 10485760}, n = {};
        return Object.keys(e).forEach(function (a) {
            var o = a + ":", s = n[o] = e[a], u = t[a] = Object.create(s);
            u.request = function (e, a) {
                return "string" == typeof e ? (e = i.parse(e)).maxRedirects = t.maxRedirects : e = Object.assign({
                    protocol: o,
                    maxRedirects: t.maxRedirects,
                    maxBodyLength: t.maxBodyLength
                }, e), e.nativeProtocols = n, r.equal(e.protocol, o, "protocol mismatch"), l("options", e), new c(e, a)
            }, u.get = function (e, t) {
                var n = u.request(e, t);
                return n.end(), n
            }
        }), t
    }

    ["abort", "aborted", "error", "socket", "timeout"].forEach(function (e) {
        d[e] = function (t) {
            this._redirectable.emit(e, t)
        }
    }), c.prototype = Object.create(s.prototype), c.prototype.write = function (e, t, n) {
        this._requestBodyLength + e.length <= this._options.maxBodyLength ? (this._requestBodyLength += e.length, this._requestBodyBuffers.push({
            data: e,
            encoding: t
        }), this._currentRequest.write(e, t, n)) : (this.emit("error", new Error("Request body larger than maxBodyLength limit")), this.abort())
    }, c.prototype.end = function (e, t, n) {
        var i = this._currentRequest;
        e ? this.write(e, t, function () {
            i.end(null, null, n)
        }) : i.end(null, null, n)
    }, c.prototype.setHeader = function (e, t) {
        this._options.headers[e] = t, this._currentRequest.setHeader(e, t)
    }, c.prototype.removeHeader = function (e) {
        delete this._options.headers[e], this._currentRequest.removeHeader(e)
    }, ["abort", "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive", "setTimeout"].forEach(function (e) {
        c.prototype[e] = function (t, n) {
            return this._currentRequest[e](t, n)
        }
    }), ["aborted", "connection", "socket"].forEach(function (e) {
        Object.defineProperty(c.prototype, e, {
            get: function () {
                return this._currentRequest[e]
            }
        })
    }), c.prototype._performRequest = function () {
        var e = this._options.protocol, t = this._options.nativeProtocols[e];
        if (this._options.agents) {
            var n = e.substr(0, e.length - 1);
            this._options.agent = this._options.agents[n]
        }
        var a = this._currentRequest = t.request(this._options, this._onNativeResponse);
        for (var o in this._currentUrl = i.format(this._options), a._redirectable = this, d) o && a.on(o, d[o]);
        if (this._isRedirect) {
            var r = this._requestBodyBuffers;
            !function e() {
                if (0 !== r.length) {
                    var t = r.pop();
                    a.write(t.data, t.encoding, e)
                } else a.end()
            }()
        }
    }, c.prototype._processResponse = function (e) {
        var t = e.headers.location;
        if (t && !1 !== this._options.followRedirects && e.statusCode >= 300 && e.statusCode < 400) {
            if (++this._redirectCount > this._options.maxRedirects) return void this.emit("error", new Error("Max redirects exceeded."));
            var n, a = this._options.headers;
            if (307 !== e.statusCode && !(this._options.method in u)) for (n in this._options.method = "GET", this._requestBodyBuffers = [], a) /^content-/i.test(n) && delete a[n];
            if (!this._isRedirect) for (n in a) /^host$/i.test(n) && delete a[n];
            var o = i.resolve(this._currentUrl, t);
            l("redirecting to", o), Object.assign(this._options, i.parse(o)), this._isRedirect = !0, this._performRequest()
        } else e.responseUrl = this._currentUrl, this.emit("response", e), this._requestBodyBuffers = []
    }, e.exports = h({http: a, https: o}), e.exports.wrap = h
}, function (e, t, n) {
    "use strict";
    e.exports = function (e) {
        return !(!e || !e.__CANCEL__)
    }
}, function (e, t, n) {
    "use strict";

    function i(e) {
        this.message = e
    }

    i.prototype.toString = function () {
        return "Cancel" + (this.message ? ": " + this.message : "")
    }, i.prototype.__CANCEL__ = !0, e.exports = i
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(767), o = n(60), r = n(62), s = n(1).default.getLogger("Thunder.VipDownload.user-info"),
        l = r.PluginHelperNS.getHelper();
    var u;
    !function (e) {
        e.login = "OnLogin", e.logout = "OnLogout", e.authorityChanged = "OnAuthorityChanged"
    }(u = t.UserEventNS || (t.UserEventNS = {}));

    class d extends o.default {
        constructor() {
            super(...arguments), this.mHasFlux = !1, this.mPeerId = void 0, this.mUserId = "0", this.mSessionId = void 0, this.mIsLogin = !1, this.mIsVip = !1, this.mVipLevel = 0, this.mVasType = 0
        }

        init() {
            this.setMaxListeners(0), l.nativeCall && this.attachUserEvents()
        }

        getPeerId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mPeerId ? e(this.mPeerId) : l.nativeCall ? l.nativeCall.CallNativeFunction("GetPeerID", (t, n) => {
                        0 === t && n && "" !== n && (this.mPeerId = n), e(this.mPeerId || "")
                    }) : e(this.mPeerId || "")
                })
            })
        }

        getSessionId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mSessionId ? e(this.mSessionId) : l.nativeCall ? l.nativeCall.CallNativeFunction("GetSessionID", (t, n) => {
                        0 === t && (this.mSessionId = n), e(this.mSessionId || "0")
                    }) : e(this.mSessionId || "0")
                })
            })
        }

        get jumpKey() {
            return ""
        }

        get userId() {
            return this.mUserId
        }

        get isLogin() {
            return this.mIsLogin
        }

        get isVip() {
            return this.mIsVip
        }

        get isPlatinumVip() {
            return this.isVip && this.vasType > 2
        }

        get isSuperVip() {
            return this.isVip && 5 === this.vasType
        }

        get hasFlux() {
            return this.mHasFlux
        }

        get vipLevel() {
            return this.mVipLevel
        }

        get vasType() {
            return this.mVasType
        }

        get userLevel() {
            return 1
        }

        get authority() {
            return this.isVip || this.hasFlux
        }

        get offlineAuthority() {
            return this.isLogin
        }

        queryFlux() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.getPeerId(), t = {userId: this.userId, peerId: e, jumpKey: this.jumpKey},
                    n = yield(new a.UserHttpSession).queryFlux(t);
                n && 0 === n.result && n.capacity > 0 && (this.mHasFlux = !0)
            })
        }

        attachUserEvents() {
            l.nativeCall.AttachNativeEvent("onLoginSuc", () => i(this, void 0, void 0, function* () {
                yield this.onLogin()
            })), l.nativeCall.AttachNativeEvent("onLogout", () => {
                this.onLogout()
            }), l.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => i(this, void 0, void 0, function* () {
                yield this.onUserInfoChange(e, t)
            })), l.nativeCall.AttachNativeEvent("onLoginStatusChange", (e, t) => {
                this.onLoginStatusChange(t)
            })
        }

        onLogin() {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3eonLogin"), this.clear(), this.mIsLogin = !0, yield this.parseUserInfo(), this.fireEvent(u.login), this.isVip || (yield this.queryFlux()), this.fireEvent(u.authorityChanged, this.authority), s.information("<--onLogin")
            })
        }

        onLogout() {
            s.information("--\x3eonLogout"), this.clear(), this.fireEvent(u.logout), this.fireEvent(u.authorityChanged, !1), s.information("<--onLogout")
        }

        onUserInfoChange(e, t) {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3eonUserInfoChange"), "vipinfo" === e && (s.information("data", t), yield this.parseUserInfo(), this.mIsVip && this.fireEvent(u.authorityChanged, this.authority, !0)), s.information("<--onUserInfoChange")
            })
        }

        onLoginStatusChange(e) {
            s.information("--\x3eonLoginStatusChange", "newStatus", e), "offline" === e && this.onLogout(), s.information("<--onLoginStatusChange")
        }

        clear() {
            this.mUserId = "0", this.mSessionId = void 0, this.mHasFlux = !1, this.mIsVip = !1, this.mIsLogin = !1, this.mVasType = 0, this.mVipLevel = 0
        }

        parseUserInfo() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.getUserinfo();
                if (s.information("userinfo", e), e) if (this.mUserId = e.userID || "0", e.vipList && e.vipList[0]) {
                    if (e.vipList[0].isVip) {
                        let t = Number(e.vipList[0].isVip).valueOf();
                        this.mIsVip = t > 0
                    } else this.mIsVip = !1;
                    e.vipList[0].vipLevel && (this.mVipLevel = Number(e.vipList[0].vipLevel).valueOf()), e.vipList[0].vasType && (this.mVasType = Number(e.vipList[0].vasType).valueOf())
                } else this.mIsVip = !1
            })
        }

        getUserinfo() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    let t = null;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("GetAllUserInfo", (n, i) => {
                        0 === n && (t = i), e(t)
                    }) : e(t)
                })
            })
        }
    }

    t.UserHelper = d, function (e) {
        const t = new d;
        e.getHelper = function () {
            return t
        }
    }(t.UserHelperNS || (t.UserHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(14);
    !function (e) {
        e.resizeToFitContent = function (e = 0, t = 0, n) {
            let a = i.remote.getCurrentWindow();
            if (e > 0 && t > 0) a.setSize(e, t); else {
                let e = document.querySelector(".td-dialog");
                a.setSize(e.offsetWidth, e.offsetHeight)
            }
            n && "function" == typeof n && n(), window.requestIdleCallback(() => {
                a.show()
            })
        }, e.autoAdaptScrollIntoView = function (e, t, n) {
            let i = t.scrollTop, a = t.getBoundingClientRect(), o = e.getBoundingClientRect(), r = a.bottom;
            void 0 !== n && "number" == typeof n && n > 0 && (r = a.top + n), o.top < a.top ? t.scrollTop = i - (a.top - o.top) : o.bottom > r && (t.scrollTop = i + (o.bottom - r))
        }, e.fitWindowPosInParent = function (e, t) {
            e || (e = i.remote.getCurrentWindow()), t || (t = e.getParentWindow()), i.ipcRenderer.sendSync(a.ThunderChannelList.channelRMSetPosition, e.getNativeWindowHandle(), t.getNativeWindowHandle())
        }, e.getWindowsInParentCenterPos = function (e, t, n) {
            n || (n = i.remote.getCurrentWindow());
            let a = n.getPosition(), o = n.getSize(), r = i.screen.getCursorScreenPoint(),
                s = i.screen.getDisplayNearestPoint(r), l = s.size.width, u = s.size.height, d = o[0], c = o[1];
            a[0] + d > l && (d = l - a[0]), a[1] + c > u && (c = u - a[1]);
            let h = a[0] + (d - e) / 2, f = a[1] + (c - t) / 2;
            return h < 0 ? h = 0 : h > l - e && (h = l - e), f < 0 ? f = 0 : f > u - t && (f = u - t), [Math.round(h), Math.round(f)]
        }, e.centerWnd = function (e, t, n) {
            do {
                if (!e || !t) break;
                let a = e.getNativeWindowHandle().readUIntLE(0, 4);
                if (!a) break;
                let o = t.getPosition(), r = t.getSize(), s = e.getSize(), l = i.screen.getCursorScreenPoint(),
                    u = i.screen.getDisplayNearestPoint(l), d = u.scaleFactor, c = u.size.width, h = u.size.height,
                    f = r[0], p = r[1];
                o[0] + f > c && (f = c - o[0]), o[1] + p > h && (p = h - o[1]);
                let g = o[0] + (f - s[0]) / 2, k = o[1] + (p - s[1]) / 2;
                g < 0 ? g = 0 : g > c - s[0] && (g = c - s[0]), k < 0 ? k = 0 : k > h - s[1] && (k = h - s[1]), n.setWindowPos(a, 0, g * d, k * d, 0, 0, 5)
            } while (0)
        }, e.bringWindowToTop = function (e) {
            e || (e = i.remote.getCurrentWindow().getNativeWindowHandle().readUIntLE(0, 4));
            i.ipcRenderer.send(a.ThunderChannelList.channelMRBringWindowToTop, e)
        }
    }(t.ThunderWindowNS || (t.ThunderWindowNS = {}))
}, function (e, t) {
    var n = e.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
    "number" == typeof __g && (__g = n)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(8), o = n(5), r = Math.pow(2, 38),
        s = o.default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e) {
            return s.isThunderPrivateUrl(e)
        }

        function n(e) {
            let t = !0;
            for (let n = 0; n < e.length; n++) if (e.charCodeAt(n) > 127) {
                t = !1;
                break
            }
            return t
        }

        e.formatSize = function (e) {
            let t = 0, n = e, i = ["B", "KB", "MB", "GB", "TB", "PB"];
            for (; n >= 1024 && !(t > i.length - 1);) n /= 1024, t++;
            let a = i[t];
            return n.toFixed(2) + a
        }, e.getSavePathFromImportFile = function (e) {
            let t = "";
            return e && "" !== e && (t = i.dirname(e)), t
        }, e.getTaskNameFromImportFile = function (e) {
            let t = "";
            do {
                if (!e || "" === e) break;
                let n = i.basename(e), a = i.extname(e);
                if (!n || "" === n || !a || "" === a) break;
                let o = i.parse(n).name;
                if (!o || "" === o) break;
                let r = i.extname(o);
                if (!r || "" === r) break;
                ".td" === a || ".xltd" === a ? t = ".bt" === r || ".emule" === r ? i.parse(o).name : o : ".cfg" === a && (".td" === r || ".xltd" === r ? t = i.parse(o).name : ".emule" !== r && ".xlemule" !== r && ".bt" !== r && ".xlbt" !== r || (o = i.parse(o).name, t = i.parse(o).name))
            } while (0);
            return t
        }, e.getTaskTypeFromImportingFile = function (e) {
            let t = a.DownloadKernel.TaskType.Unkown;
            do {
                if (!e || "" === e) break;
                let n = i.basename(e), o = i.extname(e);
                if (!n || "" === n || !o || "" === o) break;
                let r = i.parse(n).name;
                if (!r || "" === r) break;
                let s = i.extname(r).toLowerCase();
                if (!s || "" === s) break;
                ".td" === o || ".xltd" === o ? t = ".bt" === s ? a.DownloadKernel.TaskType.Bt : ".emule" === s ? a.DownloadKernel.TaskType.Emule : a.DownloadKernel.TaskType.P2sp : ".cfg" === o && (".td" === s || ".xltd" === s ? t = a.DownloadKernel.TaskType.P2sp : ".emule" === s || ".xlemule" === s || ".part" === s ? t = a.DownloadKernel.TaskType.Emule : ".bt" !== s && ".xlbt" !== s || (t = a.DownloadKernel.TaskType.Bt))
            } while (0);
            return t
        }, e.isThunderPrivateUrl = t, e.parseThunderPrivateUrl = function (e) {
            let n = e;
            if (t(e)) {
                let t = s.parseThunderPrivateUrl(e);
                n = null !== t && void 0 !== t ? t.url : void 0
            }
            return n
        }, e.isAllAsciiChar = n, e.parseEd2kUrl = function (e) {
            let t = null;
            do {
                -1 === e.indexOf("|") && (e = e.replace("%7C", "|"));
                let i = [];
                if ((i = e.split("|")).length < 5) break;
                let a = "ed2k://";
                if (i[0].length < a.length || 0 !== i[0].indexOf(a)) break;
                let o = "file";
                if (i[1].length < o.length || 0 !== i[1].indexOf(o)) break;
                let s = i[2], l = parseInt(i[3], 10);
                if (l <= 0 || l > r) break;
                if (32 !== i[4].length) break;
                let u = i[4];
                if (-1 !== s.indexOf("%") && n(s)) try {
                    s = decodeURI(s)
                } catch (e) {
                }
                t = {
                    fileName: s = (s = (s = (s = (s = (s = (s = (s = (s = s.replace("<", "_")).replace(">", "_")).replace(":", "_")).replace('"', "_")).replace("/", "_")).replace("\\", "_")).replace("|", "_")).replace("?", "_")).replace("*", "_"),
                    fileHash: u,
                    fileSize: l
                }
            } while (0);
            return t
        };
        let o = void 0;

        function l(e) {
            let t = 0, n = -1;
            for (let i = 0; i < e.length; ++i) t += (n = e.charCodeAt(i)) >= 0 && n <= 128 ? 1 : 2;
            return t
        }

        function u(e, t) {
            let n = "", i = 0, a = new String;
            for (let o = 0; o < e.length; o++) {
                let r = e.charAt(o);
                if (i++, escape(r).length > 4 && i++, a = a.concat(r), i >= t) {
                    n = a.toString();
                    break
                }
            }
            return i < t && (n = e), n
        }

        e.getXmpPath = function () {
            if (!o) {
                let e = "HKEY_LOCAL_MACHINE", t = "SOFTWARE\\Thunder Network\\Xmp", n = "Path";
                o = s.readRegString(e, t, n)
            }
            return o
        }, e.getStringLength = l, e.cutString = u, e.getMaxFilePath = function (e) {
            let t = "", n = l(e);
            if (n < 260) t = e; else {
                let a = i.dirname(e), o = i.basename(e), r = i.extname(e), s = 260 - (n = l(a) + 2) - r.length - 2;
                s > 0 && (o = u(o, s), o += r, t = i.join(a, o))
            }
            return t
        }
    }(t.Common || (t.Common = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(140), a = n(7), o = n(1), r = n(35), s = o.default.getLogger("Thunder.MainRenderer.Tabs");
    t.createXDASTab = function (e) {
        let t = new i.Tab;
        return !1 === t.initTab(i.TabType.XDAS, e) && (t = null, s.error("init tab error")), t
    }, t.createNewTab = function (e, t) {
        let n = new i.Tab;
        return !1 === n.initTab(e, t) && (n = null, s.error("init tab error")), n
    }, t.createChromiumTab = function (e) {
        let t = new i.Tab, n = {url: e};
        return !1 === t.initTab(i.TabType.XDAS, n) && (t = null, s.error("init tab error")), t
    }, t.setDefaultListeners = function (e) {
        let t = !1;
        do {
            if (a.isNullOrUndefined(e)) {
                s.error("event listeners error");
                break
            }
            if (0 === e.length) {
                s.error("event listeners length error");
                break
            }
            i.Tab.defaultEventList = e, t = !0
        } while (0);
        return t
    }, t.setDefaultNativeFunctionMap = function (e) {
        let t = !1;
        do {
            if (a.isNullOrUndefined(e)) {
                s.error("event listeners error");
                break
            }
            if (0 === e.length) {
                s.error("event listeners length error");
                break
            }
            i.Tab.nativeFunctionMap = [...i.Tab.nativeFunctionMap, ...e], t = !0
        } while (0);
        return t
    }, function (e) {
        let t;
        !function (e) {
            e.Unknow = "Unknow", e.GotFocus = "GoFocus", e.RemoveTab = "RemoveTab", e.AddTab = "AddTab", e.ChangeTab = "ChangeTab", e.VisibleChange = "VisibleChange"
        }(t = e.EventType || (e.EventType = {}));
        let n = new r.EventEmitter;
        e.getEventEmitter = function () {
            return n
        }
    }(t.TabEventManagerNS || (t.TabEventManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(15), r = a.default.getLogger("FetchRes"), s = {
        mock: "http://easy-mock.com/mock/59f0652c1bd72e7a888988ab/sl",
        test: "http://api-xl9-ssl.xunlei.com/sl_dev",
        pre: "http://api-xl9-ssl.xunlei.com/sl_pre",
        prod: "http://api-xl9-ssl.xunlei.com/sl"
    };

    function l({url: e, data: t, method: a = "get"}) {
        return i(this, arguments, void 0, function* () {
            r.information("fetchFromApiProxy", arguments);
            try {
                const i = yield Promise.all([o.default("GetUserID"), o.default("GetSessionID"), o.default("GetPeerID")]), [s, l, u] = i;
                r.information(i);
                let d = {
                    _sessid: l,
                    _uid: s,
                    _m: a,
                    _h: [`Peer-Id:${u}`, `User-Id:${s}`, `Session-Id:${l}`, "App-Type:pc_xunlei", ...t && t._h || []]
                };
                t && t._h && delete t._h;
                let c = Object.assign({}, d, "get" === a && t);
                r.information("fetchFromApiProxy data", c);
                const h = yield n(27);
                return h.defaults.adapter = n(28), "post" === a && (h.defaults.headers["Content-Type"] = "application/json"), h.request({
                    method: a,
                    url: e,
                    params: c,
                    data: t
                }).then(e => (r.information("fetchFromApiProxy success", e), e))
            } catch (e) {
                return {error: e}
            }
        })
    }

    t.fetchFromApiProxy = l, t.fetchSlRes = function ({url: e, data: t, method: n = "get"}, a = "prod") {
        return i(this, void 0, void 0, function* () {
            let i = s[a], u = yield o.default("GetValue", "ConfigFetchInterface", "TestServer", 0);
            return 1 === u ? i = s.test : 2 === u && (i = s.pre), r.information("当前fetchSlRes 是否测试服:", u, " 远程地址:", i), l({
                url: `${i}${e}`,
                data: t,
                method: n
            })
        })
    }, t.fetchPCRes = function ({url: e, data: t, method: n = "get"}, a = "prod", o = !1) {
        return i(this, void 0, void 0, function* () {
            let i = "http://api-xl9-ssl.xunlei.com";
            return o && (i = "http://api-shoulei-ssl.xunlei.com"), l({url: `${i}${e}`, data: t, method: n})
        })
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(3), r = n(1), s = n(5), l = n(9), u = n(8), d = n(67), c = n(31), h = n(114), f = n(93),
        p = n(37), g = n(82), k = n(253), m = n(36), T = n(30), v = n(13), y = n(57), S = n(22), w = n(103), b = n(7),
        C = n(61), N = n(14), D = n(139), I = n(153), _ = n(149), x = n(256), A = n(155), E = n(551), M = n(201),
        P = n(552), F = n(157), O = n(65), U = n(138), L = n(105), B = r.default.getLogger("Thunder.TaskOperator"),
        K = s.default(a.join(__rootDir, "../bin/ThunderHelper.node")), V = c.DownloadKernelTaskManager.getTaskManager(),
        R = h.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        W = f.DownloadKernelCategoryManager.getCategoryManager(), j = p.DownloadKernelEventManager.getEventManager(),
        H = I.ToastNotifyManagerNS.getToastNotifyManger(), G = o.remote.dialog;

    function z(e) {
        if (void 0 !== e) {
            let t = e + "\\.";
            o.remote.shell.showItemInFolder(t)
        }
    }

    function q(e) {
        e.properties = ["openFile"];
        let t = void 0, n = o.remote.getCurrentWindow(), i = G.showOpenDialog(n, e);
        return void 0 !== i && (t = i[0]), t
    }

    function $() {
        m.MessageBox.pop({
            title: "提示",
            size: "small",
            message: "临时文件无法正常载入，导入任务失败!",
            okText: "确定",
            cancelVisible: !1
        }).catch()
    }

    function X() {
        return i(this, void 0, void 0, function* () {
            return E.DownloadAndPlayNS.getXmpPath()
        })
    }

    function J(e) {
        return i(this, void 0, void 0, function* () {
            let t = 0;
            return new Promise(n => {
                t = j.attachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, (...i) => {
                    do {
                        if (!i) break;
                        if (i[0] !== u.DownloadKernel.TaskEventType.StatusChanged) break;
                        if (!i[1]) break;
                        let a = i[1];
                        for (let i = 0; i < a.length; ++i) {
                            let o = a[i];
                            if (!o) continue;
                            let r = o.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                            if (e === r) {
                                o.getTaskStatus() === u.DownloadKernel.TaskStatus.Started && (j.detachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, t), n(!0));
                                break
                            }
                        }
                    } while (0)
                })
            })
        })
    }

    function Y(e) {
        return i(this, void 0, void 0, function* () {
            let t = yield m.MessageBox.pop({
                title: "请选择播放任务",
                schemas: [{
                    name: "playFile",
                    type: "confRadio",
                    outerClass: "xlx-dialog__play-list",
                    ulClasses: "xlx-setting-content__horizontal",
                    option: e.map(e => e.fileName),
                    labels: e.map(e => e.fileName),
                    disableds: e.map(e => !0 === e.isForbidden)
                }],
                formData: {playFile: {value: e[0].fileName}}
            }, {center: !0, width: 400, height: 300});
            return t.action === T.MessageBoxNS.Action.OK ? e.find(e => e.fileName === t.formData.playFile.value) : null
        })
    }

    !function (e) {
        function t(e, t) {
            let n = g.Common.getTaskTypeFromImportingFile(e);
            n === u.DownloadKernel.TaskType.P2sp ? function (e, t) {
                return i(this, void 0, void 0, function* () {
                    let n = {errcode: 0, errinfo: "success"};
                    do {
                        let i = e + ".cfg";
                        if (!(yield l.FileSystemAWNS.existsAW(i))) {
                            n.errcode = 2, n.errinfo = "缺少.cfg文件,无法导入";
                            break
                        }
                        let a = yield k.TaskUtilitiesAWNS.importUnfinishedTaskAW(e, "");
                        if (null !== a && 0 === a.ret) {
                            let i = {taskType: u.DownloadKernel.TaskType.P2sp, value: a.url},
                                o = yield k.TaskUtilitiesAWNS.batchFindTaskAW([i]);
                            if (o && o.length > 0) {
                                n.errcode = 3, n.extra = o[0], w.ThunderNewTask.repeatTasksMsg([o[0]]);
                                break
                            }
                            let r = {
                                taskBaseInfo: {
                                    taskName: g.Common.getTaskNameFromImportFile(e),
                                    savePath: g.Common.getSavePathFromImportFile(e),
                                    origin: t = void 0 === t ? "Unknown" : t
                                }, p2spTaskInfo: {url: a.url, refUrl: "", cookie: ""}
                            }, s = yield V.createTask(u.DownloadKernel.TaskType.P2sp, r);
                            if (null !== s) {
                                let e = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                D.DownloadDispatchNS.startTask(e)
                            } else B.warning("createTask failed")
                        } else n.errcode = 2, n.errinfo = "临时文件无法正常载入，导入任务失败", $()
                    } while (0);
                    return n
                })
            }(e, t).then(e => {
                B.information(e.errcode, e.errinfo)
            }).catch() : n === u.DownloadKernel.TaskType.Emule ? function (e, t) {
                return i(this, void 0, void 0, function* () {
                    let n = {errcode: 0, errinfo: "success"};
                    do {
                        let i = "";
                        if (".PART" === a.extname(e).toUpperCase() && (i = e + ".met", !(yield l.FileSystemAWNS.existsAW(i))) && void 0 === (i = q({
                            title: "导入eMule文件时,需要相应的MET文件,请选择MET文件",
                            filters: [{name: "met文件(*.met)", extensions: ["met"]}]
                        }))) break;
                        let o = yield k.TaskUtilitiesAWNS.importUnfinishedTaskAW(e, i);
                        if (null !== o && 0 === o.ret) {
                            let i = g.Common.parseEd2kUrl(o.url);
                            if (null !== i) {
                                let a = {taskType: u.DownloadKernel.TaskType.Emule, value: i.fileHash},
                                    r = yield k.TaskUtilitiesAWNS.batchFindTaskAW([a]);
                                if (r && r.length > 0) {
                                    n.errcode = 3, n.extra = r[0], w.ThunderNewTask.repeatTasksMsg([r[0]]);
                                    break
                                }
                                let s = {
                                    taskBaseInfo: {
                                        taskName: g.Common.getTaskNameFromImportFile(e),
                                        savePath: g.Common.getSavePathFromImportFile(e),
                                        origin: t = void 0 === t ? "Unknown" : t
                                    }, emuleTaskInfo: {url: o.url}
                                }, l = yield V.createTask(u.DownloadKernel.TaskType.Emule, s);
                                if (null !== l) {
                                    let e = l.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                    D.DownloadDispatchNS.startTask(e)
                                }
                            }
                        } else n.errcode = 2, n.errinfo = "导入失败,该任务临时文件无法正常载入", $()
                    } while (0);
                    return n
                })
            }(e, t).then(e => {
                B.information(e.errcode, e.errinfo)
            }).catch() : n === u.DownloadKernel.TaskType.Bt && function (e, t) {
                return i(this, void 0, void 0, function* () {
                    let n = a.dirname(e), i = void 0;
                    if (yield l.FileSystemAWNS.existsAW(n)) {
                        let e = yield l.FileSystemAWNS.readdirAW(n);
                        for (let t = 0; t < e.length; t++) {
                            let n = e[t];
                            if (".torrent" === a.extname(n)) {
                                i = n;
                                break
                            }
                        }
                    }
                    do {
                        if (void 0 === i || null === i || "" === i) break;
                        let e = a.join(__profilesDir, "Torrents"), o = a.join(e, i);
                        if (yield l.FileSystemAWNS.existsAW(o)) {
                            let e = yield k.TaskUtilitiesAWNS.parserBtFileInfoAW(o),
                                i = {taskType: u.DownloadKernel.TaskType.Bt, value: e.infoId},
                                r = yield k.TaskUtilitiesAWNS.batchFindTaskAW([i]);
                            if (r && r.length > 0) {
                                w.ThunderNewTask.repeatTasksMsg([r[0]]);
                                break
                            }
                            let s = a.dirname(n), l = [];
                            for (let t = 0; t < e.fileLists.length; ++t) l.push(e.fileLists[t].realIndex);
                            let d = e.trackerUrls.join("\n"), h = M.TaskCtrlOperatorNS.constructProductInfo("");
                            t = void 0 === t ? "Unknown" : t;
                            let f = {
                                    taskBaseInfo: {savePath: s, taskName: e.title, productInfo: h, origin: t},
                                    btTaskInfo: {
                                        seedFile: o,
                                        displayName: e.title,
                                        fileRealIndexLists: l,
                                        fileLists: e.fileLists,
                                        infoId: e.infoId,
                                        tracker: d
                                    }
                                },
                                p = yield c.DownloadKernelTaskManager.getTaskManager().createTask(u.DownloadKernel.TaskType.Bt, f);
                            if (null !== p) {
                                let e = p.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                D.DownloadDispatchNS.startTask(e)
                            }
                        }
                    } while (0)
                })
            }(e, t).catch()
        }

        function r(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = [];
                do {
                    if (void 0 === e || null === e) break;
                    let i = V.getTaskFromTaskId(e);
                    if (null === i) break;
                    if (i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Bt) break;
                    let o = i.getExtraObject();
                    if (0 === o.getDownloadFile().length) break;
                    if (yield U.SingleBtTaskNS.isSingleBtTask(i)) {
                        let e = U.SingleBtTaskNS.getSinleBtTaskFilePath(i), a = o.getBtFileList();
                        for (let [, i]of a) {
                            let a = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex),
                                o = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Download),
                                r = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                            if (1 === o) {
                                let i = y.TaskUtilHelper.getTaskFileType(r);
                                if (null !== t && void 0 !== t && -1 !== t) {
                                    if (t === a) {
                                        n.push({fileExtType: i, fullPath: e});
                                        break
                                    }
                                } else n.push({fileExtType: i, fullPath: e})
                            }
                            break
                        }
                    } else {
                        let e = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                            r = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), s = o.getBtFileList();
                        for (let [, i]of s) {
                            let o = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex),
                                s = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Download),
                                l = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName),
                                d = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FilePath),
                                c = a.join(e, r, d, l);
                            if (1 === s) {
                                let e = y.TaskUtilHelper.getTaskFileType(l);
                                if (null !== t && void 0 !== t && -1 !== t) {
                                    if (t === o) {
                                        n.push({fileExtType: e, fullPath: c});
                                        break
                                    }
                                } else n.push({fileExtType: e, fullPath: c})
                            }
                        }
                    }
                } while (0);
                return n
            })
        }

        function s(e) {
            let t = !1;
            do {
                let n = 0;
                if (null !== e && (n = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.ErrorCode)), 7 === n) {
                    t = !0;
                    break
                }
                if (n >= 700 && n <= 799) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function h(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = [];
                do {
                    if (void 0 === e || null === e) break;
                    let i = V.getTaskFromTaskId(e);
                    if (null === i) break;
                    if (i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Bt) break;
                    let o = i.getExtraObject();
                    if (0 === o.getDownloadFile().length) break;
                    if (yield U.SingleBtTaskNS.isSingleBtTask(i)) {
                        let e = U.SingleBtTaskNS.getSinleBtTaskFilePath(i), a = o.getBtFileList();
                        for (let [, i]of a) {
                            let a = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex),
                                o = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Download),
                                r = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName),
                                s = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Cid),
                                l = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Gcid);
                            if (1 === o) {
                                if (y.TaskUtilHelper.getTaskFileType(r) === y.TaskUtilHelper.FileExtType.Video) if (null !== t && void 0 !== t && -1 !== t) {
                                    if (a === t) {
                                        n.push({fileName: r, fullPath: e, index: a, cid: s, gcid: l});
                                        break
                                    }
                                } else n.push({fileName: r, fullPath: e, index: a, cid: s, gcid: l})
                            }
                            break
                        }
                    } else {
                        let e = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                            r = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), s = o.getBtFileList();
                        for (let [, i]of s) {
                            let o = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex),
                                s = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Download),
                                l = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName),
                                d = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FilePath),
                                c = a.join(e, r, d, l), h = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Cid),
                                f = i.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Gcid);
                            if (1 === s) {
                                if (y.TaskUtilHelper.getTaskFileType(l) === y.TaskUtilHelper.FileExtType.Video) if (null !== t && void 0 !== t && -1 !== t) {
                                    if (o === t) {
                                        n.push({fileName: l, fullPath: c, index: o, cid: h, gcid: f});
                                        break
                                    }
                                } else n.push({fileName: l, fullPath: c, index: o, cid: h, gcid: f})
                            }
                        }
                    }
                } while (0);
                return n
            })
        }

        function f(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = [];
                do {
                    if (void 0 === e || null === e) break;
                    let i = V.getTaskFromTaskId(e);
                    if (null === i) break;
                    if (i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                    let o = i.getExtraObject();
                    if (null === o || void 0 === o) break;
                    let r = o.getSubTaskCount();
                    for (let e = 0; e < r; ++e) {
                        let i = o.getSubTaskByIndex(e), r = e,
                            l = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadSubTask),
                            d = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                            c = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), h = a.join(d, c),
                            f = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid),
                            p = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid),
                            g = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl), k = s(i);
                        if (1 === l) {
                            if (y.TaskUtilHelper.getTaskFileType(c) === y.TaskUtilHelper.FileExtType.Video) if (null !== t && void 0 !== t && -1 !== t) {
                                if (r === t) {
                                    n.push({
                                        fileName: c,
                                        fullPath: h,
                                        index: r,
                                        cid: f,
                                        gcid: p,
                                        isForbidden: k,
                                        taskId: i.getId(),
                                        taskUrl: g
                                    });
                                    break
                                }
                            } else n.push({
                                fileName: c,
                                fullPath: h,
                                index: r,
                                cid: f,
                                gcid: p,
                                isForbidden: k,
                                taskId: i.getId(),
                                taskUrl: g
                            })
                        }
                    }
                } while (0);
                return n
            })
        }

        function p(e) {
            let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType),
                n = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl);
            if (t === u.DownloadKernel.TaskType.P2sp) {
                let t = e.getExtraObject().getDisplayUrl();
                "" !== t && void 0 !== t && (n = t)
            }
            return n
        }

        function E(e, t, n, o, r, s, c, h) {
            return i(this, void 0, void 0, function* () {
                function i(e) {
                    let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadingPeriod),
                        n = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadSize);
                    return 0 === t && (t = 1), Math.round(n / t)
                }

                let f = {ret: !1, errcode: 0};
                do {
                    let p = yield X();
                    if (!p || !(yield l.FileSystemAWNS.existsAW(p))) {
                        if (!(yield P.default.installXmp())) break;
                        if (!(p = yield X()) || !(yield l.FileSystemAWNS.existsAW(p))) break
                    }
                    if (!e || "" === e) break;
                    let g = V.getTaskFromTaskId(s), k = "", m = 0, T = "", v = void 0;
                    if (null !== g) {
                        if ((v = g.getType()) === u.DownloadKernel.TaskType.Bt) {
                            T = k = g.getExtraObject().getInfoId()
                        } else if (v === u.DownloadKernel.TaskType.Magnet) {
                            k = g.getExtraObject().getFileHash()
                        } else v !== u.DownloadKernel.TaskType.Emule && v !== u.DownloadKernel.TaskType.P2sp || (k = g.getTaskBaseInfo().gcid);
                        m = i(g)
                    }
                    let y = [], S = '"' + e + '"', w = "/sstartfrom xl10", b = "/sopenfrom xunlei10";
                    y.push(S), y.push(w), y.push(b);
                    let C = '/sname "' + t + '"';
                    y.push(C);
                    let N = "/scid " + o;
                    y.push(N);
                    let D = "/sgcid " + r;
                    y.push(D), "" !== k && y.push("/scommentid " + k), m > 0 && y.push("/thunderdownloadSpeed " + m);
                    let I = "/sfilesize " + c;
                    y.push(I);
                    let _ = '/sshowurl "' + n + '"';
                    if (y.push(_), v === u.DownloadKernel.TaskType.Bt) {
                        let e = '/shashid "' + T + '"';
                        y.push(e)
                    }
                    let x = '/sext "' + a.extname(t) + '"';
                    y.push(x);
                    let A = "/staskid " + s;
                    if (y.push(A), null !== h && void 0 !== h && "" !== h) {
                        let e = '/sFilePath "' + h + '"';
                        y.push(e)
                    }
                    let E = "/ssdkver " + d.DownloadKernelManager.getDownloadSdkVersion();
                    y.push(E);
                    let F = yield M.TaskCtrlOperatorNS.getUserLoginInfo();
                    "" !== F && y.push(F);
                    let O = y.join(" "), U = a.dirname(p), L = K.shellExecute(0, "open", p, O, U, "SW_SHOW");
                    L > 32 ? f.ret = !0 : f.errcode = L, B.information("shellExecute:result = ", L)
                } while (0);
                return f
            })
        }

        function j(e, t, n, o, r) {
            return i(this, void 0, void 0, function* () {
                let i;
                var s;
                if (i = "downloading" !== o || (yield new Promise(e => {
                    s = (t => {
                        e(t)
                    }), K.isOpenXmp() ? s(!0) : O.LoginHelperNS.loginHelper.isLogined(e => {
                        e ? s(!0) : m.MessageBox.confirm({
                            title: "边下边播",
                            type: m.MessageBox.ConfirmType.Info,
                            content: "需要登录后才能使用边下边播功能",
                            okText: "立即登录",
                            cancelVisible: !1
                        }).then(e => {
                            e.action === T.MessageBoxNS.Action.OK && (O.LoginHelperNS.loginUIHelper.updateLoginWnd(), L.default(!1, !0).then(e => {
                                e && "" !== e && s(!0)
                            }).catch())
                        }).catch()
                    })
                }))) {
                    let i = !1, s = V.getTaskFromTaskId(e);
                    do {
                        if (!s) break;
                        if (!s.isSupportPlay()) break;
                        let d = "", c = "", p = "", g = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl),
                            k = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize), m = "", T = "", y = "",
                            S = e, w = s.getTaskStatus(),
                            b = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType);
                        if (w === u.DownloadKernel.TaskStatus.Succeeded || w === u.DownloadKernel.TaskStatus.Seeding) {
                            if (b === u.DownloadKernel.TaskType.Emule || b === u.DownloadKernel.TaskType.P2sp) {
                                let e = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath);
                                if (c = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), d = a.resolve(e, c), !(yield l.FileSystemAWNS.existsAW(d))) break;
                                m = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid), T = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid), p = d
                            } else if (b === u.DownloadKernel.TaskType.Bt || b === u.DownloadKernel.TaskType.Group) {
                                let n = [];
                                if (0 === (n = b === u.DownloadKernel.TaskType.Bt ? yield h(e, t) : yield f(e, t)).length) break;
                                let i = null;
                                if (null !== (i = n.length > 1 ? yield Y(n) : n[0])) {
                                    if (yield l.FileSystemAWNS.existsAW(i.fullPath)) p = i.fullPath; else if (b === u.DownloadKernel.TaskType.Bt) p = yield s.getPlayUrl(i.index); else {
                                        let e = s.getExtraObject().getSubTaskByIndex(i.index);
                                        null !== e && void 0 !== e && (p = yield e.getPlayUrl(-1))
                                    }
                                    c = i.fileName, m = i.cid, T = i.gcid, b === u.DownloadKernel.TaskType.Group && (S = i.taskId, g = i.taskUrl)
                                }
                            }
                        } else {
                            if (w === u.DownloadKernel.TaskStatus.StartWaiting) {
                                B.information("down and play waiting");
                                break
                            }
                            if (w === u.DownloadKernel.TaskStatus.Stopped || w === u.DownloadKernel.TaskStatus.Failed) {
                                if (!D.DownloadDispatchNS.startTask(e)) {
                                    B.information("down and play start waiting");
                                    break
                                }
                                yield J(e)
                            }
                            if (s.setDownloadStrategy(1), b === u.DownloadKernel.TaskType.Bt || b === u.DownloadKernel.TaskType.Group) {
                                let n = [];
                                if (0 === (n = b === u.DownloadKernel.TaskType.Bt ? yield h(e, t) : yield f(e, t)).length) break;
                                let i = null;
                                if (null !== (i = n.length > 1 ? yield Y(n) : n[0])) {
                                    if (yield l.FileSystemAWNS.existsAW(i.fullPath)) p = i.fullPath; else if (b === u.DownloadKernel.TaskType.Bt) p = yield s.getPlayUrl(i.index); else {
                                        let e = s.getExtraObject().getSubTaskByIndex(i.index);
                                        null !== e && void 0 !== e && (p = yield e.getPlayUrl(-1))
                                    }
                                    y = a.dirname(i.fullPath), c = i.fileName, m = i.cid, T = i.gcid, b === u.DownloadKernel.TaskType.Group && (S = i.taskId, g = i.taskUrl), B.information("Thunder.DownloadAndPlayIPC playTaskId:", S, ", taskId:", e)
                                }
                            } else b !== u.DownloadKernel.TaskType.Emule && b !== u.DownloadKernel.TaskType.P2sp || (p = yield s.getPlayUrl(-1), c = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), y = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath), m = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid), T = s.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid))
                        }
                        let N = yield E(p, c, g, m, T, S, k, y);
                        i = N.ret;
                        let I = [];
                        void 0 === r && (r = C.default.getCurrentCategoryId()), -1 === r ? I.push("panel_type=mypc") : I.push("panel_type=private"), void 0 === o && (o = ""), I.push("panel=" + o), I.push("taskid=" + e), I.push("filename=" + encodeURIComponent(c)), void 0 === n && (n = "other"), I.push("click_source=" + n), i ? I.push("result=success") : (I.push("result=fail"), I.push("errorcode=" + N.errcode));
                        let _ = I.join(",");
                        B.information("trackEvent", "download_leftpanel", "play_panel_show", _), v.XLStatNS.trackEvent("download_leftpanel", "play_panel_show", "", 0, 0, 0, 0, _)
                    } while (0);
                    return i
                }
                return !1
            })
        }

        function Q(e) {
            do {
                if (null === e || void 0 === e || void 0 === e.taskId) break;
                let t = V.getTaskFromTaskId(e.taskId);
                if (null === t || void 0 === t) break;
                if (t.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryViewId) !== u.DownloadKernel.CategroyViewID.Downloading) break;
                if ("ThunderUnion" !== t.getTaskAttribute(u.DownloadKernel.TaskAttribute.Origin)) break;
                if (t.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                if (e.taskStatus === u.DownloadKernel.TaskStatus.Succeeded) break;
                let n = t.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName),
                    i = `filename=${encodeURIComponent(n)}`;
                B.information("trackEvent js_grouptask_delete_click ", n, i), v.XLStatNS.trackEvent("core_operate", "js_grouptask_delete_click", "", 0, 0, 0, 0, i)
            } while (0)
        }

        e.importUncompletedFromFile = t, e.importUncompleted = function () {
            B.information("import un-finished");
            let e = o.remote.getCurrentWindow();
            G.showOpenDialog(e, {
                properties: ["openFile"],
                filters: [{
                    name: "所有支持的文件类型（*.td;*.bt.td;*.emule.td;*.bc!;*.part;*.xltd）",
                    extensions: ["td", "bt.td", "emule.td", "bc!", "part", "xltd"]
                }, {name: "迅雷专有下载文件（*.td）", extensions: ["td", "xltd"]}, {
                    name: "迅雷BT下载文件（*.bt.td）",
                    extensions: ["bt.td"]
                }, {name: "迅雷eMule下载文件（*.emule.td）", extensions: ["emule.td"]}, {
                    name: "BitComet下载文件（*.bc!）",
                    extensions: ["bc!"]
                }, {name: "eMule0.47数据文件（*.part）", extensions: ["part"]}]
            }, e => {
                void 0 === e ? B.information("import un finished select none") : t(e[0], "TD")
            })
        }, e.removeNonExistingTask = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = 0;
                do {
                    if (void 0 === e || null === e) {
                        let t = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Completed);
                        if (null === t) break;
                        let n = t.getTasks();
                        e = [...n.values()].map(e => e.getTaskBaseInfo())
                    }
                    if (null === e || void 0 === e || 0 === e.length) break;
                    let n = [];
                    for (let i of e) (yield M.TaskCtrlOperatorNS.isExistTaskFile(i)) || (n.push(i.taskId), t += 1);
                    yield V.deleteBatchTask(n, !0)
                } while (0);
                return t
            })
        }, e.markReadStatus = function (e, t) {
            do {
                if (null === e || 0 === e.length) break;
                for (let n of e) {
                    let e = V.getTaskFromTaskId(n.taskId);
                    e && e.setUserRead(t)
                }
            } while (0)
        }, e.moveCategoryTask = function (e, t) {
            do {
                if (null === e || 0 === e.length) break;
                for (let n of e) V.moveCategoryTask(n.taskId, t)
            } while (0)
        }, e.getFileIcon = function (e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    o.remote.app.getFileIcon(e, (e, n) => {
                        B.information(e), t(null === n || void 0 === n ? null : n.toDataURL())
                    })
                })
            })
        }, e.executeInstallFile = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    let a = "", r = "";
                    if (null !== t && void 0 !== t && "" !== t) a = t, null !== n && void 0 !== n && "" !== n && (r = n); else {
                        if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                        let t = e.getExtraObject(),
                            n = t.getUserData(x.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                        if (void 0 === n || null === n || "" === n || "0" === n) break;
                        let i = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                        if (a = M.TaskCtrlOperatorNS.getSavePathByFileName(i, n), !(yield l.FileSystemAWNS.existsAW(a))) break;
                        r = "", null !== (n = t.getUserData(x.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams")) && void 0 !== n && "" !== n && (r = n)
                    }
                    if (o.ipcRenderer.send("onOpenExecute", a, r), i = !0, "ThunderUnion" === e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Origin)) {
                        let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName),
                            n = `filename=${encodeURIComponent(t)}`;
                        B.information("trackEvent js_grouptask_install ", t, n), v.XLStatNS.trackEvent("core_operate", "js_grouptask_install", "", 0, 0, 0, 0, n)
                    }
                } while (0);
                return i
            })
        }, e.openTaskFolder = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = e.savePath, i = e.taskName, r = "";
                "" === i ? r = n : (void 0 !== i && i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1)), r = a.join(n, i));
                do {
                    if (e.taskType === u.DownloadKernel.TaskType.Bt) {
                        let n = V.getTaskFromTaskId(e.taskId), i = n.getExtraObject(), s = i.getDownloadFile();
                        if (1 !== s.length) {
                            t ? z(r) : o.remote.shell.showItemInFolder(r);
                            break
                        }
                        if (yield U.SingleBtTaskNS.isSingleBtTask(n)) r = U.SingleBtTaskNS.getSinleBtTaskFilePath(n); else {
                            let e = i.getBtFileList();
                            for (let [, t]of e) if (t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex) === s[0]) {
                                let e = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FilePath),
                                    n = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                                r = a.join(r, e, n);
                                break
                            }
                        }
                    } else {
                        if (e.taskType === u.DownloadKernel.TaskType.Group) {
                            t ? z(n) : o.remote.shell.showItemInFolder(n);
                            break
                        }
                        if (e.taskType === u.DownloadKernel.TaskType.Unkown) break;
                        if (e.taskType === u.DownloadKernel.TaskType.Magnet) break
                    }
                    if (e.taskStatus === u.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === u.DownloadKernel.TaskStatus.Seeding) {
                        (yield l.FileSystemAWNS.existsAW(r)) ? o.remote.shell.showItemInFolder(r) : z(n);
                        break
                    }
                    if (yield l.FileSystemAWNS.existsAW(r)) {
                        o.remote.shell.showItemInFolder(r);
                        break
                    }
                    if (e.taskType === u.DownloadKernel.TaskType.P2sp) {
                        (yield l.FileSystemAWNS.existsAW(r + ".td")) ? o.remote.shell.showItemInFolder(r + ".td") : (yield l.FileSystemAWNS.existsAW(r + ".xltd")) ? o.remote.shell.showItemInFolder(r + ".xltd") : z(n);
                        break
                    }
                    if (e.taskType === u.DownloadKernel.TaskType.Emule) {
                        (yield l.FileSystemAWNS.existsAW(r + ".emule.td")) ? o.remote.shell.showItemInFolder(r + ".emule.td") : (yield l.FileSystemAWNS.existsAW(r + ".xltd")) ? o.remote.shell.showItemInFolder(r + ".xltd") : (yield l.FileSystemAWNS.existsAW(r + ".emule.xltd")) ? o.remote.shell.showItemInFolder(r + ".emule.xltd") : z(n);
                        break
                    }
                    if (e.taskType === u.DownloadKernel.TaskType.Bt) {
                        (yield l.FileSystemAWNS.existsAW(r + ".bt.td")) ? o.remote.shell.showItemInFolder(r + ".bt.td") : (yield l.FileSystemAWNS.existsAW(r + ".xltd")) ? o.remote.shell.showItemInFolder(r + ".xltd") : (yield l.FileSystemAWNS.existsAW(r + ".bt.xltd")) ? o.remote.shell.showItemInFolder(r + ".bt.xltd") : z(n);
                        break
                    }
                    e.taskType === u.DownloadKernel.TaskType.Group && z(n)
                } while (0)
            })
        }, e.openTaskItem = function (e, t, n, s, d) {
            return i(this, void 0, void 0, function* () {
                let i = e.savePath, c = e.taskName, h = "";
                "" === c ? h = i : (void 0 !== c && c.indexOf(".") === c.length - 1 && (c = c.substring(0, c.length - 1)), h = a.join(i, c));
                let f = V.getTaskFromTaskId(e.taskId), p = f.isSupportPlay();
                do {
                    if (e.taskType === u.DownloadKernel.TaskType.P2sp || e.taskType === u.DownloadKernel.TaskType.Emule) {
                        if (e.taskStatus !== u.DownloadKernel.TaskStatus.Succeeded && e.taskStatus !== u.DownloadKernel.TaskStatus.Seeding) break;
                        (yield l.FileSystemAWNS.existsAW(h)) && (p ? yield j(e.taskId, -1, n, s, d) : o.remote.shell.openItem(h))
                    } else if (e.taskType === u.DownloadKernel.TaskType.Bt) {
                        let i = f.getExtraObject(), c = i.getDownloadFile();
                        if (e.taskStatus === u.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === u.DownloadKernel.TaskStatus.Seeding) if (1 === c.length) {
                            if (yield U.SingleBtTaskNS.isSingleBtTask(f)) h = U.SingleBtTaskNS.getSinleBtTaskFilePath(f); else {
                                let e = i.getBtFileList();
                                for (let [, t]of e) if (t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.RealIndex) === c[0]) {
                                    let e = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FilePath),
                                        n = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                                    h = a.join(h, e, n);
                                    break
                                }
                            }
                            p ? yield j(e.taskId, -1, n, s, d) : o.remote.shell.openItem(h)
                        } else if (null !== t && void 0 !== t && -1 !== t) {
                            let i = yield r(e.taskId, t);
                            null === i || void 0 === i || i.length <= 0 ? z(h) : i[0].fileExtType === y.TaskUtilHelper.FileExtType.Video ? yield j(e.taskId, t, n, s, d) : null !== i[0].fullPath && void 0 !== i[0].fullPath && "" !== i[0].fullPath ? o.remote.shell.openItem(i[0].fullPath) : z(h)
                        } else p ? yield j(e.taskId, -1, n, s, d) : z(h); else if (null !== t && void 0 !== t && -1 !== t) {
                            let i = yield r(e.taskId, t);
                            null === i || void 0 === i || i.length <= 0 ? z(h) : i[0].fileExtType === y.TaskUtilHelper.FileExtType.Video ? i[0].fullPath && (yield l.FileSystemAWNS.existsAW(i[0].fullPath)) ? yield E(i[0].fullPath, "", "", "", "", 0, 0) : yield j(e.taskId, t, n, s, d) : null !== i[0].fullPath && void 0 !== i[0].fullPath && "" !== i[0].fullPath ? o.remote.shell.openItem(i[0].fullPath) : z(h)
                        } else z(h)
                    } else if (e.taskType === u.DownloadKernel.TaskType.Group) if (null !== t && void 0 !== t && -1 !== t) {
                        let e = f.getExtraObject();
                        if (null === e || void 0 === e) break;
                        let i = e.getSubTaskByIndex(t), r = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId),
                            c = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                            h = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), p = "";
                        "" === h ? p = c : (void 0 !== h && h.indexOf(".") === h.length - 1 && (h = h.substring(0, h.length - 1)), p = a.join(c, h));
                        let g = i.isSupportPlay();
                        (yield l.FileSystemAWNS.existsAW(p)) && (g ? yield j(r, -1, n, s, d) : o.remote.shell.openItem(p))
                    } else {
                        let e = f.getExtraObject();
                        e && z(e.getSubTaskByIndex(0).getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath))
                    }
                } while (0)
            })
        }, e.startTasks = function (e) {
            let t = e.map(e => e.taskId);
            D.DownloadDispatchNS.startTasks(t)
        }, e.pauseTasks = function (e, t) {
            let n = [];
            for (let t of e) n.push(t.taskId);
            n.length > 0 && V.batchStopTask(n, t)
        }, e.deleteTasks = function (e, t) {
            do {
                if (null === e || void 0 === e || e.length <= 0) break;
                if (void 0 === t && (t = !0), t) {
                    let t = !1;
                    for (let n of e) if (n.taskStatus === u.DownloadKernel.TaskStatus.Started) {
                        t = !0;
                        break
                    }
                    if (t) m.MessageBox.confirm({
                        title: "任务正在下载，您确定删除任务吗？",
                        type: m.MessageBox.ConfirmType.Warning,
                        checkboxEnabled: !1
                    }).then(t => {
                        if (t.action === T.MessageBoxNS.Action.OK) {
                            let t = [];
                            for (let n of e) Q(n), t.push(n.taskId);
                            V.batchRemoveToRecycle(t).catch(), 1 === e.length && C.default.setNeedSelectNext(!0)
                        }
                    }).catch(); else {
                        let t = [];
                        for (let n of e) Q(n), t.push(n.taskId);
                        V.batchRemoveToRecycle(t).catch(), 1 === e.length && C.default.setNeedSelectNext(!0)
                    }
                }
            } while (0)
        }, e.destroyTasks = function (e, t) {
            do {
                if (null === e || void 0 === e || e.length <= 0) break;
                if (void 0 === t && (t = !0), t) {
                    let t = S.ConfigNS.getValue("ConfigMsg", "ConfigMsg_DeleteFile", !0);
                    m.MessageBox.confirm({
                        title: "您确定要删除此任务吗？",
                        type: m.MessageBox.ConfirmType.Warning,
                        checkboxEnabled: !0,
                        checkboxChecked: t,
                        checkboxLabel: "同时删除文件"
                    }, {width: 400, height: 174, center: !0}).then(t => {
                        if (t.action === T.MessageBoxNS.Action.OK) {
                            let n = [];
                            for (let t of e) Q(t), n.push(t.taskId);
                            S.ConfigNS.setValue("ConfigMsg", "ConfigMsg_DeleteFile", t.checkboxChecked), V.deleteBatchTask(n, t.checkboxChecked).then(e => {
                                t.checkboxChecked && !e && H.showNotify(I.ToastNotifyManagerNS.notifyIdTaskOperatorDestroyTask, _.ToastNotifyItemType.RedNotify, "文件在本地磁盘中删除失败", 3e3)
                            }).catch(), 1 === e.length && C.default.setNeedSelectNext(!0)
                        }
                    }).catch()
                } else {
                    let t = [];
                    for (let n of e) Q(n), t.push(n.taskId);
                    V.deleteBatchTask(t, !0).then(e => {
                        e || H.showNotify(I.ToastNotifyManagerNS.notifyIdTaskOperatorDestroyTask, _.ToastNotifyItemType.RedNotify, "文件在本地磁盘中删除失败", 3e3)
                    }).catch(), 1 === e.length && C.default.setNeedSelectNext(!0)
                }
            } while (0)
        }, e.move2Dir = function (e, t) {
            return i(this, void 0, void 0, function* () {
                if (void 0 === t || "" === t) {
                    let e = o.remote.getCurrentWindow(), n = G.showOpenDialog(e, {properties: ["openDirectory"]});
                    void 0 !== n && (t = n[0])
                }
                if (void 0 !== t && "" !== t) {
                    let n = S.ConfigNS.getValue("MoveToDir", "LatestSavePath", []), i = n, a = i.indexOf(t);
                    -1 !== a && i.splice(a, 1), i.splice(0, 0, t), i = i.slice(0, 3), S.ConfigNS.setValue("MoveToDir", "LatestSavePath", i), S.ConfigNS.save().catch();
                    for (let i of e) n = yield V.moveTaskToPath(i.taskId, t)
                }
                return !1
            })
        }, e.copy2Dir = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = void 0;
                if (void 0 !== t && "" !== t) n = t; else {
                    let e = o.remote.getCurrentWindow(), t = G.showOpenDialog(e, {properties: ["openDirectory"]});
                    void 0 !== t && (n = t[0])
                }
                if (void 0 !== n && "" !== n) {
                    let t = S.ConfigNS.getValue("CopyToDir", "LatestSavePath", []), i = t.indexOf(n);
                    -1 !== i && t.splice(i, 1), t.splice(0, 0, n), t = t.slice(0, 3), S.ConfigNS.setValue("CopyToDir", "LatestSavePath", t), S.ConfigNS.save().catch();
                    for (let t of e) {
                        let e = t.savePath, i = t.taskName, r = e, s = n;
                        if (t.taskType !== u.DownloadKernel.TaskType.Group) {
                            let n = V.getTaskFromTaskId(t.taskId);
                            if (yield U.SingleBtTaskNS.isSingleBtTask(n)) {
                                let e = n.getExtraObject().getBtFileList();
                                for (let [, t]of e) {
                                    i = t.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                                    break
                                }
                            }
                            r = a.join(e, i)
                        } else r = a.join(r, "*");
                        s = a.join(n, i), r !== n && o.ipcRenderer.send(N.ThunderChannelList.channelRMFileCopy, r, s)
                    }
                }
            })
        }, e.copyLink = function (e) {
            let t = [];
            for (let n of e) {
                let e = V.getTaskFromTaskId(n.taskId);
                if (n.taskType !== u.DownloadKernel.TaskType.P2sp) if (n.taskType !== u.DownloadKernel.TaskType.Emule) if (n.taskType !== u.DownloadKernel.TaskType.Group) ; else {
                    let e = V.getTaskFromTaskId(n.taskId).getExtraObject(), i = e.getSubTaskCount();
                    for (let n = 0; n < i; n++) {
                        let i = p(e.getSubTaskByIndex(n));
                        t.push(i)
                    }
                } else t.push(n.url); else {
                    let i = e.getExtraObject().getDisplayUrl();
                    "" === i && (i = n.url), t.push(i)
                }
            }
            o.clipboard.writeText(t.join("\r\n")), H.showNotify(I.ToastNotifyManagerNS.notifyIdTaskOperatorCopyLink, _.ToastNotifyItemType.GreenNotify, "链接已复制", 3e3)
        }, e.copyMagnetLink = function (e) {
            do {
                if (void 0 === e) break;
                if (e.taskType !== u.DownloadKernel.TaskType.Bt) break;
                let t = "magnet:?xt=urn:btih:" + V.getTaskFromTaskId(e.taskId).getExtraObject().getInfoId();
                o.clipboard.writeText(t), H.showNotify(I.ToastNotifyManagerNS.notifyIdTaskOperatorCopyMagnetLink, _.ToastNotifyItemType.GreenNotify, "磁力链接已复制", 3e3)
            } while (0)
        }, e.saveAsTorrent = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (void 0 === e) break;
                    if (e.taskType !== u.DownloadKernel.TaskType.Bt) break;
                    let n = V.getTaskFromTaskId(e.taskId).getExtraObject(), i = n.getSeedFilePath();
                    if (!(yield l.FileSystemAWNS.existsAW(i))) break;
                    let r = e.taskName;
                    void 0 !== r && "" !== r || "" === (r = n.getDisplayName()) && (r = a.parse(i).name);
                    let s = r, d = a.parse(r);
                    A.ParseUrlFileNameNS.isUsualFileExtName(d.ext) && (s = d.name + ".torrent");
                    let c = o.remote.getCurrentWindow(),
                        h = {defaultPath: s, filters: [{name: "BT种子文件（*.torrent）", extensions: ["torrent"]}]},
                        f = G.showSaveDialog(c, h);
                    if (void 0 === f || "" === f) {
                        t = !0;
                        break
                    }
                    ".torrent" !== a.extname(f).toLowerCase() && (f += ".torrent"), t = yield l.FileSystemAWNS.copyFileAW(i, f)
                } while (0);
                t || H.showNotify(I.ToastNotifyManagerNS.notifyIdTaskOperatorSaveAsTorrent, _.ToastNotifyItemType.RedNotify, "获取此任务种子文件失败", 3e3)
            })
        }, e.renameTask = function (e) {
            B.information("rename", e.taskName, e.taskId);
            let t = e.taskName;
            m.MessageBox.custom("task-rename", {taskBase: e}, {width: 300, height: 194, center: !0}).then(n => {
                if (n.action === T.MessageBoxNS.Action.OK) do {
                    if (b.isNullOrUndefined(n.args)) break;
                    if (void 0 === n.args.fileName || null === n.args.fileName) break;
                    let i = n.args.fileName;
                    if (i === t) break;
                    V.getTaskFromTaskId(e.taskId).reName(i).catch()
                } while (0)
            }).catch()
        }, e.recoverTask = function (e) {
            if (e.length > 1) {
                let t = [];
                for (let n of e) t.push(n.taskId);
                V.batchRecoverFromRecycle(t)
            } else for (let t of e) V.recoverFromRecycle(t.taskId);
            H.showNotify(I.ToastNotifyManagerNS.notifyIdTaskOperatorRecoverTask, _.ToastNotifyItemType.GreenNotify, "已还原任务", 3e3)
        }, e.clearRecycle = function () {
            let e = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Recycle).getTasks();
            e.size > 0 && m.MessageBox.confirm({
                title: "确定清空垃圾箱？",
                type: m.MessageBox.ConfirmType.Warning,
                checkboxEnabled: !0,
                checkboxChecked: !1,
                checkboxLabel: "同时删除文件"
            }, {width: 400, height: 174, center: !0}).then(t => {
                if (t.action === T.MessageBoxNS.Action.OK) {
                    let n = [];
                    e.forEach(e => {
                        n.push(e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId))
                    }), V.deleteBatchTask(n, t.checkboxChecked).catch()
                }
            }).catch()
        }, e.startAllPausedTask = function () {
            let e = [], t = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n]of t) n.getTaskStatus() === u.DownloadKernel.TaskStatus.Stopped && e.push(n);
            let n = e.map(e => e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId));
            D.DownloadDispatchNS.startTasks(n)
        }, e.startAll = function () {
            let e = [], t = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n]of t) e.push(n);
            let n = e.map(e => e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId));
            D.DownloadDispatchNS.startTasks(n)
        }, e.pauseAll = function () {
            let e = [], t = R.getCategoryViewFromId(u.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n]of t) null !== n && (n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background) || e.push(n.getId()));
            e.length > 0 && V.batchStopTask(e)
        }, e.hasCategoryStartTask = function (e) {
            let t = !1, n = W.getCategoryView(e, u.DownloadKernel.CategroyViewID.Downloading);
            if (!n) return t;
            let i = n.getTasks();
            for (let [, e]of i) if (null !== e) {
                let n = e.getTaskStatus();
                if (n === u.DownloadKernel.TaskStatus.StartWaiting || n === u.DownloadKernel.TaskStatus.StartPending || n === u.DownloadKernel.TaskStatus.Started) {
                    t = !0;
                    break
                }
            }
            return t
        }, e.startCategoryAllTask = function (e) {
            let t = W.getCategoryView(e, u.DownloadKernel.CategroyViewID.Downloading);
            if (!t) return;
            let n = t.getTasks();
            for (let [, e]of n) null !== e && (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background) || V.startTask(e.getId()))
        }, e.pauseCategoryAllTask = function (e) {
            let t = W.getCategoryView(e, u.DownloadKernel.CategroyViewID.Downloading);
            if (!t) return;
            let n = [], i = t.getTasks();
            for (let [, e]of i) null !== e && (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background) || n.push(e.getId()));
            n.length > 0 && V.batchStopTask(n)
        }, e.playVedioByXmp = E, e.downloadAndPlay = j, e.vipAcclerate = function (e) {
            return i(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: t} = yield Promise.resolve().then(() => n(53));
                do {
                    if (void 0 === e) break;
                    if (0 === e.length) break;
                    let n = [];
                    for (let t of e) n.push(t.taskId);
                    t.clickBatchAcclerateBtn(n)
                } while (0)
            })
        }, e.statJsSdkDeleteTask = Q, e.createBirdKey = function (e) {
            let t, n, i = V.getTaskFromTaskId(e), a = i.getTaskBaseInfo(), o = i.getType(), r = "";
            if (o === u.DownloadKernel.TaskType.P2sp) r = a.url, n = "p2sp", t = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid); else if (o === u.DownloadKernel.TaskType.Emule) r = a.url, n = "emule", t = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid); else if (o === u.DownloadKernel.TaskType.Bt) {
                n = "bt";
                let e = i.getExtraObject();
                t = e.getInfoId(), r = "magnet:?xt=urn:btih:" + e.getInfoId()
            } else o === u.DownloadKernel.TaskType.Magnet && (n = "magnet");
            if (r.length > 0) {
                B.information("点击任务详情按钮,生成迅雷口令,taskURL:", r);
                let e = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryViewId), o = new Map;
                o.set(u.DownloadKernel.CategroyViewID.Downloading, "downloading"), o.set(u.DownloadKernel.CategroyViewID.Completed, "complete"), o.set(u.DownloadKernel.CategroyViewID.Recycle, "trash"), o.set(u.DownloadKernel.CategroyViewID.Unkown, "unknown");
                let s = {
                    pannel: o.get(e),
                    gcid: t,
                    taskid: a.taskId.toString(),
                    filename: a.taskName,
                    pannelType: i.getIsPrivate() ? "private" : "mypc",
                    taskType: n
                };
                F.openBirdKeyEncodeDialog(r, s)
            }
        }
    }(t.TaskOperatorNs || (t.TaskOperatorNs = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        function t(e) {
            let t = e.toString(16).toUpperCase();
            return t.length < 2 && (t = "0" + t), t
        }

        function n(e, n, i, a) {
            return "0x" + t(a) + t(e) + t(n) + t(i)
        }

        e.rgbaStringToHexWith0xBegin = function (e) {
            if (void 0 !== e) {
                let t = e.split(",");
                return n(parseInt(t[0] || "0", 10), parseInt(t[1] || "0", 10), parseInt(t[2] || "0", 10), parseInt(t[3] || "255", 10))
            }
        }, e.colorNumberToHex = t, e.rgbaToHexWith0xBegin = n
    }(t.ColorUtilNS || (t.ColorUtilNS = {}))
}, function (e, t) {
    e.exports = function (e) {
        return e.webpackPolyfill || (e.deprecate = function () {
        }, e.paths = [], e.children || (e.children = []), Object.defineProperty(e, "loaded", {
            enumerable: !0,
            get: function () {
                return e.l
            }
        }), Object.defineProperty(e, "id", {
            enumerable: !0, get: function () {
                return e.i
            }
        }), e.webpackPolyfill = 1), e
    }
}, function (e, t) {
    var n = {}.hasOwnProperty;
    e.exports = function (e, t) {
        return n.call(e, t)
    }
}, , , function (e, t, n) {
    "use strict";
    t.__esModule = !0;
    var i, a = n(574), o = (i = a) && i.__esModule ? i : {default: i};
    t.default = o.default || function (e) {
        for (var t = 1; t < arguments.length; t++) {
            var n = arguments[t];
            for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i])
        }
        return e
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(5), o = n(82);
    !function (e) {
        const t = n(2), r = a.default(t.join(__rootDir, "../bin/ThunderKernel.node")),
            s = i.default.getLogger("DownloadKernel.ThunderKernel");
        let l = 0;
        e.initDownloadSdk = function (e, t, n, i) {
            return r.initDownloadSdk(e, t, n, i)
        }, e.createP2spTask = function (e, t, n, i, a) {
            return e && "" !== e || s.error("createP2spTask url:", e), i && "" !== i || s.error("createP2spTask savePath:", i), a && "" !== a || s.error("createP2spTask fileName:", a), e = o.Common.parseThunderPrivateUrl(e), r.createP2spTask(e, void 0 === t ? "" : t, void 0 === n ? "" : n, i, a)
        }, e.createBtTask = function (e, t, n) {
            return e && "" !== e || s.error("createBtTask torrentFilePath:", e), t && "" !== t || s.error("createBtTask savePath:", t), 0 === n.length && s.error("createBtTask fileRealIndexLists:", 0), r.createBtTask(e, t, n)
        }, e.createEmuleTask = function (e, t, n) {
            return e && "" !== e || s.error("createEmuleTask url:", e), t && "" !== t || s.error("createEmuleTask savePath:", t), n && "" !== n || s.error("createEmuleTask fileName:", n), e = o.Common.parseThunderPrivateUrl(e), r.createEmuleTask(e, t, n)
        }, e.createMagnetTask = function (e, t) {
            return e && "" !== e || s.error("createMagnetTask url:", e), t && "" !== t || s.error("createMagnetTask torrentFilePath:", t), e = o.Common.parseThunderPrivateUrl(e), r.createMagnetTask(e, t)
        }, e.startTask = function (e) {
            return s.information("startTask virtualTaskId:", e), r.startTask(e)
        }, e.stopTask = function (e) {
            return s.information("stopTask virtualTaskId:", e), r.stopTask(e)
        }, e.deleteTask = function (e) {
            return s.information("deleteTask virtualTaskId:", e), r.deleteTask(e)
        }, e.renameP2spTaskFile = function (e, t) {
            return r.renameP2spTaskFile(e, t)
        }, e.queryTaskInfo = function (e, t) {
            return 0 === r.queryTaskInfo(e, t)
        }, e.queryBtTaskInfo = function (e, t) {
            return 0 === r.queryBtTaskInfo(e, t)
        }, e.queryPlayInfo = function (e, t, n) {
            return 0 === r.queryPlayInfo(e, t, n)
        }, e.queryGlobalInfo = function (e, t) {
            return 0 === r.queryGlobalInfo(e, t)
        }, e.createTaskId = function () {
            return r.createTaskId()
        }, e.importTask = function (e, t, n) {
            return r.importTask(e, t, n)
        }, e.parserBtFileInfo = function (e, t) {
            return r.parserBtFileInfo(e, t)
        }, e.getFileHashByUrl = function (e) {
            return r.getFileHashByUrl(e)
        }, e.getInfoHashByUrl = function (e) {
            return r.getInfoHashByUrl(e)
        }, e.enableDcdnWithVipCert = function (e, t, n) {
            return r.enableDcdnWithVipCert(e, t, n)
        }, e.updateDcdnWithVipCert = function (e, t, n) {
            return r.updateDcdnWithVipCert(e, t, n)
        }, e.disableDcdnWithVipCert = function (e, t) {
            return r.disableDcdnWithVipCert(e, t)
        }, e.setDownloadSpeedLimit = function (e) {
            return r.setDownloadSpeedLimit(Number(e))
        }, e.setUploadSpeedLimit = function (e) {
            return r.setUploadSpeedLimit(Number(e))
        }, e.setTaskStrategy = function (e, t) {
            return r.setTaskStrategy(e, t)
        }, e.setDownloadStrategy = function (e, t) {
            return r.setDownloadStrategy(e, t)
        }, e.setTaskThreadCount = function (e, t) {
            return r.setTaskThreadCount(e, Number(t))
        }, e.setCacheSize = function (e) {
            return r.setCacheSize(Number(e))
        }, e.setUserInfo = function (e, t) {
            return r.setUserInfo(e, t)
        }, e.setBTExtraTrackers = function (e, t) {
            return r.setBTExtraTrackers(e, t)
        }, e.setGlobalExtInfo = function (e, t) {
            return r.setGlobalExtInfo(e, t)
        }, e.setTaskExtInfo = function (e, t) {
            return r.setTaskExtInfo(e, t)
        }, e.initDataBase = function (e, t) {
            return r.initDataBase(e, t)
        }, e.beginTransaction = function () {
            s.information("beginTransaction transactionId:", l);
            let e = l;
            return r.beginTransaction(e), l >= Number.MAX_SAFE_INTEGER ? l = 0 : l++, e
        }, e.commitTransaction = function (e) {
            return s.information("commitTransaction transactionId:", e), r.commitTransaction(e)
        }, e.rollbackTransaction = function (e) {
            return s.information("rollbackTransaction transactionId:", e), r.rollbackTransaction(e)
        }, e.execSqlite = function (e, t) {
            return r.execSqlite(e, t)
        }, e.querySqlite = function (e, t) {
            return r.querySqlite(e, t)
        }, e.insertTaskBase = function (e) {
            r.insertTaskBase(e)
        }, e.insertP2spTask = function (e, t, n, i, a, o) {
            r.insertP2spTask(e, t, n, i, a, o)
        }, e.insertBtTask = function (e, t, n, i, a) {
            r.insertBtTask(e, t, n, i, a)
        }, e.insertBtFile = function (e, t) {
            r.insertBtFile(e, t)
        }, e.insertEmuleTask = function (e, t, n) {
            r.insertEmuleTask(e, t, n)
        }, e.insertGroupTask = function (e, t, n, i) {
            r.insertGroupTask(e, t, n, i)
        }, e.insertMagnetTask = function (e) {
            r.insertMagnetTask(e)
        }, e.deleteStorageTask = function (e, t) {
            r.deleteStorageTask(e, t)
        }, e.loadTaskBase = function (e) {
            r.loadTaskBase(e)
        }, e.loadStorageTask = function (e, t, n) {
            r.loadStorageTask(e, t, n)
        }, e.saveTaskBaseInfo = function (e, t, n, i) {
            r.saveTaskBaseInfo(e, t, n, i)
        }, e.saveTaskUserData = function (e, t) {
            r.saveTaskUserData(e, t)
        }, e.saveTaskChannelInfo = function (e, t, n, i, a, o) {
            r.saveTaskChannelInfo(e, t, n, i, a, o)
        }, e.setP2spTaskOriginOnly = function (e, t) {
            r.setP2spTaskOriginOnly(e, t)
        }, e.setP2spTaskThreadCount = function (e, t) {
            r.setP2spTaskThreadCount(e, t)
        }, e.saveBtFileInfo = function (e, t, n, i, a) {
            r.saveBtFileInfo(e, t, n, i, a)
        }, e.saveBtFileCid = function (e, t, n, i) {
            r.saveBtFileCid(e, t, n, i)
        }, e.setCategoryId = function (e, t) {
            r.setCategoryId(e, t)
        }, e.loadCategory = function (e) {
            r.loadCategory(e)
        }, e.createCategory = function (e, t, n, i, a, o, s) {
            r.createCategory(e, t, n, i, a, o, s)
        }, e.setCategoryPassword = function (e, t, n, i) {
            r.setCategoryPassword(e, t, n, i)
        }, e.setCategoryAccountPassword = function (e, t) {
            r.setCategoryAccountPassword(e, t)
        }, e.searchTask = function (e, t, n, i, a) {
            r.searchTask(e, t, n, i, a)
        }, e.setTaskPriorityLevel = function (e, t, n) {
            r.setTaskPriorityLevel(e, t, n)
        }, e.setBtFileFailureErrorCode = function (e, t, n) {
            r.setBtFileFailureErrorCode(e, t, n)
        }, e.batchFindP2spTask = function (e, t) {
            return 0 === r.batchFindP2spTask(e, t)
        }, e.batchFindEmuleTask = function (e, t) {
            return 0 === r.batchFindEmuleTask(e, t)
        }, e.batchFindBtTask = function (e, t) {
            return 0 === r.batchFindBtTask(e, t)
        }, e.batchFindGroupTask = function (e, t) {
            return 0 === r.batchFindGroupTask(e, t)
        }
    }(t.ThunderKernel || (t.ThunderKernel = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(763), o = n(92), r = n(26), s = i.default.getLogger("DownloadKernel.CategoryManager");

    class l {
        constructor() {
            this.newCategoryId = 0, this.categorys = new Map, this.userId = "", this.accountPassword = ""
        }

        init() {
            o.ThunderKernel.loadCategory(e => {
                e.forEach(e => {
                    if ("Private" === e.name) {
                        let t = a.PrivateCategory.createCategoryFromData(e);
                        t && this.categorys.set(e.categoryId, t)
                    } else s.warning("unkown category name:", e.name);
                    void 0 !== e.categoryId && this.newCategoryId <= e.categoryId && (this.newCategoryId = e.categoryId + 1)
                })
            })
        }

        getCategorys() {
            return this.categorys
        }

        getCategoryCount() {
            return this.categorys.size
        }

        getCategoryFromId(e) {
            return this.categorys.get(e)
        }

        getCategoryView(e, t) {
            let n = null, i = this.getCategoryFromId(e);
            return i && (n = i.getCategoryViewFromId(t)), n
        }

        getPrivateCategoryFromUserId(e) {
            if (!e || "" === e) return null;
            let t = null;
            for (let n of this.categorys.values()) if (n.getUserName() === e) {
                t = n;
                break
            }
            return t || (s.information("create new private category, id:", this.newCategoryId), (t = new a.PrivateCategory(this.newCategoryId)).setName("Private"), t.setDescription("Private Space"), t.setUserName(e), t.setAccountPassword(""), this.categorys.set(this.newCategoryId, t), this.newCategoryId++, o.ThunderKernel.createCategory(t.getId(), -1, -1, t.getName(), t.getDescription(), t.getUserName(), t.getAccountPassword())), t
        }

        getCurrentPrivateCategory() {
            if (!this.userId || "" === this.userId) return null;
            return this.getPrivateCategoryFromUserId(this.userId)
        }

        setUserInfo(e, t) {
            e = e || "", t = t || "";
            let n = !1;
            this.userId !== e && (this.userId = e, n = !0);
            let i = "";
            if ("" === t) i = ""; else {
                let e = r.createHash("md5");
                e.update(this.accountPassword), i = e.digest("hex")
            }
            if (this.accountPassword !== i && (this.accountPassword = i, n = !0), n) {
                let e = null;
                for (let t of this.categorys.values()) if (t.getUserName() === this.userId) {
                    e = t;
                    break
                }
                e && e.setAccountPassword(this.accountPassword)
            }
        }
    }

    t.CategoryManager = l, function (e) {
        const t = new l;
        e.getCategoryManager = function () {
            return t
        }
    }(t.DownloadKernelCategoryManager || (t.DownloadKernelCategoryManager = {}))
}, function (e, t) {
    e.exports = require("zlib")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(35), a = n(2), o = n(5);
    let r = null, s = null, l = null;
    s = o.default(a.join(__rootDir, "../bin/ThunderHelper.node"));

    class u extends i.EventEmitter {
        constructor() {
            super(...arguments), this.mouse = null
        }

        setMouse(e) {
            this.mouse = e
        }

        ref() {
            this.mouse && this.mouse.ref()
        }

        unref() {
            this.mouse && this.mouse.unref()
        }

        destroy() {
            this.mouse && (this.mouse.destroy(), this.mouse = null, l = null)
        }
    }

    t.WinMouseEvent = u, t.mouseDestroy = function () {
        l && l.destroy()
    }, t.mouseUse = function (e) {
        if (l) return;
        r = s.registerWinMouseObj(), l = new u;
        let t = new r((t, n, i, a) => {
            e(!0, t)
        });
        l.setMouse(t)
    }, t.mouseMove = function () {
        let e = null, t = new u;
        return t.once("newListener", function () {
            null === r && (r = s.registerWinMouseObj()), null !== r && (e = new r(function (e, n, i, a) {
                "move" === e && t.emit(e, n, i, a)
            }), t.setMouse(e))
        }), t
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(59), a = n(58);
    !function (e) {
        e.setStyle = function (e, t) {
            if (null !== e) {
                let n = {windowPreference: a.WindowPreferenceNS.getWindowPreference()};
                e.setStyle(i(n, t))
            }
        }
    }(t.DropDownWindowSkinNS || (t.DropDownWindowSkinNS = {}))
}, , , , , , , function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(1), s = n(5), l = n(14), u = n(8), d = n(31), c = n(253), h = n(201), f = n(10),
        p = n(56), g = n(155), k = n(36), m = n(61), T = n(23), v = n(22), y = n(9), S = n(82), w = n(29), b = n(150),
        C = n(278), N = n(256), D = n(139), I = n(769), _ = n(57), x = n(17), A = n(13), E = n(156),
        M = r.default.getLogger("ThunderNewTask"), P = d.DownloadKernelTaskManager.getTaskManager(),
        F = s.default(o.join(__rootDir, "../bin/ThunderNewTask.node")),
        O = s.default(o.join(__rootDir, "../bin/ThunderHelper.node")), U = n(30), L = n(3).remote;
    let B = !1;
    !function (e) {
        function t(e, t) {
            let n = P.getTaskFromTaskId(e);
            do {
                if (null === n) break;
                let i = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryId),
                    a = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryViewId);
                if (M.information("查看重复任务", a), a === u.DownloadKernel.CategroyViewID.Unkown) break;
                t = void 0 === t || t, m.default.fireEvent(T.NodeEventMesssageNS.eventDownloadSwitchCategory, i, a, e, t)
            } while (0)
        }

        function n(e, n) {
            M.information("重复下载任务：nlen = ", e.length);
            do {
                if (e.length <= 0) break;
                if (e.length <= 1) {
                    let a = !1, o = e[0], r = e[0].getTaskBaseInfo();
                    if (r.taskType === u.DownloadKernel.TaskType.P2sp || r.taskType === u.DownloadKernel.TaskType.Emule) {
                        let t = e[0].getTaskAttribute(u.DownloadKernel.TaskAttribute.GroupTaskId);
                        if (t > 0) {
                            let e = P.getTaskFromTaskId(t);
                            null !== e && void 0 !== e && (o = e, a = !0)
                        }
                    }
                    k.MessageBox.confirm({
                        title: "重复下载，该任务已存在列表中",
                        type: k.MessageBox.ConfirmType.Warning,
                        fileName: o.getTaskBaseInfo().taskName,
                        okText: "查看",
                        cancelText: "重新下载",
                        cancelVisible: !a
                    }).then(e => i(this, void 0, void 0, function* () {
                        if (e.action === U.MessageBoxNS.Action.OK) {
                            t(o.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId))
                        } else if (e.action === U.MessageBoxNS.Action.Cancel) if (void 0 === n || null === n || 0 === n.length) h.TaskCtrlOperatorNS.redownloadTask([o.getTaskBaseInfo()], !1).catch(); else {
                            yield P.deleteTask(o.getTaskBaseInfo().taskId, !0), n[0].newTaskInfo.taskBaseInfo.productInfo = h.TaskCtrlOperatorNS.constructProductInfo(""), n[0].newTaskInfo.taskBaseInfo.origin = "re_download";
                            let e = yield P.createTask(n[0].taskType, n[0].newTaskInfo);
                            if (null !== e) {
                                let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                D.DownloadDispatchNS.startTask(t)
                            }
                        }
                    })).catch()
                } else {
                    let t = e.map(e => e.getTaskBaseInfo().url), n = JSON.stringify(t);
                    k.MessageBox.custom("multi-repeat-task", {file: n}).catch()
                }
            } while (0)
        }

        function r(e, t) {
            for (let n of e) {
                let e = t.indexOf(n.index);
                -1 !== e && t.splice(e, 1)
            }
            return t
        }

        function s(e) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (void 0 === e) break;
                    if (null === e) break;
                    for (let t of e) yield y.FileSystemAWNS.unlinkAW(t.fullPath)
                } while (0)
            })
        }

        function K(e, n, a, l, c, f, p, g, m, T, v) {
            return i(this, void 0, void 0, function* () {
                let i = f;
                const y = d.DownloadKernelTaskManager.getTaskManager();
                do {
                    if (void 0 === g) break;
                    if ("ignore" === g) {
                        if (void 0 === (i = r(m, f)) || null === i) break;
                        if (0 === i.length) {
                            if (void 0 !== T) t(T); else {
                                let t = o.join(e, a.title);
                                k.MessageBox.confirm({
                                    title: "全部文件已存在，位于以下路径：",
                                    type: k.MessageBox.ConfirmType.Warning,
                                    content: t,
                                    okText: "知道了",
                                    cancelText: "打开文件夹"
                                }).then(e => {
                                    e.action === U.MessageBoxNS.Action.Cancel && L.shell.showItemInFolder(t)
                                }).catch()
                            }
                            break
                        }
                        void 0 !== T && (yield y.deleteTask(T, !1))
                    } else if ("delete" === g) yield s(m), void 0 !== T && (yield y.deleteTask(T, !0)); else if ("continue" === g && void 0 !== T) {
                        D.DownloadDispatchNS.startTask(T);
                        break
                    }
                    let d = a.trackerUrls.join("\n"), S = h.TaskCtrlOperatorNS.constructProductInfo(p.browser), w = {
                        taskBaseInfo: {savePath: e, taskName: a.title, productInfo: S, origin: p.source},
                        btTaskInfo: {
                            seedFile: l,
                            displayName: c,
                            fileLists: a.fileLists,
                            infoId: a.infoId,
                            fileRealIndexLists: i,
                            tracker: d
                        },
                        privateSpace: v
                    };
                    M.information("create task bt productinfo", p);
                    let b = yield y.createTask(u.DownloadKernel.TaskType.Bt, w);
                    if (null !== b) {
                        if (1 === n) {
                            let e = b.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                            D.DownloadDispatchNS.startTask(e)
                        }
                    } else M.warning("create bt task null")
                } while (0)
            })
        }

        function V(e, t) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (0 === e.length) break;
                    a.ipcRenderer.send("create-new-task-window", JSON.stringify(e))
                } while (0)
            })
        }

        function R(e, t, n, i, o) {
            a.ipcRenderer.send("create-pre-new-task-window", e ? JSON.stringify(e) : e, t, n, i, o ? JSON.stringify(o) : o)
        }

        function W(e, t) {
            a.ipcRenderer.send("create-bt-task-window", e ? JSON.stringify(e) : e, t ? JSON.stringify(t) : t)
        }

        function j(e) {
            if (void 0 !== e && null !== e && "" !== e) {
                v.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "") !== e && (v.ConfigNS.setValue("PathAndCategory", "LastUsedPath", e), v.ConfigNS.save().catch())
            }
        }

        function H(e) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (e.length > 1) {
                        V(e).catch();
                        break
                    }
                    let t = e[0];
                    if (void 0 === t.browser || t.browser, t.browser, 0 === (yield p.NativeCallAWNS.getConfigValueAW("TaskDefaultSettings", "OpenSilenceDownload", 0))) {
                        V(e).catch();
                        break
                    }
                    let i = x.ThunderHelper.getTaskTypeFromUrl(t.url), a = g.ParseUrlFileNameNS.getNameFromUrl(t.url),
                        o = yield p.NativeCallAWNS.getDownloadDir(),
                        r = yield p.NativeCallAWNS.getConfigValueAW("TaskDefaultSettings", "NewTaskStartMode", 1),
                        s = [], l = void 0;
                    if (i === u.DownloadKernel.TaskType.P2sp) l = {
                        taskType: u.DownloadKernel.TaskType.P2sp,
                        newTaskInfo: {
                            taskBaseInfo: {taskName: a, savePath: o},
                            p2spTaskInfo: {url: t.url, refUrl: t.referer, cookie: t.cookie}
                        }
                    }, s = yield c.TaskUtilitiesAWNS.batchFindTaskAW([{
                        taskType: u.DownloadKernel.TaskType.P2sp,
                        value: t.url
                    }]); else if (i === u.DownloadKernel.TaskType.Emule) {
                        l = {
                            taskType: u.DownloadKernel.TaskType.Emule,
                            newTaskInfo: {taskBaseInfo: {taskName: a, savePath: o}, emuleTaskInfo: {url: t.url}}
                        };
                        let e = g.ParseUrlFileNameNS.parseEd2kUrl(t.url);
                        s = yield c.TaskUtilitiesAWNS.batchFindTaskAW([{
                            taskType: u.DownloadKernel.TaskType.Emule,
                            value: e.fileHash
                        }])
                    }
                    if (s && s.length > 0) {
                        L.getCurrentWindow().show(), n(s, [l]);
                        break
                    }
                    if (void 0 === l) break;
                    let d = yield P.createTask(l.taskType, l.newTaskInfo);
                    if (null !== d && 1 === r) {
                        let e = d.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                        D.DownloadDispatchNS.startTask(e)
                    }
                } while (0)
            })
        }

        function G(e, t) {
            let n = "";
            do {
                if (null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                let i = e;
                if (S.Common.isThunderPrivateUrl(e) && (i = S.Common.parseThunderPrivateUrl(e)), null === i || void 0 === i || "" === i) break;
                let a = i.indexOf(t);
                if (a < 0) break;
                let r = i.substring(a + t.length);
                if (null === r || void 0 === r || "" === r) break;
                n = z(o.dirname(r))
            } while (0);
            return n
        }

        function z(e) {
            let t = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = e.split(/\//);
                if (n.length <= 0) break;
                for (let e = 0; e < n.length; ++e) {
                    let i = n[e];
                    if (null !== i && "" !== i) {
                        let e = i.replace(/[*?/:|<>"]/g, "");
                        null !== e && "" !== e && (e = e.trim(), t = "" === t ? e : o.join(t, e))
                    }
                }
            } while (0);
            return t
        }

        function q(e, t, n) {
            let i = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let a = e;
                if (S.Common.isThunderPrivateUrl(e) && (a = S.Common.parseThunderPrivateUrl(e)), null === a || void 0 === a || "" === a) break;
                if (null !== n && void 0 !== n && "" !== n) {
                    n === o.basename(t) && (i = a);
                    break
                }
                o.basename(a) === o.basename(t) && (i = a)
            } while (0);
            return i
        }

        function $(e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = w.parse(e).hostname;
                if (null === n || void 0 === n || "" === n) break;
                let i = b.default.getConfigInfo("thunderLink", "whiteList");
                if (null === i || void 0 === i || "" === i || i.length <= 0) break;
                for (let e = 0; e < i.length; ++e) if (n.toLowerCase() === i[e].toLowerCase()) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function X(e) {
            return i(this, void 0, void 0, function* () {
                let t = "您正在使用旧版本迅雷，不支持下载";
                return null !== e && void 0 !== e && "" !== e ? t = t + '"' + e + '"' : t += '"此类文件"', t += "<br>建议您升级到最新版迅雷后，再次进行下载！", new Promise(e => {
                    k.MessageBox.confirm({
                        title: "请使用最新版迅雷",
                        type: k.MessageBox.ConfirmType.Warning,
                        content: t,
                        okText: "升级迅雷",
                        cancelVisible: !1
                    }).then(t => {
                        t.action === U.MessageBoxNS.Action.OK ? e(!0) : e(!1)
                    }).catch()
                })
            })
        }

        function J(e) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (void 0 === e || null === e || "" === e) break;
                    let t = null, n = null;
                    try {
                        n = JSON.parse(e)
                    } catch (e) {
                    }
                    if (null === n || void 0 === n || n.length <= 0) break;
                    let i = n.json, a = !1;
                    if (null !== i && void 0 !== i && "" !== i) {
                        a = !0, t = yield E.ThunderNewtaskHelperNS.readThunderUnionConfig(i);
                        let e = "url=" + encodeURIComponent(i);
                        if (M.information("createThunderxTask:需要读取配置信息 jsonUrlStr = ", i), null === t || void 0 === t) {
                            e += ",result=fail,errorcode=pick_up_fail", A.XLStatNS.trackEvent("core_operate", "js_grouptask_pick_up_info", "", 0, 0, 0, 0, e);
                            break
                        }
                        if ("" === t || null === t.tasks || void 0 === t.tasks) {
                            e += ",result=fail,errorcode=analysis_fail", A.XLStatNS.trackEvent("core_operate", "js_grouptask_pick_up_info", "", 0, 0, 0, 0, e);
                            break
                        }
                        e += ",result=success", A.XLStatNS.trackEvent("core_operate", "js_grouptask_pick_up_info", "", 0, 0, 0, 0, e)
                    } else t = n;
                    let r = t.tasks;
                    if (null === r || void 0 === r || r.length <= 0) break;
                    let s = t.taskGroupName;
                    M.information("createThunderxTask:jsonData = ", t);
                    let l = t.minVersion;
                    if (null !== l && void 0 !== l && "" !== l || a && (l = "10.1.2.0"), null !== l && void 0 !== l && "" !== l) {
                        let e = o.join(__rootDir, "../../Thunder.exe"), t = O.getFileVersion(e);
                        if (-1 === _.TaskUtilHelper.compareVersion(l, t)) {
                            if (!B) {
                                A.XLStatNS.trackEvent("core_operate", "newthunder_lowversion_popup", "", 0, 0, 0, 0, ""), B = !0;
                                let e = yield X(s);
                                B = !1, e && (A.XLStatNS.trackEvent("core_operate", "newthunder_lowversion_download", "", 0, 0, 0, 0, ""), O.startManualUpdateWithUI())
                            }
                            return
                        }
                    }
                    let u = t.downloadDir, d = t.installFile, c = t.excludePath, h = t.runParams, p = t.userAgent,
                        g = null;
                    null !== t.threadCount && void 0 !== t.threadCount && "" !== t.threadCount && (g = Number(t.threadCount));
                    let k = [], m = "", T = !1;
                    null !== s && void 0 !== s && "" !== s && (T = !0);
                    for (let e = 0; e < r.length; ++e) {
                        let t = r[e], n = t.url, i = t.name, a = 0;
                        if (null !== d && void 0 !== d && "" !== d && "" === m) {
                            let e = q(n, d, i);
                            "" !== e && (m = e)
                        }
                        null !== t.size && void 0 !== t.size && (a = t.size);
                        let o = "";
                        T && (null !== t.dir && void 0 !== t.dir && "" !== t.dir ? o = z(t.dir) : null !== c && void 0 !== c && "" !== c && (o = G(n, c)));
                        let s = n;
                        if (S.Common.isThunderPrivateUrl(n) && (s = S.Common.parseThunderPrivateUrl(n)), void 0 !== s && null !== s && "" !== s) {
                            let e = {url: n, fileName: i, fileSize: a, subDir: o, statClick: "ThunderUnion"};
                            k.push(e)
                        }
                    }
                    if (k.length >= 1) {
                        let e = {};
                        if (null !== u && void 0 !== u && "" !== u) {
                            let t = f.ThunderUtil.getMaxFreeDriver();
                            null !== t && "" !== t && (t += ":"), u = o.join(t, u), e.isNotSavePath = !0
                        }
                        if (null !== g && void 0 !== g && (g <= 0 ? g = 1 : g >= 10 && (g = 10), e.threadCount = g), null !== p && void 0 !== p && "" !== p && (e.userAgent = p), null !== s && void 0 !== s && "" !== s && null !== d && void 0 !== d && "" !== d && null !== m && void 0 !== m && "" !== m && $(m)) {
                            let t = d.replace(/[*?:|<>"]/g, "_");
                            e.installFile = t, e.runParams = h
                        }
                        R(k, "ThunderUnion", u, s, e), O.emptyClipBoard()
                    }
                } while (0)
            })
        }

        e.selectTask = t, e.repeatTasksMsg = n, e.createNewTaskWindow = V, e.createPreNewTaskWindow = R, e.createBtTaskWindow = W, e.uninit = function () {
            F.uninitNodeBKWindow()
        }, e.saveLastestDownloadPath = j, e.createTaskByUrl = function (e, t) {
            do {
                if (void 0 === e || null === e || "" === e) break;
                let n = "";
                n = void 0 !== t && "" !== t ? t : g.ParseUrlFileNameNS.getNameFromUrl(e);
                let i = x.ThunderHelper.getTaskTypeFromUrl(e);
                i === u.DownloadKernel.TaskType.Emule || i === u.DownloadKernel.TaskType.P2sp ? H([{
                    url: e,
                    fileName: n
                }]).catch() : i === u.DownloadKernel.TaskType.Bt && W({url: e, type: "url"}, {browser: "xlbrowser.exe"})
            } while (0)
        }, e.createUnionTask = function (e) {
            return i(this, void 0, void 0, function* () {
                do {
                    let t = decodeURIComponent(e);
                    M.information("createUnionTask:urlPath = ", t, e);
                    let n = yield y.FileSystemAWNS.readFileAW(t);
                    if (yield y.FileSystemAWNS.unlinkAW(t), null === n || void 0 === n || "" === n.toString()) {
                        M.information("createUnionTask:读取内容 buf为null");
                        break
                    }
                    let i = n.toString(), a = (i += "\r\n").split("\r\n");
                    if (a.length <= 1) {
                        M.information("createUnionTask:lines.length <= 1");
                        break
                    }
                    let r = !1, s = "", l = [], u = "", d = "", c = "", h = "", p = "", g = "", k = "", m = new Map,
                        T = new Map, v = new Map, w = new Map;
                    for (let e = 0; e < a.length; ++e) {
                        let t = a[e].split("=");
                        if (null !== t && 2 === t.length) {
                            let e = t[0].toLowerCase(), n = t[1];
                            if (null !== e && "" !== e) {
                                if (n = decodeURIComponent(n), "json" === e) {
                                    r = !0, s = n;
                                    break
                                }
                                if ("taskgroupname" === e) u = n; else if ("downloaddir" === e) d = n; else if ("installfile" === e) c = n; else if ("excludepath" === e) h = n; else if ("runparams" === e) p = n; else if ("useragent" === e) g = n; else if ("threadcount" === e) k = n; else {
                                    M.information("createUnionTask:", e, n);
                                    let t = e.match(/^tasks\[\d+\]/), i = "";
                                    null !== t && void 0 !== t && (i = t[0]);
                                    let a = /url/;
                                    a.test(e) ? "" !== i ? m.set(i, n) : l.push(n) : (a = /^tasks\[\d+\]\[name\]/).test(e) ? "" !== i && T.set(i, n) : (a = /^tasks\[\d+\]\[size\]/).test(e) ? "" !== i && v.set(i, n) : (a = /^tasks\[\d+\]\[dir\]/).test(e) && "" !== i && w.set(i, n)
                                }
                            }
                        }
                    }
                    if (r) {
                        M.information("createUnionTask 通过读取配置信息得到数据 jsonUrlStr:", s);
                        let e = {minVersion: "", json: s};
                        yield J(JSON.stringify(e))
                    } else {
                        let e = [], t = "";
                        if (null !== m && m.size > 0) {
                            let n = !1;
                            null !== u && void 0 !== u && "" !== u && (n = !0), m.forEach((i, a) => {
                                let o = i, r = "", s = 0;
                                if (null !== T && T.size > 0 && (r = T.get(a)), null !== c && void 0 !== c && "" !== c && "" === t) {
                                    let e = q(o, c, r);
                                    "" !== e && (t = e)
                                }
                                if (null !== v && v.size > 0) {
                                    let e = v.get(a);
                                    null !== e && "" !== e && (s = Number(e))
                                }
                                let l = "";
                                if (n) {
                                    let e = w.get(a);
                                    null !== e && void 0 !== e && "" !== e ? l = z(e) : null !== h && void 0 !== h && "" !== h && (l = G(o, h))
                                }
                                let u = o;
                                if (S.Common.isThunderPrivateUrl(o) && (u = S.Common.parseThunderPrivateUrl(o)), void 0 !== u && null !== u && "" !== u) {
                                    let t = {url: o, fileName: r, fileSize: s, subDir: l, statClick: "ThunderUnion"};
                                    e.push(t)
                                }
                            })
                        }
                        if (e.length >= 1) {
                            let n = {};
                            if (null !== d && "" !== d) {
                                let e = f.ThunderUtil.getMaxFreeDriver();
                                null !== e && "" !== e && (e += ":"), d = o.join(e, d), n.isNotSavePath = !0
                            }
                            if (null !== k && void 0 !== k && "" !== k) {
                                let e = Number(k);
                                e <= 0 ? e = 1 : e >= 10 && (e = 10), n.threadCount = e
                            }
                            if (null !== g && void 0 !== g && "" !== g && (n.userAgent = g), null !== u && void 0 !== u && "" !== u && null !== c && void 0 !== c && "" !== c && null !== t && void 0 !== t && "" !== t && $(t)) {
                                let e = c.replace(/[*?:|<>"]/g, "_");
                                n.installFile = e, n.runParams = p
                            }
                            M.information("createUnionTask：新协议拉起新建面板", n), R(e, "ThunderUnion", d, u, n)
                        }
                        l.length >= 1 && (M.information("createUnionTask：旧协议拉起新建面板"), R(l, "ThunderUnion"))
                    }
                } while (0)
            })
        }, e.sendMessageBox = X, e.createThunderxTask = J, e.init = function () {
            M.information("xxxxx init====="), F.setNewTaskCallback(e => i(this, void 0, void 0, function* () {
                if (M.information("setNewTaskCallback", e), e.length > 0) {
                    let t = [], n = [];
                    for (let i of e) {
                        let e = i.url, a = x.ThunderHelper.getTaskTypeFromUrl(e);
                        a === u.DownloadKernel.TaskType.P2sp || a === u.DownloadKernel.TaskType.Emule ? t.push(i) : a !== u.DownloadKernel.TaskType.Magnet && a !== u.DownloadKernel.TaskType.Bt || n.push(i)
                    }
                    if (t.length > 0 && H(t).catch(), n.length > 0) for (let e of n) W({
                        url: e.url,
                        type: "url"
                    }, {browser: e.browser, source: e.statClick})
                }
            })), F.initNodeBKWindow(), L.ipcMain.on(l.ThunderChannelList.channelRMNewTaskCreateNewTask, (e, t, a, r, s, d, f, p) => i(this, void 0, void 0, function* () {
                let i = null;
                try {
                    i = JSON.parse(r)
                } catch (e) {
                    M.warning(e)
                }
                if (null === i) return;
                let g = [...Object.values(i)];
                if (M.information("xxx", g, s), s) {
                    let t = yield h.TaskCtrlOperatorNS.getUsrInfoAw("userid"),
                        n = yield C.PrivateSpaceHelperNS.openPrivateCategory(t);
                    if (n < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !1, "开启私人空间后才能创建任务至私人空间"), 0 !== n) return;
                    let i = yield C.PrivateSpaceHelperNS.accessPrivateCategory(t);
                    if (i < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !1, "开启私人空间后才能创建任务至私人空间"), 0 !== i) return
                }
                e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !0), null !== p && void 0 !== p && null !== p.isNotSavePath && void 0 !== p.isNotSavePath && !0 === p.isNotSavePath || s || j(t), M.information(p), M.verbose(e);
                let k = [];
                if (void 0 !== typeof g && null !== g && g.length > 0) {
                    let e = [], i = t;
                    null !== f && void 0 !== f && "" !== f && (i = o.join(t, f));
                    let r = g.map(e => {
                        let t = "";
                        return e.taskType === u.DownloadKernel.TaskType.P2sp ? t = e.data.url : e.taskType === u.DownloadKernel.TaskType.Emule && (t = e.data.fileHash), {
                            taskType: e.taskType,
                            value: t
                        }
                    }), l = yield c.TaskUtilitiesAWNS.batchFindTaskAW(r);
                    for (let t = 0; t < g.length; t++) {
                        let n = g[t], a = i;
                        void 0 !== n.data.subDir && null !== n.data.subDir && "" !== n.data.subDir && (a = o.join(i, n.data.subDir));
                        let r = h.TaskCtrlOperatorNS.constructProductInfo(n.data.browser),
                            d = {taskName: n.data.fileName, savePath: a, productInfo: r, origin: n.data.statClick};
                        n.data.fileSize && n.data.fileSize > 0 && (d.fileSize = n.data.fileSize), n.data.gcid && "" !== n.data.gcid && (d.gcid = n.data.gcid);
                        let c = {taskBaseInfo: d, privateSpace: s};
                        if (void 0 !== n.setting && null !== n.setting) {
                            let e = n.setting;
                            void 0 !== e.note && null !== e.note && "" !== e.note && (d.description = e.note), e.openAfterDownload && (d.openOnComplete = 1)
                        }
                        if (n.taskType === u.DownloadKernel.TaskType.P2sp) {
                            if (c.taskType = u.DownloadKernel.TaskType.P2sp, c.p2spTaskInfo = {
                                url: n.data.url,
                                refUrl: n.data.referer,
                                cookie: n.data.cookie,
                                downloadSubTask: 1
                            }, void 0 !== n.setting && null !== n.setting) {
                                let e = n.setting;
                                e.onlyOrigin && (c.p2spTaskInfo.useOriginResourceOnly = 1), void 0 !== e.thread && "number" == typeof e.thread && (c.p2spTaskInfo.originResourceThreadCount = e.thread)
                            }
                            let t = !1;
                            if (l && l.length > 0) for (let e of l) if (e.getType() === u.DownloadKernel.TaskType.P2sp && e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl).toLowerCase() === n.data.url.toLowerCase()) {
                                t = !0;
                                break
                            }
                            if (t) {
                                e.push({taskType: u.DownloadKernel.TaskType.P2sp, newTaskInfo: c});
                                continue
                            }
                            k.push(c)
                        } else if (n.taskType === u.DownloadKernel.TaskType.Emule) {
                            c.taskType = u.DownloadKernel.TaskType.Emule, c.emuleTaskInfo = {
                                url: n.data.url,
                                downloadSubTask: 1
                            };
                            let t = !1;
                            if (l && l.length > 0) for (let e of l) if (e.getType() === u.DownloadKernel.TaskType.Emule && e.getExtraObject().getFileHash().toLowerCase() === n.data.fileHash.toLowerCase()) {
                                t = !0;
                                break
                            }
                            if (t) {
                                e.push({taskType: u.DownloadKernel.TaskType.Emule, newTaskInfo: c});
                                continue
                            }
                            k.push(c)
                        }
                    }
                    if (null !== f && void 0 !== f && "" !== f && k.length > 0) {
                        let e = {taskName: f, savePath: i, origin: k[0].taskBaseInfo.origin}, t = {subTaskList: k},
                            n = yield P.createTask(u.DownloadKernel.TaskType.Group, {
                                taskBaseInfo: e,
                                groupTaskInfo: t,
                                privateSpace: s
                            });
                        if (null !== n) {
                            if (1 === a) {
                                let e = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                D.DownloadDispatchNS.startTask(e)
                            }
                            if (null !== p && void 0 !== p && null !== p.installFile && void 0 !== p.installFile && "" !== p.installFile) {
                                M.information("setUserData:", p);
                                let e = n.getExtraObject();
                                e.setUserData(N.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile", p.installFile), null !== p.isSelectInstallCheck && void 0 !== p.isSelectInstallCheck && p.isSelectInstallCheck && e.setUserData(N.TaskUserDataGUID.guidDownloadCompleteInstall, "isImmediatelyInstall", "1"), null !== p.runParams && void 0 !== p.runParams && "" !== p.runParams && e.setUserData(N.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams", p.runParams)
                            }
                        }
                    } else if (k.length > 0) {
                        let e = yield P.createBatchTask(k);
                        if (1 === a) {
                            let t = [];
                            for (let n of e) t.push(n.getId());
                            M.information("download-dispatch createBatchTask", t), D.DownloadDispatchNS.startTasks(t)
                        }
                    }
                    l.length > 0 && n(l, e)
                }
                if (void 0 !== d && null !== d && d.length > 0) for (let e of d) W({
                    url: e,
                    type: "url"
                }, {source: "newwindow_url"})
            })), L.ipcMain.on(l.ThunderChannelList.channelRMNewTaskDownloadTorrent, (e, t, n) => i(this, void 0, void 0, function* () {
                let a = (t, n) => i(this, void 0, void 0, function* () {
                        do {
                            if (!e.sender) break;
                            if (e.sender.isDestroyed()) {
                                M.information("download torrent back isDestroyed");
                                break
                            }
                            if (n) {
                                let n = P.getTaskFromTaskId(t);
                                if (null === n) {
                                    e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1), M.information("channelRMNewTaskDownloadTorrent error");
                                    break
                                }
                                let i = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.SavePath),
                                    a = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), r = o.join(i, a),
                                    s = yield c.TaskUtilitiesAWNS.parserBtFileInfoAW(r);
                                if (null === s) {
                                    e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1);
                                    break
                                }
                                let d = JSON.stringify(s);
                                e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !0, d, r)
                            } else e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1)
                        } while (0)
                    }), r = {taskType: u.DownloadKernel.TaskType.Magnet, value: t},
                    s = yield c.TaskUtilitiesAWNS.batchFindTaskAW([r]);
                if (s && s.length > 0) {
                    M.information("channelRMNewTaskDownloadTorrent repeat magnet task.url:", t);
                    let n = s[0].getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                    e.sender.send(l.ThunderChannelList.channelMRNewTaskMagnetTaskCreated, n), I.MagnetListenerNS.addRef(n, a)
                } else {
                    let i = yield f.ThunderUtil.getThunderTempPath(!0),
                        r = g.ParseUrlFileNameNS.parseMagnetUrl(t) + ".torrent", s = o.join(i, r), c = {
                            taskBaseInfo: {
                                taskName: r,
                                savePath: i,
                                productInfo: h.TaskCtrlOperatorNS.constructProductInfo(n.browser),
                                origin: n.source
                            }, magnetTaskInfo: {url: t, torrentFilePath: s}, isBackground: !0
                        };
                    const p = d.DownloadKernelTaskManager.getTaskManager();
                    M.information("create task magnet productinfo", n);
                    let k = yield p.createTask(u.DownloadKernel.TaskType.Magnet, c);
                    if (null !== k) {
                        let t = k.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                        e.sender.send(l.ThunderChannelList.channelMRNewTaskMagnetTaskCreated, t), I.MagnetListenerNS.addRef(t, a), D.DownloadDispatchNS.startTask(t, !0)
                    }
                }
            })), L.ipcMain.on(l.ThunderChannelList.channelRMNewTaskCancleMagnet, (e, t) => {
                I.MagnetListenerNS.release(t)
            }), L.ipcMain.on(l.ThunderChannelList.channelRMNewTaskCreateBtTask, (e, t, a, r, s, d, f, g, m) => i(this, void 0, void 0, function* () {
                M.verbose(e);
                do {
                    if (void 0 === r || null === r) {
                        e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1, "开启私人空间后才能创建任务至私人空间");
                        break
                    }
                    let i = null;
                    try {
                        i = JSON.parse(r)
                    } catch (e) {
                        M.warning(e)
                    }
                    if (null === i) break;
                    if (g) {
                        let t = yield h.TaskCtrlOperatorNS.getUsrInfoAw("userid"),
                            n = yield C.PrivateSpaceHelperNS.openPrivateCategory(t);
                        if (n < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1), 0 !== n) break;
                        let i = yield C.PrivateSpaceHelperNS.accessPrivateCategory(t);
                        if (i < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1), 0 !== i) break
                    }
                    if (e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !0), g || j(t), void 0 !== typeof t && null !== t || (t = yield p.NativeCallAWNS.getDownloadDir()), void 0 === typeof i || null === i) break;
                    if (i = Object.assign({}, i), void 0 === typeof s || null === s) break;
                    let T = yield h.TaskCtrlOperatorNS.getBtExistFilePathList(t, i, f),
                        v = {taskType: u.DownloadKernel.TaskType.Bt, value: i.infoId},
                        y = yield c.TaskUtilitiesAWNS.batchFindTaskAW([v]), S = i.trackerUrls.join("\n"),
                        w = h.TaskCtrlOperatorNS.constructProductInfo(m.browser),
                        b = {savePath: t, taskName: i.title, productInfo: w, origin: m.source}, N = {
                            seedFile: s,
                            displayName: d,
                            fileLists: i.fileLists,
                            infoId: i.infoId,
                            fileRealIndexLists: f,
                            tracker: S
                        }, I = {
                            taskType: u.DownloadKernel.TaskType.Bt,
                            newTaskInfo: {taskBaseInfo: b, btTaskInfo: N, privateSpace: g}
                        };
                    if (0 !== T.length) {
                        if (y && y.length > 0) {
                            k.MessageBox.custom("bt-repeat-task").then(e => {
                                if (e.action === U.MessageBoxNS.Action.OK) {
                                    let n = e.args.picked,
                                        o = y[0].getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                                    "continue" === n ? D.DownloadDispatchNS.startTask(o) : K(t, a, i, s, d, f, m, n, T, o, g).catch()
                                }
                            }).catch();
                            break
                        }
                        {
                            let e = o.join(t, i.title), n = T.map(e => e.relativePath), r = JSON.stringify(n);
                            k.MessageBox.custom("bt-repeat-file", {saveDir: e, file: r}).then(e => {
                                if (e.action === U.MessageBoxNS.Action.OK) {
                                    let n = e.args.picked;
                                    K(t, a, i, s, d, f, m, n, T, void 0, g).catch()
                                }
                            }).catch();
                            break
                        }
                    }
                    if (y && y.length > 0) {
                        n(y, [I]);
                        break
                    }
                    let _ = yield P.createTask(I.taskType, I.newTaskInfo);
                    if (null !== _) {
                        if (1 === a) {
                            let e = _.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                            D.DownloadDispatchNS.startTask(e)
                        }
                    } else M.warning("create bt task null")
                } while (0)
            })), L.ipcMain.on(l.ThunderChannelList.channelRMImportTorrent, (e, t) => i(this, void 0, void 0, function* () {
                M.verbose(e);
                let n = yield c.TaskUtilitiesAWNS.parserBtFileInfoAW(t);
                W(null === n ? {type: "file", seedFile: t} : {
                    data: JSON.stringify(n),
                    type: "file",
                    seedFile: t
                }, {source: "newwindow_bt"})
            }))
        }
    }(t.ThunderNewTask || (t.ThunderNewTask = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(52), a = n(1).default.getLogger("Thunder.shub-http.http-session");
    t.HttpSession = class {
        constructor() {
            this.mRetries = 0, this.mHost = void 0, this.mPort = 80, this.mPath = void 0, this.mAuth = void 0, this.mAccept = void 0, this.mBody = null, this.mUrl = void 0, this.mTimeout = void 0, this.mCurRetries = 0
        }

        set host(e) {
            this.mHost = e
        }

        get host() {
            return this.mHost
        }

        set port(e) {
            this.mPort = e
        }

        get port() {
            return this.mPort
        }

        set path(e) {
            this.mPath = e
        }

        get path() {
            return this.mPath
        }

        set url(e) {
            this.mUrl = e
        }

        get url() {
            return this.mUrl
        }

        set auth(e) {
            this.mAuth = e
        }

        get auth() {
            return this.mAuth
        }

        set accept(e) {
            this.mAccept = e
        }

        get accept() {
            return this.mAccept
        }

        set body(e) {
            this.mBody = e
        }

        get body() {
            return this.mBody
        }

        set retries(e) {
            this.mRetries = e
        }

        get retries() {
            return this.mRetries
        }

        set timeout(e) {
            this.mTimeout = e
        }

        get timeout() {
            return this.mTimeout
        }

        post(e, t) {
            let n = this.body;
            if (!n) return a.information("body is empty"), void t(null);
            let i = this.auth, o = this.accept, r = {
                hostname: this.host,
                port: this.port,
                path: this.path || "/",
                method: "POST",
                auth: i || void 0,
                headers: {"Content-Length": n ? n.length : 0, Accept: o || "*/*"}
            };
            a.information("option", r), this.postImpl(n, r, e, n => {
                this.mCurRetries < this.retries ? (this.mCurRetries++, a.information("mCurRetries", this.mCurRetries), this.post(e, t)) : t(n)
            })
        }

        get(e, t) {
            let n = this.url;
            n || (n = {
                hostname: this.host,
                port: this.port,
                path: this.path || "/",
                method: "GET"
            }), a.information("option", n), this.getImpl(n, e, n => {
                this.mCurRetries < this.retries ? (this.mCurRetries++, a.information("mCurRetries", this.mCurRetries), this.get(e, t)) : t(n)
            })
        }

        postImpl(e, t, n, o) {
            let r = i.request(t, e => {
                let t = null;
                e.on("data", e => {
                    t = t ? Buffer.concat([t, e]) : e
                }), e.on("end", () => {
                    a.information("statusCode", e.statusCode), a.information("headers", e.headers), n({
                        statusCode: e.statusCode,
                        headers: e.headers,
                        body: t
                    })
                })
            });
            r.on("error", e => {
                o(e)
            }), r.on("timeout", () => {
                r.abort()
            }), this.timeout && r.setTimeout(this.timeout), r.write(e), r.end()
        }

        getImpl(e, t, n) {
            i.get(e, e => {
                let n = null;
                e.on("data", e => {
                    n = n ? Buffer.concat([n, e]) : e
                }), e.on("end", () => {
                    a.information("statusCode", e.statusCode), a.information("headers", e.headers), t({
                        statusCode: e.statusCode,
                        headers: e.headers,
                        body: n
                    })
                })
            }).on("error", e => {
                n(e)
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(15), r = n(6), s = a.default.getLogger("Thunder.ShouldLogin");
    t.default = function (e = !1, t = !1) {
        return i(this, void 0, void 0, function* () {
            let n;
            try {
                let i = yield o.default("IsLogined"), a = yield o.default("GetUserID");
                i ? (s.information("is logined"), n = Promise.resolve(a)) : (n = new Promise((n, i) => {
                    let a = -1;
                    if (a = r.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => {
                        s.information("On UserLogin", e), n(e), -1 !== a && (r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", a), a = -1)
                    }), !e) {
                        let e = r.NativeCallModule.nativeCall.AttachNativeEvent("OnLoginWndClose", i => {
                            do {
                                if ("close" === i) {
                                    if (n(""), !t && -1 !== a) {
                                        r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", a), a = -1;
                                        break
                                    }
                                } else if ("suc" === i && -1 !== a) break;
                                t && -1 !== a && (r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", a), a = -1)
                            } while (0);
                            r.NativeCallModule.nativeCall.DetachNativeEvent("OnLoginWndClose", e)
                        })
                    }
                }), e || o.default("ShowLoginDlg").catch(e => {
                    s.warning(e)
                }))
            } catch (e) {
                s.warning(e), n = Promise.resolve("")
            }
            return n
        })
    }
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l, u, d, c, h, f, p = {}.hasOwnProperty;
        f = n(202), h = f.isObject, c = f.isFunction, d = f.isEmpty, r = null, t = null, i = null, a = null, o = null, l = null, u = null, s = null, e.exports = function () {
            function e(e) {
                this.parent = e, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), this.children = [], r || (r = n(282), t = n(283), i = n(284), a = n(285), o = n(286), l = n(291), u = n(292), s = n(293))
            }

            return e.prototype.element = function (e, t, n) {
                var i, a, o, r, s, l, u, f, g, k;
                if (l = null, null == t && (t = {}), t = t.valueOf(), h(t) || (n = (g = [t, n])[0], t = g[1]), null != e && (e = e.valueOf()), Array.isArray(e)) for (o = 0, u = e.length; o < u; o++) a = e[o], l = this.element(a); else if (c(e)) l = this.element(e.apply()); else if (h(e)) {
                    for (s in e) if (p.call(e, s)) if (k = e[s], c(k) && (k = k.apply()), h(k) && d(k) && (k = null), !this.options.ignoreDecorators && this.stringify.convertAttKey && 0 === s.indexOf(this.stringify.convertAttKey)) l = this.attribute(s.substr(this.stringify.convertAttKey.length), k); else if (!this.options.separateArrayItems && Array.isArray(k)) for (r = 0, f = k.length; r < f; r++) a = k[r], (i = {})[s] = a, l = this.element(i); else h(k) ? (l = this.element(s)).element(k) : l = this.element(s, k)
                } else l = !this.options.ignoreDecorators && this.stringify.convertTextKey && 0 === e.indexOf(this.stringify.convertTextKey) ? this.text(n) : !this.options.ignoreDecorators && this.stringify.convertCDataKey && 0 === e.indexOf(this.stringify.convertCDataKey) ? this.cdata(n) : !this.options.ignoreDecorators && this.stringify.convertCommentKey && 0 === e.indexOf(this.stringify.convertCommentKey) ? this.comment(n) : !this.options.ignoreDecorators && this.stringify.convertRawKey && 0 === e.indexOf(this.stringify.convertRawKey) ? this.raw(n) : !this.options.ignoreDecorators && this.stringify.convertPIKey && 0 === e.indexOf(this.stringify.convertPIKey) ? this.instruction(e.substr(this.stringify.convertPIKey.length), n) : this.node(e, t, n);
                if (null == l) throw new Error("Could not create any elements with: " + e);
                return l
            }, e.prototype.insertBefore = function (e, t, n) {
                var i, a, o;
                if (this.isRoot) throw new Error("Cannot insert elements at root level");
                return a = this.parent.children.indexOf(this), o = this.parent.children.splice(a), i = this.parent.element(e, t, n), Array.prototype.push.apply(this.parent.children, o), i
            }, e.prototype.insertAfter = function (e, t, n) {
                var i, a, o;
                if (this.isRoot) throw new Error("Cannot insert elements at root level");
                return a = this.parent.children.indexOf(this), o = this.parent.children.splice(a + 1), i = this.parent.element(e, t, n), Array.prototype.push.apply(this.parent.children, o), i
            }, e.prototype.remove = function () {
                var e;
                if (this.isRoot) throw new Error("Cannot remove the root element");
                return e = this.parent.children.indexOf(this), [].splice.apply(this.parent.children, [e, e - e + 1].concat([])), this.parent
            }, e.prototype.node = function (e, t, n) {
                var i, a;
                return null != e && (e = e.valueOf()), t || (t = {}), t = t.valueOf(), h(t) || (n = (a = [t, n])[0], t = a[1]), i = new r(this, e, t), null != n && i.text(n), this.children.push(i), i
            }, e.prototype.text = function (e) {
                var t;
                return t = new u(this, e), this.children.push(t), this
            }, e.prototype.cdata = function (e) {
                var n;
                return n = new t(this, e), this.children.push(n), this
            }, e.prototype.comment = function (e) {
                var t;
                return t = new i(this, e), this.children.push(t), this
            }, e.prototype.commentBefore = function (e) {
                var t, n;
                return t = this.parent.children.indexOf(this), n = this.parent.children.splice(t), this.parent.comment(e), Array.prototype.push.apply(this.parent.children, n), this
            }, e.prototype.commentAfter = function (e) {
                var t, n;
                return t = this.parent.children.indexOf(this), n = this.parent.children.splice(t + 1), this.parent.comment(e), Array.prototype.push.apply(this.parent.children, n), this
            }, e.prototype.raw = function (e) {
                var t;
                return t = new l(this, e), this.children.push(t), this
            }, e.prototype.instruction = function (e, t) {
                var n, i, a, o, r;
                if (null != e && (e = e.valueOf()), null != t && (t = t.valueOf()), Array.isArray(e)) for (o = 0, r = e.length; o < r; o++) n = e[o], this.instruction(n); else if (h(e)) for (n in e) p.call(e, n) && (i = e[n], this.instruction(n, i)); else c(t) && (t = t.apply()), a = new s(this, e, t), this.children.push(a);
                return this
            }, e.prototype.instructionBefore = function (e, t) {
                var n, i;
                return n = this.parent.children.indexOf(this), i = this.parent.children.splice(n), this.parent.instruction(e, t), Array.prototype.push.apply(this.parent.children, i), this
            }, e.prototype.instructionAfter = function (e, t) {
                var n, i;
                return n = this.parent.children.indexOf(this), i = this.parent.children.splice(n + 1), this.parent.instruction(e, t), Array.prototype.push.apply(this.parent.children, i), this
            }, e.prototype.declaration = function (e, t, n) {
                var i, o;
                return i = this.document(), o = new a(i, e, t, n), i.children[0] instanceof a ? i.children[0] = o : i.children.unshift(o), i.root() || i
            }, e.prototype.doctype = function (e, t) {
                var n, i, a, r, s, l, u, d, c;
                for (n = this.document(), i = new o(n, e, t), a = r = 0, l = (d = n.children).length; r < l; a = ++r) if (d[a] instanceof o) return n.children[a] = i, i;
                for (a = s = 0, u = (c = n.children).length; s < u; a = ++s) if (c[a].isRoot) return n.children.splice(a, 0, i), i;
                return n.children.push(i), i
            }, e.prototype.up = function () {
                if (this.isRoot) throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
                return this.parent
            }, e.prototype.root = function () {
                var e;
                for (e = this; e;) {
                    if (e.isDocument) return e.rootObject;
                    if (e.isRoot) return e;
                    e = e.parent
                }
            }, e.prototype.document = function () {
                var e;
                for (e = this; e;) {
                    if (e.isDocument) return e;
                    e = e.parent
                }
            }, e.prototype.end = function (e) {
                return this.document().end(e)
            }, e.prototype.prev = function () {
                var e;
                if ((e = this.parent.children.indexOf(this)) < 1) throw new Error("Already at the first node");
                return this.parent.children[e - 1]
            }, e.prototype.next = function () {
                var e;
                if (-1 === (e = this.parent.children.indexOf(this)) || e === this.parent.children.length - 1) throw new Error("Already at the last node");
                return this.parent.children[e + 1]
            }, e.prototype.importDocument = function (e) {
                var t;
                return (t = e.root().clone()).parent = this, t.isRoot = !1, this.children.push(t), this
            }, e.prototype.ele = function (e, t, n) {
                return this.element(e, t, n)
            }, e.prototype.nod = function (e, t, n) {
                return this.node(e, t, n)
            }, e.prototype.txt = function (e) {
                return this.text(e)
            }, e.prototype.dat = function (e) {
                return this.cdata(e)
            }, e.prototype.com = function (e) {
                return this.comment(e)
            }, e.prototype.ins = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.doc = function () {
                return this.document()
            }, e.prototype.dec = function (e, t, n) {
                return this.declaration(e, t, n)
            }, e.prototype.dtd = function (e, t) {
                return this.doctype(e, t)
            }, e.prototype.e = function (e, t, n) {
                return this.element(e, t, n)
            }, e.prototype.n = function (e, t, n) {
                return this.node(e, t, n)
            }, e.prototype.t = function (e) {
                return this.text(e)
            }, e.prototype.d = function (e) {
                return this.cdata(e)
            }, e.prototype.c = function (e) {
                return this.comment(e)
            }, e.prototype.r = function (e) {
                return this.raw(e)
            }, e.prototype.i = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.u = function () {
                return this.up()
            }, e.prototype.importXMLBuilder = function (e) {
                return this.importDocument(e)
            }, e
        }()
    }).call(this)
}, function (e, t) {
    e.exports = function () {
        for (var e = [].slice.call(arguments), t = e[0], n = 1; n < e.length; n++) try {
            t = t[e[n]]
        } catch (e) {
            return
        }
        return t
    }
}, function (e, t, n) {
    var i = n(109), a = n(161);
    e.exports = n(110) ? function (e, t, n) {
        return i.f(e, t, a(1, n))
    } : function (e, t, n) {
        return e[t] = n, e
    }
}, function (e, t, n) {
    var i = n(160), a = n(265), o = n(215), r = Object.defineProperty;
    t.f = n(110) ? Object.defineProperty : function (e, t, n) {
        if (i(e), t = o(t, !0), i(n), a) try {
            return r(e, t, n)
        } catch (e) {
        }
        if ("get" in n || "set" in n) throw TypeError("Accessors not supported!");
        return "value" in n && (e[t] = n.value), e
    }
}, function (e, t, n) {
    e.exports = !n(144)(function () {
        return 7 != Object.defineProperty({}, "a", {
            get: function () {
                return 7
            }
        }).a
    })
}, function (e, t, n) {
    var i = n(268), a = n(216);
    e.exports = function (e) {
        return i(a(e))
    }
}, function (e, t, n) {
    var i = n(219)("wks"), a = n(164), o = n(81).Symbol, r = "function" == typeof o;
    (e.exports = function (e) {
        return i[e] || (i[e] = r && o[e] || (r ? o : a)("Symbol." + e))
    }).store = i
}, function (e, t) {
    e.exports = require("stream")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(718);
    !function (e) {
        const t = new class {
            constructor() {
                this.categoryViews = [];
                let e = new a.CategoryView(-1, i.DownloadKernel.CategroyViewID.Downloading),
                    t = new a.CategoryView(-1, i.DownloadKernel.CategroyViewID.Completed),
                    n = new a.CategoryView(-1, i.DownloadKernel.CategroyViewID.Recycle);
                this.categoryViews.push(e), this.categoryViews.push(t), this.categoryViews.push(n)
            }

            getCategoryViews() {
                return this.categoryViews
            }

            getCategoryViewCount() {
                return this.categoryViews.length
            }

            getCategoryViewFromId(e) {
                let t = null;
                for (let n = 0; n < this.categoryViews.length; ++n) {
                    let i = this.categoryViews[n];
                    if (i && e === i.getCategoryViewId()) {
                        t = i;
                        break
                    }
                }
                return t
            }
        };
        e.getCategoryViewManager = function () {
            return t
        }
    }(t.DownloadKernelCategoryViewManager || (t.DownloadKernelCategoryViewManager = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, n, i;
        !function (e) {
            e[e.Vip = 0] = "Vip", e[e.Try = 1] = "Try"
        }(t = e.VipTaskType || (e.VipTaskType = {})), function (e) {
            e[e.PlatinumVip = 0] = "PlatinumVip", e[e.SuperVip = 1] = "SuperVip"
        }(n = e.TryType || (e.TryType = {})), function (e) {
            e[e.Unkown = -1] = "Unkown", e[e.Init = 0] = "Init", e[e.CommitWait = 1] = "CommitWait", e[e.Commiting = 2] = "Commiting", e[e.CommitFailed = 3] = "CommitFailed", e[e.AcclerateWait = 4] = "AcclerateWait", e[e.SearchResource = 5] = "SearchResource", e[e.AcclerateFailed = 6] = "AcclerateFailed", e[e.AcclerateStoped = 7] = "AcclerateStoped", e[e.Acclerating = 8] = "Acclerating", e[e.Finished = 9] = "Finished"
        }(i = e.VipTaskStatus || (e.VipTaskStatus = {}))
    }(t.VipDownloadDefineNS || (t.VipDownloadDefineNS = {}))
}, , function (e, t, n) {
    "use strict";
    var i = n(11), a = n(71), o = n(119), r = n(43);

    function s(e) {
        var t = new o(e), n = a(o.prototype.request, t);
        return i.extend(n, o.prototype, t), i.extend(n, t), n
    }

    var l = s(r);
    l.Axios = o, l.create = function (e) {
        return s(i.merge(r, e))
    }, l.Cancel = n(78), l.CancelToken = n(136), l.isCancel = n(77), l.all = function (e) {
        return Promise.all(e)
    }, l.spread = n(137), e.exports = l, e.exports.default = l
}, function (e, t) {
    function n(e) {
        return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
    }

    /*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
    e.exports = function (e) {
        return null != e && (n(e) || function (e) {
            return "function" == typeof e.readFloatLE && "function" == typeof e.slice && n(e.slice(0, 0))
        }(e) || !!e._isBuffer)
    }
}, function (e, t, n) {
    "use strict";
    var i = n(43), a = n(11), o = n(131), r = n(132);

    function s(e) {
        this.defaults = e, this.interceptors = {request: new o, response: new o}
    }

    s.prototype.request = function (e) {
        "string" == typeof e && (e = a.merge({url: arguments[0]}, arguments[1])), (e = a.merge(i, {method: "get"}, this.defaults, e)).method = e.method.toLowerCase();
        var t = [r, void 0], n = Promise.resolve(e);
        for (this.interceptors.request.forEach(function (e) {
            t.unshift(e.fulfilled, e.rejected)
        }), this.interceptors.response.forEach(function (e) {
            t.push(e.fulfilled, e.rejected)
        }); t.length;) n = n.then(t.shift(), t.shift());
        return n
    }, a.forEach(["delete", "get", "head", "options"], function (e) {
        s.prototype[e] = function (t, n) {
            return this.request(a.merge(n || {}, {method: e, url: t}))
        }
    }), a.forEach(["post", "put", "patch"], function (e) {
        s.prototype[e] = function (t, n, i) {
            return this.request(a.merge(i || {}, {method: e, url: t, data: n}))
        }
    }), e.exports = s
}, function (e, t, n) {
    "use strict";
    var i = n(11);
    e.exports = function (e, t) {
        i.forEach(e, function (n, i) {
            i !== t && i.toUpperCase() === t.toUpperCase() && (e[t] = n, delete e[i])
        })
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11), a = n(72), o = n(74), r = n(122), s = n(123), l = n(44),
        u = "undefined" != typeof window && window.btoa && window.btoa.bind(window) || n(124);
    e.exports = function (e) {
        return new Promise(function (t, d) {
            var c = e.data, h = e.headers;
            i.isFormData(c) && delete h["Content-Type"];
            var f = new XMLHttpRequest, p = "onreadystatechange", g = !1;
            if ("undefined" == typeof window || !window.XDomainRequest || "withCredentials" in f || s(e.url) || (f = new window.XDomainRequest, p = "onload", g = !0, f.onprogress = function () {
            }, f.ontimeout = function () {
            }), e.auth) {
                var k = e.auth.username || "", m = e.auth.password || "";
                h.Authorization = "Basic " + u(k + ":" + m)
            }
            if (f.open(e.method.toUpperCase(), o(e.url, e.params, e.paramsSerializer), !0), f.timeout = e.timeout, f[p] = function () {
                if (f && (4 === f.readyState || g) && (0 !== f.status || f.responseURL && 0 === f.responseURL.indexOf("file:"))) {
                    var n = "getAllResponseHeaders" in f ? r(f.getAllResponseHeaders()) : null, i = {
                        data: e.responseType && "text" !== e.responseType ? f.response : f.responseText,
                        status: 1223 === f.status ? 204 : f.status,
                        statusText: 1223 === f.status ? "No Content" : f.statusText,
                        headers: n,
                        config: e,
                        request: f
                    };
                    a(t, d, i), f = null
                }
            }, f.onerror = function () {
                d(l("Network Error", e, null, f)), f = null
            }, f.ontimeout = function () {
                d(l("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", f)), f = null
            }, i.isStandardBrowserEnv()) {
                var T = n(125),
                    v = (e.withCredentials || s(e.url)) && e.xsrfCookieName ? T.read(e.xsrfCookieName) : void 0;
                v && (h[e.xsrfHeaderName] = v)
            }
            if ("setRequestHeader" in f && i.forEach(h, function (e, t) {
                void 0 === c && "content-type" === t.toLowerCase() ? delete h[t] : f.setRequestHeader(t, e)
            }), e.withCredentials && (f.withCredentials = !0), e.responseType) try {
                f.responseType = e.responseType
            } catch (t) {
                if ("json" !== e.responseType) throw t
            }
            "function" == typeof e.onDownloadProgress && f.addEventListener("progress", e.onDownloadProgress), "function" == typeof e.onUploadProgress && f.upload && f.upload.addEventListener("progress", e.onUploadProgress), e.cancelToken && e.cancelToken.promise.then(function (e) {
                f && (f.abort(), d(e), f = null)
            }), void 0 === c && (c = null), f.send(c)
        })
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11),
        a = ["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"];
    e.exports = function (e) {
        var t, n, o, r = {};
        return e ? (i.forEach(e.split("\n"), function (e) {
            if (o = e.indexOf(":"), t = i.trim(e.substr(0, o)).toLowerCase(), n = i.trim(e.substr(o + 1)), t) {
                if (r[t] && a.indexOf(t) >= 0) return;
                r[t] = "set-cookie" === t ? (r[t] ? r[t] : []).concat([n]) : r[t] ? r[t] + ", " + n : n
            }
        }), r) : r
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);
    e.exports = i.isStandardBrowserEnv() ? function () {
        var e, t = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a");

        function a(e) {
            var i = e;
            return t && (n.setAttribute("href", i), i = n.href), n.setAttribute("href", i), {
                href: n.href,
                protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
                host: n.host,
                search: n.search ? n.search.replace(/^\?/, "") : "",
                hash: n.hash ? n.hash.replace(/^#/, "") : "",
                hostname: n.hostname,
                port: n.port,
                pathname: "/" === n.pathname.charAt(0) ? n.pathname : "/" + n.pathname
            }
        }

        return e = a(window.location.href), function (t) {
            var n = i.isString(t) ? a(t) : t;
            return n.protocol === e.protocol && n.host === e.host
        }
    }() : function () {
        return !0
    }
}, function (e, t, n) {
    "use strict";
    var i = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

    function a() {
        this.message = "String contains an invalid character"
    }

    a.prototype = new Error, a.prototype.code = 5, a.prototype.name = "InvalidCharacterError", e.exports = function (e) {
        for (var t, n, o = String(e), r = "", s = 0, l = i; o.charAt(0 | s) || (l = "=", s % 1); r += l.charAt(63 & t >> 8 - s % 1 * 8)) {
            if ((n = o.charCodeAt(s += .75)) > 255) throw new a;
            t = t << 8 | n
        }
        return r
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);
    e.exports = i.isStandardBrowserEnv() ? {
        write: function (e, t, n, a, o, r) {
            var s = [];
            s.push(e + "=" + encodeURIComponent(t)), i.isNumber(n) && s.push("expires=" + new Date(n).toGMTString()), i.isString(a) && s.push("path=" + a), i.isString(o) && s.push("domain=" + o), !0 === r && s.push("secure"), document.cookie = s.join("; ")
        }, read: function (e) {
            var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
            return t ? decodeURIComponent(t[3]) : null
        }, remove: function (e) {
            this.write(e, "", Date.now() - 864e5)
        }
    } : {
        write: function () {
        }, read: function () {
            return null
        }, remove: function () {
        }
    }
}, function (e, t) {
    e.exports = require("assert")
}, function (e, t, n) {
    function i() {
        var e;
        try {
            e = t.storage.debug
        } catch (e) {
        }
        return !e && "undefined" != typeof process && "env" in process && (e = process.env.DEBUG), e
    }

    (t = e.exports = n(128)).log = function () {
        return "object" == typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments)
    }, t.formatArgs = function (e) {
        var n = this.useColors;
        if (e[0] = (n ? "%c" : "") + this.namespace + (n ? " %c" : " ") + e[0] + (n ? "%c " : " ") + "+" + t.humanize(this.diff), !n) return;
        var i = "color: " + this.color;
        e.splice(1, 0, i, "color: inherit");
        var a = 0, o = 0;
        e[0].replace(/%[a-zA-Z%]/g, function (e) {
            "%%" !== e && "%c" === e && (o = ++a)
        }), e.splice(o, 0, i)
    }, t.save = function (e) {
        try {
            null == e ? t.storage.removeItem("debug") : t.storage.debug = e
        } catch (e) {
        }
    }, t.load = i, t.useColors = function () {
        if ("undefined" != typeof window && window.process && "renderer" === window.process.type) return !0;
        if ("undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return !1;
        return "undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)
    }, t.storage = "undefined" != typeof chrome && void 0 !== chrome.storage ? chrome.storage.local : function () {
        try {
            return window.localStorage
        } catch (e) {
        }
    }(), t.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"], t.formatters.j = function (e) {
        try {
            return JSON.stringify(e)
        } catch (e) {
            return "[UnexpectedJSONParseError]: " + e.message
        }
    }, t.enable(i())
}, function (e, t, n) {
    function i(e) {
        var n;

        function i() {
            if (i.enabled) {
                var e = i, a = +new Date, o = a - (n || a);
                e.diff = o, e.prev = n, e.curr = a, n = a;
                for (var r = new Array(arguments.length), s = 0; s < r.length; s++) r[s] = arguments[s];
                r[0] = t.coerce(r[0]), "string" != typeof r[0] && r.unshift("%O");
                var l = 0;
                r[0] = r[0].replace(/%([a-zA-Z%])/g, function (n, i) {
                    if ("%%" === n) return n;
                    l++;
                    var a = t.formatters[i];
                    if ("function" == typeof a) {
                        var o = r[l];
                        n = a.call(e, o), r.splice(l, 1), l--
                    }
                    return n
                }), t.formatArgs.call(e, r), (i.log || t.log || console.log.bind(console)).apply(e, r)
            }
        }

        return i.namespace = e, i.enabled = t.enabled(e), i.useColors = t.useColors(), i.color = function (e) {
            var n, i = 0;
            for (n in e) i = (i << 5) - i + e.charCodeAt(n), i |= 0;
            return t.colors[Math.abs(i) % t.colors.length]
        }(e), i.destroy = a, "function" == typeof t.init && t.init(i), t.instances.push(i), i
    }

    function a() {
        var e = t.instances.indexOf(this);
        return -1 !== e && (t.instances.splice(e, 1), !0)
    }

    (t = e.exports = i.debug = i.default = i).coerce = function (e) {
        return e instanceof Error ? e.stack || e.message : e
    }, t.disable = function () {
        t.enable("")
    }, t.enable = function (e) {
        var n;
        t.save(e), t.names = [], t.skips = [];
        var i = ("string" == typeof e ? e : "").split(/[\s,]+/), a = i.length;
        for (n = 0; n < a; n++) i[n] && ("-" === (e = i[n].replace(/\*/g, ".*?"))[0] ? t.skips.push(new RegExp("^" + e.substr(1) + "$")) : t.names.push(new RegExp("^" + e + "$")));
        for (n = 0; n < t.instances.length; n++) {
            var o = t.instances[n];
            o.enabled = t.enabled(o.namespace)
        }
    }, t.enabled = function (e) {
        if ("*" === e[e.length - 1]) return !0;
        var n, i;
        for (n = 0, i = t.skips.length; n < i; n++) if (t.skips[n].test(e)) return !1;
        for (n = 0, i = t.names.length; n < i; n++) if (t.names[n].test(e)) return !0;
        return !1
    }, t.humanize = n(129), t.instances = [], t.names = [], t.skips = [], t.formatters = {}
}, function (e, t) {
    var n = 1e3, i = 60 * n, a = 60 * i, o = 24 * a, r = 365.25 * o;

    function s(e, t, n) {
        if (!(e < t)) return e < 1.5 * t ? Math.floor(e / t) + " " + n : Math.ceil(e / t) + " " + n + "s"
    }

    e.exports = function (e, t) {
        t = t || {};
        var l, u = typeof e;
        if ("string" === u && e.length > 0) return function (e) {
            if ((e = String(e)).length > 100) return;
            var t = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);
            if (!t) return;
            var s = parseFloat(t[1]);
            switch ((t[2] || "ms").toLowerCase()) {
                case"years":
                case"year":
                case"yrs":
                case"yr":
                case"y":
                    return s * r;
                case"days":
                case"day":
                case"d":
                    return s * o;
                case"hours":
                case"hour":
                case"hrs":
                case"hr":
                case"h":
                    return s * a;
                case"minutes":
                case"minute":
                case"mins":
                case"min":
                case"m":
                    return s * i;
                case"seconds":
                case"second":
                case"secs":
                case"sec":
                case"s":
                    return s * n;
                case"milliseconds":
                case"millisecond":
                case"msecs":
                case"msec":
                case"ms":
                    return s;
                default:
                    return
            }
        }(e);
        if ("number" === u && !1 === isNaN(e)) return t.long ? s(l = e, o, "day") || s(l, a, "hour") || s(l, i, "minute") || s(l, n, "second") || l + " ms" : function (e) {
            if (e >= o) return Math.round(e / o) + "d";
            if (e >= a) return Math.round(e / a) + "h";
            if (e >= i) return Math.round(e / i) + "m";
            if (e >= n) return Math.round(e / n) + "s";
            return e + "ms"
        }(e);
        throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e))
    }
}, function (e) {
    e.exports = {
        _args: [["axios@0.18.0", "D:\\thunderx_bin\\trunk\\build\\app"]],
        _from: "axios@0.18.0",
        _id: "axios@0.18.0",
        _inBundle: !1,
        _integrity: "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
        _location: "/axios",
        _phantomChildren: {},
        _requested: {
            type: "version",
            registry: !0,
            raw: "axios@0.18.0",
            name: "axios",
            escapedName: "axios",
            rawSpec: "0.18.0",
            saveSpec: null,
            fetchSpec: "0.18.0"
        },
        _requiredBy: ["/", "/@types/axios", "/@xunlei/thunderx-login-main"],
        _resolved: "http://xnpm.repo.xunlei.cn/axios/-/axios-0.18.0.tgz",
        _spec: "0.18.0",
        _where: "D:\\thunderx_bin\\trunk\\build\\app",
        author: {name: "Matt Zabriskie"},
        browser: {"./lib/adapters/http.js": "./lib/adapters/xhr.js"},
        bugs: {url: "https://github.com/axios/axios/issues"},
        bundlesize: [{path: "./dist/axios.min.js", threshold: "5kB"}],
        dependencies: {"follow-redirects": "^1.3.0", "is-buffer": "^1.1.5"},
        description: "Promise based HTTP client for the browser and node.js",
        devDependencies: {
            bundlesize: "^0.5.7",
            coveralls: "^2.11.9",
            "es6-promise": "^4.0.5",
            grunt: "^1.0.1",
            "grunt-banner": "^0.6.0",
            "grunt-cli": "^1.2.0",
            "grunt-contrib-clean": "^1.0.0",
            "grunt-contrib-nodeunit": "^1.0.0",
            "grunt-contrib-watch": "^1.0.0",
            "grunt-eslint": "^19.0.0",
            "grunt-karma": "^2.0.0",
            "grunt-ts": "^6.0.0-beta.3",
            "grunt-webpack": "^1.0.18",
            "istanbul-instrumenter-loader": "^1.0.0",
            "jasmine-core": "^2.4.1",
            karma: "^1.3.0",
            "karma-chrome-launcher": "^2.0.0",
            "karma-coverage": "^1.0.0",
            "karma-firefox-launcher": "^1.0.0",
            "karma-jasmine": "^1.0.2",
            "karma-jasmine-ajax": "^0.1.13",
            "karma-opera-launcher": "^1.0.0",
            "karma-safari-launcher": "^1.0.0",
            "karma-sauce-launcher": "^1.1.0",
            "karma-sinon": "^1.0.5",
            "karma-sourcemap-loader": "^0.3.7",
            "karma-webpack": "^1.7.0",
            "load-grunt-tasks": "^3.5.2",
            minimist: "^1.2.0",
            sinon: "^1.17.4",
            typescript: "^2.0.3",
            "url-search-params": "^0.6.1",
            webpack: "^1.13.1",
            "webpack-dev-server": "^1.14.1"
        },
        homepage: "https://github.com/axios/axios",
        keywords: ["xhr", "http", "ajax", "promise", "node"],
        license: "MIT",
        main: "index.js",
        name: "axios",
        repository: {type: "git", url: "git+https://github.com/axios/axios.git"},
        scripts: {
            build: "NODE_ENV=production grunt build",
            coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
            examples: "node ./examples/server.js",
            postversion: "git push && git push --tags",
            preversion: "npm test",
            start: "node ./sandbox/server.js",
            test: "grunt test && bundlesize",
            version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"
        },
        typings: "./index.d.ts",
        version: "0.18.0"
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);

    function a() {
        this.handlers = []
    }

    a.prototype.use = function (e, t) {
        return this.handlers.push({fulfilled: e, rejected: t}), this.handlers.length - 1
    }, a.prototype.eject = function (e) {
        this.handlers[e] && (this.handlers[e] = null)
    }, a.prototype.forEach = function (e) {
        i.forEach(this.handlers, function (t) {
            null !== t && e(t)
        })
    }, e.exports = a
}, function (e, t, n) {
    "use strict";
    var i = n(11), a = n(133), o = n(77), r = n(43), s = n(134), l = n(135);

    function u(e) {
        e.cancelToken && e.cancelToken.throwIfRequested()
    }

    e.exports = function (e) {
        return u(e), e.baseURL && !s(e.url) && (e.url = l(e.baseURL, e.url)), e.headers = e.headers || {}, e.data = a(e.data, e.headers, e.transformRequest), e.headers = i.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers || {}), i.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function (t) {
            delete e.headers[t]
        }), (e.adapter || r.adapter)(e).then(function (t) {
            return u(e), t.data = a(t.data, t.headers, e.transformResponse), t
        }, function (t) {
            return o(t) || (u(e), t && t.response && (t.response.data = a(t.response.data, t.response.headers, e.transformResponse))), Promise.reject(t)
        })
    }
}, function (e, t, n) {
    "use strict";
    var i = n(11);
    e.exports = function (e, t, n) {
        return i.forEach(n, function (n) {
            e = n(e, t)
        }), e
    }
}, function (e, t, n) {
    "use strict";
    e.exports = function (e) {
        return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)
    }
}, function (e, t, n) {
    "use strict";
    e.exports = function (e, t) {
        return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e
    }
}, function (e, t, n) {
    "use strict";
    var i = n(78);

    function a(e) {
        if ("function" != typeof e) throw new TypeError("executor must be a function.");
        var t;
        this.promise = new Promise(function (e) {
            t = e
        });
        var n = this;
        e(function (e) {
            n.reason || (n.reason = new i(e), t(n.reason))
        })
    }

    a.prototype.throwIfRequested = function () {
        if (this.reason) throw this.reason
    }, a.source = function () {
        var e;
        return {
            token: new a(function (t) {
                e = t
            }), cancel: e
        }
    }, e.exports = a
}, function (e, t, n) {
    "use strict";
    e.exports = function (e) {
        return function (t) {
            return e.apply(null, t)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(9), r = n(8);
    !function (e) {
        e.isSingleBtTask = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (!e) break;
                    if (e.getType() !== r.DownloadKernel.TaskType.Bt) break;
                    let n = e.getExtraObject();
                    if (!n) break;
                    if (1 !== n.getFileCount()) break;
                    let i = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath),
                        s = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), l = a.join(i, s);
                    if (yield o.FileSystemAWNS.existsAW(l)) {
                        let e = yield o.FileSystemAWNS.lstatAW(l);
                        if (e && e.isDirectory()) {
                            let e = void 0, i = n.getBtFileList();
                            for (let [, t]of i) {
                                e = t.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName);
                                break
                            }
                            if (!e) break;
                            let s = a.join(l, e);
                            if (yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            let u = e + ".bt.xltd";
                            if (s = a.join(l, u), yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            if (u = e + ".bt.td", s = a.join(l, u), yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            break
                        }
                    }
                    t = !0
                } while (0);
                return t
            })
        }, e.getSinleBtTaskFilePath = function (e) {
            let t = void 0;
            {
                let n = void 0, i = e.getExtraObject().getBtFileList();
                for (let [, e]of i) {
                    n = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName);
                    break
                }
                let o = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath);
                t = a.join(o, n)
            }
            return t
        }
    }(t.SingleBtTaskNS || (t.SingleBtTaskNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(8), r = n(23), s = n(149), l = n(153), u = n(31), d = n(37), c = n(67), h = n(114),
        f = n(548), p = n(17), g = a.default.getLogger("download-dispatch"),
        k = u.DownloadKernelTaskManager.getTaskManager(), m = d.DownloadKernelEventManager.getEventManager(),
        T = l.ToastNotifyManagerNS.getToastNotifyManger(),
        v = h.DownloadKernelCategoryViewManager.getCategoryViewManager(), y = 50;
    const S = new class {
        constructor() {
            this.maxStartCount = 5, this.tasks = [], this.downloadingTasks = [], this.freeDownloadingTasks = [], this.waitingTasks = [], this.isFreeOpened = !1, this.noLimitSize = 30, this.autoAddTimerId = void 0, this.autoAddRate = void 0, this.speedArray = [], this.autoAddAvailable = !1
        }

        init() {
            this.attachTaskEvent()
        }

        setAutoAddTask(e, t) {
            e ? this.startAutoAddTask(t) : (this.autoAddRate = void 0, this.stopAutoAddTask())
        }

        setFreeFromScheduleOpen(e, t) {
            if (this.isFreeOpened = e, this.noLimitSize = t, g.information("setFreeFromScheduleOpen", this.isFreeOpened, this.noLimitSize, this.tasks.length), e) {
                for (let e of this.tasks) {
                    let n = k.getTaskFromTaskId(e), i = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize);
                    g.information("setFreeFromSchedule", i, t), i <= 1024 * t * 1024 && i > 0 ? n.setFreeFromSchedule(!0) : n.setFreeFromSchedule(!1)
                }
                for (let e of this.waitingTasks) k.getTaskFromTaskId(e).isFreeFromSchedule() && this.startNoWaiting(e, !0)
            } else for (let e of this.tasks) k.getTaskFromTaskId(e).setFreeFromSchedule(!1)
        }

        setAutoAddTaskAvailable(e) {
            g.information("auto add available", e), this.autoAddAvailable = e, e ? this.switchAutoAddTask() : this.stopAutoAddTask()
        }

        updateTasks(e) {
            this.tasks = [...e]
        }

        startTask(e, t) {
            let n = !0;
            do {
                if (this.downloadingTasks.includes(e) || this.freeDownloadingTasks.includes(e)) {
                    g.information("startTask is downloading", e);
                    break
                }
                let i = k.getTaskFromTaskId(e);
                if (null === i) break;
                if (i.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) {
                    g.information("startTask is background", e), k.startTask(e);
                    break
                }
                let a = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId);
                if (-1 !== a) {
                    g.information("startTask is private", e, a), k.startTask(e);
                    break
                }
                let r = i.isFreeFromSchedule();
                if (r) {
                    g.information("startTask isFreeFromSchedule"), this.startNoWaiting(e, !0), this.showSmallFileAdvancedNotify();
                    break
                }
                if (void 0 === r && this.isFreeOpened && !isNaN(this.noLimitSize) && this.noLimitSize > 0) {
                    let t = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize);
                    if (t <= 1024 * this.noLimitSize * 1024 && t > 0) {
                        i.setFreeFromSchedule(!0), g.information("startTask isFreeFromSchedule"), this.startNoWaiting(e, !0), this.showSmallFileAdvancedNotify();
                        break
                    }
                    i.setFreeFromSchedule(!1)
                }
                if (t) {
                    g.information("startTask force no waiting", e), this.startNoWaiting(e);
                    break
                }
                if (this.downloadingTasks.length < this.maxStartCount) {
                    g.information("startTask no waiting", e), this.startNoWaiting(e);
                    break
                }
                g.information("startTask waiting", e), this.startWaiting(e), n = !1
            } while (0);
            return n
        }

        startTasks(e) {
            do {
                if (null === e || void 0 === e || 0 === e.length) break;
                let t = k.getTaskFromTaskId(e[0]).getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId);
                if (void 0 !== t && -1 !== t) {
                    for (let t = 0; t < e.length; ++t) k.startTask(e[t]);
                    break
                }
                0 === this.tasks.length && (g.information("try to start multi task but tasks not inited"), this.initTasksOrderFromConfig());
                let n = [];
                for (let t of e) {
                    let e = this.tasks.indexOf(t);
                    -1 !== e && n.push(e)
                }
                if (n.length !== e.length) {
                    this.batchStartTasks(e);
                    break
                }
                n.sort((e, t) => e - t);
                let i = [];
                for (let e of n) {
                    let t = this.tasks[e];
                    i.push(t)
                }
                this.batchStartTasks(i)
            } while (0)
        }

        setMaxStartTaskCount(e) {
            return i(this, void 0, void 0, function* () {
                if (this.maxStartCount !== e && e > 0) {
                    this.maxStartCount = e;
                    let t = this.downloadingTasks.length;
                    if (this.isFreeOpened || (t = this.downloadingTasks.length + this.freeDownloadingTasks.length), t > this.maxStartCount) {
                        let e = 0;
                        for (let t = 0; t < this.tasks.length; t++) {
                            let n = this.tasks[t], i = k.getTaskFromTaskId(n), a = i.getTaskStatus(),
                                r = i.isFreeFromSchedule();
                            a !== o.DownloadKernel.TaskStatus.StartPending && a !== o.DownloadKernel.TaskStatus.Started || r || (e += 1) > this.maxStartCount && (g.information("to stop", n), k.stopTaskAW(n).then(e => {
                                e ? (g.information("stoptask and startwaiting", n), this.startWaiting(n)) : g.information("stopTaskAW fail", n)
                            }).catch())
                        }
                    } else if (this.waitingTasks.length > 0 && this.downloadingTasks.length < this.maxStartCount) {
                        g.information("setMaxStartTaskCount to add start task", this.waitingTasks.length, this.downloadingTasks.length, this.maxStartCount);
                        for (let e = 0; e < this.tasks.length; e++) {
                            let t = this.tasks[e];
                            if (k.getTaskFromTaskId(t).getTaskStatus() === o.DownloadKernel.TaskStatus.StartWaiting && (this.startNoWaiting(t), g.information("setMaxStartTaskCount add start task", t, this.waitingTasks.length, this.downloadingTasks.length), 0 === this.waitingTasks.length || this.downloadingTasks.length === this.maxStartCount)) break
                        }
                    }
                }
            })
        }

        showSmallFileAdvancedNotify() {
            this.downloadingTasks.length >= this.maxStartCount ? T.showNotify(l.ToastNotifyManagerNS.notifyIdTaskDispatchSmallFileAdvanced, s.ToastNotifyItemType.GreenNotify, `正在优先下载小于${this.noLimitSize}MB的任务`, 3e3) : g.information("showSmallFileAdvancedNotify no waiting ")
        }

        batchStartTasks(e) {
            let t = [];
            for (let n = 0; n < e.length; n++) {
                let i = e[n];
                if (!this.startTask(i)) {
                    if (!this.isFreeOpened) {
                        n + 1 < e.length && (t = e.slice(n + 1));
                        break
                    }
                    t.push(i)
                }
            }
            t.length > 0 && this.startBatchWaiting(t)
        }

        initTasksOrderFromConfig() {
            let e = [], t = v.getCategoryViewFromId(o.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n]of t) e.push(n.getTaskBaseInfo());
            e.sort(f.SortNS.getSortFuncByConfig(o.DownloadKernel.CategroyViewID.Downloading, -1)), this.tasks = e.map(e => e.taskId)
        }

        startNoWaiting(e, t = !1) {
            if (k.startTask(e)) {
                t ? this.freeDownloadingTasks.includes(e) || this.freeDownloadingTasks.push(e) : this.downloadingTasks.includes(e) || this.downloadingTasks.push(e);
                let n = this.waitingTasks.indexOf(e);
                -1 !== n && (this.waitingTasks.splice(n, 1), this.switchAutoAddTask())
            }
        }

        startWaiting(e) {
            if (k.startWaitingTask(e)) {
                this.waitingTasks.includes(e) || (this.waitingTasks.push(e), this.switchAutoAddTask());
                let t = this.downloadingTasks.indexOf(e);
                -1 !== t && this.downloadingTasks.splice(t, 1)
            }
        }

        startBatchWaiting(e) {
            for (let t of e) {
                let e = k.getTaskFromTaskId(t).getTaskStatus();
                if (e === o.DownloadKernel.TaskStatus.Stopped || e === o.DownloadKernel.TaskStatus.Failed || e === o.DownloadKernel.TaskStatus.Unkown) {
                    this.waitingTasks.includes(t) || (this.waitingTasks.push(t), this.switchAutoAddTask());
                    let e = this.downloadingTasks.indexOf(t);
                    -1 !== e && this.downloadingTasks.splice(e, 1)
                }
            }
            k.startWaitingTasks(e)
        }

        convertWaiting2Start() {
            for (let e = 0; e < this.tasks.length; e++) {
                let t = this.tasks[e];
                if (this.waitingTasks.includes(t) && k.getTaskFromTaskId(t).getTaskStatus() === o.DownloadKernel.TaskStatus.StartWaiting) {
                    g.information("convertWaiting2Start", t), this.startNoWaiting(t);
                    break
                }
            }
        }

        getAverageSpeed(e = 10) {
            let t = 0;
            do {
                if (isNaN(e)) break;
                if (e < 0) break;
                if (0 === this.speedArray.length) break;
                let n = p.ThunderHelper.getTickCount(), i = this.speedArray.filter(t => t.tickCount + 1e3 * e >= n);
                if (0 === i.length) break;
                let a = i.map(e => e.speed);
                t = a.reduce((e, t) => e + t, 0) / a.length
            } while (0);
            return t
        }

        onGlobalDownloadSpeedChanged() {
            do {
                if (void 0 === this.autoAddTimerId) break;
                let e = c.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1);
                this.speedArray.length >= 10 && (this.speedArray = this.speedArray.slice(0, 9));
                let t = {speed: e, tickCount: p.ThunderHelper.getTickCount()};
                this.speedArray.push(t)
            } while (0)
        }

        startAutoAddTask(e) {
            do {
                if (isNaN(e)) {
                    this.stopAutoAddTask();
                    break
                }
                if (this.autoAddRate = e, !this.autoAddAvailable) break;
                if (0 === this.waitingTasks.length) break;
                void 0 === this.autoAddTimerId && (c.DownloadKernelManager.attachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, this.onGlobalDownloadSpeedChanged.bind(this)), g.information("start auto add timer"), this.autoAddTimerId = setInterval(() => {
                    do {
                        if (this.downloadingTasks.length + this.freeDownloadingTasks.length >= y) {
                            g.information("auto add task upper limit");
                            break
                        }
                        if (0 === this.waitingTasks.length) break;
                        this.isAutoAddTask() && this.convertWaiting2Start()
                    } while (0)
                }, 3e4))
            } while (0)
        }

        stopAutoAddTask() {
            g.information("stopAutoAddTask"), void 0 !== this.autoAddTimerId && (clearInterval(this.autoAddTimerId), this.autoAddTimerId = void 0, this.speedArray = [], g.information("detachListener"), c.DownloadKernelManager.detachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, this.onGlobalDownloadSpeedChanged.bind(this)))
        }

        isAutoAddTask() {
            let e = !1, t = this.getAverageSpeed();
            return t < 1024 * this.autoAddRate && (e = !0), g.information("isAutoAddTask", t, 1024 * this.autoAddRate, e), e
        }

        switchAutoAddTask() {
            do {
                if (!this.autoAddAvailable) break;
                if (void 0 === this.autoAddRate) break;
                this.waitingTasks.length > 0 ? this.startAutoAddTask(this.autoAddRate) : (g.information("no waiting task to stopAutoAdd"), this.stopAutoAddTask())
            } while (0)
        }

        attachTaskEvent() {
            m.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        if (n.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) continue;
                        let i = n.getTaskStatus(), a = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        if (n.getTaskAttribute(o.DownloadKernel.TaskAttribute.GroupTaskId) > 0) continue;
                        if (-1 !== n.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId)) continue;
                        if (i === o.DownloadKernel.TaskStatus.StartPending || i === o.DownloadKernel.TaskStatus.Started) continue;
                        let r = this.downloadingTasks.indexOf(a);
                        if (-1 !== r) this.downloadingTasks.splice(r, 1); else {
                            let e = this.freeDownloadingTasks.indexOf(a);
                            -1 !== e && this.freeDownloadingTasks.splice(e, 1)
                        }
                        if (i === o.DownloadKernel.TaskStatus.StartWaiting) continue;
                        let s = this.waitingTasks.indexOf(a);
                        -1 !== s && (this.waitingTasks.splice(s, 1), this.switchAutoAddTask()), i !== o.DownloadKernel.TaskStatus.Succeeded && i !== o.DownloadKernel.TaskStatus.Failed && i !== o.DownloadKernel.TaskStatus.StopPending && i !== o.DownloadKernel.TaskStatus.Stopped || this.waitingTasks.length > 0 && this.downloadingTasks.length < this.maxStartCount && this.convertWaiting2Start()
                    }
                } while (0)
            }), m.attachTaskEvent(o.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== o.DownloadKernel.CategroyViewID.Downloading) break;
                    let t = e[3];
                    for (let e of t) {
                        let t = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId),
                            n = this.downloadingTasks.indexOf(t);
                        if (-1 !== n) this.downloadingTasks.splice(n, 1); else {
                            let e = this.freeDownloadingTasks.indexOf(t);
                            -1 !== e && this.freeDownloadingTasks.splice(e, 1)
                        }
                        let i = this.waitingTasks.indexOf(t);
                        -1 !== i && (this.waitingTasks.splice(i, 1), this.switchAutoAddTask())
                    }
                } while (0)
            })
        }
    };
    !function (e) {
        e.init = function () {
            S.init()
        }, e.updateTasksOrder = function (e) {
            S.updateTasks(e)
        }, e.startTask = function (e, t) {
            let n = k.getTaskFromTaskId(e).getTaskStatus();
            return n !== o.DownloadKernel.TaskStatus.Succeeded && n !== o.DownloadKernel.TaskStatus.Seeding && S.startTask(e, t)
        }, e.startTasks = function (e) {
            S.startTasks(e)
        }, e.setStartTaskCount = function (e) {
            do {
                if ("number" != typeof e && (e = Number(e)), isNaN(e)) break;
                if (e <= 0) break;
                S.setMaxStartTaskCount(e).catch()
            } while (0)
        }, e.setFreeFromScheduleOpen = function (e, t) {
            S.setFreeFromScheduleOpen(e, t)
        }, e.setAutoAddTaskAvailable = function (e) {
            S.setAutoAddTaskAvailable(e)
        }, e.setAutoAddTask = function (e, t) {
            S.setAutoAddTask(e, t)
        }
    }(t.DownloadDispatchNS || (t.DownloadDispatchNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(21), a = n(244), o = n(1), r = n(7), s = n(66),
        l = o.default.getLogger("Thunder.MainRenderer.TabsBrowser"), u = 0;
    var d;
    !function (e) {
        e[e.XDAS = 0] = "XDAS", e[e.Chromium = 1] = "Chromium", e[e.IE = 2] = "IE", e[e.Other = 3] = "Other"
    }(d = t.TabType || (t.TabType = {}));

    class c {
        constructor() {
            this.canGoForward = !1, this.canGoBack = !1, this.url = "", this.iconUrl = "", this.originalUrl = "", this.isErrorPage = !1, this.pinned = !1, l.information("tab construct")
        }

        initTab(e, t) {
            let n = !1;
            do {
                if (r.isNullOrUndefined(e)) {
                    l.error(e);
                    break
                }
                this.type = e, this.originalUrl = t.url, this.name = t.name, this.index = t.index, this.showUrl = !("showUrl" in t) || t.showUrl, void 0 !== t.pinned && "boolean" == typeof t.pinned && (this.pinned = t.pinned), e === d.XDAS ? n = this.xdasTabInit(t) : e === d.Chromium ? n = this.chromiumTabInit(t) : e === d.IE && (n = this.ieTabInit(t))
            } while (0);
            return n
        }

        navigate(e) {
            let t = !1;
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.navigate(e, "", "", !1), t = !0
            } while (0);
            return t
        }

        refresh(e) {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (r.isNullOrUndefined(e)) {
                    l.error(e);
                    break
                }
                this.browser.refresh(e)
            } while (0);
            return !1
        }

        stop() {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.stop()
            } while (0);
            return !1
        }

        goForward() {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.goForward()
            } while (0);
            return !1
        }

        goBack() {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.goBack()
            } while (0);
            return !1
        }

        showDevTool(e) {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (r.isNullOrUndefined(e)) {
                    l.error(e);
                    break
                }
                this.browser.showDevTool(e)
            } while (0);
            return !1
        }

        destroyBrowser(e) {
            do {
                if (this.type !== d.Chromium) {
                    l.error(this.type);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (r.isNullOrUndefined(a.browserSupport.browserManager)) {
                    l.error(a.browserSupport.browserManager);
                    break
                }
                if (r.isNullOrUndefined(e)) {
                    l.error(e);
                    break
                }
                a.browserSupport.browserManager.destroyBrowser(this.browser, e)
            } while (0);
            return !1
        }

        viewSource() {
            do {
                if (this.type !== d.Chromium) break;
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                this.browser.viewSource()
            } while (0);
            return !1
        }

        attachListener(e) {
            let t = 0;
            do {
                if (this.type !== d.Chromium) break;
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (r.isNullOrUndefined(e) || r.isNullOrUndefined(e.eventName) || r.isNullOrUndefined(e.listener)) {
                    l.error(e);
                    break
                }
                t = this.browser.attachEventListener(e.eventName, e.listener)
            } while (0);
            return t
        }

        detachListener(e, t) {
            let n = !1;
            do {
                if (t === u) {
                    l.error(t);
                    break
                }
                if (r.isNullOrUndefined(e) || "" === e) {
                    l.error(e);
                    break
                }
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (this.type !== d.Chromium) break;
                n = this.browser.detachEventListener(e, t)
            } while (0);
            return n
        }

        getTabType() {
            return this.type
        }

        getTitle() {
            return this.title
        }

        getOriginalUrl() {
            return this.originalUrl
        }

        getPinned() {
            return this.pinned
        }

        setTitle(e) {
            return !r.isNullOrUndefined(e) && (this.title = e, !0)
        }

        setIconUrl(e) {
            return !r.isNullOrUndefined(e) && (this.iconUrl = e, !0)
        }

        getBrowser() {
            return this.browser
        }

        attachListeners(e) {
            do {
                if (r.isNullOrUndefined(this.browser)) {
                    l.error(this.browser);
                    break
                }
                if (this.type === d.Chromium) for (let t of e) {
                    if (r.isNullOrUndefined(t) || r.isNullOrUndefined(t.eventName) || r.isNullOrUndefined(t.listener)) continue;
                    let e = this.browser.attachEventListener(t.eventName, t.listener);
                    e === u && l.error(e)
                }
            } while (0)
        }

        registerNativeFunction(e, t) {
            let n = !1;
            do {
                if (r.isNullOrUndefined(e) || "" === e) {
                    l.error(e);
                    break
                }
                if (r.isNullOrUndefined(t)) {
                    l.error(t);
                    break
                }
                if (r.isNullOrUndefined(c.nativeFunctionMap)) {
                    l.error(t);
                    break
                }
                let i = c.nativeFunctionMap.filter(t => e === t.functionName);
                if (r.isNullOrUndefined(i)) {
                    let i = {functionName: e, nativeFunc: t};
                    c.nativeFunctionMap.push(i), n = !0
                }
            } while (0);
            return n
        }

        unRegisterNativeFunction(e) {
            let t = !1;
            do {
                if (r.isNullOrUndefined(e) || "" === e) {
                    l.error(e);
                    break
                }
                if (r.isNullOrUndefined(c.nativeFunctionMap)) {
                    l.error(c.nativeFunctionMap);
                    break
                }
                for (let n in c.nativeFunctionMap) if (c.nativeFunctionMap[Number(n)].functionName === e) {
                    c.nativeFunctionMap.splice(Number(n), 1), t = !0;
                    break
                }
            } while (0);
            return t
        }

        callNativeFunctionCallback(e, t, ...n) {
            let i = !1;
            do {
                if (r.isNullOrUndefined(t)) {
                    l.error(t);
                    break
                }
                if (this.type === d.XDAS) {
                    if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                        l.error(s.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    s.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(s.NativeCallHostModule.nativeCallHost, [e].concat(t, n)), i = !0
                } else if (this.type === d.Chromium) {
                    if (r.isNullOrUndefined(this.browser)) {
                        l.error(this.browser);
                        break
                    }
                    this.browser.callNativeFunctionCallback(t, n), i = !0
                }
            } while (0);
            return i
        }

        callJSFunction(e, t, ...n) {
            let i = !1;
            do {
                if (r.isNullOrUndefined(t) || "" === t) {
                    l.error(t);
                    break
                }
                if (this.type === d.XDAS) {
                    if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                        l.error(s.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    s.NativeCallHostModule.nativeCallHost.callJsFunctionByName(e, t, n), i = !0
                } else if (this.type === d.Chromium) {
                    if (r.isNullOrUndefined(this.browser)) {
                        l.error(this.browser);
                        break
                    }
                    this.browser.callJSFunction(t, n), i = !0
                }
            } while (0);
            return i
        }

        fireEvent(e, ...t) {
            let n = !1;
            do {
                if (r.isNullOrUndefined(e) || "" === e) {
                    l.error(e);
                    break
                }
                if (this.type === d.XDAS) {
                    if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                        l.error(s.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    s.NativeCallHostModule.nativeCallHost.fireNativeEvent.apply(s.NativeCallHostModule.nativeCallHost, [e].concat(t)), n = !0
                } else if (this.type === d.Chromium) {
                    if (r.isNullOrUndefined(this.browser)) {
                        l.error(this.browser);
                        break
                    }
                    this.browser.fireEvent(e, t), n = !0
                }
            } while (0);
            return n
        }

        onJsCallNativeFunction(e, t, n, a) {
            let o = !1;
            do {
                if (r.isNullOrUndefined(e) && l.error(e), r.isNullOrUndefined(t) || "" === t) {
                    l.error(t);
                    break
                }
                if (r.isNullOrUndefined(c.nativeFunctionMap)) {
                    l.error(c.nativeFunctionMap);
                    break
                }
                let u = c.nativeFunctionMap.filter(e => t === e.functionName), h = void 0,
                    f = i.NativeFunctionErrorCode.Success;
                if (r.isNullOrUndefined(u) || 0 === u.length || r.isNullOrUndefined(u[0].nativeFunc)) {
                    if (f = i.NativeFunctionErrorCode.FunctionUnExist, r.isNullOrUndefined(n)) {
                        o = !0;
                        break
                    }
                    if (this.type === d.XDAS) {
                        if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                            l.error(s.NativeCallHostModule.nativeCallHost);
                            break
                        }
                        s.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(s.NativeCallHostModule.nativeCallHost, [e].concat(n, f, h))
                    } else if (this.type === d.Chromium) {
                        if (r.isNullOrUndefined(this.browser)) {
                            l.error(this.browser);
                            break
                        }
                        this.browser.callNativeFunctionCallback(n, [f].concat(h))
                    }
                } else u[0].nativeFunc(this, e, n, a)
            } while (0);
            return o
        }

        onJsCheckNativeFunction(e, t, n) {
            do {
                if (r.isNullOrUndefined(e) && l.error(e), r.isNullOrUndefined(n)) break;
                if (r.isNullOrUndefined(t) || "" === t) {
                    l.error(t);
                    break
                }
                if (r.isNullOrUndefined(c.nativeFunctionMap)) {
                    l.error(c.nativeFunctionMap);
                    break
                }
                let a = c.nativeFunctionMap.filter(e => t === e.functionName), o = i.NativeFunctionErrorCode.Success;
                if ((r.isNullOrUndefined(a) || r.isNullOrUndefined(a[0]) || r.isNullOrUndefined(a[0].nativeFunc)) && (o = i.NativeFunctionErrorCode.FunctionUnExist, l.error(a)), this.type === d.XDAS) {
                    if (r.isNullOrUndefined(s.NativeCallHostModule.nativeCallHost)) {
                        l.error(s.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    s.NativeCallHostModule.nativeCallHost.callJsFunctionById(e, n, o)
                } else if (this.type === d.Chromium) {
                    if (r.isNullOrUndefined(this.browser)) {
                        l.error(this.browser);
                        break
                    }
                    this.browser.callNativeFunctionCallback(n, [].concat(o))
                }
            } while (0);
            return !1
        }

        isDefaultTab() {
            return this.url.split("#")[0] === c.defaultBrowserUrl
        }

        xdasTabInit(e) {
            return r.isNullOrUndefined(e) && (e = {}), void 0 === e.title ? this.title = c.defaultXDASTitle : this.title = e.title, !0
        }

        chromiumTabInit(e) {
            let t = !1;
            r.isNullOrUndefined(e) && (e = {});
            do {
                if (r.isNullOrUndefined(a.browserSupport.browserManager)) {
                    l.error(a.browserSupport.browserManager);
                    break
                }
                r.isNullOrUndefined(e.url) && (e.url = c.defaultBrowserUrl), void 0 === e.parentHwnd && (e.parentHwnd = a.browserSupport.browserParentWndHandle), void 0 === e.title ? this.title = c.defaultBrowserTitle : this.title = e.title, void 0 === e.isFromPopup && (e.isFromPopup = !1), void 0 === e.eventListeners ? e.eventListeners = c.defaultEventList : e.eventListeners = e.eventListeners.concat(c.defaultEventList), void 0 === e.rect && (e.rect = {
                    x: 0,
                    y: 0,
                    width: 0,
                    height: 0
                });
                let n = a.browserSupport.browserManager.createChromiumBrowser(e.parentHwnd, e.url, e.isFromPopup, e.rect);
                if (r.isNullOrUndefined(n)) {
                    l.error(n);
                    break
                }
                if (this.browser = n, n.addCustomProtocol("ed2k://"), n.addCustomProtocol("thunder://"), n.addCustomProtocol("magnet:?"), n.registerHotKey(116, 4), n.registerHotKey(116, 0), n.registerHotKey(84, 4), n.registerHotKey(82, 4), n.registerHotKey(87, 4), this.attachListeners(e.eventListeners), e.isFromPopup) {
                    this.browser.navigate(e.url, "", "", !1), t = !0;
                    break
                }
                r.isNullOrUndefined(c.tempBrowser) && (c.tempBrowser = a.browserSupport.browserManager.createChromiumBrowser(e.parentHwnd, c.defaultBrowserUrl, e.isFromPopup, {
                    x: 0,
                    y: 0,
                    width: 0,
                    height: 0
                })), t = !0
            } while (0);
            return t
        }

        ieTabInit(e) {
            return void 0 === e.title ? this.title = c.defaultBrowserTitle : this.title = e.title, !0
        }
    }

    c.defaultXDASTitle = "下载", c.defaultBrowserTitle = "正在加载...", c.defaultBrowserUrl = "http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", c.defaultEventList = [], c.nativeFunctionMap = [], c.tempBrowser = null, t.Tab = c
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(240), a = n(172);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-tip.vue", t.default = s.exports
}, function (e, t) {
    var n = e.exports = {version: "2.5.7"};
    "number" == typeof __e && (__e = n)
}, function (e, t) {
    e.exports = function (e) {
        return "object" == typeof e ? null !== e : "function" == typeof e
    }
}, function (e, t) {
    e.exports = function (e) {
        try {
            return !!e()
        } catch (e) {
            return !0
        }
    }
}, , , , , function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(60);
    var a;
    !function (e) {
        e[e.GreenNotify = 0] = "GreenNotify", e[e.RedNotify = 1] = "RedNotify", e[e.RedCancelNotify = 2] = "RedCancelNotify"
    }(a = t.ToastNotifyItemType || (t.ToastNotifyItemType = {}));

    class o extends i.default {
        constructor(e, t, n) {
            super(), this.id = "", this.message = "", this.duration = 0, this.id = e, this.message = t, this.duration = n
        }

        setMessage(e) {
            this.message = e
        }

        getMessage() {
            return this.message
        }

        setDuration(e) {
            this.duration = e
        }

        getDuration() {
            return this.duration
        }

        getId() {
            return this.id
        }

        getType() {
            return a.GreenNotify
        }

        getCancel() {
            return !1
        }
    }

    t.ToastNotifyItem = o;
    t.RedToastNotifyItem = class extends o {
        constructor(e, t, n) {
            super(e, t, n)
        }

        getType() {
            return a.RedNotify
        }
    };

    class r extends o {
        constructor(e, t, n) {
            super(e, t, n)
        }

        getCancel() {
            return !0
        }

        onCancel(e) {
            this.attachOnceListener("OnCancel", e)
        }

        cancel() {
            this.fireEvent("OnCancel")
        }
    }

    t.CancelToastNotifyItem = r;
    t.RedCancelToastNotifyItem = class extends r {
        constructor(e, t, n) {
            super(e, t, n)
        }

        getType() {
            return a.RedCancelNotify
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(27), o = n(1), r = n(35), s = o.default.getLogger("config-modules");
    const l = new class {
        constructor() {
            this.configModulesJsonData = null, this.eventEmitter = new r.EventEmitter, this.inited = !1
        }

        init() {
            return i(this, void 0, void 0, function* () {
                let e = null;
                try {
                    a.default.defaults.adapter = n(28), e = yield a.default.get("http://static-xl9-ssl.xunlei.com/json/modules.json")
                } catch (e) {
                    s.information(e)
                }
                let t = !1;
                null !== e && void 0 !== e.status && 200 === e.status && void 0 !== e.data && null !== e.data && "" !== e.data && (this.configModulesJsonData = e.data, t = !0), this.inited = !0, this.eventEmitter.emit("OnConfigModulesLoaded", t)
            })
        }

        getConfigInfo(e, t) {
            let n = null;
            do {
                if (null === this.configModulesJsonData || void 0 === this.configModulesJsonData) break;
                null === e || void 0 === e || "" === e ? n = this.configModulesJsonData : null === t || void 0 === t || "" === t ? null !== this.configModulesJsonData[e] && void 0 !== this.configModulesJsonData[e] && (n = this.configModulesJsonData[e]) : null !== this.configModulesJsonData[e] && void 0 !== this.configModulesJsonData[e] && null !== this.configModulesJsonData[e][t] && void 0 !== this.configModulesJsonData[e][t] && (n = this.configModulesJsonData[e][t])
            } while (0);
            return n
        }

        getEventEmitter() {
            return this.eventEmitter
        }

        isInited() {
            return this.inited
        }

        isInitedAw() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.inited ? e(!0) : this.eventEmitter.once("OnConfigModulesLoaded", t => {
                        e(!0)
                    })
                })
            })
        }
    };
    t.default = l
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(60), o = n(8), r = n(62), s = n(1).default.getLogger("Thunder.VipDownload.download-kernel-helper"),
        l = r.PluginHelperNS.getHelper();
    var u;
    !function (e) {
        e.taskInserted = "OnTaskInserted", e.taskCompleted = "OnTaskCompleted", e.taskRemoved = "OnTaskRemoved", e.taskStatusChanged = "OnTaskStatusChanged", e.taskDetailChanged = "OnTaskDetailChanged", e.taskDcdnStatusChanged = "OnTaskDcdnStatusChanged", e.btSubFileDcdnStatusChanged = "OnBtSubFileDcdnStatusChanged", e.btSubFileDetailChanged = "OnBtSubFileDetailChanged", e.btSubFileForbidden = "OnBtSubFileForbidden"
    }(u = t.DkEventNS || (t.DkEventNS = {}));

    class d extends a.default {
        constructor() {
            super(...arguments), this.mPeerId = void 0
        }

        init() {
            this.setMaxListeners(0), l.nativeCall && this.attachDkEvents()
        }

        getTpPeerId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mPeerId ? e(this.mPeerId) : l.nativeCall ? l.nativeCall.CallNativeFunction("GetTpPeerId", (t, n) => {
                        s.information("GetTpPeerId", "errorCode", t, "returnValue", n), 0 === t && n && "" !== n && (this.mPeerId = n), e(this.mPeerId || "")
                    }) : e(this.mPeerId || "")
                })
            })
        }

        getCurrentCategoryId() {
            return new Promise(e => {
                let t = void 0;
                l.nativeCall ? l.nativeCall.CallNativeFunction("GetCurrentCategoryId", (n, i) => {
                    0 === n && i && (t = i), e(t)
                }) : e(t)
            })
        }

        getTaskBaseInfo(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = null;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("GetTaskBaseInfo", e, (e, i) => {
                        if (0 === e && i) try {
                            n = JSON.parse(i)
                        } catch (e) {
                            s.warning(e)
                        }
                        t(n)
                    }) : t(n)
                })
            })
        }

        getTaskStatus(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = void 0;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("GetTaskStatus", e, (e, i) => {
                        0 === e && (n = i), t(n)
                    }) : t(n)
                })
            })
        }

        IsTaskExist(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = !1;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("IsTaskExist", e, (e, i) => {
                        0 === e && (n = i), t(n)
                    }) : t(n)
                })
            })
        }

        getTaskDetail(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = null;
                    l.nativeCall ? l.nativeCall.CallNativeFunction("GetTaskInfo", e, void 0, "taskDetail", (e, i) => {
                        do {
                            if (s.information("getTaskDetail", e, i), 0 !== e || !i) break;
                            let t = null;
                            try {
                                t = JSON.parse(i)
                            } catch (e) {
                                s.warning(e)
                            }
                            if (!t || !t.fileList) break;
                            let a = t.infoId, r = t.type;
                            n = {infoId: a, files: new Map};
                            for (let e of t.fileList) {
                                let t = -1, i = e.url;
                                r === o.DownloadKernel.TaskType.Bt ? (t = e.index, i = this.createBtFileUrl(e.index, a)) : r === o.DownloadKernel.TaskType.Group && (t = e.taskId);
                                let s = {
                                    subId: t,
                                    taskStatus: e.status,
                                    filePath: e.filePath,
                                    fileName: e.fileName,
                                    gcid: e.gcid,
                                    cid: e.cid,
                                    url: i,
                                    refUrl: e.refUrl || "",
                                    fileSize: e.fileSize,
                                    downloadSize: e.downloadSize,
                                    errCode: e.errCode,
                                    isNeedDownload: e.isNeedDownload,
                                    dcdnStatus: e.dcdnStatus
                                };
                                n.files.set(t, s)
                            }
                        } while (0);
                        t(n)
                    }) : t(n)
                })
            })
        }

        createBtTaskUrl(e) {
            return "bt://" + e
        }

        createBtFileUrl(e, t) {
            let n = this.createBtTaskUrl(t);
            return n = n + "/" + e
        }

        startTask(e) {
            this.operateTask(e, "continue")
        }

        stopTask(e) {
            this.operateTask(e, "pause")
        }

        enableDcdnWithVipCert(e, t) {
            s.information("enableDcdnWithVipCert", "taskId", e, "vipCert", t), l.nativeCall && l.nativeCall.CallNativeFunction("EnableDcdnWithVipCert", e, t, (e, t) => {
                s.information("errorCode", e, "returnValue", t)
            })
        }

        updateDcdnWithVipCert(e, t) {
            s.information("updateDcdnWithVipCert", "taskId", e, "vipCert", t), l.nativeCall && l.nativeCall.CallNativeFunction("UpdateDcdnWithVipCert", e, t, (e, t) => {
                s.information("errorCode", e, "returnValue", t)
            })
        }

        disableDcdnWithVipCert(e) {
            s.information("disableDcdnWithVipCert", "taskId", e), l.nativeCall && l.nativeCall.CallNativeFunction("DisableDcdnWithVipCert", e, (e, t) => {
                s.information("errorCode", e, "returnValue", t)
            })
        }

        selectCategoryView(e, t, n, i) {
            l.nativeCall && l.nativeCall.CallNativeFunction("SelectCategoryView", e, t, n, i, (e, t) => {
                s.information("errorCode", e, "returnValue", t)
            })
        }

        attachDkEvents() {
            l.nativeCall.AttachNativeEvent("OnTaskInserted", (e, t, n) => {
                this.onTaskInserted(e, t, n)
            }), l.nativeCall.AttachNativeEvent("OnTaskRemoved", (e, t, n) => {
                this.onTaskRemoved(e, t, n)
            }), l.nativeCall.AttachNativeEvent("OnTaskStatusChanged", e => {
                {
                    let t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                        s.warning(e)
                    }
                    if (null !== t) for (let e in t) {
                        let n = t[e];
                        this.onTaskStatusChanged(Number(e), n)
                    }
                }
            }), l.nativeCall.AttachNativeEvent("OnTaskDetailChanged", e => {
                {
                    let t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                        s.warning(e)
                    }
                    if (null !== t) for (let e in t) {
                        let n = t[e];
                        this.onTaskDetailChanged(Number(e), n)
                    }
                }
            }), l.nativeCall.AttachNativeEvent("OnTaskDcdnStatusChanged", e => {
                {
                    let t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                        s.warning(e)
                    }
                    if (null !== t) for (let e in t) {
                        let n = t[e];
                        this.onTaskDcdnStatusChanged(Number(e), n)
                    }
                }
            }), l.nativeCall.AttachNativeEvent("OnBtSubFileDcdnStatusChanged", (e, t, n) => {
                this.onBtSubFileDcdnStatusChanged(e, t, n)
            }), l.nativeCall.AttachNativeEvent("OnBtSubFileDetailChanged", (e, t) => {
                {
                    let n = null;
                    try {
                        n = JSON.parse(t)
                    } catch (e) {
                        s.warning(e)
                    }
                    null !== n && this.onBtSubFileDetailChanged(e, n)
                }
            }), l.nativeCall.AttachNativeEvent("OnBtSubFileForbidden", (e, t) => {
                this.onBtSubFileForbidden(e, t)
            })
        }

        operateTask(e, t, n) {
            l.nativeCall && l.nativeCall.CallNativeFunction("OperateTask", e, t, n, e => {
                s.information("operateTask errorCode", e)
            })
        }

        onTaskInserted(e, t, n) {
            s.information("onTaskInserted categoryId:", e, ", categoryViewId:", t);
            let i = null;
            if (n) {
                try {
                    i = JSON.parse(n)
                } catch (e) {
                    s.warning(e)
                }
                if (null !== i) switch (t) {
                    case o.DownloadKernel.CategroyViewID.Downloading:
                        for (let e of i) this.fireEvent(u.taskInserted, e);
                        break;
                    case o.DownloadKernel.CategroyViewID.Completed:
                        for (let e of i) this.fireEvent(u.taskCompleted, e)
                }
            }
        }

        onTaskRemoved(e, t, n) {
            s.information("onTaskRemoved categoryId:", e, ", categoryViewId:", t);
            let i = [];
            if (n) switch (i = JSON.parse(n), t) {
                case o.DownloadKernel.CategroyViewID.Downloading:
                case o.DownloadKernel.CategroyViewID.Completed:
                    for (let e of i) this.fireEvent(u.taskRemoved, e)
            }
        }

        onTaskStatusChanged(e, t) {
            this.fireEvent(u.taskStatusChanged, e, t)
        }

        onTaskDetailChanged(e, t) {
            this.fireEvent(u.taskDetailChanged, e, t)
        }

        onTaskDcdnStatusChanged(e, t) {
            this.fireEvent(u.taskDcdnStatusChanged, e, t)
        }

        onBtSubFileDcdnStatusChanged(e, t, n) {
            this.fireEvent(u.btSubFileDcdnStatusChanged, e, t, n)
        }

        onBtSubFileDetailChanged(e, t) {
            this.fireEvent(u.btSubFileDetailChanged, e, t)
        }

        onBtSubFileForbidden(e, t) {
            this.fireEvent(u.btSubFileForbidden, e, t)
        }
    }

    t.DkHelper = d, function (e) {
        const t = new d;
        e.getHelper = function () {
            return t
        }
    }(t.DkHelperNS || (t.DkHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.formatDate = function (e, t) {
            /(y+)/.test(t) && (t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length)));
            let n = {
                "M+": e.getMonth() + 1,
                "d+": e.getDate(),
                "h+": e.getHours(),
                "m+": e.getMinutes(),
                "s+": e.getSeconds()
            };
            for (let e in n) {
                let i = n[e] + "";
                new RegExp(`(${e})`).test(t) && (t = t.replace(RegExp.$1, 1 === RegExp.$1.length ? i : ("00" + (i = i)).substr(i.length)))
            }
            var i;
            if (/(f+)/.test(t)) {
                let n = e.getMilliseconds() + "";
                t = t.replace(RegExp.$1, ("000" + n).substr(n.length))
            }
            return t
        }, e.formatSeconds = function (e) {
            let t = "";
            do {
                if (e <= 0) {
                    t = "00:00:00";
                    break
                }
                let n = Math.floor(e / 3600), i = Math.floor(e / 60) % 60, a = Math.floor(e % 60);
                t = n < 10 ? "0" + n + ":" : n + ":", t += i < 10 ? "0" + i + ":" : i + ":", t += a < 10 ? "0" + a : "" + a
            } while (0);
            return t
        }, e.convertTimeToMinutes = function (e, t, n) {
            return 3600 * e + 60 * t + n
        }, e.convertMinuteToTime = function (e) {
            return [Math.floor(e / 3600), Math.floor(e / 60 % 60), Math.floor(e % 60)]
        }
    }(t.TimeHelperNS || (t.TimeHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(60), o = n(149), r = i.default.getLogger("ToastNotifyManager");
    !function (e) {
        e.notifyIdAutoDeleteNonExistTasks = "auto_delete_nonexsit_tasks", e.notifyIdScheduleTaskComplete = "schedule_task_complete", e.notifyIdTaskOperatorDestroyTask = "task_operator_destroy_task", e.notifyIdTaskOperatorCopyLink = "task_operator_copy_link", e.notifyIdTaskOperatorCopyMagnetLink = "task_operator_copy_magnet_link", e.notifyIdTaskOperatorSaveAsTorrent = "task_operator_save_as_torrent", e.notifyIdTaskOperatorRecoverTask = "task_operator_recover_task", e.notifyIdScheduleTaskDownloadMode = "schedule_task_download_mode", e.notifyIdTaskOperatorMoveTask = "task_operator_move_task", e.notifyIdTaskDispatchSmallFileAdvanced = "task_dispatch_small_file_advanced";

        class t extends a.default {
            constructor() {
                super(...arguments), this.notifyList = []
            }

            getTopNotify() {
                return this.notifyList.length < 1 ? null : this.notifyList[this.notifyList.length - 1]
            }

            closeNotify(e) {
                r.information("closeNotify notifyId:", e);
                for (let t = 0; t < this.notifyList.length; t++) if (this.notifyList[t].getId() === e) {
                    let n = this.notifyList[t];
                    this.notifyList.splice(t, 1), this.fireEvent("OnCloseNotify", e, n);
                    break
                }
            }

            updateNotify(e, t, n) {
                r.information("updateNotify notifyId:", e, ", msg:", t, ", duration:", n);
                for (let i = 0; i < this.notifyList.length; i++) {
                    let a = this.notifyList[i];
                    if (a.getId() === e) return a.setMessage(t), a.setDuration(n), this.fireEvent("OnUpdateNotify", e, a), !0
                }
                return !1
            }

            showNotify(e, t, n, i) {
                r.information("showNotify notifyId:", e, ", notifyType:", o.ToastNotifyItemType, ", message:", n, ", duration:", i);
                let a = null;
                switch (t) {
                    case o.ToastNotifyItemType.GreenNotify:
                        a = new o.ToastNotifyItem(e, n, i);
                        break;
                    case o.ToastNotifyItemType.RedCancelNotify:
                        a = new o.RedCancelToastNotifyItem(e, n, i);
                        break;
                    case o.ToastNotifyItemType.RedNotify:
                        a = new o.RedToastNotifyItem(e, n, i)
                }
                return a ? (this.notifyList.push(a), this.fireEvent("OnShowNotify", e, a), a) : a
            }
        }

        e.ToastNotifyManager = t;
        const n = new t;
        e.getToastNotifyManger = function () {
            return n
        }
    }(t.ToastNotifyManagerNS || (t.ToastNotifyManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(549);
    !function (e) {
        let t, n, o;

        function r(e) {
            let a = null, r = e.receiveSize, s = e.srcUsing;
            do {
                if (e.taskType === i.DownloadKernel.TaskType.P2sp) {
                    if (r > 0) {
                        a = t.Stared;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.StartPending) {
                        a = t.Starting;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.Started && 0 === r) {
                        a = t.Connect;
                        break
                    }
                } else if (e.taskType === i.DownloadKernel.TaskType.Bt) {
                    if (r > 0) {
                        a = n.Stared;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.StartPending) {
                        a = n.Analy;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.Started) {
                        a = s > 0 ? n.Connect : n.Search;
                        break
                    }
                } else if (e.taskType === i.DownloadKernel.TaskType.Emule) {
                    if (r > 0) {
                        a = o.Stared;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.StartPending) {
                        a = o.Starting;
                        break
                    }
                    if (e.taskStatus === i.DownloadKernel.TaskStatus.Started) {
                        a = s > 0 ? o.Connect : o.Search;
                        break
                    }
                }
            } while (0);
            return a
        }

        function s(e) {
            let t = "未知错误，无法继续下载";
            e > 704 && e <= 799 && (e = 701);
            let n = a.ErrorCodeHelperNS.getHelper().getMessage(a.ErrorCodeHelperNS.ErrorType.Download, e);
            if (n) t = n; else switch (e) {
                case 1:
                    t = "任务创建失败，无法继续下载";
                    break;
                case 2:
                    t = "任务参数错误，无法继续下载";
                    break;
                case 3:
                    t = "链接失效，无法继续下载";
                    break;
                case 4:
                    t = "任务配置文件错误，无法继续下载";
                    break;
                case 5:
                    t = "任务连接超时，无法继续下载";
                    break;
                case 6:
                    t = "文件校验失败，无法继续下载";
                    break;
                case 7:
                    t = "任务包含违规内容，无法继续下载";
                    break;
                case 8:
                    t = "下载引擎加速出错，无法继续下载";
                    break;
                case 9:
                    t = "文件路径超出系统限制，无法继续下载";
                    break;
                case 201:
                    t = "文件创建失败，无法继续下载";
                    break;
                case 202:
                    t = "文件写入失败，无法继续下载";
                    break;
                case 203:
                    t = "文件读取失败，无法继续下载";
                    break;
                case 204:
                    t = "文件重命名失败，无法继续下载";
                    break;
                case 205:
                    t = "磁盘空间不足，无法继续下载";
                    break;
                case 601:
                    t = "BT任务已存在，无法继续下载";
                    break;
                case 701:
                    t = "任务包含违规内容，无法继续下载";
                    break;
                case 702:
                    t = "帐号存在异常，无法继续下载";
                    break;
                case 703:
                    t = "根据当地法律法规，文件无法下载";
                    break;
                case 704:
                    t = "应版权方要求，文件无法下载";
                    break;
                case 10001:
                    t = "下载引擎未启动，无法继续下载";
                    break;
                case 10002:
                    t = "种子文件不存在，无法继续下载"
            }
            return t
        }

        e.canStartSelectedTask = function (e, t) {
            let n = !1;
            if (e === i.DownloadKernel.CategroyViewID.Downloading) for (let e of t) {
                let t = e.taskStatus;
                if (t === i.DownloadKernel.TaskStatus.StandBy || t === i.DownloadKernel.TaskStatus.Stopped || t === i.DownloadKernel.TaskStatus.Failed || t === i.DownloadKernel.TaskStatus.Unkown) {
                    n = !0;
                    break
                }
            }
            return n
        }, e.canStopSelectedTask = function (e, t) {
            let n = !1;
            if (e === i.DownloadKernel.CategroyViewID.Downloading) for (let e of t) {
                let t = e.taskStatus;
                if (t === i.DownloadKernel.TaskStatus.Started || t === i.DownloadKernel.TaskStatus.StartWaiting) {
                    n = !0;
                    break
                }
            }
            return n
        }, e.canDeleteSelectedTask = function (e, t) {
            let n = !1;
            if (t.length > 0) for (let e of t) {
                let t = e.taskStatus;
                if (t !== i.DownloadKernel.TaskStatus.StartPending && t !== i.DownloadKernel.TaskStatus.StopPending && t !== i.DownloadKernel.TaskStatus.DestroyPending) {
                    n = !0;
                    break
                }
                n = !1
            }
            return n
        }, e.canMarkAsOpened = function (e) {
            let t = !1;
            do {
                if (null === e || 0 === e.length) break;
                for (let n of e) if (0 === n.userRead) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.canCopySelectTaskLink = function (e) {
            let t = !1;
            do {
                if (void 0 === e) break;
                if (0 === e.length) break;
                for (let n of e) if (n.taskType === i.DownloadKernel.TaskType.P2sp || n.taskType === i.DownloadKernel.TaskType.Emule || n.taskType === i.DownloadKernel.TaskType.Group) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.canMergeSelectedTaskIntoGroup = function (e) {
            let t = !0;
            do {
                if (void 0 === e || null === e) {
                    t = !1;
                    break
                }
                if (e.length <= 1) {
                    t = !1;
                    break
                }
                for (let n of e) if (n.taskType === i.DownloadKernel.TaskType.Bt || n.taskType === i.DownloadKernel.TaskType.Group) {
                    t = !1;
                    break
                }
            } while (0);
            return t
        }, function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Starting = 1] = "Starting", e[e.Connect = 2] = "Connect", e[e.Stared = 3] = "Stared"
        }(t = e.P2spStartStatus || (e.P2spStartStatus = {})), function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Analy = 1] = "Analy", e[e.Search = 2] = "Search", e[e.Connect = 3] = "Connect", e[e.Stared = 4] = "Stared"
        }(n = e.BtStartStatus || (e.BtStartStatus = {})), function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Starting = 1] = "Starting", e[e.Search = 2] = "Search", e[e.Connect = 3] = "Connect", e[e.Stared = 4] = "Stared"
        }(o = e.EmuleStartStatus || (e.EmuleStartStatus = {})), e.getTaskStartStatus = r, e.getTaskStartStatusPrompt = function (e) {
            let a = void 0;
            do {
                if (null === e) break;
                if (e.taskStatus === i.DownloadKernel.TaskStatus.StartPending || e.taskStatus === i.DownloadKernel.TaskStatus.Started) {
                    if (e.taskType === i.DownloadKernel.TaskType.P2sp) {
                        let n = r(e);
                        if (null === n) break;
                        n === t.Connect && (a = "连接资源");
                        break
                    }
                    if (e.taskType === i.DownloadKernel.TaskType.Bt) {
                        let t = r(e);
                        if (null === t) break;
                        t === n.Analy ? a = "解析种子" : t === n.Search ? a = "寻找资源" : t === n.Connect && (a = "连接资源");
                        break
                    }
                    if (e.taskType === i.DownloadKernel.TaskType.Emule) {
                        let t = r(e);
                        if (null === t) break;
                        t === o.Search ? a = "寻找资源" : t === o.Connect && (a = "连接资源")
                    }
                }
            } while (0);
            return a
        }, e.getTaskStatusPrompt = function (e) {
            let t = void 0;
            do {
                if (null === e) break;
                let n = e.taskStatus;
                if (n === i.DownloadKernel.TaskStatus.Unkown) {
                    t = "未知错误";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.StandBy) {
                    t = "准备开始";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.PreDownloading) {
                    t = "等待中";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.StartWaiting) {
                    t = "排队等待";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.StartPending) {
                    t = "正在开始";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.StopPending) {
                    t = "正在停止";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.Stopped) {
                    t = "暂停";
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.Failed) {
                    t = "任务出错", t = s(e.errorCode);
                    break
                }
                if (n === i.DownloadKernel.TaskStatus.Succeeded || n === i.DownloadKernel.TaskStatus.Seeding) {
                    t = "完成";
                    break
                }
            } while (0);
            return t
        }, e.getValueForSort = function (e) {
            let t = 0, n = e.taskStatus;
            if (n === i.DownloadKernel.TaskStatus.PreDownloading ? t = 11 : n === i.DownloadKernel.TaskStatus.Started ? t = 10 : n === i.DownloadKernel.TaskStatus.StartPending ? t = 9 : n === i.DownloadKernel.TaskStatus.StartWaiting ? t = 8 : n === i.DownloadKernel.TaskStatus.StopPending ? t = 7 : n === i.DownloadKernel.TaskStatus.DestroyPending ? t = 6 : n === i.DownloadKernel.TaskStatus.Unkown ? t = 5 : n === i.DownloadKernel.TaskStatus.StandBy ? t = 4 : n === i.DownloadKernel.TaskStatus.Stopped ? t = 3 : n === i.DownloadKernel.TaskStatus.Failed ? t = 2 : n === i.DownloadKernel.TaskStatus.Seeding ? t = 1 : n === i.DownloadKernel.TaskStatus.Succeeded && (t = 0), n === i.DownloadKernel.TaskStatus.Started) {
                let n = r(e);
                t = null === n || 4 === n ? t + .9 - 1 / (e.downloadSpeed + 1.2) : t + n / 10 - .4
            }
            return n === i.DownloadKernel.TaskStatus.StartPending && e.taskType === i.DownloadKernel.TaskType.Bt && (t += .1), t
        }, e.getTaskErrorInfoByCode = s
    }(t.TaskStatusHelper || (t.TaskStatusHelper = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(1), o = n(8), r = n(57), s = n(17), l = n(5), u = a.default.getLogger("ThunderNewTask"),
        d = l.default(i.join(__rootDir, "../bin/ThunderHelper.node")),
        c = ".asf;.avi;.exe;.iso;.mp3;.mpeg;.mpg;.mpga;.ra;.rar;.rm;.rmvb;.tar;.wma;.wmp;.wmv;\n  .mov;.zip;.3gp;.chm;.mdf;.torrent;.jar;.msi;.arj;.bin;.dll;.psd;.hqx;.sit;.lzh;.gz;.tgz;.xlsx;.xls;.doc;.docx;.ppt;\n  .pptx;.flv;.swf;.mkv;.tp;.ts;.flac;.ape;.wav;.aac;.txt;.dat;.7z;.ttf;.bat;.xv;.xvx;.pdf;.mp4;.apk;.ipa;.epub;.mobi;\n  .deb;.sisx;.cab;.pxl;",
        h = ".a;.a3m;.a3w;.a4m;.a4p;.a4w;.a5w;.aam;.aas;.abf;.abk;.abs;.ace;.acm;.acp;.act;.ad;\n  .ada;.adb;.adf;.adi;.adm;.adp;.adr;.ads;.af2;.af3;.afm;.ai;.aif;.aifc;.aiff;.aim;.ais;.akw;.alb;.all;.ams;.anc;.ani;\n  .ans;.ant;.api;.aps;.ari;.arj;.art;.asa;.asc;.asd;.ase;.asf;.asm;.aso;.asp;.asv;.asx;.atw;.au;.avb;.avi;.avr;.avs;\n  .awd;.awr;.axx;.bak;.bas;.bat;.bdf;.bgl;.bi;.bif;.biff;.bin;.bk;.bk$;.bks;.bmk;.bmp;.book;.brx;.bsp;.btm;.bud;.bun;\n  .bw;.bwv;.c;.cab;.cad;.cal;.cap;.cas;.cb;.cc;.ccb;.cch;.cco;.cct;.cda;.cdf;.cdi;.cdm;.cdr;.cdt;.cdx;.cfg;.cgi;.cgm;\n  .chk;.chm;.chr;.cif;.cil;.class;.cll;.clp;.cls;.cmf;.cmv;.cmx;.cnf;.cnm;.cnt;.cod;.com;.cpl;.cpo;.cpp;.cpr;.cpt;.cpx;\n  .crd;.crp;.crt;.csc;.csp;.cst;.csv;.ctl;.cur;.cv;.cxx;.dat;.db;.dbc;.dbf;.dbx;.dcm;.dcs;.dct;.dcu;.dcx;.dem;.der;.dewf;\n  .dib;.dic;.dif;.dig;.dir;.diz;.dlg;.dll;.dls;.dmd;.dmf;.doc;.dot;.draw;.drv;.drw;.dsf;.dsg;.dsm;.dsp;.dsq;.dsw;.dtd;\n  .dun;.dv;.dxf;.dxr;.eda;.edd;.emd;.emf;.eml;.ephtml;.eps;.exe;.fav;.fax;.fcd;.fdf;.ffa;.ffk;.ffl;.ffo;.fif;.fla;.flc;\n  .fm;.fml;.fng;.fnk;.fon;.fot;.frt;.frx;.ftg;.fts;.gal;.gdb;.gdm;.gem;.gen;.getright;.gfi;.gfx;.gho;.gif;.gim;.gix;.gkh;\n  .gks;.gl;.gna;.gnt;.gnx;.gra;.grf;.grp;.hcom;.hgl;.hlp;.hpj;.hpp;.hst;.ht;.htm;.html;.htt;.htx;.icb;.icc;.icl;.icm;.ico;\n  .idd;.idf;.idq;.idx;.iff;.iges;.igf;.ilbm;.ima;.inf;.ini;.inrs;.ins;.int;.iqy;.iso;.ist;.isu;.iwc;.j62;.jar;.java;.jbf;\n  .jff;.jfif;.jif;.jmp;.jpe;.jpeg;.jpg;.js;.jsp;.jtf;.k25;.kar;.kdc;.key;.kfx;.kiz;.kkw;.kmp;.kqp;.lab;.lbm;.lbt;.lbx;.ldb;\n  .ldl;.leg;.lft;.lgo;.lha;.lib;.lin;.lis;.llx;.lnk;.log;.lst;.lu;.lyr;.lzh;.lzs;.m1v;.m3u;.mad;.maf;.mam;.map;.maq;.mar;.mat;\n  .mb1;.mbx;.mcr;.mdb;.mde;.mdl;.mdn;.mdw;.mdz;.mic;.mid;.mim;.mime;.mli;.mme;.mng;.mnu;.mod;.mov;.mp2;.mp3;.mpa;.mpe;.mpeg;\n  .mpg;.mpp;.mpr;.msg;.msi;.msn;.msp;.mst;.mtm;.nan;.nap;.ncb;.ncd;.ncf;.nff;.nft;.nil;.nist;.nls;.nlu;.ntx;.nwc;.nws;.obj;\n  .ocx;.ods;.ofn;.oft;.olb;.ole;.oogl;.opo;.p65;.pab;.part;.pas;.pbd;.pbl;.pbm;.pbr;.pcd;.pcl;.pcm;.pdd;.pdf;.pfm;.pgl;.pgm;\n  .ph;.php;.php3;.phtml;.pic;.pjt;.pjx;.pkg;.pli;.png;.pot;.ppa;.ppf;.ppm;.pps;.ppt;.prf;.prg;.prj;.prn;.prt;.psd;.psp;.pst;\n  .pwz;.qic;.qif;.qlb;.qry;.qtp;.qtx;.qw;.ra;.ram;.rar;.rdf;.reg;.rep;.res;.rft;.rgb;.rm;.rmd;.rpt;.rtf;.rul;.rvp;.s;.sav;.sbl;\n  .scc;.scf;.scp;.scr;.sct;.scx;.sdt;.sdv;.sdx;.sep;.sfd;.sfi;.sfr;.sfx;.sgi;.sgml;.shg;.shtml;.shw;.sig;.ska;.skl;.sl;.spl;\n  .sqc;.sqr;.str;.swa;.swf;.sys;.syw;.taz;.tga;.theme;.thn;.tif;.tiff;.tig;.tlb;.tmp;.tol;.tpl;.trm;.trn;.ttf;.txt;.txw;.udf;\n  .ult;.url;.use;.uwf;.vbp;.vbp;.vbw;.vbw;.vbx;.vbx;.vct;.vcx;.vda;.vda;.vir;.vir;.viv;.vqf;.vsd;.vsd;.vsl;.vsl;.vss;.vss;.vst;\n  .vst;.vsw;.vsw;.vxd;.vxd;.w3l;.wab;.wad;.wav;.wbk;.wcm;.wdb;.wfm;.wfn;.wil;.wiz;.wll;.wmf;.wow;.wp;.wpd;.wpf;.wpg;.wps;.wpt;.wr1;\n  .wrk;.wrl;.wrz;.x;.x16;.x32;.xar;.xbm;.xi;.xla;.xlb;.xlc;.xld;.xlk;.xll;.xlm;.xls;.xlt;.xlv;.xlw;.xnk;.xpm;.xwd;.xwf;.yal;.z;.zap;.zip;";
    !function (e) {
        function t(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                if (c.indexOf(e) > -1) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function n(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e) break;
                if (e.match(/[\/\\"<>\?\*|]/)) break;
                t = !0
            } while (0);
            return t
        }

        function a(e) {
            let n = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                let i = r.TaskUtilHelper.getTaskFileType(void 0, e);
                if (i === r.TaskUtilHelper.FileExtType.Video || i === r.TaskUtilHelper.FileExtType.Music || i === r.TaskUtilHelper.FileExtType.Pic) {
                    n = !0;
                    break
                }
                n = t(e)
            } while (0);
            return n
        }

        function l(e) {
            let t = !1, o = i.parse(e);
            return t = n(o.name) && a(o.ext)
        }

        function f(e) {
            let t = {};
            do {
                if (void 0 === e || null === e) break;
                u.information("parseDynamicUrlArgs");
                let n = /([^&=?]+)=([^&]*)/g;
                for (; n.exec(e);) t[RegExp.$1] = RegExp.$2;
                u.information("parseDynamicUrlArgs ret ", t)
            } while (0);
            return t
        }

        function p(e) {
            let t = {pageFileName: void 0, args: void 0};
            do {
                if (void 0 === e || null === e) break;
                u.information("parseDynamicUrlPath"), e.match(/[\/]?([^?]*)\?([^\s]*)/) && (t.pageFileName = RegExp.$1, t.args = RegExp.$2), u.information("parseDynamicUrlPath ret", t)
            } while (0);
            return t
        }

        function g(e) {
            let t = "";
            do {
                if (void 0 === e || null === e) break;
                let n = p(e);
                if (void 0 !== n.args) {
                    let e = f(n.args);
                    for (let n in e) {
                        let i = e[n];
                        if (l(i)) {
                            t = i;
                            break
                        }
                    }
                }
                void 0 !== n.pageFileName && l(n.pageFileName) && (t = n.pageFileName)
            } while (0);
            return t
        }

        function k(e) {
            let t = [];
            do {
                if (void 0 === e || null === e) break;
                let n = g(e);
                if ("" !== n && !t.includes(n)) {
                    let e = m(n);
                    t.push(e)
                }
                let i = m(e);
                t.includes(i) || t.push(i)
            } while (0);
            return t
        }

        function m(e) {
            return d.parseFileNameFromP2spUrlPath(e)
        }

        function T(e) {
            return d.isThunderPrivateUrl(e)
        }

        function v(e) {
            return d.parseEd2kUrl(e)
        }

        function y(e) {
            return d.parseUrl(e)
        }

        e.isDownloadFileExtName = t, e.isIllegalFileName = n, e.isGoodFileExtName = a, e.isUsualFileExtName = function (e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                if (a(e)) {
                    t = !0;
                    break
                }
                if (h.indexOf(e) > -1) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.isGoodFileName = l, e.parseDynamicUrlArgs = f, e.parseDynamicUrlPath = p, e.parseFileNameFromDynamicUrlPath = g, e.getFileNameListFromUrlPath = k, e.getNameFromUrl = function (e) {
            let t = "index.html", n = s.ThunderHelper.getTaskTypeFromUrl(e);
            if (n === o.DownloadKernel.TaskType.P2sp) {
                let n = k(y(e).fullPath);
                n.length > 0 && (t = n[0])
            } else n === o.DownloadKernel.TaskType.Emule && (t = v(e).fileName);
            return t.replace(/[*?/\\:|<>\"]/g, "_")
        }, e.parseFileNameFromP2spUrlPath = m, e.isThunderPrivateUrl = T, e.parseThunderPrivateUrl = function (e) {
            let t = {url: e, codePage: -1};
            return T(e) && (t = d.parseThunderPrivateUrl(e)), t
        }, e.parseEd2kUrl = v, e.parseUrl = y, e.parseMagnetUrl = function (e) {
            return d.parseMagnetUrl(e)
        }, e.makeUrl = function (e) {
            return d.makeUrl(e)
        }
    }(t.ParseUrlFileNameNS || (t.ParseUrlFileNameNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(5), r = n(1), s = n(3), l = n(14), u = n(9), d = n(8), c = n(17), h = n(155),
        f = r.default.getLogger("ThunderNewTask"), p = o.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    let g = 5;
    !function (e) {
        let t;

        function o(e, t, n) {
            void 0 === n && (n = c.ThunderHelper.getTaskTypeFromUrl(e));
            let i = void 0, o = -1, r = "", s = "";
            do {
                if (n !== d.DownloadKernel.TaskType.Emule && n !== d.DownloadKernel.TaskType.P2sp) break;
                let l = h.ParseUrlFileNameNS.getNameFromUrl(e), u = a.extname(l);
                if ("" !== u && (r = u.substring(1)), n === d.DownloadKernel.TaskType.Emule) {
                    let t = h.ParseUrlFileNameNS.parseEd2kUrl(e);
                    o = t.fileSize, s = t.fileHash
                }
                i = {
                    url: e,
                    cookie: "",
                    referer: "",
                    fileName: l,
                    browser: "",
                    statClick: t = void 0 === t ? "" : t,
                    fileSize: o,
                    fileHash: s,
                    fileType: r
                };
                break
            } while (0);
            return i
        }

        !function (e) {
            e.PreNewTask = "PreNewTaskCtrl", e.NewTask = "NewTaskCtrl", e.UrlFilter = "UrlFilterCtrl", e.Magnet = "BtCtrl"
        }(t = e.TaskCtrlType || (e.TaskCtrlType = {})), e.updateThreadCount = function (e) {
            do {
                if (isNaN(e)) break;
                if (e <= 0 || e > 10) break;
                g = e
            } while (0)
        }, e.contructTaskByUrl = function (e, t, n) {
            let i = o(e, t, n);
            f.verbose(e);
            let a = 5;
            return {
                taskType: n,
                data: i,
                setting: {
                    loginFtp: !1,
                    ftpInfo: {userName: "", password: ""},
                    onlyOrigin: !1,
                    thread: a = null !== i.thread && void 0 !== i.thread ? i.thread : g,
                    note: "",
                    openAfterDownload: !1
                },
                selected: !0
            }
        }, e.contructTaskByUrlData = function (e, t) {
            let n = void 0, i = c.ThunderHelper.getTaskTypeFromUrl(e.url);
            if (i === d.DownloadKernel.TaskType.Emule && (void 0 === e.fileHash || "" === e.fileHash)) {
                let t = h.ParseUrlFileNameNS.parseEd2kUrl(e.url);
                e.fileSize = t.fileSize, e.fileHash = t.fileHash
            }
            if (void 0 !== e.fileSize && null !== e.fileSize && 0 !== e.fileSize || (e.fileSize = -1), void 0 !== e.fileName && "" !== e.fileName || (e.fileName = h.ParseUrlFileNameNS.getNameFromUrl(e.url)), e.fileName = e.fileName.replace(/[*?/\\:|<>\"]/g, "_"), void 0 === e.fileType || "" === e.fileType) {
                let t = a.extname(e.fileName);
                "" !== t && (e.fileType = t.substring(1))
            }
            if (void 0 === t || null === t) {
                let n = 5;
                t = {
                    loginFtp: !1,
                    ftpInfo: {userName: "", password: ""},
                    onlyOrigin: !1,
                    thread: n = null !== e.thread && void 0 !== e.thread ? e.thread : g,
                    note: "",
                    openAfterDownload: !1
                }
            }
            return n = {taskType: i, data: e, setting: t, selected: !0}
        }, e.getDesktopPath = function () {
            return p.getDesktopPath()
        }, e.getDocumentPath = function () {
            return p.getDocumentPath()
        }, e.queryFileExists = function (e) {
            return p.queryFileExists(e)
        }, e.isFilePathValid = function (e) {
            return p.isFilePathValid(e)
        }, e.getNewTaskDataByUrl = o, e.getDownloadResult = function (e, ...t) {
            return i(this, void 0, void 0, function* () {
                let n = {result: !1};
                do {
                    if (e.length < 3) {
                        n.message = "不合法的存储路径";
                        break
                    }
                    if (!(yield u.FileSystemAWNS.mkdirsAW(e))) {
                        n.message = "不合法的存储路径";
                        break
                    }
                    s.ipcRenderer.send(l.ThunderChannelList.channelRMNewTaskCreateNewTask, e, ...t), n = yield new Promise(e => {
                        s.ipcRenderer.once(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, (t, n, i) => {
                            e({result: n, message: i})
                        })
                    })
                } while (0);
                return n
            })
        }, e.readThunderUnionConfig = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = null, i = null;
                try {
                    const i = yield n(27);
                    i.defaults.adapter = n(28), t = yield i.get(e)
                } catch (e) {
                    f.information(e)
                }
                return null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data && (i = t.data), i
            })
        }
    }(t.ThunderNewtaskHelperNS || (t.ThunderNewtaskHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(84), o = n(36), r = n(6);
    var s;
    !function (e) {
        e[e.ShowUI_Decoding = 0] = "ShowUI_Decoding", e[e.ShowUI_Creating = 1] = "ShowUI_Creating", e[e.ShowUI_DecodeFailed = 2] = "ShowUI_DecodeFailed", e[e.ShowUI_CreateFailed = 3] = "ShowUI_CreateFailed", e[e.ShowUI_CreateSucc = 4] = "ShowUI_CreateSucc", e[e.ShowUI_CreateSuccDis = 5] = "ShowUI_CreateSuccDis"
    }(s = t.ShowType || (t.ShowType = {}));

    class l {
        constructor() {
            this.lastBirdKey = []
        }

        static GetInstance() {
            return l.instance || (l.instance = new l), l.instance
        }

        setLastBirdKey(e) {
            if (e && 0 !== e.length) {
                this.lastBirdKey = [];
                for (let t = 0; t < e.length; t++) this.lastBirdKey.push(e[t])
            }
        }

        getLastBirdKey() {
            return this.lastBirdKey
        }

        isSameBirdKey(e) {
            if (!this.lastBirdKey) return !1;
            if (e.length !== this.lastBirdKey.length) return !1;
            let t = 0;
            for (let n = 0; n < e.length; n++) e[n] === this.lastBirdKey[n] && t++;
            return t === e.length
        }
    }

    l.instance = null, t.encodeBirdKey = function (e, t) {
        return a.fetchSlRes({url: "/dlj_create", data: {url: encodeURI(t), uid: e, "Chat-Version": 2}, method: "post"})
    }, t.decodeBirdKey = function (e) {
        return i(this, void 0, void 0, function* () {
            let t = yield new Promise(e => {
                r.NativeCallModule.nativeCall.CallNativeFunction("GetThunderVersion", (t, n) => {
                    e(0 === t ? n : "")
                })
            });
            return a.fetchSlRes({
                url: "/dlj/bird_key?key=" + e.toLowerCase(),
                data: {_h: ["Chat-Version:2", "Version-Name:" + t]},
                method: "get"
            })
        })
    }, t.openBirdKeyEncodeDialog = function (e, t) {
        o.MessageBox.custom("BirdKeyShow", {showType: s.ShowUI_Creating, url: e, statData: t}).catch()
    }, t.openBirdKeyDecodeDialog = function (e, t) {
        o.MessageBox.custom("BirdKeyShow", {showType: s.ShowUI_Decoding, birdkeyChars: e, statData: t}).catch()
    }, t.saveVestUrlToConfig = function (e, t) {
        let n = t ? "vestURL" : "commonUrl";
        r.NativeCallModule.nativeCall.CallNativeFunction("GetValue", "BirdKeyVest", n, [], (t, i) => {
            let a = [];
            0 === t && (a = i), "" !== e && -1 === a.join().indexOf(e) && (a.push(e), r.NativeCallModule.nativeCall.CallNativeFunction("SetValue", "BirdKeyVest", n, a, e => e))
        })
    }, t.isVestUrl = function (e, t) {
        return i(this, void 0, void 0, function* () {
            return new Promise(n => {
                r.NativeCallModule.nativeCall.CallNativeFunction("GetValue", "BirdKeyVest", t, [], (t, i) => {
                    let a = [];
                    0 === t && (a = i), "" !== e && -1 !== a.join().indexOf(e) ? n(!0) : n(!1)
                })
            })
        })
    }, t.getBirdKeyMgr = function () {
        return l.GetInstance()
    }
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(233), a = n(174);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-button.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(235), a = n(176);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(606);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-select.vue", t.default = s.exports
}, function (e, t, n) {
    var i = n(143);
    e.exports = function (e) {
        if (!i(e)) throw TypeError(e + " is not an object!");
        return e
    }
}, function (e, t) {
    e.exports = function (e, t) {
        return {enumerable: !(1 & e), configurable: !(2 & e), writable: !(4 & e), value: t}
    }
}, function (e, t, n) {
    var i = n(267), a = n(220);
    e.exports = Object.keys || function (e) {
        return i(e, a)
    }
}, function (e, t) {
    e.exports = !0
}, function (e, t) {
    var n = 0, i = Math.random();
    e.exports = function (e) {
        return "Symbol(".concat(void 0 === e ? "" : e, ")_", (++n + i).toString(36))
    }
}, function (e, t) {
    t.f = {}.propertyIsEnumerable
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(234), a = n(178);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-input.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(229), a = n(184);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-text.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(169), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(573), o = n(609), r = n(159), s = n(167), l = n(610), u = n(611), d = n(166), c = n(612), h = n(613),
        f = n(158), p = n(4);
    let g = class extends p.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    i([p.Prop({})], g.prototype, "item", void 0), i([p.Prop({})], g.prototype, "formData", void 0), i([p.Prop()], g.prototype, "value", void 0), g = i([p.Component({
        components: {
            confCheckbox: a.default,
            confRadio: o.default,
            confSelect: r.default,
            confText: s.default,
            confCheckboxInput: l.default,
            confCheckboxSelect: u.default,
            confInput: d.default,
            confSpeedText: h.default,
            confTextarea: c.default,
            confBtn: f.default
        }
    })], g), t.default = g
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(171), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(213), s = n(141), l = n(158), u = n(159), d = n(166), c = n(607), h = n(608), f = n(167);
    let p = class extends o.Vue {
        handleInput(e, t = "") {
            return a(this, void 0, void 0, function* () {
                if ("" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t), void 0 !== this.item.linkItem && e) {
                    let t = yield r.ConfigHelperNS.getValue(this.formData[this.item.linkItem.name].section, this.formData[this.item.linkItem.name].key, "");
                    "" !== e && this.$emit("input", t, this.item.linkItem.name)
                }
            })
        }
    };
    i([o.Prop({})], p.prototype, "item", void 0), i([o.Prop({})], p.prototype, "formData", void 0), i([o.Prop()], p.prototype, "value", void 0), i([o.Prop()], p.prototype, "label", void 0), p = i([o.Component({
        components: {
            confTip: s.default,
            confBtn: l.default,
            confSelect: u.default,
            confInput: d.default,
            confSpeed: c.default,
            confSpeedTime: h.default,
            confText: f.default
        }
    })], p), t.default = p
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(173), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4);
    let o = class extends a.Vue {
    };
    i([a.Prop()], o.prototype, "classes", void 0), i([a.Prop()], o.prototype, "text", void 0), o = i([a.Component({})], o), t.default = o
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(175), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(213), s = n(36), l = n(30), u = n(10), d = n(6), c = n(141);
    let h = class extends o.Vue {
        popDialog() {
            switch (this.item.boxType) {
                case"speedConfBox":
                    d.NativeCallModule.nativeCall.CallNativeFunction("ShowCustomDownloadModeDlg", () => {
                    });
                    break;
                case"browserGuideConfBox":
                    d.NativeCallModule.nativeCall.CallNativeFunction("ShowBrowserGuideDlg", () => {
                    });
                    break;
                case"function":
                    this.item.handle();
                    break;
                case"pop":
                    this.messagePop()
            }
        }

        messagePop() {
            return a(this, void 0, void 0, function* () {
                let e = u.ThunderUtil.deepCopy(this.item.pop.formData);
                for (let t in e) e[t].value = yield r.ConfigHelperNS.getValue(this.item.pop.formData[t].section, this.item.pop.formData[t].key, this.item.pop.formData[t].value);
                s.MessageBox.pop({
                    title: this.item.pop.title,
                    size: this.item.pop.size,
                    schemas: this.item.pop.schema,
                    formData: e
                }, this.item.pop.dialogOption).then(t => {
                    if (t.action === l.MessageBoxNS.Action.OK) for (let t in e) r.ConfigHelperNS.setValue(e[t].section, e[t].key, e[t].value)
                }).catch()
            })
        }
    };
    i([o.Prop({})], h.prototype, "item", void 0), i([o.Prop()], h.prototype, "classes", void 0), i([o.Prop()], h.prototype, "text", void 0), i([o.Prop()], h.prototype, "disabled", void 0), h = i([o.Component({components: {confTip: c.default}})], h), t.default = h
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(177), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(3), r = n(205), s = n(70), l = n(1).default.getLogger("conf-select");
    let u = class extends a.Vue {
        constructor() {
            super(...arguments), this.schema = null, this.tooltipVisible = !1, this.tipContent = "", this.dyNamicOptions = [], this.valueData = ""
        }

        handleInput(e) {
            void 0 === this.item.hasDeleteOption || e !== this.item.deleteOptionText ? (this.tooltipVisible || this.item.blurUpdate || this.$emit("input", e, this.item.name), this.valueData = e) : this.$emit("input", [], this.item.optionByName)
        }

        handleOutFocus() {
            this.item.blurUpdate && !this.tooltipVisible && this.$emit("input", this.valueData, this.item.name)
        }

        selectPath() {
            let e = o.remote.dialog.showOpenDialog({defaultPath: this.valueData, properties: [this.fileType]});
            void 0 !== e && (void 0 !== this.name ? this.$emit("input", e[0], this.name) : this.$emit("input", e[0], this.item.name), this.valueData = e[0])
        }

        get optionList() {
            if (this.item.optionByName && this.formData[this.item.optionByName] && this.formData[this.item.optionByName].value) {
                let e = this.formData[this.item.optionByName].value,
                    t = [...e].reverse().slice(0, this.item.maxOptionLen || e.length);
                return t.push(this.item.deleteOptionText), t
            }
            return this.options
        }

        get fileType() {
            return this.item.slotOption
        }

        get rules() {
            let e;
            do {
                if (!this.item.rules) break;
                e = this.item.rules.map(e => Array.isArray(e) ? new Function(e[0], e[1]) : e)
            } while (0);
            return e
        }

        validate(e) {
            l.information("value....", e), this.handleInput(e), void 0 !== this.item.hasDeleteOption && e === this.item.deleteOptionText || this.item.rules && this.schema.validate({[this.item.name]: e}, (e, t) => {
                l.information("errors", e), null === e ? this.tooltipVisible = !1 : (l.information("路径有误", e), this.tipContent = e[0].message, this.tooltipVisible = !0)
            })
        }

        created() {
            this.item.rules && (this.schema = new r.default({[this.item.name]: this.rules})), void 0 !== this.value ? this.valueData = this.value.value.toString() : this.valueData = this.formData[this.item.name].value.toString()
        }
    };
    i([a.Prop({})], u.prototype, "item", void 0), i([a.Prop()], u.prototype, "label", void 0), i([a.Prop({})], u.prototype, "formData", void 0), i([a.Prop()], u.prototype, "options", void 0), i([a.Prop()], u.prototype, "value", void 0), i([a.Prop()], u.prototype, "disabled", void 0), i([a.Prop()], u.prototype, "classes", void 0), i([a.Prop()], u.prototype, "name", void 0), i([a.Prop()], u.prototype, "placeHolder", void 0), u = i([a.Component({components: {SelectNative: s.default}})], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(179), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(205), o = n(4), r = n(158);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.shortcutKey = "", this.funKey = !0, this.valueData = " ", this.canRegister = !1, this.schema = null, this.tooltip = "", this.tooltipVisible = !1
        }

        get rules() {
            let e;
            do {
                if (!this.item.rules) break;
                e = this.item.rules.map(e => Array.isArray(e) ? new Function(e[0], e[1]) : e)
            } while (0);
            return e
        }

        handleInput(e) {
            this.valueData = e, this.$emit("input", e, this.name)
        }

        handleChange(e) {
            let t = e.target;
            this.valueData = t.value, void 0 !== this.item.ShortcutKey && this.canRegister ? this.$emit("input", t.value, this.name) : void 0 === this.item.ShortcutKey && this.$emit("input", t.value, this.name)
        }

        handleKeyDown(e) {
            if (void 0 !== this.item.ShortcutKey) {
                let t = /Digit\d/.test(e.code) || e.keyCode >= 65 && e.keyCode <= 90;
                if (this.shortcutKey = "", this.funKey = !1, this.canRegister = !1, this.valueData = "", "Backspace" === e.key) return this.valueData = "无", void this.$emit("input", "", this.name);
                e.altKey && (this.shortcutKey = "Alt+"), e.ctrlKey && (this.shortcutKey = "" === this.shortcutKey ? "Crtl+" : `${this.shortcutKey}Crtl+`), e.shiftKey && (this.shortcutKey = "" === this.shortcutKey ? "Shift+" : `${this.shortcutKey}Shift+`);
                let n = "Alt" === e.key || "Shift" === e.key || "Control" === e.key ? "" : t ? e.code[e.code.length - 1] : e.key;
                this.valueData = this.shortcutKey + n, "" !== n && (this.funKey = !0), this.shortcutKey + n !== n && "" !== n && (this.canRegister = !0, this.valueData = this.shortcutKey + n, this.$emit("input", this.valueData, this.name))
            }
        }

        handleKeyup() {
            this.funKey || void 0 === this.item.ShortcutKey || (this.valueData = "无", this.$emit("input", "", this.name))
        }

        mounted() {
            this.valueData = this.value.value
        }

        validate(e) {
            this.item.rules && this.schema.validate({[this.item.name]: e}, (e, t) => {
                this.tooltipVisible = null !== e
            })
        }

        outFocus() {
            this.tooltipVisible = !1
        }

        created() {
            this.item.rules && (this.schema = new a.default({[this.item.name]: this.rules}))
        }
    };
    i([o.Prop()], s.prototype, "item", void 0), i([o.Prop({})], s.prototype, "formData", void 0), i([o.Prop()], s.prototype, "disabled", void 0), i([o.Prop()], s.prototype, "value", void 0), i([o.Prop()], s.prototype, "name", void 0), i([o.Prop()], s.prototype, "label", void 0), s = i([o.Component({components: {confBtn: r.default}})], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(181), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(205), o = n(4);
    let r = class extends o.Vue {
        constructor() {
            super(...arguments), this.schema = null, this.tooltip = "", this.tooltipVisible = !1, this.timeout = null
        }

        get rules() {
            return (this.item.rules || []).map(e => Array.isArray(e) ? new Function(e[0], e[1]) : e)
        }

        get doEmit() {
            return this.item.doEmit ? new Function(this.item.doEmit[0], this.item.doEmit[1]) : null
        }

        get doBlur() {
            return this.item.doBlur ? new Function(this.item.doBlur[0], this.item.doBlur[1]) : null
        }

        get sliderValue() {
            let e;
            return e = "number" == typeof this.value ? this.value : "object" == typeof this.value ? Number(this.value.value) : Number(this.value), this.item.scales && this.item.scales.length ? Math.min(Math.max(this.item.scales[0], e), this.item.scales[this.item.scales.length - 1]) : e
        }

        handleSliderUpdate(e) {
            this.handleInput(e.toString())
        }

        handleInput(e) {
            this.doEmit ? this.doEmit(this.item.name, e, this.value.value) : this.$emit("input", e, this.item.name), this.doValidate(e)
        }

        doValidate(e) {
            this.schema && this.schema.validate({[this.item.name]: e}, (e, t) => {
                null === e ? this.hideTooltip() : this.showTooltip(e[0].message)
            })
        }

        handleBlur() {
            let e;
            e = "object" == typeof this.value ? this.value.value : this.value, this.doBlur && this.doBlur(this.item.name, e), this.$nextTick(() => {
                let e;
                e = "object" == typeof this.value ? this.value.value : this.value, this.doValidate(e)
            })
        }

        showTooltip(e) {
            this.tooltip = e, this.$refs.tooltip.show(this.$refs.input.$el)
        }

        hideTooltip() {
            this.$refs.tooltip.hide()
        }

        created() {
            this.item.rules && (this.schema = new a.default({[this.item.name]: this.rules}))
        }
    };
    i([o.Prop({})], r.prototype, "item", void 0), i([o.Prop()], r.prototype, "value", void 0), i([o.Prop()], r.prototype, "disabled", void 0), r = i([o.Component], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(183), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(70);
    let r = class extends a.Vue {
        constructor() {
            super(...arguments), this.data = [{
                label: "开始限速时间",
                options: [{index: 0, type: "hour"}, {index: 1, type: "minute"}]
            }, {
                label: "结束限速时间",
                options: [{index: 2, type: "hour"}, {index: 3, type: "minute"}]
            }], this.hours = Array.from({length: 24}, (e, t) => t), this.minutes = Array.from({length: 60}, (e, t) => t)
        }

        handleInput(e, t) {
            let n = this.value.slice(0), i = Object.assign({}, n[t]);
            i.value = e, n[t] = i, this.$emit("input", n, this.item.name)
        }
    };
    i([a.Prop({})], r.prototype, "item", void 0), i([a.Prop()], r.prototype, "value", void 0), i([a.Prop()], r.prototype, "disabled", void 0), r = i([a.Component({components: {SelectNative: o.default}})], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(185), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(6);
    let r = class extends a.Vue {
        constructor() {
            super(...arguments), this.userId = ""
        }

        get clas() {
            return void 0 !== this.classes ? this.classes : this.item.classes
        }

        get textContent() {
            return void 0 !== this.item.text ? this.item.text : this.text
        }

        mounted() {
            void 0 !== this.item.isReleventUser && this.item.isReleventUser && (o.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                this.userId = e
            }), o.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.userId = ""
            }))
        }
    };
    i([a.Prop({})], r.prototype, "item", void 0), i([a.Prop()], r.prototype, "classes", void 0), i([a.Prop()], r.prototype, "extIndex", void 0), i([a.Prop()], r.prototype, "text", void 0), r = i([a.Component({})], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(187), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(141), s = n(158), l = n(166), u = n(6), d = n(15);
    let c = class extends o.Vue {
        constructor() {
            super(...arguments), this.userId = ""
        }

        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }

        setUserId() {
            return a(this, void 0, void 0, function* () {
                let e = yield d.default("GetUserID");
                this.userId = e
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                void 0 !== this.item.isReleventUser && this.item.isReleventUser && (this.setUserId(), u.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    this.userId = e
                }), u.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                    this.userId = ""
                }))
            })
        }
    };
    i([o.Prop({})], c.prototype, "item", void 0), i([o.Prop({})], c.prototype, "formData", void 0), i([o.Prop()], c.prototype, "value", void 0), c = i([o.Component({
        components: {
            confTip: r.default,
            confBtn: s.default,
            confInput: l.default
        }
    })], c), t.default = c
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(189), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(141), r = n(166), s = n(167), l = n(159);
    let u = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    i([a.Prop({})], u.prototype, "item", void 0), i([a.Prop({})], u.prototype, "formData", void 0), u = i([a.Component({
        components: {
            confTip: o.default,
            confInput: r.default,
            confText: s.default,
            confSelect: l.default
        }
    })], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(191), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(141), r = n(167), s = n(159);
    let l = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    i([a.Prop({})], l.prototype, "item", void 0), i([a.Prop({})], l.prototype, "formData", void 0), l = i([a.Component({
        components: {
            confTip: o.default,
            confText: r.default,
            confSelect: s.default
        }
    })], l), t.default = l
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(193), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4);
    let o = class extends a.Vue {
        handleChange(e) {
            let t = e.target;
            this.$emit("input", t.value, this.item.name)
        }
    };
    i([a.Prop({})], o.prototype, "item", void 0), i([a.Prop({})], o.prototype, "formData", void 0), i([a.Prop()], o.prototype, "value", void 0), i([a.Prop()], o.prototype, "label", void 0), o = i([a.Component({components: {}})], o), t.default = o
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(195), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(213);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.maxDownloadSpeed = "", this.maxUploadSpeed = ""
        }

        onFormDataChange(e) {
            this.updateMaxDownloadSpeed(), this.updateMaxUploadSpeed()
        }

        standardNumber(e) {
            let t = parseInt(e + "", 10);
            return t > 9 ? t + "" : "0" + t
        }

        updateMaxDownloadSpeed() {
            return a(this, void 0, void 0, function* () {
                let e = "不限速";
                this.formData["ConfigNet-ConfigNet_Custom_DownloadSpeedChk"].value && (e = (yield r.ConfigHelperNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", 1024)) + "KB/S"), this.maxDownloadSpeed = e
            })
        }

        updateMaxUploadSpeed() {
            return a(this, void 0, void 0, function* () {
                let e = "不限速";
                this.formData["ConfigNet-ConfigNet_Custom_UploadSpeedChk"].value && (e = (yield r.ConfigHelperNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", 1024)) + "KB/S"), this.maxUploadSpeed = e
            })
        }
    };
    i([o.Prop({})], s.prototype, "item", void 0), i([o.Prop({})], s.prototype, "formData", void 0), i([o.Watch("formData", {
        immediate: !0,
        deep: !0
    })], s.prototype, "onFormDataChange", null), s = i([o.Component], s), t.default = s
}, , , , , function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(29), o = n(27), r = n(2), s = n(9), l = n(1).default.getLogger("Axios.Helper");
    !function (e) {
        e.getFileSizeWithUrlAW = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = 0;
                do {
                    let n = a.parse(e);
                    if ("https:" !== n.protocol && "http:" !== n.protocol) break;
                    let i = null;
                    try {
                        i = yield o.default.get(e, {responseType: "arraybuffer"})
                    } catch (e) {
                        l.warning(e)
                    }
                    if (null !== i && void 0 !== i.status && 200 === i.status) {
                        let e = i.headers["content-length"];
                        void 0 !== e && (t = parseInt(e, 10))
                    }
                } while (0);
                return t
            })
        }, e.downloadFileAW = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    let i = null;
                    try {
                        i = yield o.default.get(e, {responseType: "arraybuffer"})
                    } catch (e) {
                        l.information(e);
                        break
                    }
                    if (null !== i && void 0 !== i.status && 200 === i.status && void 0 !== i.data && null !== i.data && "" !== i.data) {
                        let e = r.dirname(t), a = yield s.FileSystemAWNS.mkdirsAW(e);
                        a && (a = yield s.FileSystemAWNS.writeFileAW(t, i.data)) && (n = !0)
                    }
                } while (0);
                return n
            })
        }
    }(t.AxiosNS || (t.AxiosNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(5), s = n(9), l = n(8), u = n(31), d = n(36), c = n(30), h = n(13), f = n(6),
        p = n(7), g = n(61), k = n(139), m = n(138), T = o.default.getLogger("Thunder.TaskOperator"),
        v = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")), y = u.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        function t(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.NativeCallModule.nativeCall.CallNativeFunction("IsLogined", (n, i) => {
                        T.verbose(n), i ? "sessionid" === e ? f.NativeCallModule.nativeCall.CallNativeFunction("GetSessionID", (e, n) => {
                            T.verbose(e), t(n)
                        }) : "userid" === e && f.NativeCallModule.nativeCall.CallNativeFunction("GetUserID", (e, n) => {
                            T.verbose(e), t(n)
                        }) : t("")
                    })
                })
            })
        }

        function n(e) {
            let t = v.getInstallChannel();
            e = void 0 === e ? "" : e;
            let n = a.join(__rootDir, "../../Thunder.exe");
            return `xl_thunder_pc|${v.getFileVersion(n)}|${t}|${e}`
        }

        function o(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (p.isNullOrUndefined(e)) break;
                    let n = e.savePath, i = e.taskName;
                    void 0 !== i && i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1));
                    let o = a.join(n, i);
                    if (e.taskType === l.DownloadKernel.TaskType.P2sp || e.taskType === l.DownloadKernel.TaskType.Emule) ; else if (e.taskType === l.DownloadKernel.TaskType.Bt) {
                        let t = y.getTaskFromTaskId(e.taskId), n = t.getExtraObject(), i = n.getDownloadFile();
                        if (1 === i.length) {
                            if (yield m.SingleBtTaskNS.isSingleBtTask(t)) o = m.SingleBtTaskNS.getSinleBtTaskFilePath(t); else {
                                let e = n.getBtFileList();
                                for (let [, t]of e) {
                                    if (t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.RealIndex) === i[0]) {
                                        let e = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FilePath),
                                            n = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName);
                                        o = a.join(o, e, n);
                                        break
                                    }
                                }
                            }
                        }
                    } else if (e.taskType === l.DownloadKernel.TaskType.Group) {
                        o = n;
                        let i = y.getTaskFromTaskId(e.taskId).getExtraObject(), r = i.getSubTaskCount();
                        for (let e = 0; e < r; ++e) {
                            let n = i.getSubTaskByIndex(e);
                            if (1 === n.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                                let e = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath),
                                    i = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName), o = a.join(e, i);
                                if (yield s.FileSystemAWNS.existsAW(o)) {
                                    t = !0;
                                    break
                                }
                            }
                        }
                        break
                    }
                    t = yield s.FileSystemAWNS.existsAW(o)
                } while (0);
                return t
            })
        }

        function r(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let n = e.taskStatus;
                    if (n === l.DownloadKernel.TaskStatus.StartPending || n === l.DownloadKernel.TaskStatus.StopPending || n === l.DownloadKernel.TaskStatus.DestroyPending) break;
                    let i = y.getTaskFromTaskId(e.taskId);
                    if (yield m.SingleBtTaskNS.isSingleBtTask(i)) {
                        let e = m.SingleBtTaskNS.getSinleBtTaskFilePath(i);
                        t = yield s.FileSystemAWNS.existsAW(e)
                    } else {
                        let n = e.savePath, i = e.taskName;
                        void 0 !== i && i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1));
                        let r = a.join(n, i), u = e.taskType;
                        if (u === l.DownloadKernel.TaskType.Bt) {
                            if ("" === i) {
                                t = yield s.FileSystemAWNS.existsAW(n);
                                break
                            }
                            t = yield s.FileSystemAWNS.existsAW(r)
                        } else u === l.DownloadKernel.TaskType.Group ? (t = yield s.FileSystemAWNS.existsAW(n)) && (t = yield o(e)) : t = yield s.FileSystemAWNS.existsAW(r)
                    }
                } while (0);
                return t
            })
        }

        e.getUsrInfoAw = t, e.getUserLoginInfo = function () {
            return i(this, void 0, void 0, function* () {
                let e = yield t("sessionid"), n = yield t("userid");
                return null === e || void 0 === e || "" === e ? "" : "/ssessionid " + e + " /suserid " + n
            })
        }, e.redownloadTask = function (e, t, a) {
            return i(this, void 0, void 0, function* () {
                if (void 0 === t) if (1 === e.length) {
                    let n = e[0].taskStatus;
                    t = n === l.DownloadKernel.TaskStatus.Succeeded || n === l.DownloadKernel.TaskStatus.Seeding ? yield r(e[0]) : n !== l.DownloadKernel.TaskStatus.Failed
                } else t = !0;
                let o = "mypc";
                if (-1 !== g.default.getCurrentCategoryId() && (o = "private"), t) {
                    let t = !1;
                    1 === e.length && e[0].taskType === l.DownloadKernel.TaskType.P2sp && (t = !0), d.MessageBox.confirm({
                        title: "重新下载会删除本地的文件，确定要重新下载吗？",
                        type: d.MessageBox.ConfirmType.Info,
                        checkboxEnabled: t,
                        checkboxChecked: !1,
                        checkboxLabel: "从原始地址重新下载"
                    }).then(t => i(this, void 0, void 0, function* () {
                        if (t.action === c.MessageBoxNS.Action.OK) {
                            if (void 0 !== a) {
                                let e = "";
                                e = void 0 !== t.checkboxChecked && t.checkboxChecked ? `panel_type=${o},button=origin` : `panel_type=${o},button=reload`, h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                            }
                            for (let i of e) {
                                let e = {
                                    taskBaseInfo: {
                                        savePath: void 0,
                                        taskName: void 0,
                                        productInfo: n(""),
                                        origin: "re_download"
                                    }, p2spTaskInfo: {url: void 0, useOriginResourceOnly: t.checkboxChecked ? 1 : 0}
                                }, a = yield y.reDownloadTask(i.taskId, e);
                                if (null !== a) {
                                    let e = a.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                                    k.DownloadDispatchNS.startTask(e)
                                }
                            }
                        } else if (void 0 !== a) {
                            let e = "";
                            e = t.action === c.MessageBoxNS.Action.Cancel ? `panel_type=${o},button=cancel` : `panel_type=${o},button=close`, h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                        }
                    })).catch()
                } else for (let t of e) {
                    if (void 0 !== a) {
                        let e = `panel_type=${o}`;
                        h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                    }
                    let e = {
                        taskBaseInfo: {
                            savePath: void 0,
                            taskName: void 0,
                            productInfo: n(""),
                            origin: "re_download"
                        }, p2spTaskInfo: {url: void 0, useOriginResourceOnly: 0}
                    }, i = yield y.reDownloadTask(t.taskId, e);
                    if (null !== i) {
                        let e = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        k.DownloadDispatchNS.startTask(e)
                    }
                }
            })
        }, e.constructProductInfo = n, e.isExistTaskFile = o, e.canOpenSelectedTaskFolder = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let n = e.taskStatus;
                    if (n === l.DownloadKernel.TaskStatus.StartPending || n === l.DownloadKernel.TaskStatus.StopPending || n === l.DownloadKernel.TaskStatus.DestroyPending) break;
                    let i = y.getTaskFromTaskId(e.taskId);
                    if (yield m.SingleBtTaskNS.isSingleBtTask(i)) t = yield s.FileSystemAWNS.existsAW(e.savePath); else {
                        let n = e.savePath, i = e.taskName, o = e.taskType, r = a.join(n, i);
                        if (o === l.DownloadKernel.TaskType.Bt) {
                            if ("" === i) {
                                t = yield s.FileSystemAWNS.existsAW(n);
                                break
                            }
                            t = yield s.FileSystemAWNS.existsAW(r)
                        } else l.DownloadKernel.TaskType.Group, t = yield s.FileSystemAWNS.existsAW(n)
                    }
                } while (0);
                return t
            })
        }, e.canOpenSelectedTaskFile = r, e.getBtExistFilePathList = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = [];
                do {
                    let o = a.join(e, t.title);
                    if (!(yield s.FileSystemAWNS.existsAW(o))) break;
                    let r = t.fileLists;
                    for (let e = 0; e < r.length; e++) {
                        let t = r[e];
                        if (-1 !== n.indexOf(t.realIndex)) {
                            let e = a.join(t.filePath, t.fileName), n = a.join(o, e);
                            (yield s.FileSystemAWNS.existsAW(n)) && i.push({
                                fullPath: n,
                                index: t.realIndex,
                                relativePath: e
                            })
                        }
                    }
                } while (0);
                return i
            })
        }, e.getSavePathByFileName = function (e, t) {
            let n = "";
            do {
                if (void 0 === e || null === e) break;
                let i = y.getTaskFromTaskId(e);
                i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskType) === l.DownloadKernel.TaskType.Group && (n = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), n = a.join(n, t), T.information("getSavePathByFileName:", n, t))
            } while (0);
            return n
        }
    }(t.TaskCtrlOperatorNS || (t.TaskCtrlOperatorNS = {}))
}, function (e, t) {
    (function () {
        var t, n, i, a, o, r, s = [].slice, l = {}.hasOwnProperty;
        t = function () {
            var e, t, n, i, o, r;
            if (r = arguments[0], o = 2 <= arguments.length ? s.call(arguments, 1) : [], a(Object.assign)) Object.assign.apply(null, arguments); else for (e = 0, n = o.length; e < n; e++) if (null != (i = o[e])) for (t in i) l.call(i, t) && (r[t] = i[t]);
            return r
        }, a = function (e) {
            return !!e && "[object Function]" === Object.prototype.toString.call(e)
        }, o = function (e) {
            var t;
            return !!e && ("function" == (t = typeof e) || "object" === t)
        }, n = function (e) {
            return a(Array.isArray) ? Array.isArray(e) : "[object Array]" === Object.prototype.toString.call(e)
        }, i = function (e) {
            var t;
            if (n(e)) return !e.length;
            for (t in e) if (l.call(e, t)) return !1;
            return !0
        }, r = function (e) {
            var t, n;
            return o(e) && (n = Object.getPrototypeOf(e)) && (t = n.constructor) && "function" == typeof t && t instanceof t && Function.prototype.toString.call(t) === Function.prototype.toString.call(Object)
        }, e.exports.assign = t, e.exports.isFunction = a, e.exports.isObject = o, e.exports.isArray = n, e.exports.isEmpty = i, e.exports.isPlainObject = r
    }).call(this)
}, , , function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(91), a = n.n(i), o = n(39), r = n.n(o), s = /%[sdj%]/g, l = function () {
    };

    function u() {
        for (var e = arguments.length, t = Array(e), n = 0; n < e; n++) t[n] = arguments[n];
        var i = 1, a = t[0], o = t.length;
        if ("function" == typeof a) return a.apply(null, t.slice(1));
        if ("string" == typeof a) {
            for (var r = String(a).replace(s, function (e) {
                if ("%%" === e) return "%";
                if (i >= o) return e;
                switch (e) {
                    case"%s":
                        return String(t[i++]);
                    case"%d":
                        return Number(t[i++]);
                    case"%j":
                        try {
                            return JSON.stringify(t[i++])
                        } catch (e) {
                            return "[Circular]"
                        }
                        break;
                    default:
                        return e
                }
            }), l = t[i]; i < o; l = t[++i]) r += " " + l;
            return r
        }
        return a
    }

    function d(e, t) {
        return void 0 === e || null === e || (!("array" !== t || !Array.isArray(e) || e.length) || !(!function (e) {
            return "string" === e || "url" === e || "hex" === e || "email" === e || "pattern" === e
        }(t) || "string" != typeof e || e))
    }

    function c(e, t, n) {
        var i = 0, a = e.length;
        !function o(r) {
            if (r && r.length) n(r); else {
                var s = i;
                i += 1, s < a ? t(e[s], o) : n([])
            }
        }([])
    }

    function h(e, t, n, i) {
        if (t.first) return c(function (e) {
            var t = [];
            return Object.keys(e).forEach(function (n) {
                t.push.apply(t, e[n])
            }), t
        }(e), n, i);
        var a = t.firstFields || [];
        !0 === a && (a = Object.keys(e));
        var o = Object.keys(e), r = o.length, s = 0, l = [], u = function (e) {
            l.push.apply(l, e), ++s === r && i(l)
        };
        o.forEach(function (t) {
            var i = e[t];
            -1 !== a.indexOf(t) ? c(i, n, u) : function (e, t, n) {
                var i = [], a = 0, o = e.length;

                function r(e) {
                    i.push.apply(i, e), ++a === o && n(i)
                }

                e.forEach(function (e) {
                    t(e, r)
                })
            }(i, n, u)
        })
    }

    function f(e) {
        return function (t) {
            return t && t.message ? (t.field = t.field || e.fullField, t) : {message: t, field: t.field || e.fullField}
        }
    }

    function p(e, t) {
        if (t) for (var n in t) if (t.hasOwnProperty(n)) {
            var i = t[n];
            "object" === (void 0 === i ? "undefined" : r()(i)) && "object" === r()(e[n]) ? e[n] = a()({}, e[n], i) : e[n] = i
        }
        return e
    }

    var g = function (e, t, n, i, a, o) {
        !e.required || n.hasOwnProperty(e.field) && !d(t, o || e.type) || i.push(u(a.messages.required, e.fullField))
    };
    var k = function (e, t, n, i, a) {
        (/^\s+$/.test(t) || "" === t) && i.push(u(a.messages.whitespace, e.fullField))
    }, m = {
        email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
        url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"),
        hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
    }, T = {
        integer: function (e) {
            return T.number(e) && parseInt(e, 10) === e
        }, float: function (e) {
            return T.number(e) && !T.integer(e)
        }, array: function (e) {
            return Array.isArray(e)
        }, regexp: function (e) {
            if (e instanceof RegExp) return !0;
            try {
                return !!new RegExp(e)
            } catch (e) {
                return !1
            }
        }, date: function (e) {
            return "function" == typeof e.getTime && "function" == typeof e.getMonth && "function" == typeof e.getYear
        }, number: function (e) {
            return !isNaN(e) && "number" == typeof e
        }, object: function (e) {
            return "object" === (void 0 === e ? "undefined" : r()(e)) && !T.array(e)
        }, method: function (e) {
            return "function" == typeof e
        }, email: function (e) {
            return "string" == typeof e && !!e.match(m.email) && e.length < 255
        }, url: function (e) {
            return "string" == typeof e && !!e.match(m.url)
        }, hex: function (e) {
            return "string" == typeof e && !!e.match(m.hex)
        }
    };
    var v = "enum";
    var y = {
        required: g, whitespace: k, type: function (e, t, n, i, a) {
            if (e.required && void 0 === t) g(e, t, n, i, a); else {
                var o = e.type;
                ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"].indexOf(o) > -1 ? T[o](t) || i.push(u(a.messages.types[o], e.fullField, e.type)) : o && (void 0 === t ? "undefined" : r()(t)) !== e.type && i.push(u(a.messages.types[o], e.fullField, e.type))
            }
        }, range: function (e, t, n, i, a) {
            var o = "number" == typeof e.len, r = "number" == typeof e.min, s = "number" == typeof e.max, l = t,
                d = null, c = "number" == typeof t, h = "string" == typeof t, f = Array.isArray(t);
            if (c ? d = "number" : h ? d = "string" : f && (d = "array"), !d) return !1;
            f && (l = t.length), h && (l = t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_").length), o ? l !== e.len && i.push(u(a.messages[d].len, e.fullField, e.len)) : r && !s && l < e.min ? i.push(u(a.messages[d].min, e.fullField, e.min)) : s && !r && l > e.max ? i.push(u(a.messages[d].max, e.fullField, e.max)) : r && s && (l < e.min || l > e.max) && i.push(u(a.messages[d].range, e.fullField, e.min, e.max))
        }, enum: function (e, t, n, i, a) {
            e[v] = Array.isArray(e[v]) ? e[v] : [], -1 === e[v].indexOf(t) && i.push(u(a.messages[v], e.fullField, e[v].join(", ")))
        }, pattern: function (e, t, n, i, a) {
            e.pattern && (e.pattern instanceof RegExp ? (e.pattern.lastIndex = 0, e.pattern.test(t) || i.push(u(a.messages.pattern.mismatch, e.fullField, t, e.pattern))) : "string" == typeof e.pattern && (new RegExp(e.pattern).test(t) || i.push(u(a.messages.pattern.mismatch, e.fullField, t, e.pattern))))
        }
    };
    var S = "enum";
    var w = function (e, t, n, i, a) {
        var o = e.type, r = [];
        if (e.required || !e.required && i.hasOwnProperty(e.field)) {
            if (d(t, o) && !e.required) return n();
            y.required(e, t, i, r, a, o), d(t, o) || y.type(e, t, i, r, a)
        }
        n(r)
    }, b = {
        string: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t, "string") && !e.required) return n();
                y.required(e, t, i, o, a, "string"), d(t, "string") || (y.type(e, t, i, o, a), y.range(e, t, i, o, a), y.pattern(e, t, i, o, a), !0 === e.whitespace && y.whitespace(e, t, i, o, a))
            }
            n(o)
        }, method: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                y.required(e, t, i, o, a), void 0 !== t && y.type(e, t, i, o, a)
            }
            n(o)
        }, number: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                y.required(e, t, i, o, a), void 0 !== t && (y.type(e, t, i, o, a), y.range(e, t, i, o, a))
            }
            n(o)
        }, boolean: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                y.required(e, t, i, o, a), void 0 !== t && y.type(e, t, i, o, a)
            }
            n(o)
        }, regexp: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                y.required(e, t, i, o, a), d(t) || y.type(e, t, i, o, a)
            }
            n(o)
        }, integer: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                y.required(e, t, i, o, a), void 0 !== t && (y.type(e, t, i, o, a), y.range(e, t, i, o, a))
            }
            n(o)
        }, float: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                y.required(e, t, i, o, a), void 0 !== t && (y.type(e, t, i, o, a), y.range(e, t, i, o, a))
            }
            n(o)
        }, array: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t, "array") && !e.required) return n();
                y.required(e, t, i, o, a, "array"), d(t, "array") || (y.type(e, t, i, o, a), y.range(e, t, i, o, a))
            }
            n(o)
        }, object: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                y.required(e, t, i, o, a), void 0 !== t && y.type(e, t, i, o, a)
            }
            n(o)
        }, enum: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                y.required(e, t, i, o, a), t && y[S](e, t, i, o, a)
            }
            n(o)
        }, pattern: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t, "string") && !e.required) return n();
                y.required(e, t, i, o, a), d(t, "string") || y.pattern(e, t, i, o, a)
            }
            n(o)
        }, date: function (e, t, n, i, a) {
            var o = [];
            if (e.required || !e.required && i.hasOwnProperty(e.field)) {
                if (d(t) && !e.required) return n();
                if (y.required(e, t, i, o, a), !d(t)) {
                    var r = void 0;
                    r = "number" == typeof t ? new Date(t) : t, y.type(e, r, i, o, a), r && y.range(e, r.getTime(), i, o, a)
                }
            }
            n(o)
        }, url: w, hex: w, email: w, required: function (e, t, n, i, a) {
            var o = [], s = Array.isArray(t) ? "array" : void 0 === t ? "undefined" : r()(t);
            y.required(e, t, i, o, a, s), n(o)
        }
    };

    function C() {
        return {
            default: "Validation error on field %s",
            required: "%s is required",
            enum: "%s must be one of %s",
            whitespace: "%s cannot be empty",
            date: {
                format: "%s date %s is invalid for format %s",
                parse: "%s date could not be parsed, %s is invalid ",
                invalid: "%s date %s is invalid"
            },
            types: {
                string: "%s is not a %s",
                method: "%s is not a %s (function)",
                array: "%s is not an %s",
                object: "%s is not an %s",
                number: "%s is not a %s",
                date: "%s is not a %s",
                boolean: "%s is not a %s",
                integer: "%s is not an %s",
                float: "%s is not a %s",
                regexp: "%s is not a valid %s",
                email: "%s is not a valid %s",
                url: "%s is not a valid %s",
                hex: "%s is not a valid %s"
            },
            string: {
                len: "%s must be exactly %s characters",
                min: "%s must be at least %s characters",
                max: "%s cannot be longer than %s characters",
                range: "%s must be between %s and %s characters"
            },
            number: {
                len: "%s must equal %s",
                min: "%s cannot be less than %s",
                max: "%s cannot be greater than %s",
                range: "%s must be between %s and %s"
            },
            array: {
                len: "%s must be exactly %s in length",
                min: "%s cannot be less than %s in length",
                max: "%s cannot be greater than %s in length",
                range: "%s must be between %s and %s in length"
            },
            pattern: {mismatch: "%s value %s does not match pattern %s"},
            clone: function () {
                var e = JSON.parse(JSON.stringify(this));
                return e.clone = this.clone, e
            }
        }
    }

    var N = C();

    function D(e) {
        this.rules = null, this._messages = N, this.define(e)
    }

    D.prototype = {
        messages: function (e) {
            return e && (this._messages = p(C(), e)), this._messages
        }, define: function (e) {
            if (!e) throw new Error("Cannot configure a schema with no rules");
            if ("object" !== (void 0 === e ? "undefined" : r()(e)) || Array.isArray(e)) throw new Error("Rules must be an object");
            this.rules = {};
            var t = void 0, n = void 0;
            for (t in e) e.hasOwnProperty(t) && (n = e[t], this.rules[t] = Array.isArray(n) ? n : [n])
        }, validate: function (e) {
            var t = this, n = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, i = arguments[2],
                o = e, s = n, d = i;
            if ("function" == typeof s && (d = s, s = {}), this.rules && 0 !== Object.keys(this.rules).length) {
                if (s.messages) {
                    var c = this.messages();
                    c === N && (c = C()), p(c, s.messages), s.messages = c
                } else s.messages = this.messages();
                var g = void 0, k = void 0, m = {};
                (s.keys || Object.keys(this.rules)).forEach(function (n) {
                    g = t.rules[n], k = o[n], g.forEach(function (i) {
                        var r = i;
                        "function" == typeof r.transform && (o === e && (o = a()({}, o)), k = o[n] = r.transform(k)), (r = "function" == typeof r ? {validator: r} : a()({}, r)).validator = t.getValidationMethod(r), r.field = n, r.fullField = r.fullField || n, r.type = t.getType(r), r.validator && (m[n] = m[n] || [], m[n].push({
                            rule: r,
                            value: k,
                            source: o,
                            field: n
                        }))
                    })
                });
                var T = {};
                h(m, s, function (e, t) {
                    var n = e.rule,
                        i = !("object" !== n.type && "array" !== n.type || "object" !== r()(n.fields) && "object" !== r()(n.defaultField));

                    function o(e, t) {
                        return a()({}, t, {fullField: n.fullField + "." + e})
                    }

                    function d() {
                        var r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
                        if (Array.isArray(r) || (r = [r]), r.length && l("async-validator:", r), r.length && n.message && (r = [].concat(n.message)), r = r.map(f(n)), s.first && r.length) return T[n.field] = 1, t(r);
                        if (i) {
                            if (n.required && !e.value) return r = n.message ? [].concat(n.message).map(f(n)) : s.error ? [s.error(n, u(s.messages.required, n.field))] : [], t(r);
                            var d = {};
                            if (n.defaultField) for (var c in e.value) e.value.hasOwnProperty(c) && (d[c] = n.defaultField);
                            for (var h in d = a()({}, d, e.rule.fields)) if (d.hasOwnProperty(h)) {
                                var p = Array.isArray(d[h]) ? d[h] : [d[h]];
                                d[h] = p.map(o.bind(null, h))
                            }
                            var g = new D(d);
                            g.messages(s.messages), e.rule.options && (e.rule.options.messages = s.messages, e.rule.options.error = s.error), g.validate(e.value, e.rule.options || s, function (e) {
                                t(e && e.length ? r.concat(e) : e)
                            })
                        } else t(r)
                    }

                    i = i && (n.required || !n.required && e.value), n.field = e.field;
                    var c = n.validator(n, e.value, d, e.source, s);
                    c && c.then && c.then(function () {
                        return d()
                    }, function (e) {
                        return d(e)
                    })
                }, function (e) {
                    !function (e) {
                        var t, n = void 0, i = void 0, a = [], o = {};
                        for (n = 0; n < e.length; n++) t = e[n], Array.isArray(t) ? a = a.concat.apply(a, t) : a.push(t);
                        if (a.length) for (n = 0; n < a.length; n++) o[i = a[n].field] = o[i] || [], o[i].push(a[n]); else a = null, o = null;
                        d(a, o)
                    }(e)
                })
            } else d && d()
        }, getType: function (e) {
            if (void 0 === e.type && e.pattern instanceof RegExp && (e.type = "pattern"), "function" != typeof e.validator && e.type && !b.hasOwnProperty(e.type)) throw new Error(u("Unknown rule type %s", e.type));
            return e.type || "string"
        }, getValidationMethod: function (e) {
            if ("function" == typeof e.validator) return e.validator;
            var t = Object.keys(e), n = t.indexOf("message");
            return -1 !== n && t.splice(n, 1), 1 === t.length && "required" === t[0] ? b.required : b[this.getType(e)] || !1
        }
    }, D.register = function (e, t) {
        if ("function" != typeof t) throw new Error("Cannot register a validator by type, validator is not a function");
        b[e] = t
    }, D.messages = N;
    t.default = D
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(243), a = n(94), o = n(26), r = n(45), s = n(1).default.getLogger("Thunder.shub-http.shub-crypto");
    !function (e) {
        function t(e) {
            let t = o.createHash("md5");
            return t.update(e), t.digest()
        }

        e.encryptHttpBuffer = function (e) {
            if (0 !== e.readUInt16LE(16)) {
                let t = i.Buffer.alloc(20);
                e.copy(t, 0, 0, 20);
                let n = i.Buffer.alloc(e.length - 20);
                e.copy(n, 0, 20);
                let o = a.deflateSync(n);
                e = i.Buffer.concat([t, o])
            }
            let n = i.Buffer.alloc(8);
            e.copy(n, 0, 0, 7), n = t(n);
            let o = i.Buffer.alloc(12);
            e.copy(o, 0, 0, 11);
            let s = i.Buffer.alloc(e.length - 12);
            e.copy(s, 0, 12), s = r.ToolsUtilitiesAWNS.encryptBuffer(s, n);
            let l = i.Buffer.concat([o, s]);
            return l.writeUInt32LE(s.length, 8), l
        }, e.decryptHttpBuffer = function (e) {
            let n = null;
            try {
                let o = i.Buffer.alloc(8);
                e.copy(o, 0, 0, 7), o = t(o);
                let l = i.Buffer.alloc(12);
                e.copy(l, 0, 0, 11);
                let u = i.Buffer.alloc(e.length - 12);
                if (e.copy(u, 0, 12), u = r.ToolsUtilitiesAWNS.decryptBuffer(u, o), 0 !== (n = i.Buffer.concat([l, u])).readUInt16LE(16)) {
                    let e = i.Buffer.alloc(20);
                    n.copy(e, 0, 0, 20);
                    let t = i.Buffer.alloc(n.length - 20);
                    n.copy(t, 0, 20);
                    let o = a.inflateSync(t);
                    n = i.Buffer.concat([e, o])
                }
            } catch (e) {
                s.error("decryptHttpBuffer", e)
            }
            return n
        }
    }(t.ShubCryptoNS || (t.ShubCryptoNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(5).default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.writeUInt64LE = function (e, t, n) {
            const i = ~~(t / 4294967295), a = t % 4294967295 - i;
            return n = e.writeUInt32LE(a, n), n = e.writeUInt32LE(i, n)
        }, e.writeString = function (e, t, n, i) {
            let o = null;
            if ("gbk" === i) {
                let e = 936, n = a.utf8StringEncodeToBinary(t, e);
                o = Buffer.from(n, "binary")
            } else o = Buffer.from(t, i);
            return (n = e.writeUInt32LE(o.byteLength, n)) + o.copy(e, n, 0)
        }, e.readUInt64LE = function (e, t) {
            let n = e.readUInt32LE(t);
            t += 4;
            let i = e.readUInt32LE(t);
            return [t += 4, i * Math.pow(2, 32) + n]
        }, e.readString = function (e, t, n) {
            let i = e.readUInt32LE(t);
            t += 4;
            let o = void 0;
            if ("gbk" === n) {
                let n = 936, r = e.toString("binary", t, t + i);
                o = a.utf8StringDecodeFromBinary(r, n)
            } else o = e.toString(n, t, t + i);
            return [t += i, o]
        }
    }(t.BufferUtilitiesNS || (t.BufferUtilitiesNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(550), o = n(9), r = n(2), s = n(1).default.getLogger("Thunder.base.unzip-utilities"),
        l = n(5).default(r.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1, a = yield function (e) {
                    return i(this, void 0, void 0, function* () {
                        let t = null;
                        if (null !== e) try {
                            t = yield e.async("nodebuffer")
                        } catch (e) {
                            s.warning(e)
                        }
                        return t
                    })
                }(t);
                return null !== a && (n = yield o.FileSystemAWNS.writeFileAW(e, a)), n
            })
        }

        function n(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !0;
                if (null !== t) {
                    (yield o.FileSystemAWNS.existsAW(e)) || (n = yield o.FileSystemAWNS.mkdirAW(e))
                }
                return n
            })
        }

        e.uncompressZipFileEx = function (e, l) {
            return i(this, void 0, void 0, function* () {
                let u = !1;
                if (void 0 !== e && void 0 !== l) {
                    let d = new a, c = yield o.FileSystemAWNS.readFileAW(l);
                    if (null !== c && c.length > 0 && null !== d) {
                        let a = yield function (e, t) {
                            return i(this, void 0, void 0, function* () {
                                let n = null;
                                try {
                                    n = yield e.loadAsync(t)
                                } catch (e) {
                                    s.warning(e)
                                }
                                return n
                            })
                        }(d, c);
                        null !== a && null !== a.files && (u = yield function (e, a, l) {
                            return i(this, arguments, void 0, function* () {
                                s.information("extractFiles", arguments);
                                let i = !1, u = yield o.FileSystemAWNS.existsAW(l), d = u;
                                if (s.information("exsitStatus", u), s.information("mkStatus", d), u || (d = yield o.FileSystemAWNS.mkdirAW(l)), d) {
                                    let u = Object.keys(a), d = !0;
                                    for (let i = 0; i < u.length; i++) {
                                        let a = u[i], c = `${l}` + a, h = e.file(a);
                                        if (s.information(r.dirname(r.join(l, a))), yield o.FileSystemAWNS.mkdirsAW(r.dirname(r.join(l, a))), null !== h) {
                                            if (!(d = yield t(c, h))) {
                                                s.warning("write file failure");
                                                break
                                            }
                                        } else if (!(d = yield n(c, e.folder(a)))) {
                                            s.warning("write folder failure");
                                            break
                                        }
                                    }
                                    d && (i = !0)
                                }
                                return i
                            })
                        }(d, a.files, e))
                    }
                }
                return u
            })
        }, e.uncompressZipFile = function (e, t) {
            return i(this, void 0, void 0, function* () {
                return new Promise(n => {
                    l.asyncUnZipFile(t, e, e => {
                        n(e)
                    })
                })
            })
        }
    }(t.UnzipUtilitiesAWNS || (t.UnzipUtilitiesAWNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(60), r = n(9), s = n(790), l = n(791),
        u = n(1).default.getLogger("Thunder.VipDownload.config");
    var d;
    !function (e) {
        e.configGet = "OnConfigGet"
    }(d = t.ConfigEventNS || (t.ConfigEventNS = {}));

    class c extends o.default {
        constructor() {
            super(...arguments), this.mSavePath = void 0, this.mConfig = new l.Config
        }

        init() {
            return i(this, void 0, void 0, function* () {
                this.setMaxListeners(0), this.config.init();
                let e = yield this.downloadConfig();
                e && (e = yield this.config.loadFile(this.savePath)), u.information("config init", "result", e), this.config.printConfigData(), this.fireEvent(d.configGet), yield r.FileSystemAWNS.unlinkAW(this.savePath)
            })
        }

        getValue(e, t) {
            return this.config.getValue(e, t)
        }

        downloadConfig() {
            return i(this, void 0, void 0, function* () {
                let e = yield r.FileSystemAWNS.existsAW(this.saveDir);
                return e || (e = yield r.FileSystemAWNS.mkdirsAW(this.saveDir)), e && (e = yield s.FileDownloadNS.downloadFile("http://media.info.client.xunlei.com/VipDownloadConfig.json", this.savePath)), e
            })
        }

        get config() {
            return this.mConfig
        }

        get savePath() {
            return this.mSavePath || (this.mSavePath = a.join(this.saveDir, "config.json")), this.mSavePath
        }

        get saveDir() {
            return a.join(__profilesDir, "VipDownload/")
        }
    }

    t.ConfigHelper = c, function (e) {
        const t = new c;
        e.getHelper = function () {
            return t
        }
    }(t.ConfigHelperNS || (t.ConfigHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(60);
    !function (e) {
        e.taskAcclerateStatusChanged = "OnTaskAcclerateStatusChanged", e.vipTaskInfoChanged = "OnVipTaskInfoChanged", e.taskTryDetailChanged = "OnTaskTryDetailChanged", e.btSubFileForbidden = "OnBtSubFileForbidden", e.taskExpand = "OnTaskExpand", e.totalAcclerateStatusChanged = "OnTotalAcclerateStatusChanged"
    }(t.TaskEventNS || (t.TaskEventNS = {}));

    class a extends i.default {
        constructor() {
            super(), this.setMaxListeners(0)
        }

        onEvent(e, ...t) {
            this.fireEvent(e, ...t)
        }
    }

    t.TaskEventContainer = a, function (e) {
        const t = new a;
        e.getEventContainer = function () {
            return t
        }
    }(t.TaskEventContainerNS || (t.TaskEventContainerNS = {}))
}, function (e, t, n) {
    e.exports = n(12)(129)
}, function (e, t, n) {
    e.exports = n(12)(66)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(6), o = n(21);
    !function (e) {
        e.getValue = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                return new Promise(i => {
                    a.NativeCallModule.nativeCall.CallNativeFunction("GetConfigValue", e, t, n, (e, t) => {
                        e === o.NativeFunctionErrorCode.Success ? i(t) : i(n)
                    })
                })
            })
        }, e.setValue = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                return new Promise((i, r) => {
                    a.NativeCallModule.nativeCall.CallNativeFunction("SetConfigValue", e, t, n, e => {
                        e === o.NativeFunctionErrorCode.Success ? i() : r(new Error("SetConfigValue error"))
                    })
                })
            })
        }
    }(t.ConfigHelperNS || (t.ConfigHelperNS = {}))
}, function (e, t, n) {
    var i = n(81), a = n(142), o = n(577), r = n(108), s = n(88), l = function (e, t, n) {
        var u, d, c, h = e & l.F, f = e & l.G, p = e & l.S, g = e & l.P, k = e & l.B, m = e & l.W,
            T = f ? a : a[t] || (a[t] = {}), v = T.prototype, y = f ? i : p ? i[t] : (i[t] || {}).prototype;
        for (u in f && (n = t), n) (d = !h && y && void 0 !== y[u]) && s(T, u) || (c = d ? y[u] : n[u], T[u] = f && "function" != typeof y[u] ? n[u] : k && d ? o(c, i) : m && y[u] == c ? function (e) {
            var t = function (t, n, i) {
                if (this instanceof e) {
                    switch (arguments.length) {
                        case 0:
                            return new e;
                        case 1:
                            return new e(t);
                        case 2:
                            return new e(t, n)
                    }
                    return new e(t, n, i)
                }
                return e.apply(this, arguments)
            };
            return t.prototype = e.prototype, t
        }(c) : g && "function" == typeof c ? o(Function.call, c) : c, g && ((T.virtual || (T.virtual = {}))[u] = c, e & l.R && v && !v[u] && r(v, u, c)))
    };
    l.F = 1, l.G = 2, l.S = 4, l.P = 8, l.B = 16, l.W = 32, l.U = 64, l.R = 128, e.exports = l
}, function (e, t, n) {
    var i = n(143);
    e.exports = function (e, t) {
        if (!i(e)) return e;
        var n, a;
        if (t && "function" == typeof(n = e.toString) && !i(a = n.call(e))) return a;
        if ("function" == typeof(n = e.valueOf) && !i(a = n.call(e))) return a;
        if (!t && "function" == typeof(n = e.toString) && !i(a = n.call(e))) return a;
        throw TypeError("Can't convert object to primitive value")
    }
}, function (e, t) {
    e.exports = function (e) {
        if (void 0 == e) throw TypeError("Can't call method on  " + e);
        return e
    }
}, function (e, t) {
    var n = Math.ceil, i = Math.floor;
    e.exports = function (e) {
        return isNaN(e = +e) ? 0 : (e > 0 ? i : n)(e)
    }
}, function (e, t, n) {
    var i = n(219)("keys"), a = n(164);
    e.exports = function (e) {
        return i[e] || (i[e] = a(e))
    }
}, function (e, t, n) {
    var i = n(142), a = n(81), o = a["__core-js_shared__"] || (a["__core-js_shared__"] = {});
    (e.exports = function (e, t) {
        return o[e] || (o[e] = void 0 !== t ? t : {})
    })("versions", []).push({
        version: i.version,
        mode: n(163) ? "pure" : "global",
        copyright: "© 2018 Denis Pushkarev (zloirock.ru)"
    })
}, function (e, t) {
    e.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")
}, function (e, t) {
    t.f = Object.getOwnPropertySymbols
}, function (e, t) {
    e.exports = {}
}, function (e, t, n) {
    var i = n(109).f, a = n(88), o = n(112)("toStringTag");
    e.exports = function (e, t, n) {
        e && !a(e = n ? e : e.prototype, o) && i(e, o, {configurable: !0, value: t})
    }
}, function (e, t, n) {
    t.f = n(112)
}, function (e, t, n) {
    var i = n(81), a = n(142), o = n(163), r = n(224), s = n(109).f;
    e.exports = function (e) {
        var t = a.Symbol || (a.Symbol = o ? {} : i.Symbol || {});
        "_" == e.charAt(0) || e in t || s(t, e, {value: r.f(e)})
    }
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement;
        return (this._self._c || e)(this.item.type, {
            tag: "component",
            attrs: {item: this.item, label: this.item.label, formData: this.formData, value: this.value},
            on: {input: this.handleInput}
        })
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {class: this.item.outerClass}, [t("label", {staticClass: "td-textarea"}, [t("textarea", {
            staticClass: "td-textarea__inner",
            class: this.item.classes,
            attrs: {placeholder: this.item.placeholder},
            domProps: {value: this.formData[this.item.name].value},
            on: {change: this.handleChange}
        })])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement;
        return (e._self._c || t)("p", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.item.isReleventUser || e.item.isReleventUser && "" !== e.userId,
                expression: "!item.isReleventUser || (item.isReleventUser && userId !== '')"
            }], class: e.clas, style: e.item.style || ""
        }, [e._v("\n   " + e._s(e.textContent) + "\n ")])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.classes}, [n("p", [e._v("\n    限速时间段：\n    " + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_Begin_Hour"].value)) + ":\n    " + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_Begin_Minute"].value)) + "-" + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_End_Hour"].value)) + ":\n    " + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_End_Minute"].value)) + "\n  ")]), e._v(" "), n("p", [e._v("\n    最大下载速度: " + e._s(e.maxDownloadSpeed) + "   \n    最大上传速度: " + e._s(e.maxUploadSpeed))])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.outerClass}, [n("ul", {class: e.item.ulClasses}, e._l(e.item.option, function (t, i) {
            return n("li", {
                directives: [{
                    name: "show",
                    rawName: "v-show",
                    value: !e.item.isReleventUser || e.item.isReleventUser && "" !== e.userId,
                    expression: "!item.isReleventUser || (item.isReleventUser && userId !== '')"
                }], key: i, class: e.item.classes
            }, [n("td-radio", {
                attrs: {
                    name: e.item.key,
                    value: "" + e.formData[e.item.name].value,
                    label: t,
                    disabled: e.item.disableds && e.item.disableds[i]
                }, on: {input: e.handleInput}
            }, [e._v("\n        " + e._s(e.item.labels[i] || e.lable) + "\n      ")]), e._v(" "), e.item.extEles ? n(e.item.extEles[i].type, {
                tag: "component",
                attrs: {
                    text: e.item.extEles[i].text,
                    item: e.item.extEles[i],
                    label: e.item.extEles[i] && e.item.extEles[i].label,
                    classes: e.item.extEles[i].classes,
                    disabled: e.formData[e.item.name].value !== e.item.extActiveValue,
                    name: e.item.extEles[i].name,
                    value: e.formData[e.item.extEles[i].name],
                    formData: e.formData
                },
                on: {input: e.handleInput}
            }) : e._e()], 1)
        })), e._v(" "), e.item.tip ? n("p", {class: e.item.tipClass}, [e._v("\n    " + e._s(e.item.tip) + "\n  ")]) : e._e()])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.outerClass}, [n("td-checkbox", {
            attrs: {value: !(0 == e.formData[e.item.name].value)},
            on: {input: e.handleInput}
        }, [e._v("\n    " + e._s(e.item.label) + "\n  ")]), e._v(" "), e._l(e.item.extEles, function (t) {
            return [n(t.type, {
                key: t.name,
                tag: "component",
                attrs: {
                    item: t,
                    classes: t.classes,
                    text: t.text,
                    formData: e.formData,
                    name: t.name,
                    disabled: !e.formData[e.item.name].value,
                    value: e.formData[t.name]
                },
                on: {input: e.handleInput}
            })]
        }), e._v(" "), e.item.tip ? n("p", {class: e.item.tipClass}, [e._v("\n    " + e._s(e.item.tip) + "\n  ")]) : e._e()], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.outerClass}, [n("td-button", {
            class: e.classes || e.item.classes,
            style: e.item.style || "",
            attrs: {disabled: e.disabled},
            on: {click: e.popDialog}
        }, [e._v("\n   " + e._s(e.text || e.item.text) + "\n")]), e._v(" "), e._l(e.item.extEles, function (e) {
            return [n(e.type, {
                key: e.name,
                tag: "component",
                style: e.style || "",
                attrs: {item: e, classes: e.classes, text: e.text}
            })]
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            class: e.item.outClasses,
            style: e.item.style
        }, [n("td-tooltip", {
            attrs: {
                content: e.item.toolTipsContent || "",
                visible: e.tooltipVisible,
                placement: "top"
            }
        }, [n("td-input", {
            ref: "input",
            class: e.item.classes,
            attrs: {
                label: e.label || e.item.label,
                value: e.valueData,
                placeholder: e.item.placeholder,
                disabled: e.disabled
            },
            on: {
                input: e.validate,
                change: e.handleChange,
                keydown: e.handleKeyDown,
                keyup: e.handleKeyup,
                blur: e.outFocus
            }
        })], 1), e._v(" "), e._l(e.item.extEles, function (t) {
            return [n(t.type, {
                key: t.name,
                tag: "component",
                attrs: {
                    item: t,
                    classes: t.classes,
                    text: t.text,
                    formData: e.formData,
                    disabled: e.disabled || !e.formData[e.item.name].value,
                    value: e.formData[t.name]
                },
                on: {input: e.handleInput}
            })]
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            class: e.item.outerClass,
            style: e.item.style
        }, ["" !== e.label ? n("span", [e._v("\n    " + e._s(e.label) + "\n  ")]) : e._e(), e._v(" "), n("td-tooltip", {
            attrs: {
                content: e.tipContent,
                visible: e.tooltipVisible,
                placement: "top"
            }
        }, [n("select-native", {
            class: e.classes || e.item.classes,
            attrs: {
                value: e.valueData,
                options: e.optionList || e.item.option,
                placeholder: e.placeHolder || e.formData[e.item.name].value + "",
                editable: e.item.editable,
                type: e.item.selectType,
                disabled: e.disabled
            },
            on: {input: e.validate, blur: e.handleOutFocus, "choose-file": e.selectPath}
        })], 1)], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", [n("td-checkbox", {
            attrs: {value: !(0 == e.formData[e.item.name].value)},
            on: {input: e.handleInput}
        }, [e._v("\n    " + e._s(e.item.label) + "\n  ")]), e._v(" "), e._l(e.item.extEles, function (t, i) {
            return e.item.extEles ? n(t.type, {
                key: i,
                tag: "component",
                attrs: {
                    formData: e.formData,
                    placeHolder: e.formData[t.name] && e.formData[t.name].value,
                    item: t,
                    value: e.formData[t.name],
                    disabled: !(e.formData[e.item.name] && e.formData[e.item.name].value),
                    name: t.name,
                    label: t.label,
                    classes: t.classes,
                    text: t.text
                },
                on: {input: e.handleInput}
            }) : e._e()
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.classes}, [n("td-checkbox", {
            attrs: {value: !(0 == e.formData[e.item.name].value)},
            on: {input: e.handleInput}
        }, [e._v("\n    " + e._s(e.item.label) + "\n  ")]), e._v(" "), e._l(e.item.extEles, function (t, i) {
            return e.item.extEles ? n(t.type, {
                key: i,
                tag: "component",
                attrs: {
                    formData: e.formData,
                    item: t,
                    placeHolder: e.formData[t.name] && e.formData[t.name].value,
                    disabled: !e.formData[e.item.name].value
                },
                on: {input: e.handleInput}
            }) : e._e()
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-dialog-setting__speed-time"}, [n("ul", e._l(e.data, function (t) {
            return n("li", {
                key: t.label,
                staticClass: "xlx-dialog-setting__item"
            }, [n("span", {staticClass: "xlx-dialog-setting__text"}, [e._v(e._s(t.label))]), e._v(" "), e._l(t.options, function (t) {
                return n("div", {
                    key: t.index,
                    staticClass: "xlx-dialog-setting__option"
                }, [n("select-native", {
                    staticClass: "xlx-select-size-1",
                    attrs: {
                        value: e.value[t.index].value.toString(),
                        options: "hour" === t.type ? e.hours : e.minutes,
                        disabled: e.disabled
                    },
                    on: {
                        input: function (n) {
                            return e.handleInput(n, t.index)
                        }
                    }
                }), e._v(" "), n("span", {staticClass: "xlx-dialog-setting__text"}, [e._v(e._s("hour" === t.type ? "时" : "分"))])], 1)
            })], 2)
        }))])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement;
        return (this._self._c || e)("i", {class: this.classes, attrs: {title: this.text}})
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.item.outerClass}, [n("td-slider", {
            attrs: {
                value: e.sliderValue,
                marks: e.item.marks,
                scales: e.item.scales,
                disabled: e.disabled
            }, on: {input: e.handleSliderUpdate}
        }), e._v(" "), n("div", {staticClass: "xlx-dialog-setting__speed-input"}, [n("td-input", {
            ref: "input",
            staticClass: "xlx-setting__input-3",
            attrs: {value: e.value.value, disabled: e.disabled},
            on: {input: e.handleInput, blur: e.handleBlur}
        }), e._v(" "), n("popup", {
            ref: "tooltip",
            staticClass: "td-tooltip",
            attrs: {direction: "top", display: e.tooltipVisible, padding: 10},
            on: {
                "update:display": function (t) {
                    e.tooltipVisible = t
                }
            }
        }, [n("p", {staticClass: "td-tooltip__inner"}, [e._v(e._s(e.tooltip))])]), e._v(" "), n("span", {staticClass: "xlx-setting__text"}, [e._v("KB/s")])], 1)], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t) {
    e.exports = require("buffer")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(21), o = n(2), r = i.remote.require(o.join(__rootDir, "../bin/ThunderHelper.node")), s = 2,
        l = 2, u = 2;
    t.browserSupport = new class {
        constructor() {
            this.browserComponent = void 0, this.browserManager = void 0, this.dpiAwareSupport = !1, this.systemDpiFactor = 0, this.browserParentWndHandle = 0, this.d3dHwnd = 0, this.browserParentWnd = void 0
        }
    };
    let d = n(3).remote.getCurrentWindow();

    function c() {
        let e = 1;
        return e = t.browserSupport.dpiAwareSupport ? r.getMonitorDPIFactor(t.browserSupport.browserParentWndHandle) : t.browserSupport.systemDpiFactor
    }

    function h() {
        return window.document.querySelector(".xlx-client__header").getBoundingClientRect().height
    }

    d.on("ready-to-show", () => {
        do {
            r.setDllDirectory(o.join(__rootDir, "../bin/TBC"));
            const e = i.remote.require(o.join(__rootDir, "../bin/ThunderBrowserSupport.node"));
            let n = r.getPeerID(), s = o.join(__rootDir, "../../Thunder.exe"), l = r.getFileVersion(s),
                u = e.TsBrowserComponent(), c = u.getUserAgent();
            if (n = n || "", l = l || "", c = c || "", !0 !== u.init({
                dataPath: o.join(__rootDir, "../bin/TBC/Data"),
                userAgent: c + " Thunder/" + l,
                enableSandbox: !1,
                productVersion: l,
                peerId: n
            })) break;
            t.browserSupport.browserComponent = u;
            let h = e.TsBrowserManager();
            t.browserSupport.browserManager = h;
            let f = r.getDPIAwareSupport(), p = r.getSysDPIFactor();
            t.browserSupport.dpiAwareSupport = f, t.browserSupport.systemDpiFactor = p;
            let g = d.getNativeWindowHandle().readUIntLE(0, 4);
            t.browserSupport.browserParentWndHandle = g, t.browserSupport.browserParentWnd = d;
            let k = t.browserSupport.browserParentWndHandle, m = r.findChildWindow(k, "Intermediate D3D Window");
            m && (t.browserSupport.d3dHwnd = m, r.setWindowLong(m, a.SetWindowType.GWL_STYLE, a.WindowStyle.WS_CLIPSIBLINGS)), r.setWindowLong(g, a.SetWindowType.GWL_STYLE, a.WindowStyle.WS_CLIPCHILDREN)
        } while (0)
    }), t.resizeBrowserWindow = function (e) {
        let n = !1;
        {
            let i = h(), o = t.browserSupport.browserParentWnd.getContentSize(), d = c();
            r.setWindowPos(e, a.OptionOfhwndInAfter.HWND_TOP, s * d, i * d, (o[0] - s - l) * d, (o[1] - i - u) * d, a.Uflags.SWP_SHOWWINDOW), n = !0
        }
        return n
    }, t.getBrowserWindowRect = function () {
        let e = {x: 0, y: 0, width: 0, height: 0}, n = t.browserSupport.browserParentWnd.getContentSize(), i = h(),
            a = c();
        return e.x = s * a, e.y = i * a, e.width = (n[0] - s - l) * a, e.height = (n[1] - i - u) * a, e
    }, t.getHeaderHeight = h
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(795), o = n(558), r = n(60), s = n(79), l = n(209), u = n(1).default.getLogger("Thunder.KuaiNiao"),
        d = s.UserHelperNS.getHelper(), c = l.ConfigHelperNS.getHelper();
    var h;
    !function (e) {
        e.statusChanged = "OnStatusChanged"
    }(h = t.KuainiaoEventNS || (t.KuainiaoEventNS = {}));

    class f extends r.default {
        constructor() {
            super(...arguments), this.mServerIp = void 0, this.mServerPort = void 0, this.mCanUpgrade = void 0, this.mDialAccount = void 0, this.mSession = new a.KuainiaoHttpSession, this.mHeartBeatTimer = null, this.mLoseHeartBeatCount = 0, this.mRetrySpeedUpCount = 0, this.mType = o.KuaiNiaoDefineNS.KuaiNiaoType.Try, this.mStatus = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Unkown, this.mAlived = !1, this.mTriggerTry = !1, this.mTryTimer = null, this.mDuration = void 0, this.mUserId = "0", this.mSessionId = "0"
        }

        init() {
            this.setMaxListeners(0), this.query().then(e => i(this, void 0, void 0, function* () {
                this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Init, yield this.checkAcclerate()
            })).catch(), d.attachListener(s.UserEventNS.login, () => i(this, void 0, void 0, function* () {
                yield this.onLogin()
            })), d.attachListener(s.UserEventNS.logout, () => i(this, void 0, void 0, function* () {
                yield this.onLogout()
            }))
        }

        clear() {
            this.mLoseHeartBeatCount = 0, this.mRetrySpeedUpCount = 0, this.mAlived = !1, this.mTriggerTry = !1, this.mDuration = void 0
        }

        enter() {
            return i(this, void 0, void 0, function* () {
                u.information("enter");
                let e = !1;
                return this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Commiting, e = yield this.commit(), this.isEnter && (this.status = e ? o.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive : o.KuaiNiaoDefineNS.KuaiNiaoStatus.Failed), e
            })
        }

        exit() {
            return i(this, void 0, void 0, function* () {
                u.information("exit"), this.killHeartBeatTimer(), this.killTryTimer(), this.status !== o.KuaiNiaoDefineNS.KuaiNiaoStatus.Commiting && this.status !== o.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive || (yield this.unAcclerate()), this.clear(), this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Init
            })
        }

        triggerTry() {
            return i(this, void 0, void 0, function* () {
                if (!this.mCanUpgrade) return u.information("can not upgrade!"), !1;
                if (this.mTriggerTry) return u.information("already trigger try!"), !1;
                u.information("triggerTry"), this.mTriggerTry = !0;
                let e = yield this.queryTry();
                return e ? (this.isEnter || (this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Enable, e = yield this.enter()), e) : (u.information("can not try!"), this.mTriggerTry = !1, !1)
            })
        }

        get status() {
            return this.mStatus
        }

        set status(e) {
            this.mStatus !== e && (this.mStatus = e, u.information(h.statusChanged, "status", e), this.fireEvent(h.statusChanged, e))
        }

        get isTry() {
            return this.mType === o.KuaiNiaoDefineNS.KuaiNiaoType.Try
        }

        get bandWidth() {
            return this.mBandWidth
        }

        get downstreamString() {
            let e = 0;
            return this.bandWidth && (e = Math.floor(this.bandWidth.downstream / 1024)), e + "M"
        }

        get authority() {
            return d.isSuperVip
        }

        get isEnter() {
            return this.status > o.KuaiNiaoDefineNS.KuaiNiaoStatus.Enable
        }

        get host() {
            return {ip: this.mServerIp, port: this.mServerPort}
        }

        query() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.queryPortal();
                return e ? (e = yield this.queryBand()) || (u.information("can not get band!"), !1) : (u.information("can not get portal!"), !1)
            })
        }

        commit() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.acclerate();
                return this.isEnter && e ? (this.isTry ? this.createTryTimer() : this.keepAlive(), !0) : (u.information("can not acclerate!"), !1)
            })
        }

        queryPortal() {
            return i(this, void 0, void 0, function* () {
                u.information("queryPortal");
                let e = yield this.mSession.queryPortal();
                return u.information("queryPortal", "response", e), e && (0 === e.result ? (this.mServerIp = e.serverIp, this.mServerPort = e.serverPort) : this.mServerIp = ""), this.mServerIp && "" !== this.mServerIp
            })
        }

        queryBand() {
            return i(this, void 0, void 0, function* () {
                u.information("queryBand");
                let e = yield this.mSession.queryBand(this.host);
                if (u.information("queryBand", "response", e), e) switch (e.result) {
                    case 0:
                        this.mCanUpgrade = 1 === e.canUpgrade, this.mDialAccount = e.dialAccount;
                        break;
                    default:
                        this.mCanUpgrade = !1
                }
                return !0 === this.mCanUpgrade
            })
        }

        acclerate() {
            return i(this, void 0, void 0, function* () {
                u.information("acclerate");
                let e = {
                    host: this.host,
                    dialAccount: this.mDialAccount,
                    speedType: this.mType,
                    userId: this.mUserId,
                    sessionId: this.mSessionId
                }, t = !1, n = yield this.mSession.speedUp(e);
                if (u.information("acclerate", "response", n), n) switch (n.result) {
                    case 0:
                        t = !0, this.mBandWidth = n.bandWidth;
                        break;
                    case 812:
                        this.mAlived = !0, t = !0, this.mBandWidth = n.bandWidth
                }
                return t
            })
        }

        unAcclerate() {
            return i(this, void 0, void 0, function* () {
                u.information("unAcclerate");
                let e = {
                    host: this.host,
                    dialAccount: this.mDialAccount,
                    speedType: this.mType,
                    userId: this.mUserId,
                    sessionId: this.mSessionId
                }, t = yield this.mSession.speedDown(e);
                return u.information("unAcclerate", "response", t), !0
            })
        }

        heartBeat() {
            return i(this, void 0, void 0, function* () {
                u.information("heartBeat");
                let e = {host: this.host, dialAccount: this.mDialAccount}, t = yield this.mSession.heartBeat(e);
                if (u.information("heartBeat", "response", t), t) switch (t.result) {
                    case 0:
                        break;
                    case 513:
                        this.onHeartBeatError(!0);
                        break;
                    case 520:
                        this.onHeartBeatError();
                        break;
                    default:
                        this.onHeartBeatLose()
                } else this.onHeartBeatLose()
            })
        }

        queryTry() {
            return i(this, void 0, void 0, function* () {
                u.information("queryTry");
                let e = {host: this.host, dialAccount: this.mDialAccount}, t = yield this.mSession.queryTry(e);
                return u.information("queryTry", "response", t), 0 === t.result && (this.mDuration = t.duration || 0, this.mDuration *= 60), 0 === t.result && t.leftCount > 0
            })
        }

        onHeartBeatError(e) {
            this.status === o.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive && (u.information("onHeartBeatError"), this.killHeartBeatTimer(), e && this.mRetrySpeedUpCount < 3 ? (this.mRetrySpeedUpCount++, this.enter().catch()) : this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Failed)
        }

        onHeartBeatLose() {
            if (this.status === o.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive) {
                u.information("onHeartBeatLose");
                let e = c.getValue("KuaiNiao", "KuaiNiaoHeartBeatLoseMaxCount");
                ++this.mLoseHeartBeatCount >= e && this.onHeartBeatError(!0)
            }
        }

        createHeartBeatTimer() {
            if (!this.mHeartBeatTimer) {
                let e = c.getValue("KuaiNiao", "KuaiNiaoHeartBeatInterval");
                u.information("createHeartBeatTimer", "interval", e), this.mHeartBeatTimer = setInterval(() => i(this, void 0, void 0, function* () {
                    yield this.heartBeat()
                }), 1e3 * e)
            }
        }

        killHeartBeatTimer() {
            this.mHeartBeatTimer && (u.information("killHeartBeatTimer"), clearInterval(this.mHeartBeatTimer), this.mHeartBeatTimer = void 0)
        }

        keepAlive() {
            u.information("keepAlive"), this.mLoseHeartBeatCount = 0, this.mAlived && this.heartBeat().catch(), this.createHeartBeatTimer()
        }

        checkAcclerate() {
            return i(this, void 0, void 0, function* () {
                this.authority ? (this.mType = o.KuaiNiaoDefineNS.KuaiNiaoType.Vip, this.mCanUpgrade && (this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Enable, yield this.enter())) : this.mType = o.KuaiNiaoDefineNS.KuaiNiaoType.Try
            })
        }

        onLogin() {
            return i(this, void 0, void 0, function* () {
                this.mUserId = d.userId, this.mSessionId = yield d.getSessionId(), this.authority && this.isEnter && (yield this.exit()), yield this.checkAcclerate()
            })
        }

        onLogout() {
            return i(this, void 0, void 0, function* () {
                this.status > o.KuaiNiaoDefineNS.KuaiNiaoStatus.Init && (yield this.exit()), yield this.checkAcclerate(), this.mUserId = "0", this.mSessionId = "0"
            })
        }

        createTryTimer() {
            !this.mTryTimer && this.mDuration && (u.information("createTryTimer"), this.mTryTimer = setTimeout(() => i(this, void 0, void 0, function* () {
                this.status = o.KuaiNiaoDefineNS.KuaiNiaoStatus.Finish, yield this.exit()
            }), 1e3 * this.mDuration))
        }

        killTryTimer() {
            this.mTryTimer && (u.information("killTryTimer"), clearTimeout(this.mTryTimer), this.mTryTimer = void 0)
        }
    }

    t.KuainiaoManager = f, function (e) {
        const t = new f;
        e.getManager = function () {
            return t
        }
    }(t.KuainiaoManagerNS || (t.KuainiaoManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Default = 0] = "Default", e[e.Normal = 1] = "Normal", e[e.Vip = 2] = "Vip", e[e.SuperVip = 3] = "SuperVip"
        }(t = e.SkinType || (e.SkinType = {})), e.defaultSkinInfo = {
            type: t.Default,
            id: 1
        }, e.cacheDir = `${__profilesDir}/speedcurve-skin`
    }(t.SpeedCurveSkinHelperNS || (t.SpeedCurveSkinHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(815);
    t.quitPromises = new class {
        constructor() {
            this.promiseFuncArray = []
        }

        add(e) {
            this.promiseFuncArray.push(e)
        }

        run() {
            a.HistoryDataNS.setExitType("normal");
            let e = [];
            for (let t of this.promiseFuncArray) "function" == typeof t && e.push(t());
            Promise.all(e).then(() => {
                i.remote.app.quit()
            }).catch(() => {
                i.remote.app.quit()
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(35), o = n(83), r = n(21), s = n(816), l = n(61), u = n(23),
        d = i.default.getLogger("CommunityNaviteFunction"), c = s.CommunityTaskManagerNS.getTaskManager();
    !function (e) {
        class t extends a.EventEmitter {
            constructor() {
                super(), this.isRegisted = !1, d.verbose("construct")
            }

            static getNativeModule() {
                return t.instance || (t.instance = new t), t.instance
            }

            registerNativeFunction() {
                if (!this.isRegisted) {
                    this.isRegisted = !0;
                    let e = [{
                        functionName: "GetTaskSpeedByGcid",
                        nativeFunc: this.getTaskSpeedByGcid
                    }, {
                        functionName: "GetTaskNameByGcid",
                        nativeFunc: this.getTaskNameByGcid
                    }, {functionName: "SwitchToTask", nativeFunc: this.switchToTask}, {
                        functionName: "NotifyUnreadNum",
                        nativeFunc: this.notifyUnreadNum
                    }, {functionName: "ShowChatPanel", nativeFunc: this.showChatPanel}, {
                        functionName: "NewMessage",
                        nativeFunc: this.newMessage
                    }, {functionName: "OpenCommunityGroup", nativeFunc: this.openCommunityGroup}];
                    o.setDefaultNativeFunctionMap(e), c.init()
                }
            }

            sendOpenCommunityEvent(e, t) {
                void 0 !== t && (d.information("sendOpenCommunityEvent", e), t.fireEvent("OnShowCommunity", e.type, e.entry, JSON.stringify(e.extra)))
            }

            showChatPanel(e, n, i, a) {
                do {
                    if (!e || !i || void 0 === n) break;
                    if (d.verbose(a), !a || !a[0]) {
                        e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = {type: "chat", extra: {userId: a[0]}};
                    t.getNativeModule().emit("openComunityGroup", o), e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            newMessage(e, n, i, a) {
                do {
                    if (!e || !i || void 0 === n) break;
                    if (d.information("newMessage", a), d.verbose(a), !a || !a[0]) {
                        e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const o = a[0];
                    try {
                        let a = JSON.parse(o);
                        t.getNativeModule().emit("newMessage", a), e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.Success)
                    } catch (e) {
                        d.information("newMessage parse data error")
                    }
                } while (0)
            }

            getTaskSpeedByGcid(e, t, n, i) {
                do {
                    if (!e || !n || void 0 === t) break;
                    if (d.verbose(i), !i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const a = i[0];
                    let o = c.getTaskAverageSpeedByTaskUniqueID(a);
                    d.information("getTaskSpeedByGcid gcid:", a, ", taskAverageSpeed:", o), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, "" + o)
                } while (0)
            }

            getTaskNameByGcid(e, t, n, i) {
                do {
                    if (!e || !n || void 0 === t) break;
                    if (d.verbose(i), !i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const a = i[0];
                    let o = c.getTaskNameByTaskUniqueID(a);
                    d.information("getTaskSpeedByGcid gcid:", a, ", taskName:", o), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, o)
                } while (0)
            }

            switchToTask(e, t, n, i) {
                do {
                    if (!e || !n || void 0 === t) break;
                    if (d.verbose(i), !i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const a = i[0];
                    d.information("switchToTask", a);
                    let o = c.getTaskInfoByTaskUniqueID(a);
                    if (!o) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    d.information("switchToTask gcid:", a, ", taskInfo:", o), l.default.fireEvent(u.NodeEventMesssageNS.eventDownloadSwitchCategory, o.categoryId, o.categoryViewId, o.taskId), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            notifyUnreadNum(e, n, i, a) {
                do {
                    if (!e || !i || void 0 === n) break;
                    if (d.verbose(a), !a || !Array.isArray(a) || a.length < 2) {
                        e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const o = a[0];
                    let s = null;
                    try {
                        s = JSON.parse(a[1])
                    } catch (e) {
                        break
                    }
                    t.getNativeModule().emit("NotifyUnreadNum", {
                        totalNum: a[0],
                        detail: s
                    }), d.information("notifyUnreadNum", o), e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            openCommunityGroup(e, n, i, a) {
                do {
                    if (!e || !i || void 0 === n) break;
                    if (!a || !Array.isArray(a)) {
                        e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = null;
                    try {
                        o = JSON.parse(a[0])
                    } catch (e) {
                        break
                    }
                    t.getNativeModule().emit("openComunityGroup", o), e.callNativeFunctionCallback(n, i, r.NativeFunctionErrorCode.Success)
                } while (0)
            }
        }

        t.instance = null, e.CommunityNaviteFunction = t
    }(t.CommunityNaviteFunctionNS || (t.CommunityNaviteFunctionNS = {}))
}, , , function (e, t, n) {
    e.exports = function (e) {
        function t(i) {
            if (n[i]) return n[i].exports;
            var a = n[i] = {i, l: !1, exports: {}};
            return e[i].call(a.exports, a, a.exports, t), a.l = !0, a.exports
        }

        var n = {};
        return t.m = e, t.c = n, t.i = function (e) {
            return e
        }, t.d = function (e, n, i) {
            t.o(e, n) || Object.defineProperty(e, n, {configurable: !1, enumerable: !0, get: i})
        }, t.n = function (e) {
            var n = e && e.__esModule ? function () {
                return e.default
            } : function () {
                return e
            };
            return t.d(n, "a", n), n
        }, t.o = function (e, t) {
            return Object.prototype.hasOwnProperty.call(e, t)
        }, t.p = "/dist/", t(t.s = 4)
    }([function (e, t) {
        e.exports = {
            inserted: function (e, t, n) {
                var i = n.context.$refs[t.arg];
                i && i.addItem({el: e, value: t.value})
            }, unbind: function (e, t, n) {
                var i = n.context.$refs[t.arg];
                i && i.removeItem({el: e, value: t.value})
            }
        }
    }, function (e, t, n) {
        var i = n(5)(n(2), n(6), null, null, null);
        e.exports = i.exports
    }, function (e, t, n) {
        "use strict";
        Object.defineProperty(t, "__esModule", {value: !0});
        var i = n(3);
        t.default = {
            name: "Popup",
            props: {
                appendToBody: {type: Boolean, default: !0},
                arrowClass: String,
                direction: {type: String, default: "bottom"},
                display: {type: Boolean, default: !1},
                padding: {type: Number, default: 0},
                trigger: {type: String, default: "hover"},
                scrollShow: {type: Boolean, default: !0}
            },
            data: function () {
                return {
                    arrowStyle: {},
                    delay: 100,
                    directionMap: {top: "height", left: "width"},
                    secondDirection: "",
                    left: 0,
                    top: 0,
                    currentElement: null,
                    willHide: !1
                }
            },
            computed: {
                directionClass: function () {
                    var e = /(top)|(bottom)|(left)|(right)/i, t = e.exec(this.direction) || [],
                        n = this.secondDirection ? e.exec(this.secondDirection)[0] : "", i = t[0] || "";
                    return "" === n ? "popup-" + i : "popup-" + n
                }, triggerEvent: function () {
                    switch (this.trigger) {
                        case"hover":
                            return "mouseenter";
                        case"focus":
                            return "focus";
                        case"click":
                            return "click"
                    }
                }, unTriggerEl: function () {
                    return "click" === this.trigger ? document : this.$el
                }, unTriggerEvent: function () {
                    switch (this.trigger) {
                        case"hover":
                            return "mouseleave";
                        case"focus":
                            return "blur";
                        case"click":
                            return "click"
                    }
                }
            },
            mounted: function () {
                this.appendToBody && document.body.appendChild(this.$el), this.$el.addEventListener(this.triggerEvent, this.handlePopupVisible), this.unTriggerEl.addEventListener(this.unTriggerEvent, this.handlePopupInvisible), this.handleResizeThrottle = n.i(i.a)(this.handleResize, 16), window.addEventListener("resize", this.handleResizeThrottle)
            },
            beforeDestroy: function () {
                this.$el.removeEventListener(this.triggerEvent, this.handlePopupVisible), this.unTriggerEl.removeEventListener(this.unTriggerEvent, this.handlePopupInvisible), window.removeEventListener("resize", this.handleResizeThrottle)
            },
            destroyed: function () {
                this.appendToBody && this.$el && document.body.hasChildNodes(this.$el) && document.body.removeChild(this.$el)
            },
            methods: {
                addItem: function (e) {
                    e.el.handleVisible = this.handleVisible.bind(this, e.value, e.el), e.el.addEventListener(this.triggerEvent, e.el.handleVisible), "click" !== this.trigger && (e.el.handleInvisible = this.handleInvisible.bind(this, e.value), e.el.addEventListener(this.unTriggerEvent, e.el.handleInvisible)), this.bindScroll(e.el)
                }, removeItem: function (e) {
                    e.el.removeEventListener(this.triggerEvent, e.el.handleVisible), "click" !== this.trigger && e.el.removeEventListener(this.unTriggerEvent, e.el.handleInvisible), this.unbindScroll(e.el)
                }, bindScroll: function (e) {
                    for (e = e.parentNode; e;) e.addEventListener("scroll", this.handleScroll), e = e.parentNode
                }, unbindScroll: function (e) {
                    for (e = e.parentNode; e;) e.removeEventListener("scroll", this.handleScroll), e = e.parentNode
                }, computePosition: function (e, t) {
                    e = e.getBoundingClientRect();
                    var n = 0, i = 0, a = (t = t.getBoundingClientRect()).top - e.height - this.padding,
                        o = t.left + t.width + this.padding, r = t.top + t.height + this.padding,
                        s = t.left - e.width - this.padding;
                    /(top)|(bottom)/i.test(this.direction) ? (n = t.left + (t.width - e.width) / 2, "bottomStart" !== this.direction && "topStart" !== this.direction || (n = t.left), "bottomEnd" !== this.direction && "topEnd" !== this.direction || (n = t.left - e.width + t.width), n < 0 ? (n = 0, this.arrowStyle = {left: (t.left + t.right) / 2 + "px"}) : n + e.width > window.innerWidth ? (n = window.innerWidth - e.width, this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}) : this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}, "top" === this.direction || "topStart" === this.direction || "topEnd" === this.direction ? a < 0 && r + e.height <= window.innerHeight ? (i = r, this.secondDirection = "bottom", "topStart" === this.direction && (this.secondDirection = "bottomStart", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}), "topEnd" === this.direction && (this.secondDirection = "bottomEnd", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"})) : (i = a, this.secondDirection = "", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}) : r + e.height > window.innerHeight && a >= 0 ? (i = a, this.secondDirection = "top", "bottomStart" === this.direction && (this.secondDirection = "topStart", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"}), "bottomEnd" === this.direction && (this.secondDirection = "topEnd", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"})) : (i = r, this.secondDirection = "", this.arrowStyle = {left: (t.left + t.right) / 2 - n + "px"})) : /(left)|(right)/i.test(this.direction) && (i = t.top + (t.height - e.height) / 2, "leftStart" !== this.direction && "rightStart" !== this.direction || (i = t.top), "leftEnd" !== this.direction && "rightEnd" !== this.direction || (i = t.top - e.height + t.height), i < 0 ? (i = 0, this.arrowStyle = {top: (t.top + t.bottom) / 2 + "px"}) : i + e.height > window.innerHeight ? (i = window.innerHeight - e.height, this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}) : this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}, "left" === this.direction || "leftStart" === this.direction || "leftEnd" === this.direction ? s < 0 && o + e.width <= window.innerWidth ? (n = o, this.secondDirection = "right", "leftStart" === this.direction && (this.secondDirection = "rightStart", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}), "leftEnd" === this.direction && (this.secondDirection = "rightEnd", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"})) : (n = s, this.secondDirection = "", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}) : o + e.width > window.innerWidth && s >= 0 ? (n = s, this.secondDirection = "left", "rightStart" === this.direction && (this.secondDirection = "leftStart", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"}), "rightEnd" === this.direction && (this.secondDirection = "leftEnd", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"})) : (n = o, this.secondDirection = "", this.arrowStyle = {top: (t.top + t.bottom) / 2 - i + "px"})), this.top = i, this.left = n
                }, handleVisible: function (e, t, n) {
                    var i = this;
                    if ("click" === this.trigger && this.display && !0 !== n) return this.handleInvisible(e);
                    this.willHide = !1, this.currentElement = t, this.currentValue = e, this.$emit("update:display", !0), this.$emit("show", e), this.$nextTick(function () {
                        setTimeout(function () {
                            i.computePosition(i.$el, i.currentElement)
                        })
                    })
                }, handleInvisible: function (e) {
                    var t = this;
                    "click" === this.trigger ? (this.$emit("update:display", !1), this.$emit("hide", e)) : (this.willHide = !0, setTimeout(function () {
                        t.willHide && (t.$emit("update:display", !1), t.$emit("hide", e))
                    }, this.delay))
                }, handleScroll: function () {
                    this.scrollShow ? this.display && this.computePosition(this.$el, this.currentElement) : (this.$emit("update:display", !1), this.$emit("hide"))
                }, handlePopupVisible: function (e) {
                    e.stopPropagation(), this.willHide = !1, this.$emit("update:display", !0), this.$emit("show", this.value)
                }, handlePopupInvisible: function (e) {
                    var t = this;
                    "click" === this.trigger && this.isClosest(e.target, this.currentElement) || ("click" === this.trigger ? (this.$emit("update:display", !1), this.$emit("hide", this.value)) : (this.willHide = !0, setTimeout(function () {
                        t.willHide && (t.$emit("update:display", !1), t.$emit("hide", t.value))
                    }, this.delay)))
                }, handleResize: function () {
                    this.display && this.handleVisible(this.value, this.currentElement, !0)
                }, show: function (e, t) {
                    this.handleVisible(t, e)
                }, hide: function () {
                    this.handleInvisible()
                }, isDirectionLine: function (e) {
                    return "top" === e || "bottom" === e ? "top" === this.direction || "bottom" === this.direction : "left" === this.direction || "right" === this.direction
                }, isClosest: function (e, t) {
                    return e !== document && (e === t || this.isClosest(e.parentNode, t))
                }
            }
        }
    }, function (e, t, n) {
        "use strict";
        t.a = function (e, t) {
            var n = this, i = 0;
            return function () {
                for (var a = arguments.length, o = Array(a), r = 0; r < a; r++) o[r] = arguments[r];
                var s = +new Date;
                s - i > t && (e.apply(n, o), i = s)
            }
        }
    }, function (e, t, n) {
        var i = n(0), a = n(1);
        a.install = function (e) {
            e.directive("popup", i), e.component(a.name, a)
        }, e.exports = a
    }, function (e, t) {
        e.exports = function (e, t, n, i, a) {
            var o, r = e = e || {}, s = typeof e.default;
            "object" !== s && "function" !== s || (o = e, r = e.default);
            var l, u = "function" == typeof r ? r.options : r;
            if (t && (u.render = t.render, u.staticRenderFns = t.staticRenderFns), i && (u._scopeId = i), a ? (l = function (e) {
                (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), n && n.call(this, e), e && e._registeredComponents && e._registeredComponents.add(a)
            }, u._ssrRegister = l) : n && (l = n), l) {
                var d = u.functional, c = d ? u.render : u.beforeCreate;
                d ? u.render = function (e, t) {
                    return l.call(t), c(e, t)
                } : u.beforeCreate = c ? [].concat(c, l) : [l]
            }
            return {esModule: o, exports: r, options: u}
        }
    }, function (e, t) {
        e.exports = {
            render: function () {
                var e = this, t = e.$createElement, n = e._self._c || t;
                return n("div", {
                    class: e.directionClass,
                    style: {display: e.display ? "block" : "none", left: e.left + "px", top: e.top + "px"},
                    attrs: {tabindex: "999"}
                }, [e._t("default"), e._v(" "), n("span", {
                    staticClass: "popup-arrow",
                    class: e.arrowClass,
                    style: e.arrowStyle
                })], 2)
            }, staticRenderFns: []
        }
    }])
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.ValueNull = 0] = "ValueNull", e[e.ValueInt = 1] = "ValueInt", e[e.ValueBigint = 2] = "ValueBigint", e[e.ValueDouble = 3] = "ValueDouble", e[e.ValueString = 4] = "ValueString", e[e.ValueBlob = 5] = "ValueBlob"
    }(t.ValueType || (t.ValueType = {})), function (e) {
        e[e.StatementBengin = -1] = "StatementBengin", e[e.CreateTaskBase = 0] = "CreateTaskBase", e[e.CreateP2spTask = 1] = "CreateP2spTask", e[e.CreateBtTask = 2] = "CreateBtTask", e[e.CreateBtFile = 3] = "CreateBtFile", e[e.CreateEmuleTask = 4] = "CreateEmuleTask", e[e.CreateGroupTask = 5] = "CreateGroupTask", e[e.CreateMagnetTask = 6] = "CreateMagnetTask", e[e.DestroyTaskBase = 7] = "DestroyTaskBase", e[e.DestroyP2spTask = 8] = "DestroyP2spTask", e[e.DestroyBtTask = 9] = "DestroyBtTask", e[e.DestroyBtFile = 10] = "DestroyBtFile", e[e.DestroyEmuleTask = 11] = "DestroyEmuleTask", e[e.DestroyGroupTask = 12] = "DestroyGroupTask", e[e.DestroyMagnetTask = 13] = "DestroyMagnetTask", e[e.LoadTaskBase = 14] = "LoadTaskBase", e[e.LoadP2spTask = 15] = "LoadP2spTask", e[e.LoadBtTask = 16] = "LoadBtTask", e[e.LoadBtFile = 17] = "LoadBtFile", e[e.LoadEmuleTask = 18] = "LoadEmuleTask", e[e.LoadGroupTask = 19] = "LoadGroupTask", e[e.SetTaskSavePath = 20] = "SetTaskSavePath", e[e.SetTaskName = 21] = "SetTaskName", e[e.SetTaskNamingType = 22] = "SetTaskNamingType", e[e.SetTaskDescription = 23] = "SetTaskDescription", e[e.SetTaskCid = 24] = "SetTaskCid", e[e.SetTaskGcid = 25] = "SetTaskGcid", e[e.SetTaskStatus = 26] = "SetTaskStatus", e[e.SetTaskFileCreated = 27] = "SetTaskFileCreated", e[e.SetTaskFileSize = 28] = "SetTaskFileSize", e[e.SetTaskReceiveSize = 29] = "SetTaskReceiveSize", e[e.SetTaskDownloadSize = 30] = "SetTaskDownloadSize", e[e.SetTaskCompletionTime = 31] = "SetTaskCompletionTime", e[e.SetTaskDownloadingPeriod = 32] = "SetTaskDownloadingPeriod", e[e.SetTaskRemovingToRecycleTime = 33] = "SetTaskRemovingToRecycleTime", e[e.SetTaskFailureErrorCode = 34] = "SetTaskFailureErrorCode", e[e.SetTaskUserRead = 35] = "SetTaskUserRead", e[e.SetTaskOpenOnCompelete = 36] = "SetTaskOpenOnCompelete", e[e.SetTaskForbidden = 37] = "SetTaskForbidden", e[e.SetTaskUserData = 38] = "SetTaskUserData", e[e.SetTaskDownload = 39] = "SetTaskDownload", e[e.SetTaskOrigin = 40] = "SetTaskOrigin", e[e.SetTaskChannelInfo = 41] = "SetTaskChannelInfo", e[e.SetP2spTaskUseOriginOnly = 42] = "SetP2spTaskUseOriginOnly", e[e.SetP2spTaskThreadCount = 43] = "SetP2spTaskThreadCount", e[e.SetBtFileInfo = 44] = "SetBtFileInfo", e[e.SetBtFileCid = 45] = "SetBtFileCid", e[e.SetCategoryId = 46] = "SetCategoryId", e[e.LoadCategory = 47] = "LoadCategory", e[e.CreateCategory = 48] = "CreateCategory", e[e.SetCategoryPassword = 49] = "SetCategoryPassword", e[e.SetCategoryAccountPassword = 50] = "SetCategoryAccountPassword", e[e.SearchTaskByName = 51] = "SearchTaskByName", e[e.SearchTaskByBtDisplayName = 52] = "SearchTaskByBtDisplayName", e[e.BatchFindP2spTask = 53] = "BatchFindP2spTask", e[e.BatchFindEmuleTask = 54] = "BatchFindEmuleTask", e[e.BatchFindBtTask = 55] = "BatchFindBtTask", e[e.BatchFindGroupTask = 56] = "BatchFindGroupTask", e[e.StatementEnd = 57] = "StatementEnd"
    }(t.StatementType || (t.StatementType = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(8), o = n(67), r = n(31), s = n(92), l = n(9), u = r.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        e.batchFindTaskAW = function (e) {
            return i(this, void 0, void 0, function* () {
                let t = [];
                for (let n = 0; n < e.length; ++n) {
                    let i = e[n], o = null;
                    i.taskType === a.DownloadKernel.TaskType.P2sp ? o = {
                        keyType: a.DownloadKernel.KeyType.P2spUrl,
                        keyValue: i.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : i.taskType === a.DownloadKernel.TaskType.Emule ? o = {
                        keyType: a.DownloadKernel.KeyType.EmuleFileHash,
                        keyValue: i.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : i.taskType === a.DownloadKernel.TaskType.Bt ? o = {
                        keyType: a.DownloadKernel.KeyType.BtInfoId,
                        keyValue: i.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : i.taskType === a.DownloadKernel.TaskType.Magnet && (o = {
                        keyType: a.DownloadKernel.KeyType.MagnetUrl,
                        keyValue: i.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    }), o && t.push(o)
                }
                return u.batchFindTaskAsync(t)
            })
        }, e.importUnfinishedTaskAW = function (e, t) {
            return i(this, void 0, void 0, function* () {
                return new Promise(n => {
                    o.DownloadKernelManager.importUnfinishedTask(e, t, (e, t, i) => {
                        n({ret: e, url: t, torrentPath: i})
                    })
                })
            })
        }, e.parserBtFileInfoAW = function (e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    (yield l.FileSystemAWNS.existsAW(e)) ? s.ThunderKernel.parserBtFileInfo(e, (e, n) => {
                        t(0 === e && n ? n : null)
                    }) : t(null)
                }))
            })
        }
    }(t.TaskUtilitiesAWNS || (t.TaskUtilitiesAWNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(243), a = n(45), o = n(62), r = n(1).default.getLogger("Thunder.VipDownload.json-crypto");
    !function (e) {
        e.getAuthorization = function (e, t) {
            return e + ":" + t
        }, e.getAccept = function () {
            return "application/json; version=1.0"
        }, e.getUriParam = function (e, t, n) {
            const i = o.PluginHelperNS.getHelper();
            let a = "client_name=" + i.clientName + "&client_version=" + i.thunderVersionNumber + "&client_sequence=" + e + "&r=" + t;
            return void 0 !== n && (a = a + "&verify_type=" + n), a
        }, e.getKey = function (e, t) {
            const n = o.PluginHelperNS.getHelper();
            let i = n.clientName + n.thunderVersionNumber + e + t;
            return (i = a.ToolsUtilitiesAWNS.genarateMd5(i)).substr(0, 16).toUpperCase()
        }, e.encryptHttpBuffer = function (e, t) {
            r.information("key", t);
            let n = JSON.stringify(e);
            r.information("jsonStr", n);
            let o = i.Buffer.from(n);
            return a.ToolsUtilitiesAWNS.encryptBuffer(o, t)
        }, e.decryptHttpBuffer = function (e, t) {
            r.information("key", t);
            let n = null;
            if (e = a.ToolsUtilitiesAWNS.decryptBuffer(e, t)) {
                let t = e.toString();
                r.information("jsonStr", t);
                try {
                    n = JSON.parse(t)
                } catch (e) {
                    r.warning(e)
                }
            }
            return n
        }
    }(t.HttpJsonCryptoNS || (t.HttpJsonCryptoNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Commit = 0] = "Commit", e[e.Token = 1] = "Token", e[e.Acclerate = 2] = "Acclerate"
        }(t = e.ErrorStep || (e.ErrorStep = {}))
    }(t.HttpDefineNS || (t.HttpDefineNS = {})), function (e) {
        let t = new Map;
        e.getMessage = function (e) {
            return t.get(e)
        }, e.errorOk = 0, t.set(e.errorOk, "成功"), e.errorConnect = -1, t.set(e.errorConnect, "服务器响应超时"), e.errorStatusCode = -2, t.set(e.errorStatusCode, "服务器响应超时"), e.errorData = -3, t.set(e.errorData, "服务器响应超时"), e.errorPrase = -4, t.set(e.errorPrase, "服务器响应超时")
    }(t.HttpErrorNS || (t.HttpErrorNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.guidDownloadAndPlay = "{6B0A52BF-FDC5-4dfd-A20E-597CCD50CB8F}", e.guidTaskRequest = "{D30770E1-0A7F-4879-A103-AC738CB477C6}", e.guidUnzip = "{C60B84A8-6D18-475d-989D-965ADBECF135}", e.guidDownloadCompleteInstall = "{66F815D6-ADE3-4c85-A6B2-E48D50C096A7}", e.guidDownloadCompleteRunParams = "{D30770E1-0A7F-4879-A103-AC738CB477C6}"
    }(t.TaskUserDataGUID || (t.TaskUserDataGUID = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(27), o = n(1), r = n(10);
    let {isDef: s} = r.ThunderUtil;
    const l = o.default.getLogger("Thunder.speedcurve-skin.skin-storage");
    t.default = new class {
        constructor() {
            this.skinURL = "http://static-xl9-ssl.xunlei.com/json/thunderx_speedcurve_skin.json"
        }

        getSkins() {
            return i(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = n(28);
                    try {
                        let e = yield a.default.get(this.skinURL);
                        if (200 === e.status && e.data) {
                            this.skins = e.data, l.information("skins", this.skins), localStorage.setItem("speedcurveSkins", JSON.stringify(this.skins));
                            break
                        }
                    } catch (e) {
                        l.warning(e)
                    }
                    if (s(this.skins)) break;
                    this.skins = JSON.parse(localStorage.getItem("speedcurveSkins"))
                } while (0);
                return this.skins
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(9), r = n(5), s = n(731), l = n(60), u = n(7), d = n(23), c = n(22), h = n(567),
        f = u.promisify, p = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        g = n(1).default.getLogger("SettingConfigHelper");
    !function (e) {
        e.configBrowserHelper = new class {
            constructor() {
                this.browserconfig = null, this.installWatchBrowsers = [], this.configShowBrowsers = [], this.eventContainer = new l.default, this.isInit = !1
            }

            init() {
                return i(this, void 0, void 0, function* () {
                    g.information("ConfigBrowserHelper enter init ");
                    let e = yield this.onConfigInit(), t = yield this.onBhoConfigInit();
                    g.information("ConfigBrowserHelper init isConfigInit:", e, ";isBhoConfigInit:", t), e && t && (yield this.readBrowserConfigXml(), yield this.writeNewBrowserToConfigINI(), this.isInit = !0, g.information("ConfigBrowserHelper init Finished"), this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventConfigBrowserInitFinished))
                })
            }

            attachListener(e, t) {
                do {
                    if (e === d.NodeEventMesssageNS.eventConfigBrowserInitFinished) {
                        if (this.isInit) {
                            t(this.isInit);
                            break
                        }
                        this.eventContainer.attachOnceListener(e, t);
                        break
                    }
                    this.eventContainer.attachListener(e, t)
                } while (0)
            }

            detachListener(e, t) {
                this.eventContainer.detachListener(e, t)
            }

            getConfigShowBrowsers() {
                let e = [];
                do {
                    if (null === this.configShowBrowsers || void 0 === this.configShowBrowsers || this.configShowBrowsers.length <= 0) break;
                    for (let t = 0; t < this.configShowBrowsers.length; ++t) {
                        let n = this.configShowBrowsers[t], i = n.browserName, a = "Motitor" + i, o = !1;
                        0 !== c.ConfigNS.getValue("Motitor", a, 2) && (o = !0);
                        let r = {content: i, name: n.name, key: a, isSelect: o};
                        e.push(r)
                    }
                } while (0);
                return g.information("getConfigShowBrowsers:", e), e
            }

            getWriteIniConfigShowBrowsers() {
                let e = "||";
                do {
                    let t = this.getConfigShowBrowsers();
                    if (null === t || void 0 === t || t.length <= 0) break;
                    for (let n = 0; n < t.length; ++n) {
                        let i = t[n], a = i.name;
                        "IE浏览器" !== i.content && i.isSelect && (void 0 !== e && null !== e && "" !== e ? "edge" === a || "edgecp" === a ? e += "edge||edgecp||" : e = e + a + "||" : e = "edge" === a || "edgecp" === a ? "edge||edgecp||" : a + "||")
                    }
                } while (0);
                return e
            }

            getWatchBrowerByName(e) {
                let t = null;
                do {
                    if (null === this.installWatchBrowsers || void 0 === this.installWatchBrowsers || this.installWatchBrowsers.length <= 0) break;
                    for (let n = 0; n < this.installWatchBrowsers.length; ++n) {
                        let i = this.installWatchBrowsers[n];
                        if (i.browserName.toLowerCase() === e.toLowerCase()) {
                            t = i;
                            break
                        }
                    }
                } while (0);
                return t
            }

            savaMotiorBrowserToConfig() {
                do {
                    let e = this.getConfigShowBrowsers();
                    if (null === e || void 0 === e || e.length <= 0) break;
                    let t = !1;
                    for (let n = 0; n < e.length; ++n) {
                        let i = e[n];
                        i.isSelect && (t = !0), "IE浏览器" === i.content && (i.isSelect ? (h.BHOConfigNS.setValue("Monitor", "ConfigWatch_Browser", 1), h.BHOConfigNS.setValue("Monitor", "MonitorIE", 1)) : (h.BHOConfigNS.setValue("Monitor", "ConfigWatch_Browser", 0), h.BHOConfigNS.setValue("Monitor", "MonitorIE", 0)))
                    }
                    t || h.BHOConfigNS.setValue("Monitor", "ConfigWatch_Browser", 0)
                } while (0)
            }

            onConfigInit() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        c.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                            e(!0)
                        })
                    })
                })
            }

            onBhoConfigInit() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        h.BHOConfigNS.attachListener(d.NodeEventMesssageNS.eventBHOConfigInitFinished, () => {
                            e(!0)
                        })
                    })
                })
            }

            readBrowserConfigXml() {
                return i(this, void 0, void 0, function* () {
                    g.information("enter readBrowserConfigXml");
                    do {
                        if (null !== this.browserconfig && void 0 !== this.browserconfig) break;
                        let e = this.getShortThunderVersion();
                        if (null === e || void 0 === e || "" === e) break;
                        let t = p.getCommonFilesPath(),
                            n = "XLWFPDOWNLOAD-SSID-{DB09E578-4ECF-486e-90A5-505A33219F71}_" + e + ".xml",
                            i = a.join(t, "Thunder Network\\ServicePlatform\\"), r = a.join(i, n),
                            l = yield o.FileSystemAWNS.readFileAW(r);
                        if (!l || "" === l.toString()) break;
                        try {
                            let e = {explicitArray: !1}, t = yield f(s.parseString)(l, e);
                            null !== t && void 0 !== t && (this.browserconfig = t.browserconfig, yield this.setInstallWatchBrowserList())
                        } catch (e) {
                            g.information(e)
                        }
                    } while (0);
                    this.setConfigShowBrowsers(), g.information("leave readBrowserConfigXml")
                })
            }

            writeNewBrowserToConfigINI() {
                return i(this, void 0, void 0, function* () {
                    g.information("enter writeNewBrowserToConfigINI");
                    let e = "||";
                    for (let t = 0; t < this.configShowBrowsers.length; ++t) {
                        let n = this.configShowBrowsers[t], i = "Motitor" + n.browserName,
                            a = c.ConfigNS.getValue("Motitor", i, 2);
                        2 === a && c.ConfigNS.setValue("Motitor", i, 1);
                        let o = n.name;
                        void 0 !== o && null !== o && "" !== o && 0 !== a && (void 0 !== e && null !== e && "" !== e ? "edge" === o || "edgecp" === o ? e += "edge||edgecp||" : e = e + o + "||" : e = "edge" === o || "edgecp" === o ? "edge||edgecp||" : o + "||")
                    }
                    h.BHOConfigNS.setValue("Monitor", "ConfigBrowsers", e), g.information("leave writeNewBrowserToConfigINI", e)
                })
            }

            getShortThunderVersion() {
                let e = "";
                do {
                    let t = a.join(__rootDir, "../../Thunder.exe"), n = p.getFileVersion(t);
                    if (null === n || void 0 === n || "" === n) break;
                    let i = n.split(/\./);
                    null !== i && void 0 !== i && i.length >= 3 && (e = i[0] + "." + i[1] + "." + i[2])
                } while (0);
                return e
            }

            setInstallWatchBrowserList() {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (null === this.browserconfig || void 0 === this.browserconfig) break;
                        if (null === this.browserconfig.browsers || void 0 === this.browserconfig.browsers) break;
                        let e = this.browserconfig.browsers;
                        if (null === e || void 0 === e || e.browser.length <= 0) break;
                        for (let t = 0; t < e.browser.length; ++t) {
                            let n = e.browser[t], i = !1;
                            "appReg" === n.type ? i = yield this.checkInstallByappReg(n) : "appPath" === n.type && (i = this.checkInstallByappPath(n)), i && this.installWatchBrowsers.push(n)
                        }
                        g.information("配置初始化时,安装的浏览器:", this.installWatchBrowsers)
                    } while (0)
                })
            }

            checkInstallByappReg(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (null === e || void 0 === e) break;
                        if (null === e.reg || void 0 === e.reg) break;
                        let n = e.reg.regRoot;
                        if (null === n || void 0 === n || "" === n) break;
                        let i = e.reg.regKey;
                        if (null === i || void 0 === i || "" === i) break;
                        let r = e.reg.regName, s = p.queryRegValue(n, i, r);
                        if (g.information("checkInstallByappReg:", s, n, i, r), null === s || void 0 === s || "" === s) break;
                        s = this.getPathFromRegString(s);
                        let l = p.getLongPathName(s);
                        null !== l && void 0 !== l && "" !== l && (s = l);
                        let u = e.proName, d = u.toLowerCase();
                        if (s.toLowerCase().search(d) < 0) {
                            let e = a.extname(s);
                            if (void 0 === e || null === e || "" === e) s = a.join(s, u); else {
                                let e = a.dirname(s);
                                s = a.join(e, u)
                            }
                            if (!(t = yield o.FileSystemAWNS.existsAW(s))) {
                                let e = a.dirname(s);
                                s = this.getFilePathByDir(e, u)
                            }
                        }
                        t || (t = yield o.FileSystemAWNS.existsAW(s))
                    } while (0);
                    return t
                })
            }

            getPathFromRegString(e) {
                let t = e, n = t.search(/\,/);
                return n >= 0 && (t = t.substring(0, n)), t = t.replace(/\"/g, "")
            }

            getFilePathByDir(e, t) {
                return g.information("getFilePathByDir:", e, t), ""
            }

            checkInstallByappPath(e) {
                let t = !1;
                do {
                    if (null === e || void 0 === e) break;
                    if (null === e.filePath || void 0 === e.filePath || "" === e.filePath) break;
                    let n = p.getSystemTempPath();
                    if (null === n || void 0 === n || "" === n) break;
                    let i = n.substring(0, 1);
                    if (null === i || void 0 === i || "" === i) break;
                    i += ":\\";
                    let o = a.join(i, e.filePath);
                    t = p.queryFileExists(o)
                } while (0);
                return t
            }

            setConfigShowBrowsers() {
                do {
                    let e = {browserName: "IE浏览器", icoUrl: ""};
                    if (this.configShowBrowsers.push(e), void 0 === this.installWatchBrowsers || null === this.installWatchBrowsers || this.installWatchBrowsers.length <= 0) break;
                    for (let e = 0; e < this.installWatchBrowsers.length; ++e) {
                        let t = this.installWatchBrowsers[e], n = !1;
                        for (let e = 0; e < this.configShowBrowsers.length; ++e) {
                            let i = this.configShowBrowsers[e];
                            if (i.browserName.toLowerCase() === t.browserName.toLowerCase()) {
                                null !== i.icoUrl && void 0 !== i.icoUrl && "" !== i.icoUrl || (this.configShowBrowsers[e].icoUrl = t.icoUrl), n = !0;
                                break
                            }
                        }
                        n || this.configShowBrowsers.push(t)
                    }
                } while (0)
            }
        }
    }(t.SettingConfigHelperNS || (t.SettingConfigHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1).default.getLogger("msg-queue");
    !function (e) {
        let t;
        !function (e) {
            e[e.Community = 0] = "Community", e[e.AdvertisementMarket = 1] = "AdvertisementMarket", e[e.AdvertisementFunctional = 2] = "AdvertisementFunctional", e[e.Download = 3] = "Download"
        }(t = e.MsgPriority || (e.MsgPriority = {}));
        e.Queue = class {
            constructor() {
                this.queue = [], this.priority = 0
            }

            enQueue(e) {
                let t = !1;
                i.information("消息队列增加消息", this.queue);
                for (let n = 0; n < this.queue.length; n++) if (this.queue[n].priority >= e.priority) {
                    t = !0, this.queue.splice(n, 0, e);
                    break
                }
                t || this.queue.push(e)
            }

            deQueue() {
                if (0 !== this.queue.length) {
                    let e = this.queue.pop();
                    this.priority = e.priority, void 0 !== e.callback && "function" == typeof e.callback && (i.information("消息队列弹出消息", this.queue), e.callback())
                }
            }

            clearQueuesByName(e) {
                let t = [];
                for (let n = 0; n < this.queue.length; n++) this.queue[n].name !== e && t.push(this.queue[n]);
                this.queue = t
            }

            isEmpty() {
                return 0 === this.queue.length
            }

            getCurrentProperty() {
                return this.priority
            }
        }
    }(t.MsgQueueNS || (t.MsgQueueNS = {}))
}, function (e, t) {
    e.exports = "data:image/png;base64, "
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(35), r = n(1), s = n(8), l = n(154), u = n(31), d = n(847), c = n(201), h = n(85), f = n(23),
        p = n(13), g = n(138), k = n(140), m = n(22), T = n(36), v = n(548), y = n(93), S = n(15), w = n(278),
        b = n(105), C = n(296), N = n(571), D = n(103), I = n(61), _ = n(7), x = n(2), A = n(563), E = n(30), M = n(54),
        P = r.default.getLogger("Thunder.ContextMenu"), F = y.DownloadKernelCategoryManager.getCategoryManager(),
        O = u.DownloadKernelTaskManager.getTaskManager(), U = C.GroupAccelerateManagerNS.getManager(),
        L = N.GroupAccelerateWebManagerNS.getManager(), B = A.SubtitleManagerNS.getSubtitleManger();
    var K;
    !function (e) {
        e[e.Unknown = 0] = "Unknown", e[e.DownloadingCategory = 1] = "DownloadingCategory", e[e.DownloadingBlank = 2] = "DownloadingBlank", e[e.DownloadingItem = 3] = "DownloadingItem", e[e.CompletedCategory = 4] = "CompletedCategory", e[e.CompletedItem = 5] = "CompletedItem", e[e.RecycleCategory = 6] = "RecycleCategory", e[e.RecycleBlank = 7] = "RecycleBlank", e[e.RecycleItem = 8] = "RecycleItem", e[e.ToolbarMore = 9] = "ToolbarMore", e[e.ChangeCategory = 10] = "ChangeCategory", e[e.PrivateSpaceHome = 11] = "PrivateSpaceHome", e[e.SearchMultiSel = 12] = "SearchMultiSel", e[e.Upper = 13] = "Upper"
    }(K = t.DownloadMenuType || (t.DownloadMenuType = {}));
    t.downloadContextMenu = new class {
        constructor() {
            this.contextInfo = [], this.count = 0, this.categoryId = -1, this.emitter = null, this.searchMode = !1, this.emitter = new o.EventEmitter
        }

        setContextInfo(e, t, n, i) {
            this.contextInfo = e, _.isNullOrUndefined(n) || (this.count = n), _.isNullOrUndefined(t) || (this.categoryId = t), _.isNullOrUndefined(i) ? this.searchMode = !1 : this.searchMode = i
        }

        attachListener(e, t) {
            this.emitter.addListener(e, t)
        }

        detachListener(e, t) {
            this.emitter.removeListener(e, t)
        }

        popMenu(e) {
            return i(this, void 0, void 0, function* () {
                switch (e) {
                    case K.DownloadingCategory: {
                        let e = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: d.ContextMenuIdsNS.contextMenuDownloadSelectAll
                        }, {
                            type: "normal",
                            label: "全部开始",
                            id: d.ContextMenuIdsNS.contextMenuDownloadStartAll
                        }, {type: "normal", label: "全部暂停", id: d.ContextMenuIdsNS.contextMenuDownloadPauseAll}];
                        this.popMenuInternal(e)
                    }
                        break;
                    case K.CompletedCategory: {
                        let e = this.contextInfo.currentCategoryId,
                            t = l.TaskStatusHelper.canMarkAsOpened(this.contextInfo.completedTaskBaseList), n = [{
                                type: "submenu",
                                label: "排序",
                                submenu: this.getSortSubMenuOptions(this.contextInfo)
                            }, {
                                type: "normal",
                                label: "全选(&A)",
                                id: d.ContextMenuIdsNS.contextMenuDownloadSelectAll
                            }, {
                                type: "normal",
                                label: "删除不存在任务",
                                id: d.ContextMenuIdsNS.contextMenuDownloadDeleteNonexisting
                            }, {
                                type: "normal",
                                label: "全部标记为已打开",
                                id: d.ContextMenuIdsNS.contextMenuDownloadAsReadedAll,
                                enabled: t
                            }];
                        -1 !== e && (n = [{
                            type: "normal",
                            label: "全部标记为已打开",
                            id: d.ContextMenuIdsNS.contextMenuDownloadAsReadedAll,
                            enabled: t
                        }]), this.popMenuInternal(n)
                    }
                        break;
                    case K.RecycleCategory: {
                        let e = !0;
                        null !== this.contextInfo && 0 !== this.contextInfo.length || (e = !1);
                        let t = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: d.ContextMenuIdsNS.contextMenuDownloadSelectAll
                        }, {
                            type: "normal",
                            label: "清空垃圾箱",
                            id: d.ContextMenuIdsNS.contextMenuDownloadClear,
                            enabled: e
                        }];
                        this.popMenuInternal(t)
                    }
                        break;
                    case K.DownloadingBlank: {
                        let e = [{
                            type: "normal",
                            label: "导入未完成任务(&I)",
                            id: d.ContextMenuIdsNS.contextMenuDownloadImportUncomplete
                        }];
                        this.popMenuInternal(e)
                    }
                        break;
                    case K.DownloadingItem:
                        if (null !== this.contextInfo && this.contextInfo.length > 0) {
                            let e = yield this.getLastestSavePathsOptions(!0, "MoveToDir", "LatestSavePath");
                            e.push({
                                type: "normal",
                                label: "其他目录",
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveFileOther,
                                statId: "downloading_rk_move_click",
                                extData: "button=other"
                            });
                            let t = yield this.canSelectTaskAcc(this.contextInfo), n = [];
                            if (-1 === this.categoryId ? n.push({
                                type: "normal",
                                label: "删除(&D)",
                                icon: `${__rootDir}/static/icon/deletetask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDelete,
                                statId: "downloading_rk_delete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {
                                type: "normal",
                                label: "彻底删除(&Q)",
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {type: "submenu", label: "移动文件到", submenu: e}) : n.push({
                                type: "normal",
                                label: "彻底删除(&D)",
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }), n.push({type: "separator"}), !this.searchMode && this.count > 3 && this.contextInfo.length !== this.count && n.splice(4, 0, {
                                type: "normal",
                                label: "上移到顶部",
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveTop
                            }, {
                                type: "normal",
                                label: "下移到底部",
                                id: d.ContextMenuIdsNS.contextMenuDownloadMoveBottom
                            }, {type: "separator"}), 1 === this.contextInfo.length) {
                                l.TaskStatusHelper.canStopSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, this.contextInfo) ? n.unshift({
                                    type: "normal",
                                    label: "暂停(&P)",
                                    icon: `${__rootDir}/static/icon/stoptask.png`,
                                    id: d.ContextMenuIdsNS.contextMenuDownloadPause,
                                    statId: "downloading_rk_pause_click"
                                }) : n.unshift({
                                    type: "normal",
                                    label: "开始(&S)",
                                    icon: `${__rootDir}/static/icon/startalltask.png`,
                                    id: d.ContextMenuIdsNS.contextMenuDownloadStart,
                                    statId: "downloading_rk_start_click"
                                });
                                let e = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(this.contextInfo[0]);
                                n.splice(0, 0, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "downloading_rk_openfolders_click",
                                    enabled: e,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }), this.searchMode && n.splice(1, 0, {
                                    type: "normal",
                                    label: "打开任务位置(&G)",
                                    id: d.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                    statId: "openfile_position_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                });
                                let t = 2;
                                U.canEnterGroupAccelerate(this.contextInfo[0].taskId) && (n.splice(t, 0, {
                                    type: "normal",
                                    label: "组队加速",
                                    icon: `${__rootDir}/static/icon/groupaccelerate.png`,
                                    id: d.ContextMenuIdsNS.contextMenuGroupAccelerate,
                                    statId: "downloading_rk_groupspeedup_click"
                                }), t += 1), O.getTaskFromTaskId(this.contextInfo[0].taskId).isSupportPlay() ? n.splice(t, 0, {
                                    type: "normal",
                                    label: "字幕搜索",
                                    icon: `${__rootDir}/static/icon/sunbtitle.png`,
                                    id: d.ContextMenuIdsNS.contxtMenuSubtitleSearch,
                                    statId: "downloading_rk_subtitlesearch_click"
                                }, {type: "separator"}) : n.splice(t, 0, {type: "separator"}), this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Bt ? n.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs,
                                    statId: "downloading_rk_torrentsave_click"
                                }, {
                                    type: "normal",
                                    label: "复制磁力链接",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    statId: "downloading_rk_copymagnet_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }) : n.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                })
                            } else {
                                let e = l.TaskStatusHelper.canStopSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, this.contextInfo),
                                    t = l.TaskStatusHelper.canStartSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, this.contextInfo);
                                e && n.unshift({
                                    type: "normal",
                                    label: "暂停(&P)",
                                    icon: `${__rootDir}/static/icon/stoptask.png`,
                                    id: d.ContextMenuIdsNS.contextMenuDownloadPause
                                }), t && n.unshift({
                                    type: "normal",
                                    label: "开始(&S)",
                                    icon: `${__rootDir}/static/icon/startalltask.png`,
                                    id: d.ContextMenuIdsNS.contextMenuDownloadStart
                                });
                                let i = l.TaskStatusHelper.canCopySelectTaskLink(this.contextInfo);
                                n.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    enabled: i,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                })
                            }
                            this.popMenuInternal(n)
                        }
                        break;
                    case K.CompletedItem:
                        if (null !== this.contextInfo && this.contextInfo.length > 0) {
                            let e = [];
                            if (-1 === this.categoryId ? e.push({
                                type: "normal",
                                label: "删除(&D)",
                                icon: `${__rootDir}/static/icon/deletetask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDelete,
                                statId: "finished_rk_delete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }, {
                                type: "normal",
                                label: "彻底删除(&Q)",
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "finished_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }) : e.push({
                                type: "normal",
                                label: "彻底删除(&D)",
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }), e.push({
                                type: "normal",
                                label: "重新下载(&T)",
                                icon: `${__rootDir}/static/icon/redownload.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadRedownload,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }), -1 === this.categoryId) {
                                let t = yield this.getLastestSavePathsOptions(!0, "CopyToDir", "LatestSavePath", !0);
                                t.push({
                                    type: "normal",
                                    label: "其他目录",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyFileOther,
                                    statId: "finished_rk_copyfiles_click",
                                    extData: "button=other"
                                }), e.splice(2, 0, {type: "submenu", label: "复制文件到", submenu: t});
                                let n = yield this.getLastestSavePathsOptions(!0, "MoveToDir", "LatestSavePath");
                                n.push({
                                    type: "normal",
                                    label: "其他目录",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadMoveFileOther,
                                    enabled: !0,
                                    statId: "finished_rk_move_click",
                                    extData: "button=other"
                                }), e.splice(2, 0, {type: "separator"}, {type: "submenu", label: "移动文件到", submenu: n})
                            }
                            if (1 === this.contextInfo.length) {
                                e.splice(2, 0, {
                                    type: "normal",
                                    label: "重命名(&R)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadRename,
                                    statId: "finished_rk_rename_click"
                                });
                                let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(this.contextInfo[0]),
                                    n = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(this.contextInfo[0]);
                                e.splice(0, 0, {
                                    type: "normal",
                                    label: "打开文件(&O)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadFile,
                                    statId: "finished_rk_openfiles_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    enabled: n,
                                    userData: this.searchMode
                                }, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "finished_rk_openfolders_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    enabled: t,
                                    userData: this.searchMode
                                }), this.searchMode && e.splice(2, 0, {
                                    type: "normal",
                                    label: "打开任务位置(&G)",
                                    id: d.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                    statId: "openfile_position_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                });
                                let i = 2;
                                U.canEnterGroupAccelerate(this.contextInfo[0].taskId) && (e.splice(i, 0, {
                                    type: "normal",
                                    label: "组队加速",
                                    icon: `${__rootDir}/static/icon/groupaccelerate.png`,
                                    id: d.ContextMenuIdsNS.contextMenuGroupAccelerate,
                                    statId: "finished_rk_groupspeedup_click"
                                }), i += 1), O.getTaskFromTaskId(this.contextInfo[0].taskId).isSupportPlay() ? e.splice(i, 0, {
                                    type: "normal",
                                    label: "字幕搜索",
                                    icon: `${__rootDir}/static/icon/sunbtitle.png`,
                                    id: d.ContextMenuIdsNS.contxtMenuSubtitleSearch,
                                    statId: "finished_rk_subtitlesearch_click"
                                }, {type: "separator"}) : e.splice(i, 0, {type: "separator"}), this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Bt ? e.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs,
                                    statId: "finished_rk_torrent_click"
                                }, {
                                    type: "normal",
                                    label: "复制磁力链接",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    statId: "finished_rk_copymagnet_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                }) : e.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "finished_rk_copyurl_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                })
                            } else {
                                let t = l.TaskStatusHelper.canCopySelectTaskLink(this.contextInfo);
                                e.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "finished_rk_copyurl_click",
                                    enabled: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                })
                            }
                            this.popMenuInternal(e)
                        }
                        break;
                    case K.RecycleBlank: {
                        let e = !0;
                        null !== this.contextInfo && 0 === this.contextInfo.length && (e = !1);
                        let t = [{
                            type: "normal",
                            label: "清空(&B)",
                            enabled: e,
                            id: d.ContextMenuIdsNS.contextMenuDownloadClear
                        }];
                        this.popMenuInternal(t)
                    }
                        break;
                    case K.RecycleItem:
                        if (null !== this.contextInfo && this.contextInfo.length > 0) {
                            let e = [{
                                type: "normal",
                                label: "打开任务位置(&G)",
                                id: d.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                statId: "openfile_position_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            }, {
                                type: "normal",
                                label: "还原(&R)",
                                id: d.ContextMenuIdsNS.contextMenuDownloadRecover,
                                statId: "dustbin_rk_undo_click"
                            }, {
                                type: "normal",
                                label: "清空(&B)",
                                id: d.ContextMenuIdsNS.contextMenuDownloadClear,
                                statId: "dustbin_rk_clear_click"
                            }, {
                                type: "normal",
                                label: "彻底删除(&Q)",
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "dustbin_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            }, {type: "separator"}, {
                                type: "normal",
                                label: "重新下载(&T)",
                                icon: `${__rootDir}/static/icon/redownload.png`,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle,
                                id: d.ContextMenuIdsNS.contextMenuDownloadRedownload
                            }];
                            if (this.searchMode || e.shift(), 1 === this.contextInfo.length) {
                                let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(this.contextInfo[0]),
                                    n = this.contextInfo[0].taskStatus;
                                if (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                                    let n = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(this.contextInfo[0]);
                                    e.splice(2, 0, {type: "separator"}, {
                                        type: "normal",
                                        label: "打开文件(&O)",
                                        id: d.ContextMenuIdsNS.contextMenuDownloadFile,
                                        categoryView: s.DownloadKernel.CategroyViewID.Recycle,
                                        statId: "dustbin_rk_openfiles_click",
                                        enabled: n,
                                        userData: this.searchMode
                                    }, {
                                        type: "normal",
                                        label: "打开文件夹(&F)",
                                        id: d.ContextMenuIdsNS.contextMenuDownloadFolder,
                                        statId: "dustbin_rk_openfolders_click",
                                        enabled: t,
                                        userData: this.searchMode,
                                        categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                    })
                                } else e.splice(2, 0, {type: "separator"}, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "dustbin_rk_openfolders_click",
                                    enabled: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                });
                                this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Bt ? e.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs
                                }, {
                                    type: "normal",
                                    label: "复制磁力链接",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                }) : e.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "dustbin_rk_copyurl_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                })
                            } else {
                                e.splice(1, 0, {type: "separator"});
                                let t = l.TaskStatusHelper.canCopySelectTaskLink(this.contextInfo);
                                e.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "dustbin_rk_copyurl_click",
                                    enabled: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                })
                            }
                            this.popMenuInternal(e)
                        }
                        break;
                    case K.ToolbarMore:
                        if (null !== this.contextInfo) {
                            let e = this.contextInfo.currentSelectdTaskInfos.length > 0, t = [{
                                type: "normal",
                                label: "彻底删除任务",
                                id: d.ContextMenuIdsNS.contextMenuToolbarMoreDestroy,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                enabled: e,
                                statId: "top_morelist_click",
                                extData: "button=completedelete"
                            }, {
                                type: "submenu",
                                label: "排序",
                                submenu: this.getSortSubMenuOptions(this.contextInfo)
                            }, {
                                type: "normal",
                                label: "设置中心",
                                icon: `${__rootDir}/static/icon/config.png`,
                                id: d.ContextMenuIdsNS.contextMenuToolbarMoreConfig,
                                statId: "top_morelist_click",
                                extData: "button=setting"
                            }, {
                                type: "normal",
                                label: "搜索下载记录",
                                id: d.ContextMenuIdsNS.contextMenuToolbarMoreOpenSearch,
                                statId: "top_morelist_click",
                                extData: "button=searchtask"
                            }];
                            this.popMenuInternal(t)
                        }
                        break;
                    case K.ChangeCategory: {
                        let e = [{
                            type: "checkbox",
                            label: "我的电脑",
                            id: d.ContextMenuIdsNS.contextMenuTabChangeCategoryMyComputer,
                            checked: -1 === this.contextInfo,
                            statId: "top_dropdownlist_click",
                            extData: "button=computer"
                        }, {
                            type: "checkbox",
                            label: "私人空间",
                            id: d.ContextMenuIdsNS.contextMenuTabChangeCategoryPrivateSpace,
                            checked: -1 !== this.contextInfo,
                            statId: "top_dropdownlist_click",
                            extData: "button=private"
                        }];
                        this.popMenuInternal(e)
                    }
                        break;
                    case K.PrivateSpaceHome: {
                        let e = [{
                            type: "normal",
                            label: "全选",
                            id: d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceSelectAll
                        }, {
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {type: "separator"}, {
                            type: "normal",
                            label: "私人空间下载设置",
                            id: d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting
                        }];
                        this.popMenuInternal(e)
                    }
                        break;
                    case K.SearchMultiSel: {
                        let e = l.TaskStatusHelper.canCopySelectTaskLink(this.contextInfo), t = [{
                            type: "normal",
                            label: "删除(&D)",
                            icon: `${__rootDir}/static/icon/deletetask.png`,
                            id: d.ContextMenuIdsNS.contextMenuDownloadDelete,
                            userData: this.searchMode
                        }, {
                            type: "normal",
                            label: "彻底删除(&Q)",
                            icon: `${__rootDir}/static/icon/destroytask.png`,
                            id: d.ContextMenuIdsNS.contextMenuDownloadDestroy,
                            userData: this.searchMode
                        }, {
                            type: "normal",
                            label: "复制下载链接(&C)",
                            id: d.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                            enabled: e,
                            userData: this.searchMode
                        }];
                        this.popMenuInternal(t)
                    }
                }
            })
        }

        getSortConfig(e) {
            let t = {sortBy: v.SortNS.SortType.Default, asce: !0};
            do {
                if (null === e || void 0 === e) break;
                let n = e.currentCategoryViewId;
                if (null === n || void 0 === n) break;
                let i = e.currentCategoryId;
                t = v.SortNS.getSortConfig(n, i)
            } while (0);
            return t
        }

        getSortSubMenuOptions(e) {
            let t = [];
            do {
                if (null === e || void 0 === e) break;
                let n = e.currentCategoryViewId;
                if (null === n || void 0 === n) break;
                let i = this.getSortConfig(e);
                P.information("sort_by", i);
                let a = i.sortBy === v.SortNS.SortType.ByTime_Remain || i.sortBy === v.SortNS.SortType.ByTime_Creation || i.sortBy === v.SortNS.SortType.ByTime_Completion,
                    o = "按时间", r = "";
                n === s.DownloadKernel.CategroyViewID.Downloading ? (o = "按创建时间", r = "downloading_rk_rank_click") : n === s.DownloadKernel.CategroyViewID.Completed ? (o = "按完成时间", r = "finished_rk_rank_click") : n === s.DownloadKernel.CategroyViewID.Recycle && (o = "按删除时间", r = "dustbin_rk_rank_click"), t = [{
                    type: "checkbox",
                    label: "默认",
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortByDefault,
                    statId: r,
                    extData: "rank_type=default",
                    checked: i.sortBy === v.SortNS.SortType.Default
                }, {
                    type: "checkbox",
                    label: o,
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortByTime,
                    checked: a,
                    statId: r,
                    extData: "rank_type=create_time",
                    userData: a ? i.asce : void 0
                }, {
                    type: "checkbox",
                    label: "按文件名 A-Z",
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortByName,
                    checked: i.sortBy === v.SortNS.SortType.ByName,
                    statId: r,
                    extData: "rank_type=file_name",
                    userData: i.sortBy === v.SortNS.SortType.ByName ? i.asce : void 0
                }, {
                    type: "checkbox",
                    label: "按文件大小",
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortBySize,
                    checked: i.sortBy === v.SortNS.SortType.BySize,
                    statId: r,
                    extData: "rank_type=file_size",
                    userData: i.sortBy === v.SortNS.SortType.BySize ? i.asce : void 0
                }], n === s.DownloadKernel.CategroyViewID.Downloading && t.splice(2, 0, {
                    type: "checkbox",
                    label: "按当前进度",
                    id: d.ContextMenuIdsNS.contextMenuToolbarMoreSortByProgress,
                    checked: i.sortBy === v.SortNS.SortType.ByProgress,
                    statId: r,
                    extData: "rank_type=progress_speed",
                    userData: i.sortBy === v.SortNS.SortType.ByProgress ? i.asce : void 0
                })
            } while (0);
            return t
        }

        getLastestSavePathsOptions(e, t, n, a) {
            return i(this, void 0, void 0, function* () {
                let i = m.ConfigNS.getValue(t, n, []), o = [],
                    r = d.ContextMenuIdsNS.contextMenuDownloadMoveFileLastest;
                a && (r = d.ContextMenuIdsNS.contextMenuDownloadCopyFileLastest);
                for (let t of i) {
                    let n = /&/gi;
                    t = t.replace(n, "&&"), o.push({type: "normal", label: t, enabled: e, id: r})
                }
                return o
            })
        }

        handleMenuClick(e) {
            let t = e.id, n = e.label, a = e.categoryView;
            switch (t) {
                case d.ContextMenuIdsNS.contextMenuDownloadSelectAll:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "select_all");
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadDeleteNonexisting:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        if (void 0 === this.contextInfo.completedTaskBaseList || null === this.contextInfo.completedTaskBaseList) break;
                        if (0 === this.contextInfo.completedTaskBaseList.length) break;
                        h.TaskOperatorNs.removeNonExistingTask(this.contextInfo.completedTaskBaseList).catch(e => {
                            P.warning(e)
                        })
                    } while (0);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadAsReadedAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        if (void 0 === this.contextInfo.completedTaskBaseList || null === this.contextInfo.completedTaskBaseList) break;
                        if (0 === this.contextInfo.completedTaskBaseList.length) break;
                        h.TaskOperatorNs.markReadStatus(this.contextInfo.completedTaskBaseList, 1)
                    } while (0);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadImportUncomplete:
                    h.TaskOperatorNs.importUncompleted();
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadFolder:
                    !0 === e.userData && p.XLStatNS.trackEvent("download_leftpanel", "search_rk_openfolders_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && (h.TaskOperatorNs.openTaskFolder(this.contextInfo[0]).catch(e => {
                        P.warning(e)
                    }), void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed && h.TaskOperatorNs.markReadStatus(this.contextInfo, 1));
                    break;
                case d.ContextMenuIdsNS.contextMenuGroupAccelerate:
                    a === s.DownloadKernel.CategroyViewID.Downloading ? L.openGroupAccelerateTabByTaskId(this.contextInfo[0].taskId, "menu", "downloading", void 0).catch() : L.openGroupAccelerateTabByTaskId(this.contextInfo[0].taskId, "menu", "complete", void 0).catch();
                    break;
                case d.ContextMenuIdsNS.contxtMenuSubtitleSearch: {
                    let e = this.contextInfo[0].taskId, t = O.getTaskFromTaskId(e), n = t.getTaskName(),
                        i = t.getType(), a = "";
                    t && (a = t.getSavePath()), i === s.DownloadKernel.TaskType.Bt && t.getExtraObject().getDownloadFile().length > 1 && (a = x.join(a, n));
                    let o = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId), r = B.getDisaplayName(e),
                        l = 0;
                    (l = r.length) > 1 ? T.MessageBox.custom("SubtitleTaskFilelist", {
                        size: "large",
                        taskId: e,
                        taskName: n,
                        taskType: i,
                        fileList: r,
                        saveDir: a,
                        categoryViewId: o
                    }, {
                        center: !0,
                        width: 460,
                        height: 358
                    }).catch() : T.MessageBox.custom("SubtitleSearch", {
                        size: "large",
                        taskId: e,
                        taskName: r[0].fileName,
                        cid: r[0].cid,
                        saveDir: a,
                        from: "taskList",
                        categoryViewId: o
                    }, {center: !0, width: 460, height: 358}).catch()
                }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadStartAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        if (void 0 === this.contextInfo.downloadingTaskBaseList || null === this.contextInfo.downloadingTaskBaseList) break;
                        if (0 === this.contextInfo.downloadingTaskBaseList.length) break;
                        h.TaskOperatorNs.startAll()
                    } while (0);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadStart:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.startTasks(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadPauseAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        if (void 0 === this.contextInfo.downloadingTaskBaseList || null === this.contextInfo.downloadingTaskBaseList) break;
                        if (0 === this.contextInfo.downloadingTaskBaseList.length) break;
                        h.TaskOperatorNs.pauseTasks(this.contextInfo.downloadingTaskBaseList, s.DownloadKernel.TaskStopReason.ContextMenu)
                    } while (0);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadPause:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.pauseTasks(this.contextInfo, s.DownloadKernel.TaskStopReason.ContextMenu);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadDelete:
                    !0 === e.userData && p.XLStatNS.trackEvent("download_leftpanel", "search_rk_delete_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && h.TaskOperatorNs.deleteTasks(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadDestroy:
                    !0 === e.userData && p.XLStatNS.trackEvent("download_leftpanel", "search_rk_completedelete_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && h.TaskOperatorNs.destroyTasks(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace:
                    this.contextInfo.length > 0 && b.default(!1, !0).then(e => {
                        e && "" !== e && w.PrivateSpaceHelperNS.accessPrivateCategory(e).then(t => {
                            if (0 === t) {
                                let t = F.getPrivateCategoryFromUserId(e);
                                t && h.TaskOperatorNs.moveCategoryTask(this.contextInfo, t.getId())
                            }
                        }, () => {
                        })
                    }).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace:
                    this.contextInfo.length > 0 && F.getCurrentPrivateCategory() && h.TaskOperatorNs.moveCategoryTask(this.contextInfo, -1);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveFileOther:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.move2Dir(this.contextInfo).catch(e => {
                        P.warning(e)
                    });
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveFileLastest:
                    if (this.contextInfo.length > 0) {
                        let e = /&&/gi, t = n.replace(e, "&");
                        h.TaskOperatorNs.move2Dir(this.contextInfo, t).catch(e => {
                            P.warning(e)
                        })
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveTop:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "move_up");
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMoveBottom:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "move_down");
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadMerge:
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadVipAcc:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.vipAcclerate(this.contextInfo).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadCopyLink:
                    !0 === e.userData && p.XLStatNS.trackEvent("download_leftpanel", "search_rk_copylink_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && h.TaskOperatorNs.copyLink(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadCopyMagnet:
                    !0 === e.userData && p.XLStatNS.trackEvent("download_leftpanel", "search_rk_copylink_click", "", 0, 0, 0, 0, this.getStatExtData(a)), this.contextInfo.length > 0 && h.TaskOperatorNs.copyMagnetLink(this.contextInfo[0]);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.saveAsTorrent(this.contextInfo[0]).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadFile: {
                    !0 === e.userData && p.XLStatNS.trackEvent("download_leftpanel", "search_rk_openfiles_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = "";
                    if (e.categoryView === s.DownloadKernel.CategroyViewID.Completed ? t = "finished" : e.categoryView === s.DownloadKernel.CategroyViewID.Recycle && (t = "dustbin"), this.contextInfo.length > 0) {
                        if (this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Bt) {
                            let e = O.getTaskFromTaskId(this.contextInfo[0].taskId);
                            g.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                                e ? h.TaskOperatorNs.openTaskItem(this.contextInfo[0]).catch() : h.TaskOperatorNs.openTaskFolder(this.contextInfo[0], !0).catch()
                            }).catch()
                        } else if (this.contextInfo[0].taskType === s.DownloadKernel.TaskType.Group) {
                            let e = O.getTaskFromTaskId(this.contextInfo[0].taskId);
                            h.TaskOperatorNs.executeInstallFile(e).then(e => {
                                e || h.TaskOperatorNs.openTaskFolder(this.contextInfo[0], !0).catch()
                            }).catch()
                        } else h.TaskOperatorNs.openTaskItem(this.contextInfo[0], void 0, void 0, t, this.categoryId).catch(e => {
                            P.warning(e)
                        });
                        void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed && h.TaskOperatorNs.markReadStatus(this.contextInfo, 1)
                    }
                }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadRename:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.renameTask(this.contextInfo[0]);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadCopyFileOther:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.copy2Dir(this.contextInfo).catch(e => {
                        P.warning(e)
                    });
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadCopyFileLastest:
                    if (this.contextInfo.length > 0) {
                        let e = /&&/gi, t = n.replace(e, "&");
                        h.TaskOperatorNs.copy2Dir(this.contextInfo, t).catch(e => {
                            P.warning(e)
                        })
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadRedownload:
                    if (this.contextInfo.length > 0) {
                        let e = "";
                        void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed ? e = "finished_rk_reload_click" : a === s.DownloadKernel.CategroyViewID.Recycle && (e = "dustbin_rk_reload_click"), c.TaskCtrlOperatorNS.redownloadTask(this.contextInfo, void 0, e).catch()
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadRecover:
                    this.contextInfo.length > 0 && h.TaskOperatorNs.recoverTask(this.contextInfo);
                    break;
                case d.ContextMenuIdsNS.contextMenuDownloadClear:
                    h.TaskOperatorNs.clearRecycle();
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreConfig:
                    if (null !== this.contextInfo) {
                        let e = {tabType: k.TabType.XDAS, tabParam: {title: "设置中心", name: "conf-setting"}};
                        p.XLStatNS.trackEvent("setting_center", "setting_panel_show", "", 0, 0, 0, 0, "entry=download_panel"), this.contextInfo.CREATE_NEW_TAB(e)
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreOpenSearch:
                    I.default.fireEvent(f.NodeEventMesssageNS.eventShowSearchTaskPage, !0);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByDefault:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.Default, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByTime:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.ByTime, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByType:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.ByType, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByName:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.ByName, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortBySize:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.BySize, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByStatus:
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreSortByProgress:
                    v.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, v.SortNS.SortType.ByProgress, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarMoreDestroy:
                    if (null !== this.contextInfo) {
                        let e = this.contextInfo.currentSelectdTaskInfos;
                        null !== e && void 0 !== e && e.length > 0 && h.TaskOperatorNs.destroyTasks(e)
                    }
                    break;
                case d.ContextMenuIdsNS.contextMenuTabChangeCategoryMyComputer:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "my_computer");
                    break;
                case d.ContextMenuIdsNS.contextMenuTabChangeCategoryPrivateSpace:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "private_space");
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceSelectAll:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "select_all");
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting:
                    S.default("GetUserID").then(e => i(this, void 0, void 0, function* () {
                        if (e && "" !== e) {
                            let t = m.ConfigNS.getValue("PrivateSpaceDefaultPath", e, ""),
                                n = m.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1);
                            T.MessageBox.custom("private-space-download-setting", {
                                savePath: t,
                                hideLocalDir: 1 === n
                            }).then(t => i(this, void 0, void 0, function* () {
                                t.action === E.MessageBoxNS.Action.OK && (m.ConfigNS.setValue("PrivateSpaceDefaultPath", e, t.args.savePath), m.ConfigNS.setValue("PrivateSpaceLockUserTask", e, t.args.hideLocalDir), w.PrivateSpaceHelperNS.setPrivateSavePath(e, t.args.savePath).then().catch(), w.PrivateSpaceHelperNS.setAllTaskFileHidden(e, 1 === t.args.hideLocalDir))
                            })).catch()
                        }
                    })).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceTaskManager:
                    T.MessageBox.custom("private-space-task-manager", {}).catch();
                    break;
                case d.ContextMenuIdsNS.contextMenuOpenTaskPosition:
                    !0 === e.userData && p.XLStatNS.trackEvent("download_leftpanel", "search_rk_openlocation_click", "", 0, 0, 0, 0, this.getStatExtData(a)), I.default.fireEvent(f.NodeEventMesssageNS.eventShowSearchTaskPage, !1), D.ThunderNewTask.selectTask(this.contextInfo[0].taskId)
            }
        }

        getStatExtData(e) {
            let t = "mypc";
            -1 !== I.default.getCurrentCategoryId() && (t = "private");
            let n = "unknown";
            switch (e) {
                case s.DownloadKernel.CategroyViewID.Completed:
                    n = "finished";
                    break;
                case s.DownloadKernel.CategroyViewID.Downloading:
                    n = "downloading";
                    break;
                case s.DownloadKernel.CategroyViewID.Recycle:
                    n = "dustbin"
            }
            return "panel_type=" + t + ",panel=" + n
        }

        popMenuInternal(e) {
            let t = this.buildMenuTemplate(e);
            if (t.length > 0) {
                const e = a.remote.getCurrentWindow();
                this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuPopup, t);
                const n = a.remote.Menu.buildFromTemplate(t);
                M.MenuSkinNS.setStyle(n, {}), n.popup({
                    window: e,
                    async: !1
                }), this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuEnd)
            }
        }

        canSelectTaskAcc(e) {
            return i(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: t} = yield Promise.resolve().then(() => n(53));
                let i = {enable: !1, text: "会员加速"};
                do {
                    if (void 0 === e) break;
                    if (0 === e.length) break;
                    let n = [];
                    for (let t of e) n.push(t.taskId);
                    let a = t.getVipAccelerateMenuState(n);
                    if (a) {
                        let e = JSON.parse(a);
                        e && (i.enable = e.enable, e.text && (i.text = e.text))
                    }
                } while (0);
                return i
            })
        }

        statExtData(e) {
            let t = "panel_type=mypc";
            return -1 !== this.categoryId && (t = "panel_type=private"), void 0 !== e && "" !== e && (t = t + "," + e), t
        }

        buildMenuTemplate(e) {
            let t = [];
            for (let n = 0; n < e.length; n++) {
                let i = null, a = e[n];
                if ("submenu" === a.type) {
                    let e = this.buildMenuTemplate(a.submenu);
                    i = {type: a.type, label: a.label, submenu: e}
                } else i = "separator" === a.type ? {type: a.type} : {
                    type: a.type,
                    label: a.label,
                    enabled: a.enabled,
                    icon: a.icon,
                    id: a.id,
                    checked: a.checked,
                    click: (e, t, n) => {
                        if (P.verbose(e, t, n), void 0 !== a.statId && "" !== a.statId) {
                            void 0 === a.extData && (a.extData = "");
                            let e = this.statExtData(a.extData);
                            P.information("trackEvent", "download_leftpanel", a.statId, e), p.XLStatNS.trackEvent("download_leftpanel", a.statId, "", 0, 0, 0, 0, e)
                        }
                        this.handleMenuClick(a)
                    }
                };
                null !== i && t.push(i)
            }
            return t
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(27), o = n(2), r = n(45), s = n(9), l = n(5), u = n(22), d = n(23), c = n(297), h = n(1), f = n(6),
        p = n(65), g = n(103), k = n(150), m = h.default.getLogger("AdHelperNS"),
        T = l.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    a.default.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
    const v = "1.0", y = "14", S = "1b301990901c336d84fbdd8bc8dda35c";
    !function (e) {
        let t;

        function n(e) {
            let t = "";
            do {
                if (null === e || void 0 === e) break;
                Object.keys(e).forEach(n => {
                    let i = e[n];
                    t = `${t}${n}=${i}`
                }), t = `${t}${S}`, t = r.ToolsUtilitiesAWNS.genarateMd5(t)
            } while (0);
            return t
        }

        function l(e, a, o) {
            return i(this, void 0, void 0, function* () {
                let r = "", s = "";
                s = void 0 === o || null === o || !1 === o ? "" : yield function () {
                    return i(this, void 0, void 0, function* () {
                        let e = t.unLogin;
                        if (yield p.LoginHelperNS.loginHelper.isLoginedAw()) {
                            let n = yield p.LoginHelperNS.loginHelper.getAllUserInfoAw();
                            if (null === n || void 0 === n || null === n.vipList || void 0 === n.vipList || n.vipList.length <= 0) e = t.noVip; else {
                                let i = n.vipList[0], a = Number(i.isVip), o = Number(i.vasType), r = Number(i.isYear);
                                0 === a ? e = t.noVip : 3 === o ? e = 0 !== r ? t.bjN : t.bjVip : 5 === o && (e = 0 !== r ? t.cjN : t.cjVip)
                            }
                        }
                        return e
                    })
                }();
                let l = {
                    appId: y,
                    callId: Date.now(),
                    devicId: T.getPeerID(),
                    identity: s,
                    isAll: 1,
                    positionId: e,
                    shownOrderId: a,
                    v
                };
                return l.sig = n(l), Object.keys(l).forEach(e => {
                    let t = l[e];
                    r = "" === r ? `${e}=${encodeURIComponent(t)}` : `${r}&${e}=${encodeURIComponent(t)}`
                }), r
            })
        }

        function h() {
            let e = "", t = k.default.getConfigInfo("ad", "url");
            return null !== t && void 0 !== t && "" !== t && ("/" === t.slice(t.length - 1) && (t = t.slice(0, t.length - 1)), e = t), 1 === u.ConfigNS.getValue("Ad", "AdServer", 0) && (e = "http://test.api-shoulei-ssl.xunlei.com"), e
        }

        !function (e) {
            e.unLogin = "1", e.noVip = "2", e.bjVip = "21", e.cjVip = "22", e.bjN = "23", e.cjN = "24", e.knVip = "41", e.knN = "42"
        }(t || (t = {})), e.getAdDataAw = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = null;
                do {
                    let o = k.default.getConfigInfo("ad", "enable");
                    if (0 === o) {
                        m.information("获取到的配置中信息，不显示广告 enable = ", o);
                        break
                    }
                    if (null === e || void 0 === e) break;
                    let r = `${h()}/api/adp/get`, s = null, u = yield l(e, t, n);
                    m.information("getAdDataAw:", r, u);
                    try {
                        null !== (s = yield a.default({
                            method: "post",
                            url: r,
                            data: u
                        })) && void 0 !== s && 200 === s.status && void 0 !== s.data && null !== s.data && "" !== s.data && (i = s.data)
                    } catch (e) {
                        m.information(e)
                    }
                } while (0);
                return i
            })
        }, e.statServer = function (e, t, o) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (null === e || void 0 === e || null === t || void 0 === t || null === o || void 0 === o) break;
                    let i = {positionId: e, orderId: t, statType: o, statValue: 1}, r = [];
                    r.push(i);
                    let s = {
                        appId: y,
                        callId: Date.now(),
                        guid: T.getPeerID(),
                        identity: "",
                        items: JSON.stringify(r),
                        positionId: e,
                        v
                    };
                    s.sig = n(s);
                    let l = "";
                    Object.keys(s).forEach(e => {
                        let t = s[e];
                        l = "" === l ? `${e}=${encodeURIComponent(t)}` : `${l}&${e}=${encodeURIComponent(t)}`
                    });
                    let u = `${h()}/api/adp/addStat`, d = null;
                    m.information("statServer:", u, l);
                    try {
                        null !== (d = yield a.default({
                            method: "post",
                            url: u,
                            data: l
                        })) && void 0 !== d && 200 === d.status && void 0 !== d.data && null !== d.data && "" !== d.data && m.information(d.data)
                    } catch (e) {
                        m.information(e)
                    }
                } while (0)
            })
        }, e.getCurDate = function () {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }, e.onConfigInitAw = function () {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    u.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        e(!0)
                    })
                })
            })
        }, e.loadScene = function (e) {
            return i(this, void 0, void 0, function* () {
                m.information("loadScene enter");
                let t = null, n = o.join(e, "index.js");
                return (yield s.FileSystemAWNS.existsAW(n)) && (t = require(n)), m.information("loadScene leave ", t), t
            })
        }, e.execute = function (e, t, n) {
            let i = 0;
            do {
                let a = t;
                if (null !== a && void 0 !== a && "" !== a || (a = n), null === a || void 0 === a || "" === a) break;
                if (e === c.AdCommonNS.OpenType.tab) {
                    f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", a);
                    break
                }
                if (e === c.AdCommonNS.OpenType.app) {
                    let t = "file://";
                    if (a.indexOf(t) < 0) null !== n && void 0 !== n && "" !== n && f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", n); else {
                        let r = a.substring(t.length);
                        r = o.join(__rootDir, `../../../${r}`), i = T.shellExecute(0, "open", r, "", "", "SW_SHOW"), m.information("execute:", e, r, i), i <= 32 && null !== n && void 0 !== n && "" !== n && f.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", n)
                    }
                    break
                }
                if (e === c.AdCommonNS.OpenType.download) {
                    let e = [];
                    e.push(a), g.ThunderNewTask.createPreNewTaskWindow(e);
                    break
                }
                e === c.AdCommonNS.OpenType.defaultBrowser ? i = T.openURLByDefault(a) : e === c.AdCommonNS.OpenType.ieBrowser && (i = T.openURLByIEorDefault(a))
            } while (0);
            return i
        }
    }(t.AdHelperNS || (t.AdHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(104), o = n(264), r = n(1), s = n(82), l = n(84), u = r.default.getLogger("Thunder.QueryTaskInfo");
    const d = new class extends a.HttpSession {
        constructor() {
            super(), this.lastActiveTaskId = -1, this.curBatchQueryId = void 0, this.timerId = null
        }

        queryP2spTaskInfo(e) {
            return i(this, void 0, void 0, function* () {
                return s.Common.isThunderPrivateUrl(e) && (e = s.Common.parseThunderPrivateUrl(e)), new Promise(t => {
                    this.queryResInfo("url", e).then(e => {
                        let n = {result: 0, gcid: "", fileSize: 0, errCode: 0};
                        e && 200 === e.status && null !== e.data && null !== e.data.code && 0 === e.data.code && "" !== e.data.gcid && (n.result = e.data.code, n.fileSize = e.data.file_size, n.gcid = e.data.gcid, t(n))
                    }).catch(() => {
                        t(null)
                    })
                })
            })
        }

        asyncBatchQueryP2spTaskInfoByUrl(e, t, n) {
            return i(this, void 0, void 0, function* () {
                if (!e || 0 === e.length) return 0;
                void 0 === this.curBatchQueryId ? this.curBatchQueryId = 1 : this.curBatchQueryId += 1;
                let i = 0;
                for (; i < e.length; ++i) {
                    let n = yield this.queryP2spTaskInfo(e[i]);
                    n && t(e[i], n, i), yield this.delay(200)
                }
                return i >= e.length && n && "function" == typeof n && n(this.curBatchQueryId), this.curBatchQueryId
            })
        }

        postRequestEd2kTaskInfoByEd2kLink(e) {
            return s.Common.isThunderPrivateUrl(e) && (e = s.Common.parseThunderPrivateUrl(e)), new Promise(t => {
                this.host = "hub5idx.shub.sandai.net", this.port = 80, this.retries = 1, this.timeout = 15e3, this.body = o.QueryTaskInfoPackageNS.createQueryEd2kTaskInfoBuffer(e), this.post(e => {
                    let n = null;
                    200 === e.statusCode && e.body && e.body.length > 12 && (n = o.QueryTaskInfoPackageNS.praseEd2kTaskInfoBuffer(e.body)), u.information("postRequestEd2kTaskInfoByEd2kLink", n), t(n)
                }, e => {
                    u.error("postRequestEd2kTaskInfoByEd2kLink", e), t(null)
                })
            })
        }

        delay(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    setTimeout(t, e)
                })
            })
        }

        queryResInfo(e, t) {
            return i(this, void 0, void 0, function* () {
                return l.fetchPCRes({url: "/xlppc.resinfo.api/v1/queryresinfo", data: {type: e, res: t}}, "prod", !0)
            })
        }
    };
    !function (e) {
        e.postRequestEd2kTaskInfoByEd2kLink = function (e) {
            return i(this, void 0, void 0, function* () {
                return d.postRequestEd2kTaskInfoByEd2kLink(e)
            })
        }, e.asyncBatchQueryP2spTaskInfoByUrl = function (e, t, n) {
            return i(this, void 0, void 0, function* () {
                return d.asyncBatchQueryP2spTaskInfoByUrl(e, t, n)
            })
        }, e.queryResInfo = function (e, t) {
            return i(this, void 0, void 0, function* () {
                return d.queryResInfo(e, t)
            })
        }
    }(t.QueryTaskInfoHelperNS || (t.QueryTaskInfoHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(5), o = n(206), r = n(207), s = n(1).default.getLogger("Thunder.QueryTaskInfoPackage"),
        l = a.default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t = 0;

        function n() {
            let e = 0, t = i.join(__rootDir, "../../Thunder.exe"), n = l.getFileVersion(t).split(".");
            if (n && 4 === n.length) {
                e = 26 * Number(n[0]).valueOf() + 18 * Number(n[1]).valueOf() + Number(n[3]).valueOf()
            }
            return e
        }

        function a() {
            return l.getPeerID()
        }

        e.createQueryP2spTaskInfoBuffer = function (e) {
            let i = 0, l = Buffer.alloc(10240);
            return s.information("createQueryP2spTaskInfoBuffer protocolVersion", 61, i), i = l.writeUInt32LE(61, i), s.information("createQueryP2spTaskInfoBuffer sequence", t, i), i = l.writeUInt32LE(++t, i), s.information("createQueryP2spTaskInfoBuffer command length", "0", i), i = l.writeUInt32LE(0, i), s.information("createQueryP2spTaskInfoBuffer thunder ver", n(), i), i = l.writeUInt32LE(n(), i), s.information("createQueryP2spTaskInfoBuffer compress flag", "0", i), i = l.writeUInt16LE(0, i), s.information("createQueryP2spTaskInfoBuffer reserved", "0", i), i = r.BufferUtilitiesNS.writeString(l, "", i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer command", "2021", i), i = l.writeUInt16LE(2021, i), s.information("createQueryP2spTaskInfoBuffer by what", "2", i), i = l.writeUInt8(2, i), s.information("createQueryP2spTaskInfoBuffer body length", "0", i), i = l.writeUInt32LE(0, i), s.information("createQueryP2spTaskInfoBuffer url", e, i), i = r.BufferUtilitiesNS.writeString(l, e, i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", i), i = l.writeInt32LE(-1, i), s.information("createQueryP2spTaskInfoBuffer", "origin url", i), i = r.BufferUtilitiesNS.writeString(l, "", i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", i), i = l.writeInt32LE(-1, i), s.information("createQueryP2spTaskInfoBuffer", "refurl", i), i = r.BufferUtilitiesNS.writeString(l, "", i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", i), i = l.writeInt32LE(-1, i), s.information("createQueryP2spTaskInfoBuffer", a(), i), i = r.BufferUtilitiesNS.writeString(l, a(), i, "utf-8"), s.information("createQueryP2spTaskInfoBuffer", "ip", i), i = l.writeInt32LE(0, i), i = l.writeInt32LE(0, i), i = l.writeInt32LE(-1, i), i = l.writeInt32LE(-1, i), s.information("createQueryP2spTaskInfoBuffer", "length", i), l = l.slice(0, i), s.information("createQueryP2spTaskInfoBuffer", l), l = o.ShubCryptoNS.encryptHttpBuffer(l)
        }, e.praseP2spTaskInfoBuffer = function (e) {
            let t = {result: 0, gcid: "", fileSize: 0, errCode: 0};
            try {
                e = o.ShubCryptoNS.decryptHttpBuffer(e);
                let n = 0, i = e.readUInt32LE(n);
                s.information("protocolVersion:", i), n += 4;
                let a = e.readUInt32LE(n);
                s.information("sequence:", a), n += 4;
                let l = e.readUInt32LE(n);
                s.information("commandLegth:", l), n += 4;
                let u = e.readUInt32LE(n);
                s.information("thunderVersion:", u), n += 4;
                let d = e.readUInt16LE(n);
                s.information("compressFlag:", d), n += 2, n = r.BufferUtilitiesNS.readString(e, n, "utf-8")[0];
                let c = e.readUInt16LE(n);
                if (s.information("commandType:", c), n += 2, t.result = e.readUInt8(n), n += 1, 1 === t.result) {
                    n = r.BufferUtilitiesNS.readString(e, n, "hex")[0];
                    let i = r.BufferUtilitiesNS.readUInt64LE(e, n);
                    n = i[0], t.fileSize = i[1];
                    let a = r.BufferUtilitiesNS.readString(e, n, "hex");
                    n = a[0], t.gcid = a[1].toUpperCase(), s.information("gcid", a[1])
                } else t.errCode = e.readUInt32LE(n);
                s.information("praseTaskInfoBuffer", t)
            } catch (e) {
                s.error("decryptHttpBuffer", e)
            }
            return t
        }, e.createQueryEd2kTaskInfoBuffer = function (e) {
            let i = 0, u = Buffer.alloc(4096);
            s.information("createQueryEd2kTaskInfoBuffer protocolVersion", 60, i), i = u.writeUInt32LE(60, i), s.information("createQueryEd2kTaskInfoBuffer sequence", t, i), i = u.writeUInt32LE(++t, i), s.information("createQueryEd2kTaskInfoBuffer command length", "0", i), i = u.writeUInt32LE(0, i), s.information("createQueryEd2kTaskInfoBuffer thunder ver", n(), i), i = u.writeUInt32LE(n(), i), s.information("createQueryEd2kTaskInfoBuffer compress flag", "0", i), i = u.writeUInt16LE(0, i), s.information("createQueryEd2kTaskInfoBuffer reserved", "0", i), i = r.BufferUtilitiesNS.writeString(u, "", i, "utf-8"), s.information("createQueryEd2kTaskInfoBuffer command", "5001", i), i = u.writeUInt16LE(5001, i), s.information("createQueryEd2kTaskInfoBuffer", a(), i), i = r.BufferUtilitiesNS.writeString(u, a(), i, "utf-8");
            let d = l.parseEd2kUrl(e), c = d.fileHash;
            i = u.writeInt32LE(c.length / 2, i);
            let h = 0, f = 0;
            for (let e = 0; e < c.length; e += 2) h = parseInt(c.charAt(e), 16), f = parseInt(c.charAt(e + 1), 16), i = u.writeUInt8(h << 4 | f, i);
            return i = r.BufferUtilitiesNS.writeUInt64LE(u, d.fileSize, i), i = u.writeInt32LE(0, i), i = r.BufferUtilitiesNS.writeString(u, "", i, "utf-8"), i = u.writeInt32LE(0, i), i = r.BufferUtilitiesNS.writeString(u, e, i, "utf-8"), u = u.slice(0, i), s.information("createQueryEd2kTaskInfoBuffer before encrypt", u, i), u = o.ShubCryptoNS.encryptHttpBuffer(u)
        }, e.praseEd2kTaskInfoBuffer = function (e) {
            let t = {result: 0, hasRecord: 0, gcid: ""};
            try {
                e = o.ShubCryptoNS.decryptHttpBuffer(e), s.information("praseEd2kTaskInfoBuffer buffer", e);
                let n = 0, i = e.readUInt32LE(n);
                s.information("protocolVersion:", i), n += 4;
                let a = e.readUInt32LE(n);
                s.information("sequence:", a), n += 4;
                let l = e.readUInt32LE(n);
                s.information("commandLegth:", l), n += 4;
                let u = e.readUInt32LE(n);
                s.information("thunderVersion:", u), n += 4;
                let d = e.readUInt16LE(n);
                s.information("compressFlag:", d), n += 2, n = r.BufferUtilitiesNS.readString(e, n, "utf-8")[0];
                let c = e.readUInt16LE(n);
                if (s.information("commandType:", c), n += 2, t.result = e.readUInt8(n), n += 1, 1 === t.result && (t.hasRecord = e.readInt32LE(n), n += 4, 1 === t.hasRecord)) {
                    n = r.BufferUtilitiesNS.readString(e, n, "utf-8")[0], n = r.BufferUtilitiesNS.readString(e, n, "utf-8")[0], n = r.BufferUtilitiesNS.readString(e, n, "hex")[0];
                    let i = r.BufferUtilitiesNS.readString(e, n, "hex");
                    n = i[0], t.gcid = i[1].toUpperCase()
                }
                s.information("praseTaskInfoBuffer", t)
            } catch (e) {
                s.error("decryptHttpBuffer", e)
            }
            return s.information("praseEd2kTaskInfoBuffer response", t), t
        }
    }(t.QueryTaskInfoPackageNS || (t.QueryTaskInfoPackageNS = {}))
}, function (e, t, n) {
    e.exports = !n(110) && !n(144)(function () {
        return 7 != Object.defineProperty(n(266)("div"), "a", {
            get: function () {
                return 7
            }
        }).a
    })
}, function (e, t, n) {
    var i = n(143), a = n(81).document, o = i(a) && i(a.createElement);
    e.exports = function (e) {
        return o ? a.createElement(e) : {}
    }
}, function (e, t, n) {
    var i = n(88), a = n(111), o = n(580)(!1), r = n(218)("IE_PROTO");
    e.exports = function (e, t) {
        var n, s = a(e), l = 0, u = [];
        for (n in s) n != r && i(s, n) && u.push(n);
        for (; t.length > l;) i(s, n = t[l++]) && (~o(u, n) || u.push(n));
        return u
    }
}, function (e, t, n) {
    var i = n(269);
    e.exports = Object("z").propertyIsEnumerable(0) ? Object : function (e) {
        return "String" == i(e) ? e.split("") : Object(e)
    }
}, function (e, t) {
    var n = {}.toString;
    e.exports = function (e) {
        return n.call(e).slice(8, -1)
    }
}, function (e, t, n) {
    var i = n(216);
    e.exports = function (e) {
        return Object(i(e))
    }
}, function (e, t, n) {
    "use strict";
    var i = n(163), a = n(214), o = n(272), r = n(108), s = n(222), l = n(587), u = n(223), d = n(590),
        c = n(112)("iterator"), h = !([].keys && "next" in [].keys()), f = function () {
            return this
        };
    e.exports = function (e, t, n, p, g, k, m) {
        l(n, t, p);
        var T, v, y, S = function (e) {
                if (!h && e in N) return N[e];
                switch (e) {
                    case"keys":
                    case"values":
                        return function () {
                            return new n(this, e)
                        }
                }
                return function () {
                    return new n(this, e)
                }
            }, w = t + " Iterator", b = "values" == g, C = !1, N = e.prototype, D = N[c] || N["@@iterator"] || g && N[g],
            I = D || S(g), _ = g ? b ? S("entries") : I : void 0, x = "Array" == t && N.entries || D;
        if (x && (y = d(x.call(new e))) !== Object.prototype && y.next && (u(y, w, !0), i || "function" == typeof y[c] || r(y, c, f)), b && D && "values" !== D.name && (C = !0, I = function () {
            return D.call(this)
        }), i && !m || !h && !C && N[c] || r(N, c, I), s[t] = I, s[w] = f, g) if (T = {
            values: b ? I : S("values"),
            keys: k ? I : S("keys"),
            entries: _
        }, m) for (v in T) v in N || o(N, v, T[v]); else a(a.P + a.F * (h || C), t, T);
        return T
    }
}, function (e, t, n) {
    e.exports = n(108)
}, function (e, t, n) {
    var i = n(160), a = n(588), o = n(220), r = n(218)("IE_PROTO"), s = function () {
    }, l = function () {
        var e, t = n(266)("iframe"), i = o.length;
        for (t.style.display = "none", n(589).appendChild(t), t.src = "javascript:", (e = t.contentWindow.document).open(), e.write("<script>document.F=Object<\/script>"), e.close(), l = e.F; i--;) delete l.prototype[o[i]];
        return l()
    };
    e.exports = Object.create || function (e, t) {
        var n;
        return null !== e ? (s.prototype = i(e), n = new s, s.prototype = null, n[r] = e) : n = l(), void 0 === t ? n : a(n, t)
    }
}, function (e, t, n) {
    var i = n(267), a = n(220).concat("length", "prototype");
    t.f = Object.getOwnPropertyNames || function (e) {
        return i(e, a)
    }
}, , , function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(758), o = n(7), r = n(92), s = i.default.getLogger("DownloadKernel.TaskUserData");
    t.TaskUserData = class {
        constructor(e, t) {
            this.userData = new a.BencodeMap.BencodeMap, s.information("new TaskUserData userData:", t), this.task = e, this.userData.decode(t)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            r.ThunderKernel.setTaskPriorityLevel(this.task.getId(), e, t)
        }

        setUserData(e, t, n) {
            let i = !1;
            if (!e || 38 !== e.length) return s.warning("setUserData invalid userGuid:", e), i;
            let a = this.userData.addMapItem("UserData").addMapItem(e);
            if (o.isNumber(n) ? (i = a.addItem(t, n), s.information("addItem number key:", t, ", value:", n)) : o.isString(n) ? (i = a.addItem(t, n), s.information("addItem string key:", t, ", value:", n)) : s.information("addItem not support value type. key:", t, ", value:", n), i) {
                let e = "";
                e = this.userData.encode(e), s.information("bencodingUserData:", e), r.ThunderKernel.saveTaskUserData(this.task.getTaskBaseInfo().taskId, e)
            }
            return i
        }

        getUserData(e, t) {
            if (!e || 38 !== e.length) return void s.warning("getUserData invalid userGuid:", e);
            let n = this.userData.getItem("UserData");
            if (!n) return;
            let i = n.getItem(e);
            if (!i) return;
            let o = i.getItem(t);
            if (o) switch (o.getType()) {
                case a.BencodeMap.BencodeDataType.Integer:
                case a.BencodeMap.BencodeDataType.String:
                    return o.getValue()
            }
        }

        getAllUserData() {
            return this.userData.encode("")
        }

        setAllUserData(e) {
            this.userData.decode(e);
            let t = "";
            t = this.userData.encode(t), r.ThunderKernel.saveTaskUserData(this.task.getTaskBaseInfo().taskId, t)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(3), r = n(6), s = n(8), l = n(93), u = n(22), d = n(9), c = n(10), h = n(56), f = n(1),
        p = n(36), g = n(37), k = n(61), m = n(14), T = n(5), v = n(35), y = n(30), S = n(138),
        w = T.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        b = g.DownloadKernelEventManager.getEventManager(), C = l.DownloadKernelCategoryManager.getCategoryManager(),
        N = f.default.getLogger("Thunder.PrivateSpaceHelper");
    !function (e) {
        let t = void 0, n = void 0, l = "", f = !0, g = void 0, T = void 0;
        const D = new v.EventEmitter;
        let I;

        function _(e, t, n) {
            N.information("onInsertToCategoryView categoryId:", e, ", categoryViewId:", t);
            for (let t = 0; t < n.length; t++) {
                let i = n[t];
                if (i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) return;
                let a = i.getTaskStatus();
                N.information("onInsertToCategoryView taskStatus:", a), a !== s.DownloadKernel.TaskStatus.Succeeded && a !== s.DownloadKernel.TaskStatus.Seeding || A(i, -1 !== e).then().catch()
            }
        }

        function x(e) {
            for (let t = 0; t < e.length; t++) {
                let n = e[t];
                if (n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) continue;
                let i = n.getTaskStatus();
                i !== s.DownloadKernel.TaskStatus.Succeeded && i !== s.DownloadKernel.TaskStatus.Seeding || n.getIsPrivate() && A(n, !0).then().catch()
            }
        }

        function A(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = e.getTaskStatus(), o = e.getTaskBaseInfo().taskType;
                if (N.information("moveTaskFileToPrivateSpace taskType:", o, ", taskStatus:", n, ", moveIn:", t), n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId) > 0) return;
                    let n = "";
                    if (t ? (n = yield M(l), n = a.join(n, l)) : n = yield h.NativeCallAWNS.getDownloadDir(), N.information("moveTaskFileToPrivateSpace newSrcPath:", n), o === s.DownloadKernel.TaskType.Group) return function (e, t, n) {
                        return i(this, void 0, void 0, function* () {
                            let i = e.getSavePath(), o = e.getTaskName();
                            if (!(yield d.FileSystemAWNS.existsAW(i))) return;
                            let r = a.join(i, o);
                            if (N.information("destPath:", r), i !== r) {
                                yield d.FileSystemAWNS.mkdirsAW(n);
                                let a = yield E(i, r);
                                if (a) {
                                    e.setSavePath(n), F(e, !!t && P());
                                    let i = e.getExtraObject(), a = i.getSubTaskCount();
                                    if (a && a > 0) for (let e = 0; e < a; e++) {
                                        let t = i.getSubTaskByIndex(e);
                                        t && t.setSavePath(r)
                                    }
                                    b.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e])
                                }
                            } else F(e, !!t && P())
                        })
                    }(e, t, n);
                    if (o === s.DownloadKernel.TaskType.Bt) return function (e, t, n) {
                        return i(this, void 0, void 0, function* () {
                            let i = e.getExtraObject(), o = i.getDownloadFile();
                            if (1 !== o.length) return;
                            let r = i.getBtFileList(), l = r.get(o[0]);
                            if (!l) return;
                            let u = void 0, c = e.getSavePath(),
                                h = l.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName),
                                f = l.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FilePath),
                                p = yield S.SingleBtTaskNS.isSingleBtTask(e);
                            if (p) u = S.SingleBtTaskNS.getSinleBtTaskFilePath(e); else {
                                if (!h || "" === h) return;
                                c = a.join(c, f), u = a.join(c, h)
                            }
                            if (yield d.FileSystemAWNS.existsAW(u)) if (c !== n) {
                                yield d.FileSystemAWNS.mkdirsAW(n);
                                let i = a.join(n, h), o = yield E(u, i);
                                o && (e.setSavePath(n), b.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e]), F(e, !!t && P()))
                            } else F(e, !!t && P())
                        })
                    }(e, t, n);
                    if (o === s.DownloadKernel.TaskType.P2sp || o === s.DownloadKernel.TaskType.Emule) return function (e, t, n) {
                        return i(this, void 0, void 0, function* () {
                            let i = e.getSavePath(), o = e.getTaskName(), r = a.join(i, o);
                            if (yield d.FileSystemAWNS.existsAW(r)) if (i !== n) {
                                yield d.FileSystemAWNS.mkdirsAW(n);
                                let i = a.join(n, o), l = yield E(r, i);
                                l && (e.setSavePath(n), b.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e]), F(e, !!t && P()))
                            } else F(e, !!t && P())
                        })
                    }(e, t, n)
                }
            })
        }

        function E(e, t) {
            return i(this, void 0, void 0, function* () {
                return N.information("moveFile srcParh:", e, ", destPath:", t), new Promise(n => i(this, void 0, void 0, function* () {
                    if (e[0] === t[0]) {
                        yield d.FileSystemAWNS.renameAW(e, t);
                        let i = yield d.FileSystemAWNS.existsAW(t);
                        N.information("moveFile existsAW success:", i), n(i)
                    } else {
                        let i = !1;
                        (yield d.FileSystemAWNS.lstatAW(e)).isDirectory() ? (i = yield d.FileSystemAWNS.copyDirsAW(e, t), N.information("moveFile copyDirsAW success:", i), i && (i = yield d.FileSystemAWNS.rmdirsAW(e), N.information("moveFile rmdirsAW success:", i))) : (i = yield d.FileSystemAWNS.copyFileAW(e, t), N.information("moveFile copyFileAW success:", i), i && (i = yield d.FileSystemAWNS.unlinkAW(e), N.information("moveFile unlinkAW success:", i))), n(i)
                    }
                }))
            })
        }

        function M(e) {
            return i(this, void 0, void 0, function* () {
                let t = u.ConfigNS.getValue("PrivateSpaceDefaultPath", e, "");
                if (t && "" !== t) {
                    let n = a.join(t, e);
                    if (yield d.FileSystemAWNS.existsAW(n)) return t;
                    if (yield d.FileSystemAWNS.mkdirAW(n)) return t
                }
                let n = u.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "");
                return void 0 !== n && "" !== n || (n = c.ThunderUtil.getDefaultDownloadDir()), void 0 !== n && "" !== n ? (u.ConfigNS.setValue("PrivateSpaceDefaultPath", e, n), n) : ""
            })
        }

        function P(e) {
            return e && "" === e || (e = l), 1 === u.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1)
        }

        function F(e, t) {
            let n = e.getSavePath(), i = e.getTaskName();
            N.information("setTaskHidden path:", n, ", name:", i, ", hidden:", t), t && !function (e) {
                if (!e || "" === e) return !1;
                let t = l;
                "" !== l && "0" !== l || (t = "私人空间");
                if (N.information("userId:", t), N.information("filePath:", e), new RegExp(t).test(e)) return !0;
                return !1
            }(n) || (O(n, t), O(a.join(n, i), t))
        }

        function O(e, t) {
            let n = t ? 2 : 128, i = w.setFileAttributes(e, n);
            N.information("setPathHidden ret:", i, ", path:", e, ", hidden:", t)
        }

        function U(e, t) {
            return i(this, void 0, void 0, function* () {
                if (!t || "" === t) return;
                if (t = a.join(t, e), !(yield d.FileSystemAWNS.existsAW(t))) {
                    yield d.FileSystemAWNS.mkdirAW(t)
                }
                1 === u.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1) && O(t, !0)
            })
        }

        function L(e) {
            f = e
        }

        function B() {
            return f
        }

        !function (e) {
            e.Unknow = "Unknow", e.SetPassword = "SetPassword"
        }(I = e.EventType || (e.EventType = {})), e.getEventEmitter = function () {
            return D
        }, e.setPrivateSavePath = U, e.setAllTaskFileHidden = function (e, t) {
            let n = C.getPrivateCategoryFromUserId(e);
            if (!n) return;
            let i = n.getCategoryViews();
            if (i && !(i.length <= 0)) for (let e = 0; e < i.length; e++) {
                let n = i[e].getTasks();
                for (let e of n.values()) {
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) continue;
                    let n = e.getTaskStatus();
                    n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || e.getIsPrivate() && F(e, t)
                }
            }
        }, e.openPrivateCategory = function (e) {
            return i(this, void 0, void 0, function* () {
                return new Promise((t, n) => {
                    let i = null;
                    if (i = e && "" !== e ? C.getPrivateCategoryFromUserId(e) : C.getCurrentPrivateCategory()) {
                        let e = i.getPassword();
                        e && "" !== e ? t(0) : p.MessageBox.custom("private-space-set-password", {}).then(e => {
                            if (e.action === y.MessageBoxNS.Action.OK) {
                                let n = C.getCurrentPrivateCategory();
                                n && n.setPassword(e.args.password, "", !0, (e, n) => {
                                    e && (L(!1), D.emit(I.SetPassword, !0), t(0))
                                })
                            } else t(-1)
                        }).catch()
                    } else t(-1)
                })
            })
        }, e.accessPrivateCategory = function (e) {
            return i(this, void 0, void 0, function* () {
                var t;
                return new Promise((t, n) => {
                    let i = null;
                    if (i = e && "" !== e ? C.getPrivateCategoryFromUserId(e) : C.getCurrentPrivateCategory()) if (B()) {
                        let e = i.getPassword();
                        e && "" !== e ? (e = e, p.MessageBox.custom("private-space-verify-password", {password: e})).then(e => {
                            e.action === y.MessageBoxNS.Action.OK && e.args && e.args.success && (L(!1), t(0))
                        }).catch(() => {
                            t(-1)
                        }) : t(0)
                    } else t(0); else t(-1)
                })
            })
        }, e.setNeedPassword = L, e.getNeedPassword = B, e.init = function () {
            return i(this, void 0, void 0, function* () {
                (function () {
                    return i(this, void 0, void 0, function* () {
                        t = r.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => i(this, void 0, void 0, function* () {
                            if (N.information("OnUserLogin userId:", e), l = e, C.setUserInfo(e, ""), C.getCurrentPrivateCategory()) {
                                let t = yield M(e);
                                t && "" !== t && U(e, t).then().catch()
                            }
                        })), n = r.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                            N.information("OnUserLogout currentUserId:", l), l = "", f = !0, C.setUserInfo("", "")
                        })
                    })
                })().then().catch(), g = b.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                        if (!e[1]) break;
                        let t = e[1];
                        t.length > 0 && x(t)
                    } while (0)
                }), T = b.attachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== s.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                        if (void 0 === e[1] || !e[2] || !e[3]) break;
                        let t = e[1], n = e[2];
                        N.information("insertTaskCallback categoryId:", t, ", categoryViewId:", n);
                        let i = e[3], a = e[4];
                        i.length > 0 && a === s.DownloadKernel.TaskInsertReason.MoveThoughCategory && _(t, n, i)
                    } while (0)
                }), o.remote.ipcMain.on(m.ThunderChannelList.channelRMGetPrivateSpaceInfo, e => i(this, void 0, void 0, function* () {
                    let t = !0, n = C.getCurrentPrivateCategory();
                    if (n) {
                        let e = n.getPassword();
                        e && "" !== e && (t = !0)
                    }
                    let i = k.default.getCurrentCategoryId();
                    e.sender.send(m.ThunderChannelList.channelMRGetPrivateSpaceInfoResult, t, i)
                }))
            })
        }, e.uninit = function () {
            r.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", t), r.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", n), b.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, g), b.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, T)
        }
    }(t.PrivateSpaceHelperNS || (t.PrivateSpaceHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(66), o = n(722), r = n(83), s = n(21), l = n(8), u = n(37), d = n(23), c = n(61),
        h = i.default.getLogger("TaskDetail.TaskDetail"), f = o.TaskInfoManagerNS.getTaskInfoManager(),
        p = u.DownloadKernelEventManager.getEventManager();
    var g;
    !function (e) {
        e.Comments = "comments", e.FileList = "files", e.Attribute = "detail"
    }(g = t.DetailIndex || (t.DetailIndex = {}));
    !function (e) {
        const t = new class {
            constructor() {
                this.isPageReady = !1, this.unFireTaskId = 0, this.unFireTaskData = "", this.unFireIndex = g.Comments, this.curTaskId = 0, this.curPannel = "", this.select = !1
            }

            init() {
                p.attachTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.ChannelInfoChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskDescriptionChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskRenamed, (...e) => {
                    this.updateTaskInfo(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), p.attachTaskEvent(l.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, (...e) => {
                    this.onGroupTaskSubFileDetailChanged(...e)
                }), c.default.attachListener(d.NodeEventMesssageNS.eventDownloadItemActive, (e, t, n, i, a, o) => {
                    t ? (this.curTaskId = n, this.select = !0, this.onTaskSelectChanged(e, o)) : (a || n === this.curTaskId) && (this.curTaskId = 0, this.curPannel = "", this.select = !1, setTimeout(() => {
                        this.select || this.onTaskSelectChanged(e)
                    }, 100))
                }), c.default.attachListener(d.NodeEventMesssageNS.eventDetailSwitch2Index, (e, t) => {
                    this.switch2DetailIndex(e, t)
                });
                let e = [{functionName: "GetCurTask", nativeFunc: this.getCurTask.bind(this)}];
                r.setDefaultNativeFunctionMap(e)
            }

            pageReady() {
                this.isPageReady = !0, h.information("pageReady"), 0 !== this.unFireTaskId && (this.onCurTaskChange(this.unFireTaskId, this.unFireTaskData, this.unFireIndex), this.unFireTaskId = 0, this.unFireTaskData = "")
            }

            switch2DetailIndex(e, t) {
                this.isPageReady ? a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSwitchDetail", e, t) : this.unFireTaskId === e && (this.unFireIndex = t)
            }

            updateTaskInfo(...e) {
                do {
                    if (!e) break;
                    if (!e[1]) break;
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let i = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        i === this.curTaskId && (n.getTaskAttribute(l.DownloadKernel.TaskAttribute.GroupTaskId) > 0 || f.getTaskInfoString(i).then(e => {
                            this.onTaskInfoChange(i, e)
                        }).catch())
                    }
                } while (0)
            }

            onBtSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1];
                    if (t !== this.curTaskId) break;
                    let n = e[2], i = f.getBtSubFileListString(t, n);
                    this.onSubFileInfoChange(t, i)
                } while (0)
            }

            onGroupTaskSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged) break;
                    if (!e[1]) break;
                    e[1].forEach((e, t) => {
                        if (t === this.curTaskId) {
                            let n = f.getGroupTaskSubFileListString(e);
                            this.onSubFileInfoChange(t, n)
                        }
                    })
                } while (0)
            }

            onTaskSelectChanged(e, t) {
                let n = "";
                switch (e) {
                    case l.DownloadKernel.CategroyViewID.Downloading:
                        n = "downloading";
                        break;
                    case l.DownloadKernel.CategroyViewID.Completed:
                        n = "complete";
                        break;
                    case l.DownloadKernel.CategroyViewID.Recycle:
                        n = "trash"
                }
                this.curPannel = n;
                let i = {};
                i.pannel = n;
                let a = JSON.stringify(i);
                this.onCurTaskChange(this.curTaskId, a, t)
            }

            onCurTaskChange(e, t, n) {
                this.isPageReady ? (h.information("OnCurTaskChange", e, t, n), a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnCurTaskChange", e, t, n)) : (this.unFireTaskId = e, this.unFireTaskData = t, this.unFireIndex = n)
            }

            onTaskInfoChange(e, t) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskInfoChange", e, t)
            }

            onSubFileInfoChange(e, t) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSubFileInfoChange", e, t)
            }

            getCurTask(e, t, n) {
                do {
                    if (!e || !t || !n) break;
                    let i = {};
                    i.taskID = this.curTaskId, i.pannel = this.curPannel;
                    let a = JSON.stringify(i);
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, a)
                } while (0)
            }
        };
        e.init = function () {
            t.init()
        }, e.pageReady = function () {
            t.pageReady()
        }
    }(t.TaskDetailNS || (t.TaskDetailNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(27), o = n(723), r = n(6), s = n(65), l = n(1).default.getLogger("PhoneAuth");
    t.phoneAuthObject = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "迅雷提示", this.url = "http://misc-xl9-ssl.xunlei.com/bindphone/dist/index.html", this.width = 346, this.height = 468, this.lefttMargin = 8, this.rigthMargin = 8, this.topMargin = 38, this.bootomMargin = 8, this.isType = !1, this.embeddedBrowserObj = new o.EmbeddedBrowser
        }

        createPhoneAuthDlg(e, t) {
            return i(this, void 0, void 0, function* () {
                this.isType = !1, this.embeddedBrowserObj.createWnd(this.url, this.title, !0, "phoneAuth", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, t, null, this.onWndCloseResult.bind(this))
            })
        }

        onWndCloseResult() {
            return i(this, void 0, void 0, function* () {
                this.isType || r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnPhoneAuthResult", 0)
            })
        }

        closeDialog(e, t) {
            this.isType = !0;
            let n = e;
            null !== e && void 0 !== e || (n = 0), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnPhoneAuthResult", n), this.embeddedBrowserObj.closeWnd()
        }

        isPhoneAuthAw() {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let t = yield s.LoginHelperNS.loginHelper.isLoginedAw();
                    if (!0 !== t) {
                        l.information("isPhoneAuthAw 没有登陆 isLogin：", t);
                        break
                    }
                    let n = yield s.LoginHelperNS.loginHelper.getUserInfoAw();
                    if (null === n || void 0 === n) {
                        l.information("isPhoneAuthAw userInfo有问题 userInfo:", n);
                        break
                    }
                    let i = n.sessionid;
                    if (null === i || void 0 === i || "" === i) {
                        l.information("isPhoneAuthAw sessionid有问题 sessionid:", i);
                        break
                    }
                    let o = n.deviceid, r = n.userid, u = n.usernewno, d = n.usrname, c = n.usernick,
                        h = s.LoginHelperNS.loginSDKHelper.getInitData(), f = JSON.parse(h), p = f.platform,
                        g = f.appid, k = "PC-" + f.package, m = f.thunderVersion, T = null,
                        v = "https://xluser-ssl.xunlei.com/certification/v1/isauth?";
                    v = `${v}${`auth.deviceid=${encodeURIComponent(o)}&auth.sessionid=${encodeURIComponent(i)}&auth.userid=${encodeURIComponent(r)}&auth.usernewno=${encodeURIComponent(u)}&auth.usrname=${encodeURIComponent(d)}&auth.usernick=${encodeURIComponent(c)}&auth.platformVersion=${encodeURIComponent(p)}&auth.appid=${encodeURIComponent(g)}&auth.appName=${encodeURIComponent(k)}&auth.clientVersion=${encodeURIComponent(m)}&authType==${encodeURIComponent("phone")}&userid ==${encodeURIComponent("userid")}`}`;
                    try {
                        if (null !== (T = yield a.default.get(v)) && void 0 !== T.status && 200 === T.status && void 0 !== T.data && null !== T.data && "" !== T.data) {
                            let t = T.data;
                            "ISAUTH" === t.result ? e = !0 : l.information("isPhoneAuthAw:data=", t)
                        }
                    } catch (e) {
                        l.information("isPhoneAuthAw:error=", e);
                        break
                    }
                } while (0);
                return e
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(151), o = n(780);

    class r {
        constructor() {
            this.mTasks = new Map
        }

        deleteTask(e) {
            this.mTasks.delete(e)
        }

        getTask(e) {
            return this.mTasks.get(e)
        }

        getTaskMap() {
            return this.mTasks
        }

        createTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.mTasks.get(e);
                if (!t) {
                    let n = yield a.DkHelperNS.getHelper().getTaskBaseInfo(e);
                    n && n.groupTaskId <= 0 && (t = new o.Task(e, n), this.mTasks.set(e, t))
                }
                return t
            })
        }
    }

    t.TaskManager = r, function (e) {
        const t = new r;
        e.getTaskManager = function () {
            return t
        }
    }(t.TaskManagerNS || (t.TaskManagerNS = {}))
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s = {}.hasOwnProperty;
        r = n(202), o = r.isObject, a = r.isFunction, i = n(106), t = n(732), e.exports = function (e) {
            function n(e, t, i) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing element name");
                this.name = this.stringify.eleName(t), this.attributes = {}, null != i && this.attribute(i), e.isDocument && (this.isRoot = !0, this.documentObject = e, e.rootObject = this)
            }

            return function (e, t) {
                for (var n in t) s.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, i), n.prototype.clone = function () {
                var e, t, n, i;
                for (t in(n = Object.create(this)).isRoot && (n.documentObject = null), n.attributes = {}, i = this.attributes) s.call(i, t) && (e = i[t], n.attributes[t] = e.clone());
                return n.children = [], this.children.forEach(function (e) {
                    var t;
                    return (t = e.clone()).parent = n, n.children.push(t)
                }), n
            }, n.prototype.attribute = function (e, n) {
                var i, r;
                if (null != e && (e = e.valueOf()), o(e)) for (i in e) s.call(e, i) && (r = e[i], this.attribute(i, r)); else a(n) && (n = n.apply()), this.options.skipNullAttributes && null == n || (this.attributes[e] = new t(this, e, n));
                return this
            }, n.prototype.removeAttribute = function (e) {
                var t, n, i;
                if (null == e) throw new Error("Missing attribute name");
                if (e = e.valueOf(), Array.isArray(e)) for (n = 0, i = e.length; n < i; n++) t = e[n], delete this.attributes[t]; else delete this.attributes[e];
                return this
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).element(this)
            }, n.prototype.att = function (e, t) {
                return this.attribute(e, t)
            }, n.prototype.a = function (e, t) {
                return this.attribute(e, t)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(106), e.exports = function (e) {
            function n(e, t) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing CDATA text");
                this.text = this.stringify.cdata(t)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).cdata(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(106), e.exports = function (e) {
            function n(e, t) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing comment text");
                this.text = this.stringify.comment(t)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).comment(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a = {}.hasOwnProperty;
        i = n(202).isObject, t = n(106), e.exports = function (e) {
            function n(e, t, a, o) {
                var r;
                n.__super__.constructor.call(this, e), i(t) && (t = (r = t).version, a = r.encoding, o = r.standalone), t || (t = "1.0"), this.version = this.stringify.xmlVersion(t), null != a && (this.encoding = this.stringify.xmlEncoding(a)), null != o && (this.standalone = this.stringify.xmlStandalone(o))
            }

            return function (e, t) {
                for (var n in t) a.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).declaration(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l = {}.hasOwnProperty;
        s = n(202).isObject, r = n(106), t = n(287), a = n(288), i = n(289), o = n(290), e.exports = function (e) {
            function n(e, t, i) {
                var a, o;
                n.__super__.constructor.call(this, e), this.documentObject = e, s(t) && (t = (a = t).pubID, i = a.sysID), null == i && (i = (o = [t, i])[0], t = o[1]), null != t && (this.pubID = this.stringify.dtdPubID(t)), null != i && (this.sysID = this.stringify.dtdSysID(i))
            }

            return function (e, t) {
                for (var n in t) l.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, r), n.prototype.element = function (e, t) {
                var n;
                return n = new i(this, e, t), this.children.push(n), this
            }, n.prototype.attList = function (e, n, i, a, o) {
                var r;
                return r = new t(this, e, n, i, a, o), this.children.push(r), this
            }, n.prototype.entity = function (e, t) {
                var n;
                return n = new a(this, !1, e, t), this.children.push(n), this
            }, n.prototype.pEntity = function (e, t) {
                var n;
                return n = new a(this, !0, e, t), this.children.push(n), this
            }, n.prototype.notation = function (e, t) {
                var n;
                return n = new o(this, e, t), this.children.push(n), this
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).docType(this)
            }, n.prototype.ele = function (e, t) {
                return this.element(e, t)
            }, n.prototype.att = function (e, t, n, i, a) {
                return this.attList(e, t, n, i, a)
            }, n.prototype.ent = function (e, t) {
                return this.entity(e, t)
            }, n.prototype.pent = function (e, t) {
                return this.pEntity(e, t)
            }, n.prototype.not = function (e, t) {
                return this.notation(e, t)
            }, n.prototype.up = function () {
                return this.root() || this.documentObject
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(106), e.exports = function (e) {
            function n(e, t, i, a, o, r) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing DTD element name");
                if (null == i) throw new Error("Missing DTD attribute name");
                if (!a) throw new Error("Missing DTD attribute type");
                if (!o) throw new Error("Missing DTD attribute default");
                if (0 !== o.indexOf("#") && (o = "#" + o), !o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");
                if (r && !o.match(/^(#FIXED|#DEFAULT)$/)) throw new Error("Default value only applies to #FIXED or #DEFAULT");
                this.elementName = this.stringify.eleName(t), this.attributeName = this.stringify.attName(i), this.attributeType = this.stringify.dtdAttType(a), this.defaultValue = this.stringify.dtdAttDefault(r), this.defaultValueType = o
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdAttList(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a = {}.hasOwnProperty;
        i = n(202).isObject, t = n(106), e.exports = function (e) {
            function n(e, t, a, o) {
                if (n.__super__.constructor.call(this, e), null == a) throw new Error("Missing entity name");
                if (null == o) throw new Error("Missing entity value");
                if (this.pe = !!t, this.name = this.stringify.eleName(a), i(o)) {
                    if (!o.pubID && !o.sysID) throw new Error("Public and/or system identifiers are required for an external entity");
                    if (o.pubID && !o.sysID) throw new Error("System identifier is required for a public external entity");
                    if (null != o.pubID && (this.pubID = this.stringify.dtdPubID(o.pubID)), null != o.sysID && (this.sysID = this.stringify.dtdSysID(o.sysID)), null != o.nData && (this.nData = this.stringify.dtdNData(o.nData)), this.pe && this.nData) throw new Error("Notation declaration is not allowed in a parameter entity")
                } else this.value = this.stringify.dtdEntityValue(o)
            }

            return function (e, t) {
                for (var n in t) a.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdEntity(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(106), e.exports = function (e) {
            function n(e, t, i) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing DTD element name");
                i || (i = "(#PCDATA)"), Array.isArray(i) && (i = "(" + i.join(",") + ")"), this.name = this.stringify.eleName(t), this.value = this.stringify.dtdElementValue(i)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdElement(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(106), e.exports = function (e) {
            function n(e, t, i) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing notation name");
                if (!i.pubID && !i.sysID) throw new Error("Public or system identifiers are required for an external entity");
                this.name = this.stringify.eleName(t), null != i.pubID && (this.pubID = this.stringify.dtdPubID(i.pubID)), null != i.sysID && (this.sysID = this.stringify.dtdSysID(i.sysID))
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdNotation(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(106), e.exports = function (e) {
            function n(e, t) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing raw text");
                this.value = this.stringify.raw(t)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).raw(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(106), e.exports = function (e) {
            function n(e, t) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing element text");
                this.value = this.stringify.eleText(t)
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).text(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i = {}.hasOwnProperty;
        t = n(106), e.exports = function (e) {
            function n(e, t, i) {
                if (n.__super__.constructor.call(this, e), null == t) throw new Error("Missing instruction target");
                this.target = this.stringify.insTarget(t), i && (this.value = this.stringify.insValue(i))
            }

            return function (e, t) {
                for (var n in t) i.call(t, n) && (e[n] = t[n]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(n, t), n.prototype.clone = function () {
                return Object.create(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).processingInstruction(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(22), o = n(67), r = n(36), s = n(30), l = n(1).default.getLogger("DownloadMode");
    !function (e) {
        let t = void 0, n = void 0;

        function u() {
            void 0 !== t && (clearTimeout(t), t = void 0), void 0 !== n && (clearTimeout(n), n = void 0)
        }

        function d(e, t) {
            l.information("setSpeedLimit Enter maxDownloadSpeed = ", e, "maxUploadSpeed = ", t), o.DownloadKernelManager.setDownloadSpeedLimit(e), o.DownloadKernelManager.setUploadSpeedLimit(t)
        }

        function c(e) {
            l.information("setCustomDownloadMode Enter"), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", e.maxDownloadSpeedEnabled.value), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_UploadSpeedChk", e.maxUploadSpeedEnabled.value);
            let t = 51200, n = 2048;
            if (t = Number(e.maxDownloadSpeed.value) || 1024, a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", t), n = Number(e.maxUploadSpeed.value) || 1024, a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", n), e.maxDownloadSpeedEnabled.value ? a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", t) : a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", -1), e.maxUploadSpeedEnabled.value ? a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", n) : a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", -1), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_Switch", e.limitTimeEnabled.value), e.limitTimeEnabled.value) {
                let t = e.limitTime[0].value, n = e.limitTime[1].value, i = e.limitTime[2].value,
                    o = e.limitTime[3].value;
                a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", t), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", n), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", i), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", o)
            }
            a.ConfigNS.setValue("ConfigNet", "ConfigNet_Type", "0")
        }

        e.handleCustomDownloadMode = function () {
            u();
            let e = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", 1024),
                i = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", 1024),
                o = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Switch", !1);
            if (l.information("handleCustomDownloadMode Enter maxDownloadSpeed = ", e, ", maxUploadSpeed = ", i, ", timeSwitch = ", o), o) {
                let o = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", 0)),
                    r = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", 0)),
                    s = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", 23)),
                    l = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", 59)), u = new Date,
                    c = u.getHours(), h = u.getMinutes();
                (o > s || o === s && r > l) && (s += 24), (c > s || c === s && h > l) && (o += 24, s += 24);
                let f = 60 * c + h, p = 60 * o + r, g = 60 * s + l;
                p <= f && f < g ? (d(e, i), n = setTimeout(() => {
                    d(-1, -1), n = void 0
                }, 6e4 * (g - f))) : (d(-1, -1), t = setTimeout(() => {
                    d(e, i), t = void 0
                }, 6e4 * (p - f)), n = setTimeout(() => {
                    d(-1, -1), n = void 0
                }, 6e4 * (g - f)))
            } else d(e, i)
        }, e.getFreeDownLoad = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_IdleDownload", !1)
        }, e.getCurrentDownloadMode = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1")
        }, e.getCustomModeDownloadSpeed = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", 1024)
        }, e.getCustomModeUploadSpeed = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", 1024)
        }, e.setFullDownloadMode = function () {
            l.information("setFullDownloadMode Enter"), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Type", "1"), o.DownloadKernelManager.setDownloadSpeedLimit(-1), o.DownloadKernelManager.setUploadSpeedLimit(-1), u()
        }, e.setFreeDownLoadConfig = function (e) {
            a.ConfigNS.setValue("ConfigNet", "ConfigNet_IdleDownload", e)
        }, e.setCustomDownloadMode = c, e.showCustomDownloadModeDlg = function () {
            return i(this, void 0, void 0, function* () {
                let e = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", 1024),
                    t = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", 1024),
                    n = r.MessageBox.pop({
                        title: "限制我的下载速度",
                        size: "large",
                        schemas: [{
                            name: "maxDownloadSpeedEnabled",
                            type: "confCheckbox",
                            label: "最大下载速度",
                            outerClass: "xlx-dialog-setting__item",
                            extEles: [{
                                name: "maxDownloadSpeed",
                                type: "confSpeed",
                                outerClass: "xlx-dialog-setting__speed-content",
                                rules: [["rule, value, callback", "let errors = [];\n\n                value = Number(value);\n\n                if (value < 60) {\n                  errors.push(new Error('输入值必须≥60'));\n                } else if (value > 51200) {\n                  errors.push(new Error('输入值必须≤51200'));\n                }\n\n                callback(errors);"]],
                                doEmit: ["key, newValue, oldValue", "\n              newValue = Number(newValue)\n              if (isNaN(newValue)) {\n                this.$emit('input', Number(oldValue), key);\n              } else if (newValue > 51200) {\n                this.$emit('input', Number(oldValue), key);\n              } else {\n                this.$emit('input', newValue, key)\n              }\n              "],
                                doBlur: ["key, value", "\n              value = Number(value)\n              if (value < 60) {\n                this.$emit('input', 60, key)\n              }\n              "],
                                scales: [60, 500, 1024, 5120, 51200],
                                marks: ["60KB", "500KB", "1MB", "5MB", "50MB"]
                            }]
                        }, {
                            name: "maxUploadSpeedEnabled",
                            type: "confCheckbox",
                            label: "最大上传速度",
                            outerClass: "xlx-dialog-setting__item",
                            extEles: [{
                                name: "maxUploadSpeed",
                                type: "confSpeed",
                                outerClass: "xlx-dialog-setting__speed-content",
                                rules: [["rule, value, callback", "let errors = [];\n\n                value = Number(value);\n\n                if (value < 30) {\n                  errors.push(new Error('输入值必须≥30'));\n                } else if (value > 2048) {\n                  errors.push(new Error('输入值必须≤2048'));\n                }\n\n                callback(errors);"]],
                                doEmit: ["key, newValue, oldValue", "\n              newValue = Number(newValue)\n              if (isNaN(newValue)) {\n                this.$emit('input', Number(oldValue), key);\n              } else if (newValue > 2048) {\n                this.$emit('input', Number(oldValue), key);\n              } else {\n                this.$emit('input', newValue, key)\n              }\n              "],
                                doBlur: ["key, value", "\n              value = Number(value)\n              if (value < 30) {\n                this.$emit('input', 30, key)\n              }\n              "],
                                scales: [30, 100, 200, 1024, 2048],
                                marks: ["30KB", "100KB", "200KB", "1MB", "2MB"]
                            }]
                        }, {
                            name: "limitTimeEnabled",
                            type: "confCheckbox",
                            label: "限速下载时间段",
                            outerClass: "xlx-dialog-setting__item",
                            extEles: [{
                                name: "limitTime",
                                type: "confSpeedTime",
                                outerClass: "xlx-dialog-setting__speed-content"
                            }]
                        }],
                        formData: {
                            maxDownloadSpeedEnabled: {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", !0)},
                            maxDownloadSpeed: {value: e},
                            maxUploadSpeedEnabled: {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_UploadSpeedChk", !0)},
                            maxUploadSpeed: {value: t},
                            limitTimeEnabled: {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Switch", !1)},
                            limitTime: [{value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", 0)}, {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", 0)}, {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", 23)}, {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", 59)}]
                        }
                    }, {width: 460, height: 428, maxHeight: 428, center: !0});
                return new Promise(e => {
                    n.then(t => {
                        t.action === s.MessageBoxNS.Action.OK ? (c(t.formData), e(!0)) : e(!1)
                    }).catch()
                })
            })
        }
    }(t.DownloadModeNS || (t.DownloadModeNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(259);
    !function (e) {
        class t {
            constructor() {
            }

            static getInstance() {
                return null === t.instance ? new t : t.instance
            }

            getQueue(e) {
                return null === t.queueMap && (t.queueMap = new Map), t.queueMap.has(e) || t.queueMap.set(e, new i.MsgQueueNS.Queue), t.queueMap.get(e)
            }
        }

        t.queueMap = null, t.instance = null, e.MsgQueue = t
    }(t.MsgQueueManagerNS || (t.MsgQueueManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(13), r = n(2), s = n(9), l = n(6), u = n(84), d = n(23), c = n(8), h = n(67), f = n(37),
        p = n(31), g = n(114), k = n(93), m = n(570), T = n(65), v = n(7),
        y = m.GroupAccelerateEventManagerNS.getEventManager(), S = p.DownloadKernelTaskManager.getTaskManager(),
        w = f.DownloadKernelEventManager.getEventManager(),
        b = g.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        C = k.DownloadKernelCategoryManager.getCategoryManager(), N = a.default.getLogger("GroupAccelerate.Manager");
    !function (e) {
        class t {
            constructor() {
                this.reportInterval = 120, this.currentUserId = 0, this.currentUserLicensed = !1, this.enterGroupAccelerateTimeStamp = 0, this.enterGroupAccelerateUploadSize = 0, this.groupAcceleratingTaskNum = 0, this.insertToCategoryViewEventId = void 0, this.removeFromCategoryViewEventId = void 0, this.detailChangedEventId = void 0, this.taskStatusChangedEventId = void 0, this.taskGroupInfoMap = new Map, this.taskIdMap = new Map, this.insertToCategoryViewEventId = 0, this.removeFromCategoryViewEventId = 0, this.detailChangedEventId = 0, this.taskStatusChangedEventId = 0
            }

            init() {
                N.information("init"), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    let t = Number(e);
                    isNaN(t) || (this.currentUserId = t), this.updatePrivateSpaceCategoryViewTaskIdMap(), S.isLoadStorageTaskFinish() && this.checkTaskGroupAccelerateStatus(), this.getUserGroupAccelerateInfo().then(e => {
                        N.information("init login getUserGroupAccelerateInfo")
                    }).catch(() => {
                        N.information("init login getUserGroupAccelerateInfo failed")
                    })
                }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    this.exitAllTeam(this.currentUserId, !1), this.currentUserId = 0, this.currentUserLicensed = !1
                }), T.LoginHelperNS.loginHelper.getUserInfo("userid", e => {
                    if (N.information("getUserID:userid = ", e), e && "" !== e) {
                        let t = Number(e);
                        isNaN(t) || (this.currentUserId = t), S.isLoadStorageTaskFinish() && this.checkTaskGroupAccelerateStatus(), this.getUserGroupAccelerateInfo().then(e => {
                            N.information("init getUserGroupAccelerateInfo")
                        }).catch(() => {
                            N.information("init getUserGroupAccelerateInfo failed")
                        })
                    }
                }), this.insertToCategoryViewEventId = w.attachTaskEvent(c.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.InsertToCategoryView && this.onInsertToCategoryView(e[1], e[2], e[3])
                }), this.removeFromCategoryViewEventId = w.attachTaskEvent(c.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.RemoveFromCategoryView && this.onRemoveFromCategoryView(e[1], e[2], e[3])
                }), this.detailChangedEventId = w.attachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.DetailChanged && this.onDetailChanged(e[1])
                }), this.taskStatusChangedEventId = w.attachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.StatusChanged && this.onTaskStatusChanged(e[1])
                }), setInterval(() => {
                    this.reportGroupAccelerateTaskInfo()
                }, 1e3 * this.reportInterval), h.DownloadKernelManager.attachOnceListener(d.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                    this.updateTaskIdMap(), this.checkTaskGroupAccelerateStatus()
                })
            }

            uninit() {
                void 0 !== this.insertToCategoryViewEventId && (w.detachTaskEvent(c.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), this.insertToCategoryViewEventId = void 0), void 0 !== this.removeFromCategoryViewEventId && (w.detachTaskEvent(c.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeFromCategoryViewEventId), this.removeFromCategoryViewEventId = void 0), void 0 !== this.detailChangedEventId && (w.detachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, this.detailChangedEventId), this.detailChangedEventId = void 0), void 0 !== this.taskStatusChangedEventId && (w.detachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventId), this.taskStatusChangedEventId = void 0), this.taskGroupInfoMap.clear(), this.taskIdMap.clear()
            }

            canEnterGroupAccelerate(e) {
                N.information("canEnterGroupAccelerate", " taskId: ", e);
                let t = !1;
                do {
                    if (!e) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    let i = this.getTaskUniqueIdByTask(n);
                    if (!i || "" === i) break;
                    let a = n.getTaskStatus();
                    if (!a || a === c.DownloadKernel.TaskStatus.Failed) break;
                    t = !0
                } while (0);
                return t
            }

            isEnterGroupAccelerate(e) {
                N.information("canEnterGroupAccelerate", " taskId: ", e);
                let t = !1;
                do {
                    if (!e) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    let i = this.getTaskUniqueIdByTask(n);
                    if (!i || "" === i) break;
                    let a = n.getTaskStatus();
                    if (!a || a === c.DownloadKernel.TaskStatus.Failed) break;
                    let o = this.getTaskGroupInfo(i);
                    o && o.taskId === e && (t = !0)
                } while (0);
                return t
            }

            joinTeam(e, t, n, a, o) {
                return i(this, void 0, void 0, function* () {
                    N.information("joinTeam", " taskId: ", e, " groupId:", t, " groupName:", n, " memberCount: ", a, " taskUniqueId: ", o);
                    let i = 0;
                    i = "" !== o ? this.taskIdMap.get(o) : e || 0, N.information("joinTeam", " realTaskId: ", i);
                    do {
                        let e = this.taskGroupInfoMap.get(o);
                        if (e && e.taskId) {
                            N.information("joinTeam Alert! taskGroupInfo.taskId:", e.taskId);
                            break
                        }
                        if ((e = {}).groupId = Number(t), e.memberCount = a, e.groupName = n, e.taskId = i, e.currentIncreaseSize = 0, S.getTaskFromTaskId(i)) {
                            e.previousSpeed = this.getTaskAverageSpeed(i), (yield this.getIsVip()) ? this.setTaskPriority(i, 999) : this.setTaskPriority(i, 700), y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnJoinTeam, i, o), 0 === this.groupAcceleratingTaskNum && (this.enterGroupAccelerateTimeStamp = (new Date).getTime(), this.enterGroupAccelerateUploadSize = h.DownloadKernelManager.getTotalUploadSize()), this.groupAcceleratingTaskNum += 1, N.information("joinTeam", " this.enterGroupAccelerateTimeStamp: ", this.enterGroupAccelerateTimeStamp), N.information("joinTeam", " this.enterGroupAccelerateUploadSize: ", this.enterGroupAccelerateUploadSize), N.information("joinTeam", " this.groupAcceleratingTaskNum: ", this.groupAcceleratingTaskNum)
                        } else e.previousSpeed = 0;
                        this.taskGroupInfoMap.set(o, e), N.information("joinTeam", " this.taskGroupInfoMap.size: ", this.taskGroupInfoMap.size), this.saveGroupAccelerateInfo().then(e => {
                            N.information("joinTeam saveGroupAccelerateInfo")
                        }).catch(() => {
                            N.information("joinTeam saveGroupAccelerateInfo failed")
                        })
                    } while (0)
                })
            }

            exitTeam(e, t, n) {
                if (N.information("exitTeam", " taskId: ", e, " groupId: ", t, " taskUniqueId: ", n), "" !== n) {
                    let e = this.taskGroupInfoMap.get(n);
                    if (e) {
                        N.information("exitTeam", " taskGroupInfo.taskId: ", e.taskId);
                        let t = e.taskId;
                        this.taskGroupInfoMap.delete(n), this.setTaskPriority(t, 0), this.saveGroupAccelerateInfo().then(e => {
                            N.information("exitTeam saveGroupAccelerateInfo")
                        }).catch(() => {
                            N.information("exitTeam saveGroupAccelerateInfo failed")
                        }), this.groupAcceleratingTaskNum -= 1, 0 === this.groupAcceleratingTaskNum && (this.enterGroupAccelerateTimeStamp = 0, this.enterGroupAccelerateUploadSize = 0), N.information("exitTeam", " this.enterGroupAccelerateTimeStamp: ", this.enterGroupAccelerateTimeStamp), N.information("exitTeam", " this.enterGroupAccelerateUploadSize: ", this.enterGroupAccelerateUploadSize), N.information("exitTeam", " this.groupAcceleratingTaskNum: ", this.groupAcceleratingTaskNum), y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, t, n)
                    } else N.information("exitTeam bad taskGroupInfo")
                } else N.information("exitTeam bad taskUniqueId")
            }

            getTaskGroupInfo(e) {
                N.information("getTaskGroupInfo", " taskUniqueId: ", e);
                let t = null;
                return "" !== e && (t = this.taskGroupInfoMap.get(e)), t
            }

            exitAllTeamNoTask() {
                N.information("exitAllTeamNoTask"), this.taskGroupInfoMap.forEach((e, t) => {
                    e.taskId || (this.sendExitTeamCommand("" + e.groupId), this.taskGroupInfoMap.delete(t))
                }), this.saveGroupAccelerateInfo().then(e => {
                    N.information("exitAllTeamNoTask saveGroupAccelerateInfo")
                }).catch(() => {
                    N.information("exitAllTeamNoTask saveGroupAccelerateInfo failed")
                })
            }

            sendExitTeamCommand(e) {
                do {
                    N.information("sendExitTeamCommand", " taskUniqueId: ", e);
                    let t = this.taskGroupInfoMap.get(e);
                    if (!t) break;
                    u.fetchSlRes({
                        url: "/group_accel/exit",
                        data: {uid: this.currentUserId, group_id: t.groupId},
                        method: "post"
                    }).then(t => {
                        this.taskGroupInfoMap.delete(e), this.saveGroupAccelerateInfo().then(e => {
                            N.information("sendExitTeamCommand saveGroupAccelerateInfo")
                        }).catch(() => {
                            N.information("sendExitTeamCommand saveGroupAccelerateInfo failed")
                        })
                    }).catch(() => {
                    })
                } while (0)
            }

            isUserLicensed() {
                return this.currentUserLicensed
            }

            getTaskInfoJson(e, t) {
                N.information("getTaskInfoJson", " taskId: ", e, " taskUniqueId: ", t);
                let n = void 0;
                "" !== t && (n = this.taskIdMap.get(t)), N.information("getTaskInfoJson", " realTaskId: ", n), void 0 !== n && (e = n), N.information("getTaskInfoJson now", " taskId: ", e);
                let i = "null";
                do {
                    if (!e) {
                        i = "null";
                        break
                    }
                    let a = S.getTaskFromTaskId(n);
                    if (a) {
                        let e = {};
                        e.status = "" + a.getTaskBaseInfo().taskStatus, e.taskID = "" + n, e.type = "" + a.getTaskBaseInfo().taskType, e.name = a.getTaskBaseInfo().taskName, e.gcid = t;
                        let o = "", s = a.getTaskBaseInfo().taskType, l = e.name;
                        s !== c.DownloadKernel.TaskType.P2sp && s !== c.DownloadKernel.TaskType.Emule || (o = r.extname(l)) && (o = o.substring(1)), e.suffix = o, e.url = a.getTaskBaseInfo().url, e.size = a.getTaskBaseInfo().fileSize, e.progress = e.size > 0 ? 100 * a.getTaskBaseInfo().downloadSize / e.size : 0, N.information("taskInfoTable.progress:", e.progress), e.progress > 100 && (e.progress = 100);
                        let u = this.taskGroupInfoMap.get(t);
                        e.uploaded = u ? this.getUploadedSize() : 0, i = JSON.stringify(e)
                    } else i = "null"
                } while (0);
                return N.information("getTaskInfoJson", " taskInfoJson: ", i), i
            }

            updateTaskAccelerateInfo(e) {
                N.information("updateTaskAccelerateInfo", " taskId: ", e);
                do {
                    if (!e) break;
                    let t = this.getTaskUniqueIdByTaskId(e);
                    if (N.information("updateTaskAccelerateInfo", " taskUniqueId: ", t), !t || "" === t) break;
                    u.fetchSlRes({
                        url: "/group_accel/belong_batch",
                        data: {uid: this.currentUserId, tasks: [t]},
                        method: "post"
                    }).then(e => {
                        if (N.information("updateTaskAccelerateInfo fetchSlRes success res.data: ", e.data), "ok" === e.data.result && e.data.data) {
                            let t = e.data.data;
                            for (let e = 0; e < t.length; e++) {
                                let n = t[e].group_id, i = t[e].member_count, a = t[e].group_name, o = t[e].task,
                                    r = t[e].belong_status;
                                N.information("updateTaskAccelerateInfo data[", e, "]:", t[e]);
                                let s = this.taskGroupInfoMap.get(o);
                                s && (N.information("updateTaskAccelerateInfo has group"), 0 !== r ? (s.memberCount = i, s.groupName = a) : setTimeout(() => {
                                    this.exitTeam(s.taskId, n, o)
                                }, 100))
                            }
                            y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTeamInfoUpdated)
                        }
                    }).catch(() => {
                    })
                } while (0)
            }

            requestTaskTeamInfo(e) {
                do {
                    if (!e || "" === e) break;
                    N.information("requestTaskTeamInfo", " taskUniqueId: ", e), u.fetchSlRes({
                        url: "/group_accel/motorcade_list",
                        data: {task: e},
                        method: "get"
                    }).then(t => {
                        t && y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.RequestTaskTeamInfoSuccess, e, t.data)
                    }).catch(() => {
                        y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.RequestTaskTeamInfofailed, e)
                    })
                } while (0)
            }

            getTaskUniqueIdByTaskId(e) {
                N.information("getTaskUniqueIdByTaskId", " taskId: ", e);
                let t = "";
                if (e) {
                    let n = S.getTaskFromTaskId(e);
                    n && (t = this.getTaskUniqueIdByTask(n))
                }
                return N.information("getTaskUniqueIdByTaskId", " uniqueId: ", t), t
            }

            getTaskUniqueIdByTask(e) {
                let t = "";
                if (e) {
                    switch (e.getTaskBaseInfo().taskType) {
                        case c.DownloadKernel.TaskType.Bt:
                            let n = e.getExtraObject().getInfoId();
                            N.information("getTaskUniqueIdByTaskBase bt task infoId:", n), t = n;
                            break;
                        case c.DownloadKernel.TaskType.P2sp:
                        case c.DownloadKernel.TaskType.Emule:
                            let i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid);
                            N.information("getTaskUniqueIdByTaskBase p2sp or emule task gcid: ", i), t = i
                    }
                }
                return N.information("getTaskUniqueIdByTaskId", " uniqueId: ", t), t
            }

            getTaskStatus(e) {
                N.information("getTaskStatus", " taskId: ", e);
                let t = c.DownloadKernel.TaskStatus.Unkown;
                if (e) {
                    let n = S.getTaskFromTaskId(e);
                    n && (t = n.getTaskStatus())
                }
                return N.information("getTaskStatus", " taskStatus: ", t), t
            }

            getTaskIdByTaskUniqueId(e) {
                N.information("getTaskIdByTaskUniqueId", " taskUniqueId: ", e);
                let t = 0;
                return e && "" !== e && ((t = this.taskIdMap.get(e)) || (t = 0)), N.information("getTaskIdByTaskUniqueId", " taskId: ", t), t
            }

            addTaskToExistingTeam(e) {
                do {
                    if (!e) break;
                    let t = e.getTaskBaseInfo().taskId;
                    if (!t) break;
                    N.information("addTaskToExistingTeam", " taskId: ", t);
                    let n = this.getTaskUniqueIdByTask(e);
                    if ("" !== n) {
                        N.information("addTaskToExistingTeam", " taskUniqueId: ", n), this.taskIdMap.set(n, t);
                        let e = this.taskGroupInfoMap.get(n);
                        e && (N.information("addTaskToExistingTeam has taskGroupInfo, taskGroupInfo.taskId:", e.taskId), e.taskId || (N.information("addTaskToExistingTeam do joinTeam"), this.joinTeam(t, "" + e.groupId, e.groupName, e.memberCount, n).catch()))
                    }
                    let i = e.getTaskStatus();
                    y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, t, i, n)
                } while (0)
            }

            exitAllTeam(e, t = !0) {
                if (N.information("exitAllTeam", " userId: ", e), !e) return;
                let n = new Map;
                for (let [e, t]of this.taskGroupInfoMap) this.setTaskPriority(t.taskId, 0), n.set(e, t);
                this.groupAcceleratingTaskNum = 0, this.enterGroupAccelerateTimeStamp = 0, t ? this.sendExitAllTeamCommand(e).then(e => {
                    N.information("exitAllTeam success"), this.saveGroupAccelerateInfo().then(e => {
                        N.information("exitAllTeam saveGroupAccelerateInfo")
                    }).catch(() => {
                        N.information("exitAllTeam saveGroupAccelerateInfo failed")
                    }), n.forEach((e, t) => {
                        y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, e.taskId, t)
                    })
                }).catch(() => {
                    N.information("exitAllTeam failed")
                }) : n.forEach((e, t) => {
                    y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, e.taskId, t)
                }), this.taskGroupInfoMap.clear()
            }

            updateCategoryViewTaskIdMap(e) {
                let t = e.getTasks();
                if (t) {
                    N.information("updateCategoryViewTaskIdMap tasks.size:", t.size);
                    for (let [, e]of t) if (e) {
                        let t = e.getTaskBaseInfo().taskId, n = this.getTaskUniqueIdByTask(e);
                        N.information("updateCategoryViewTaskIdMap", " taskId: ", t, " taskUniqueId: ", n), t && "" !== n && this.taskIdMap.set(n, t)
                    } else N.information("updateCategoryViewTaskIdMap bad task")
                }
            }

            updatePrivateSpaceCategoryViewTaskIdMap() {
                let e = [c.DownloadKernel.CategroyViewID.Downloading, c.DownloadKernel.CategroyViewID.Completed];
                for (let t of e) {
                    let e = C.getCurrentPrivateCategory();
                    if (e) {
                        let n = e.getCategoryViewFromId(t);
                        this.updateCategoryViewTaskIdMap(n)
                    }
                }
            }

            updateTaskIdMap() {
                N.information("updateTaskIdMap enter");
                let e = [c.DownloadKernel.CategroyViewID.Downloading, c.DownloadKernel.CategroyViewID.Completed];
                for (let t of e) {
                    N.information("updateTaskIdMap categroyViewID", t);
                    let e = b.getCategoryViewFromId(t);
                    this.updateCategoryViewTaskIdMap(e)
                }
                this.updatePrivateSpaceCategoryViewTaskIdMap()
            }

            onDetailChanged(e) {
                do {
                    if (!e) break;
                    N.information("onDetailChanged number of taskList:", e.length);
                    for (let t = 0; t < e.length; ++t) {
                        let n = e[t];
                        if (!n) continue;
                        let i = n.getTaskBaseInfo(), a = i.taskId;
                        if (!a) continue;
                        let o = this.getTaskUniqueIdByTask(n);
                        if (!o || "" === o) continue;
                        N.information("onDetailChanged", " taskId: ", a);
                        let r = this.taskIdMap.get(o);
                        N.information("onDetailChanged", " taskUniqueId: ", o, ", taskIdRecord:", r), r || (this.addTaskToExistingTeam(n), y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnReceiveGcid, a, o));
                        let s = n.getDownloadSpeed(), l = this.getIncreaseSpeedInfo(a), u = l.increaseSpeed, d = {};
                        d.uploaded = this.getUploadedSize(), d.progress = i.fileSize > 0 ? 100 * i.downloadSize / i.fileSize : 0, d.progress > 100 && (d.progress = 100), d.increased = l.increaseSize;
                        let c = JSON.stringify(d);
                        N.information("onDetailChanged", " taskSpeed: ", s, " increaseSpeed: ", u, " extraInfoStr: ", c), y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, a, s, u, c, o)
                    }
                } while (0)
            }

            onTaskStatusChanged(e) {
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t];
                    if (!n) continue;
                    let i = n.getId(), a = n.getTaskStatus();
                    n.getTaskPreStatus() === c.DownloadKernel.TaskStatus.StartPending && a === c.DownloadKernel.TaskStatus.Started && this.addTaskToExistingTeam(n);
                    let o = this.getTaskUniqueIdByTask(n);
                    if (!o || "" === o) continue;
                    let r = a;
                    if (N.information("onTaskStatusChanged", " taskId: ", i), N.information("onTaskStatusChanged", " taskUniqueId: ", o), N.information("onTaskStatusChanged", " status: ", r), y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, i, r, o), a === c.DownloadKernel.TaskStatus.DestroyPending) {
                        N.information("onTaskStatusChanged delete taskInfoMap taskUniqueId:", o), this.taskIdMap.delete(o);
                        let e = this.taskGroupInfoMap.get(o);
                        e && e.taskId === i && (e.taskId = 0)
                    }
                    a !== c.DownloadKernel.TaskStatus.Succeeded && a !== c.DownloadKernel.TaskStatus.Seeding || this.sendFileCompleteStat(i)
                }
            }

            onInsertToCategoryView(e, t, n) {
                if (t === c.DownloadKernel.CategroyViewID.Recycle) do {
                    if (!n) break;
                    N.information("onInsertToCategoryView number of taskList:", n.length);
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e];
                        if (!t) continue;
                        let i = t.getId(), a = this.getTaskUniqueIdByTask(t);
                        a && "" !== a && (N.information("onInsertToCategoryView", " taskId: ", i), N.information("onInsertToCategoryView", " taskUniqueId: ", a), y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, i, 20, a))
                    }
                } while (0)
            }

            onRemoveFromCategoryView(e, t, n) {
                if (t === c.DownloadKernel.CategroyViewID.Recycle) do {
                    if (!n) break;
                    N.information("onRemoveFromCategoryView number of taskList:", n.length);
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e];
                        if (!t) continue;
                        let i = t.getId(), a = t.getTaskStatus(), o = this.getTaskUniqueIdByTask(t);
                        if (!o || "" === o) continue;
                        let r = a;
                        N.information("onRemoveFromCategoryView", " taskId: ", i), N.information("onRemoveFromCategoryView", " taskUniqueId: ", o), N.information("onRemoveFromCategoryView", " status: ", r), y.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, i, r, o)
                    }
                } while (0)
            }

            reportGroupAccelerateTaskInfo() {
                do {
                    if (!this.currentUserId || 0 === this.currentUserId) break;
                    N.information("reportGroupAccelerateTaskInfo", " currentUserId: ", this.currentUserId);
                    let e = new Array;
                    if (this.taskGroupInfoMap.forEach((t, n) => {
                        let i = {};
                        i.group_id = t.groupId, N.information("reportGroupAccelerateTaskInfo", " groupId: ", t.groupId), i.uid = this.currentUserId;
                        let a = t.taskId;
                        if (a) {
                            let e = S.getTaskFromTaskId(a);
                            if (e) {
                                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize),
                                    n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                                i.rate = Math.round(1e3 * t / n) / 10, i.ul_total = this.getUploadedSize(), i.ul_time = (new Date).getTime() - this.enterGroupAccelerateTimeStamp, i.dl_speed = this.getTaskAverageSpeed(a)
                            } else i.rate = 0, i.ul_total = 0, i.ul_time = 0, i.dl_speed = 0
                        } else i.rate = 0, i.ul_total = 0, i.ul_time = 0, i.dl_speed = 0;
                        N.information("reportGroupAccelerateTaskInfo", " group_id: ", i.group_id), N.information("reportGroupAccelerateTaskInfo", " rate: ", i.rate), N.information("reportGroupAccelerateTaskInfo", " ul_total: ", i.ul_total), N.information("reportGroupAccelerateTaskInfo", " ul_time: ", i.ul_time), N.information("reportGroupAccelerateTaskInfo", " dl_speed: ", i.dl_speed), e.push(i)
                    }), e.length <= 0) break;
                    u.fetchSlRes({url: "/group_accel/report_batch", data: {data: e}, method: "post"}).then(e => {
                    }).catch(() => {
                    })
                } while (0)
            }

            checkTaskGroupAccelerateStatus() {
                N.information("checkTaskGroupAccelerateStatus this.currentUserId:", this.currentUserId), this.currentUserId && 0 !== this.currentUserId && this.loadGroupAccelerateInfo().then(e => {
                    do {
                        if (!e || e.size <= 0) {
                            N.information("checkTaskGroupAccelerateStatus bad taskGroupInfoMapTemp");
                            break
                        }
                        let t = [];
                        if (e.forEach((e, n) => {
                            let i = e.taskId;
                            if (N.information("checkTaskGroupAccelerateStatus", " taskUniqueId: ", n, " taskId: ", i), i) {
                                S.getTaskFromTaskId(i) && n && "" !== n && (N.information("checkTaskGroupAccelerateStatus has task"), t.push(n))
                            }
                        }), t.length <= 0) break;
                        u.fetchSlRes({
                            url: "/group_accel/belong_batch",
                            data: {uid: this.currentUserId, tasks: t},
                            method: "post"
                        }).then(t => {
                            if (N.information("checkTaskGroupAccelerateStatus fetchSlRes success res.data: ", t.data), "ok" === t.data.result && t.data.data) {
                                let n = t.data.data;
                                for (let t = 0; t < n.length; t++) if (N.information("checkTaskGroupAccelerateStatus data[", t, "]:", n[t]), 1 === n[t].belong_status) {
                                    let i = n[t].group_id, a = n[t].member_count, o = n[t].group_name, r = n[t].task;
                                    e.forEach((e, t) => {
                                        if (e.groupId === i && t === r) {
                                            this.joinTeam(e.taskId, "" + i, o, a, t).catch();
                                            let n = this.taskGroupInfoMap.get(t);
                                            n && (n.memberCount = a, n.groupName = o)
                                        }
                                    })
                                }
                            }
                        }).catch(() => {
                            N.information("checkTaskGroupAccelerateStatus", " fetchSlRes failed")
                        })
                    } while (0)
                }).catch(() => {
                })
            }

            sendExitAllTeamCommand(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (!e) break;
                        let n = new Array;
                        this.taskGroupInfoMap.forEach((e, t) => {
                            n.push(e.groupId), N.information("sendExitAllTeamCommand", " groupId: ", e.groupId)
                        }), 0 === n.length && (N.information("sendExitAllTeamCommand no group"), t = !0), u.fetchSlRes({
                            url: "/group_accel/exit_batch",
                            data: {uid: this.currentUserId, group_ids: n},
                            method: "post"
                        }).then(e => {
                            N.information("sendExitAllTeamCommand success"), t = !0
                        }).catch(() => {
                            N.information("sendExitAllTeamCommand failed"), t = !1
                        })
                    } while (0);
                    return t
                })
            }

            getUserGroupAccelerateInfo() {
                return i(this, void 0, void 0, function* () {
                    N.information("getUserGroupAccelerateInfo this.currentUserId:", this.currentUserId), this.currentUserId && 0 !== this.currentUserId && u.fetchSlRes({
                        url: "/group_accel/user_info",
                        data: {uid: this.currentUserId},
                        method: "get"
                    }).then(e => {
                        do {
                            if (N.information("getUserGroupAccelerateInfo success ", e), !e) {
                                N.information("getUserGroupAccelerateInfo bad res"), this.currentUserLicensed = !1;
                                break
                            }
                            if (!e.data) {
                                N.information("getUserGroupAccelerateInfo bad res.data"), this.currentUserLicensed = !1;
                                break
                            }
                            if (!e.data.data) {
                                N.information("getUserGroupAccelerateInfo bad res.data"), this.currentUserLicensed = !1;
                                break
                            }
                            e.data.data.have_licence && 1 === e.data.data.have_licence ? (N.information("getUserGroupAccelerateInfo licensed"), this.currentUserLicensed = !0) : (N.information("getUserGroupAccelerateInfo not licensed"), this.currentUserLicensed = !1)
                        } while (0)
                    }).catch(() => {
                        N.information("getUserGroupAccelerateInfo fail"), this.currentUserLicensed = !1
                    })
                })
            }

            getNewPercent(e, t) {
                N.information("getNewPercent", " currentPercent: ", e, " taskType: ", t);
                let n = 0, i = 0, a = 5, o = 0;
                do {
                    if (t === c.DownloadKernel.TaskType.P2sp) n = 10, i = 40, a = 5; else if (t === c.DownloadKernel.TaskType.Bt) n = 30, i = 80, a = 10; else {
                        if (t !== c.DownloadKernel.TaskType.Emule) {
                            o = e;
                            break
                        }
                        n = 20, i = 60, a = 10
                    }
                    if (e) if (e < n || e > i) o = n + (i - n) * Math.random(); else {
                        let t = e - a;
                        t < n && (t = n);
                        let r = e + a;
                        r > i && (r = i), o = t + (r - t) * Math.random()
                    } else o = n + (i - n) * Math.random()
                } while (0);
                return N.information("getNewPercent", " newPercent: ", o), o
            }

            setTaskPriority(e, t) {
                do {
                    if (!e) break;
                    if (!t || 0 !== t && 700 !== t && 999 !== t) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    n.getExtraObject().setTaskPriorityLevel(-1, t), N.information("taskExtra.setTaskPriorityLevel taskId: ", e, ", index: -1, priority: ", t)
                } while (0)
            }

            getTaskAverageSpeed(e) {
                let t = S.getTaskFromTaskId(e);
                if (!t) return 0;
                let n = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadingPeriod),
                    i = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize);
                0 === n && (n = 1);
                let a = Math.round(i / n);
                return N.information("getTaskAverageSpeed taskId:", e, ", taskAverageSpeed:", a), N.information("getTaskAverageSpeed downloadSize:", i, ", downloadingPeriod:", n), a
            }

            getIncreaseSpeedInfo(e) {
                let t = {increaseSpeed: 0, increaseSize: 0};
                do {
                    if (!e) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    let i = this.getTaskUniqueIdByTaskId(e);
                    if (!i || "" === i) break;
                    let a = this.taskGroupInfoMap.get(i);
                    if (!a) break;
                    let o = n.getTaskBaseInfo().taskType, r = a.currentPercent, s = this.getNewPercent(r, o);
                    a.currentPercent = s;
                    let l = this.getTaskP2PSpeedInfo(e), u = Math.round(s * l.p2pSpeed / 100),
                        d = Math.round(s * l.p2pSize / 100), c = a.currentIncreaseSize;
                    c += d, a.currentIncreaseSpeed = u, a.currentIncreaseSize = c, t.increaseSpeed = u, t.increaseSize = c
                } while (0);
                return t
            }

            getTaskP2PSpeedInfo(e) {
                let t = {p2pSpeed: 0, p2pSize: 0};
                do {
                    if (!e) break;
                    let n = S.getTaskFromTaskId(e);
                    if (!n) break;
                    let i = this.getTaskUniqueIdByTask(n);
                    if (!i || "" === i) break;
                    let a = this.taskGroupInfoMap.get(i);
                    if (!a) break;
                    let o = n.getTaskBaseInfo().downloadingPeriod;
                    if (!o) break;
                    let r = n.getTaskChannelInfo();
                    if (!r) break;
                    let s = r.p2pSize - r.dcdnSize;
                    if (s < 0 && (s = 0), !a.lastDownloadingPeriod || !a.lastP2PSize) {
                        a.lastDownloadingPeriod = o, a.lastP2PSize = s;
                        break
                    }
                    let l = s - a.lastP2PSize;
                    l < 0 && (l = 0), a.lastP2PSize = s;
                    let u = o - a.lastDownloadingPeriod;
                    u < 0 && (u = 0), a.lastDownloadingPeriod = o;
                    let d = 0;
                    0 !== u && (d = Math.round(l / u));
                    let c = n.getTaskBaseInfo().downloadSpeed;
                    d > c && (d = c), t.p2pSpeed = d, t.p2pSize = l
                } while (0);
                return t
            }

            getUploadedSize() {
                let e = 0, t = h.DownloadKernelManager.getTotalUploadSize();
                return t && (e = t, this.enterGroupAccelerateUploadSize && (e -= this.enterGroupAccelerateUploadSize)), e
            }

            saveGroupAccelerateInfo() {
                return i(this, void 0, void 0, function* () {
                    if (N.information("saveGroupAccelerateInfo", " currentUserId: ", this.currentUserId), !this.currentUserId) return;
                    let e = r.join(__profilesDir, "GroupAccelerate");
                    (yield s.FileSystemAWNS.existsAW(e)) || (yield s.FileSystemAWNS.mkdirsAW(e));
                    let t = r.join(__profilesDir, "GroupAccelerate\\TaskInfoEx_" + this.currentUserId + ".txt");
                    N.information("saveGroupAccelerateInfo", " filePath: ", t), N.information("saveGroupAccelerateInfo", " this.taskGroupInfoMap.size: ", this.taskGroupInfoMap.size);
                    let n = JSON.stringify([...this.taskGroupInfoMap]);
                    N.information("saveGroupAccelerateInfo", " strData: ", n), yield s.FileSystemAWNS.writeFileAW(t, n)
                })
            }

            loadGroupAccelerateInfo() {
                return i(this, void 0, void 0, function* () {
                    if (N.information("loadGroupAccelerateInfo", " currentUserId: ", this.currentUserId), !this.currentUserId) return null;
                    let e = r.join(__profilesDir, "GroupAccelerate\\TaskInfoEx_" + this.currentUserId + ".txt");
                    N.information("loadGroupAccelerateInfo", " filePath: ", e);
                    let t = yield s.FileSystemAWNS.readFileAW(e), n = null;
                    try {
                        let e = t.toString();
                        return N.information("loadGroupAccelerateInfo", " fileStr: ", e), n = new Map(JSON.parse(e))
                    } catch (e) {
                        return null
                    }
                })
            }

            sendFileCompleteStat(e) {
                do {
                    if (!e) break;
                    let t = S.getTaskFromTaskId(e);
                    if (!t) break;
                    let n = this.getTaskUniqueIdByTask(t);
                    if (!n || "" === n) break;
                    let i = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                    if (!i || i < 104857600) break;
                    let a = this.taskGroupInfoMap.get(n);
                    if (!a) break;
                    let r = a.previousSpeed;
                    if (!r) break;
                    let s = "pannel=complete,taskid=" + e + ",gcid=" + n + ",previos_speed=" + r + ",stop_speed=" + this.getTaskAverageSpeed(e);
                    N.information("SendFileCompleteStat", " strExtData: ", s), o.XLStatNS.trackEvent("download_pannel", "groupspeed", "", 0, 0, 0, 0, s)
                } while (0)
            }

            getIsVip() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        T.LoginHelperNS.loginHelper.getUserInfo("vipList", function (t) {
                            v.isArray(t) && t[0] ? e("1" === t[0].isVip) : e(!1)
                        })
                    })
                })
            }
        }

        e.Manager = t;
        const n = new t;
        e.getManager = function () {
            return n
        }
    }(t.GroupAccelerateManagerNS || (t.GroupAccelerateManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, n;
        !function (e) {
            e[e.tab = 1] = "tab", e[e.app = 2] = "app", e[e.download = 3] = "download", e[e.defaultBrowser = 5] = "defaultBrowser", e[e.ieBrowser = 6] = "ieBrowser"
        }(t = e.OpenType || (e.OpenType = {})), function (e) {
            e.AdPlatform = "AdPlatform"
        }(n = e.AdName || (e.AdName = {})), e.eventAdShow = "event_ad_show"
    }(t.AdCommonNS || (t.AdCommonNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(27), o = n(1), r = n(10), s = n(9), l = n(15);
    let {isDef: u} = r.ThunderUtil;
    const d = o.default.getLogger("WallpaperManager");
    t.default = new class {
        constructor() {
            this.wallpapersURL = "https://api-xl9-ssl.xunlei.com/sl/xlppc.personalizedcenter.api/api/xskin/list", this.testPapersURL = "http://test.api-shoulei-ssl.xunlei.com/xlppc.personalizedcenter.api/api/xskin/list"
        }

        getWallpapers() {
            return i(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = n(28);
                    let e = 1 === (yield l.default("GetValue", "ConfigFetchInterface", "TestServer", 0)) ? this.testPapersURL : this.wallpapersURL;
                    try {
                        let t = yield a.default.get(e, {params: {page: 0, per_page: 30}});
                        if (200 === t.status && "ok" === t.data.result) {
                            this.wallpapers = t.data.list;
                            try {
                                localStorage.setItem("wallpapers", JSON.stringify(this.wallpapers))
                            } catch (e) {
                                d.warning(e)
                            }
                            break
                        }
                    } catch (e) {
                        d.warning(e)
                    }
                    if (u(this.wallpapers)) break;
                    this.wallpapers = JSON.parse(localStorage.getItem("wallpapers"))
                } while (0);
                return this.wallpapers
            })
        }

        getImage(e) {
            return i(this, void 0, void 0, function* () {
                let t = `${__profilesDir}/skins/${e.id}/wallpaper.jpg`;
                return (yield s.FileSystemAWNS.existsAW(t)) ? (this.updateImage(e).catch(e => {
                    d.information("update skin preview error", e)
                }), t) : (yield this.updateImage(e), t)
            })
        }

        updateImage(e) {
            return i(this, void 0, void 0, function* () {
                a.default.defaults.adapter = n(28);
                let t = yield a.default.get(e.skin_link, {responseType: "arraybuffer"});
                if (u(t) && 200 === t.status && u(t.data) && (yield s.FileSystemAWNS.mkdirAW(`${__profilesDir}/skins`), yield s.FileSystemAWNS.writeFileAW(`${__profilesDir}/skins/${e.id}.zip`, t.data))) {
                    const {UnzipUtilitiesAWNS: t} = yield Promise.resolve().then(() => n(208));
                    yield t.uncompressZipFile(`${__profilesDir}/skins/${e.id}/`, `${__profilesDir}/skins/${e.id}.zip`)
                }
            })
        }
    }
}, , function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(301), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(830), r = n(871), s = n(918);
    let l = class extends a.Vue {
    };
    l = i([a.Component({
        components: {
            MainTop: o.default,
            MainBottom: r.default,
            MainBackground: s.default
        }
    })], l), t.default = l
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(303), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(831), r = n(839), s = n(856), l = n(861), u = n(865), d = n(867);
    let c = class extends a.Vue {
        constructor() {
            super(...arguments), this.dragable = !0
        }
    };
    c = i([a.Component({
        components: {
            LoginArea: o.default,
            AddressBarContainer: r.default,
            SystemButtonsContainer: s.default,
            TabsContainer: l.default,
            MessageTips: u.default,
            BookMarks: d.default
        }
    })], c), t.default = c
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(305), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(3), r = n(4), s = n(2), l = n(6), u = n(45), d = n(65), c = n(1), h = n(13), f = n(5), p = n(832),
        g = n(834), k = f.default(s.join(__rootDir, "../bin/ThunderHelper.node")), m = n(260),
        T = c.default.getLogger("Thunder.Main");
    let v = class extends r.Vue {
        constructor() {
            super(...arguments), this.userNick = "点击登录", this.curLoginStatus = "unlogin", this.oldLoginStatus = "unlogin", this.isLogin = !1, this.isShowPersonalInfoWnd = !1, this.curUserid = "", this.isVip = 0, this.isYear = 0, this.vipLevel = 0, this.vipType = 2, this.headerUrl = "", this.curLoginHeaderUrl = m, this.yearIcon = "vip-icon-nian is-large is-disabled", this.rectDatas = "", this.bShowUserInfoPanle = !1, this.yearTipsText = "", this.strOpenVip = "", this.isShowYearTip = !1, this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1, this.cashTipTrigger = null, this.promptData = null, this.promptTextClicked = !1, this.personalInfoWnd = null, this.nVipGrow = 0, this.vipData = null
        }

        onHeaderChange(e, t) {
            T.information("curLoginHeaderUrl cur=", e, ";old=", t)
        }

        get strNickCss() {
            let e = "";
            return this.isLogin && 0 !== this.isVip && (e = "is-vip"), e
        }

        get userYearIcon() {
            return 0 !== this.isYear && 0 !== this.isVip ? (this.yearIcon = "vip-icon-nian", this.yearTipsText = "迅雷年费会员", this.strOpenVip = "") : (this.yearIcon = "vip-icon-nian is-disabled", this.yearTipsText = "迅雷年费会员"), this.yearIcon
        }

        get strIsOffline() {
            let e = "";
            return "offline" === this.curLoginStatus && (e = "is-offline"), T.information("strIsOffline:", e), e
        }

        closePersonalInfoWnd() {
            null !== this.personalInfoWnd && (this.personalInfoWnd.close(), this.personalInfoWnd = null)
        }

        setDefaultHeader() {
            T.information("setDefaultHeader"), this.curLoginHeaderUrl = m
        }

        showPersonalInfoWnd(e) {
            let t = this.getClientRectsEx(), n = this.isLoginInfoRect(t);
            T.information("datastr", t, n), n && (this.personalInfoWnd = d.LoginHelperNS.loginUIHelper.createPersonalInfoWnd(e), null !== this.personalInfoWnd && (this.personalInfoWnd.once("ready-to-show", () => {
                if (t = this.getClientRectsEx(), n = this.isLoginInfoRect(t)) {
                    this.personalInfoWnd.show(), u.ToolsUtilitiesAWNS.setForegroundWindow(k, this.personalInfoWnd), o.ipcRenderer.send("enteLeftTopUserInfoArea", e, t);
                    let n = "", i = "";
                    "header" === e ? i = "1" : "nick" === e ? i = "2" : "vip" === e && (i = "3"), n = "from=" + i + ",is_vip=" + this.isVip + ",vip_type=" + this.vipType;
                    let a = encodeURIComponent(n);
                    h.XLStatNS.trackEvent("clienttop", "logged_hover_layer_show", "", 0, 0, 0, 0, a), this.stat("userinfo_show")
                } else this.closePersonalInfoWnd()
            }), this.personalInfoWnd.once("closed", () => {
                this.personalInfoWnd = null;
                let e = o.remote.getCurrentWindow();
                e.isMinimized() && e.restore(), e.show()
            })))
        }

        onPromptTitleShow(e) {
            if (T.information("onPromptTitleShow", e), e) {
                let e = "";
                e = "is_ad=1";
                let t = encodeURIComponent(e);
                T.information(e, t), h.XLStatNS.trackEvent("clienttop", "nolog_head_nickname_show", "", 0, 0, 0, 0, t)
            }
        }

        onToolYearTip(e) {
            if (e) {
                if (this.$emit("tooltip-show"), "开通会员" === this.strOpenVip) {
                    let e = "";
                    e = "is_vip=" + this.isVip + ",vip_type=" + this.vipType, 0 === this.isVip && 0 === this.nVipGrow ? e += ",show_type=1" : 0 === this.isVip && 0 !== this.nVipGrow && (e += ",show_type=2");
                    let t = encodeURIComponent(e);
                    T.information(e, t), h.XLStatNS.trackEvent("clienttop", "xufei_botton_show", "", 0, 0, 0, 0, t)
                }
            } else this.$emit("tooltip-hide");
            this.isShowYearTip = e
        }

        onIconClick() {
            g.VipRenewIconManagerNS.getIconManager().onIconClick()
        }

        getClientRectsEx() {
            let e = null, t = 10, n = 40;
            null !== this.$refs.userAvatar && void 0 !== this.$refs.userAvatar && null !== (e = this.$refs.userAvatar.getClientRects()) && void 0 !== e && e.length > 0 && null !== e[0] && void 0 !== e[0] && (t = e[0].left), null !== this.$refs.userVip && void 0 !== this.$refs.userVip && (null !== (e = this.$refs.userVip.$el.getClientRects()) && void 0 !== e && e.length > 0 && null !== e[0] && void 0 !== e[0] ? n = e[0].right : null !== this.$refs.userNick && void 0 !== this.$refs.userNick && null !== (e = this.$refs.userNick.getClientRects()) && void 0 !== e && e.length > 0 && null !== e[0] && void 0 !== e[0] && (n = e[0].right));
            let i = n - t + 5;
            return JSON.stringify({width: i, height: 40})
        }

        isLoginInfoRect(e) {
            let t = !1;
            do {
                let n = o.screen.getCursorScreenPoint(), i = null;
                try {
                    i = JSON.parse(e)
                } catch (e) {
                    T.warning(e)
                }
                if (null === i) break;
                let a = o.remote.getCurrentWindow().getBounds(), r = a.x + 10, s = a.y + 3,
                    l = a.x + 10 + Number(i.width), u = a.y + 10 + Number(i.height);
                n.x >= r && n.x <= l && n.y >= s && n.y <= u && (t = !0)
            } while (0);
            return t
        }

        getUserAvatarRect() {
            let e = o.remote.getCurrentWindow().getBounds(), t = this.$refs.userAvatar.getClientRects(),
                n = e.x + t[0].left, i = e.y + t[0].top, a = t[0].right - t[0].left, r = t[0].bottom - t[0].top;
            return JSON.stringify({x: n, y: i, width: a, height: r})
        }

        enter(e) {
            if (T.information("enter:", e, this.isLogin, this.personalInfoWnd), this.isLogin && null === this.personalInfoWnd) this.showPersonalInfoWnd(e); else if ("offline" === this.curLoginStatus && "head" === e) {
                let e = this.getUserAvatarRect();
                this.closePersonalInfoWnd(), d.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
            }
        }

        clickPromptTitle(e) {
            if (T.information("点击促销文案", this.promptData.title), T.information("islogin", this.isLogin), T.information("curLoginStatus", this.curLoginStatus), !this.isLogin) {
                let t = `button=${e}`;
                t += ",is_ad=1", T.information("extData", t);
                let n = encodeURIComponent(t);
                T.information(t, n), h.XLStatNS.trackEvent("clienttop", "nolog_head_nickname_click", "", 0, 0, 0, 0, n), this.promptTextClicked = !0, T.information("this.curLoginHeaderUrl", this.curLoginHeaderUrl), d.LoginHelperNS.loginHelper.showLoginDlg("leftcenter_notlogged", !0), T.information("this.curLoginHeaderUrl", this.curLoginHeaderUrl)
            }
        }

        clickUserHeader(e) {
            if (T.information("点击登录", this.curLoginStatus), this.isLogin && "online" === this.curLoginStatus) {
                let t = "http://pc.xunlei.com/d#/users/" + this.curUserid + "?entrypage=client_leftright_login&entry=client_leftright_login_head";
                l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t);
                let n = `button=${e}`;
                n = n + ",is_vip=" + this.isVip + ",vip_type=" + this.vipType + ",referfrom=v_pc_xlx_ggong_head_nickname";
                let i = encodeURIComponent(n);
                T.information(n, i), h.XLStatNS.trackEvent("clienttop", "head_nickname_click", "", 0, 0, 0, 0, i)
            } else "unlogin" === this.curLoginStatus && d.LoginHelperNS.loginHelper.showLoginDlg("leftcenter_notlogged", !0);
            let t = `button=${e}`, n = "no";
            this.isLogin && (n = "yes"), t = `${t},is_login=${n}`, !this.isLogin && this.promptData && this.clickPromptTitle("head"), h.XLStatNS.trackEvent("clienttop", "clienttop_userinfo_click", "", 0, 0, 0, 0, t)
        }

        onClick(e) {
            let t = "", n = "", i = "";
            if ("nian" === e ? (t = "https://vip.xunlei.com/vip_service/year/?referfrom=v_pc_xlx_ggong_yearicon", n = "nf_icon_click", i = "v_pc_xlx_ggong_yearicon") : "vip" === e ? (t = 0 !== this.isVip ? "https://vip.xunlei.com/vip_service/rule/?referfrom=v_pc_xlx_ggong_vipicon" : "https://pay.xunlei.com/pay.html?bizNo=baijin?referfrom=v_pc_xlx_ggong_vipicon", n = "vip_icon_click", i = "v_pc_xlx_ggong_vipicon") : "nian_tip" === e && (this.isShowYearTip = !1, t = "https://vip.xunlei.com/vip_service/year/?referfrom=v_pc_xlx_ggong_pay_top", n = "xufei_botton_click", i = "v_pc_xlx_ggong_pay_top"), "" !== t) {
                l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t);
                let a = "";
                a = "is_vip=" + this.isVip + ",vip_type=" + this.vipType + ",referfrom=" + i, "vip" === e ? 0 === this.isVip && 0 === this.nVipGrow ? a += ",show_type=1,aidfrom=ktnovip" : 0 === this.isVip && 0 !== this.nVipGrow && (a += ",show_type=2,aidfrom=ktnovip1") : "nian_tip" === e && (0 === this.isVip && 0 === this.nVipGrow ? a += ",show_type=1,aidfrom=xfbtn_exp7_kt" : 0 === this.isVip && 0 !== this.nVipGrow && (a += ",show_type=2,aidfrom=xfbtn_exp7_kt"));
                let o = encodeURIComponent(a);
                T.information(e, a, o), h.XLStatNS.trackEvent("clienttop", n, "", 0, 0, 0, 0, o)
            }
        }

        switchAccount() {
            this.isLogin = !1, this.curUserid = "", this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = m, this.rectDatas = "", this.updateLoginStatus(), d.LoginHelperNS.loginHelper.switchAccount("changeaccount")
        }

        personalCenter() {
            l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "http://i.xunlei.com/login.html")
        }

        updateLoginStatus() {
            if (T.information(this.oldLoginStatus, this.curLoginStatus), this.oldLoginStatus === this.curLoginStatus) ; else {
                let e = this.oldLoginStatus;
                this.oldLoginStatus = this.curLoginStatus, l.NativeCallModule.nativeCall.CallNativeFunction("NativeFireEvent", "onLoginStatusChange", e, this.curLoginStatus, function (e) {
                })
            }
            this.checkPromptState()
        }

        updateUserInfo(e) {
            return a(this, void 0, void 0, function* () {
                return new Promise(t => {
                    d.LoginHelperNS.loginHelper.getAllUserInfo(n => {
                        do {
                            if (T.information("收到 getAllUserInfo 返回数据"), null === n || void 0 === n) {
                                T.information("getAllUserInfo 得到数据是 null");
                                break
                            }
                            "login" === e && (this.isLogin = !0, this.curLoginStatus = "online", this.updateLoginStatus()), this.curUserid = n.userID, this.userNick = n.nickName, this.rectDatas = "", "login" === e && h.XLStatNS.setUserID(Number(this.curUserid));
                            let t = n.imgURL;
                            if (null !== t && void 0 !== t && "" !== t || (t = "http://img2.user.kanimg.com/usrimg/" + this.curUserid + "/%s"), t = t.replace("%s", "100*100"), this.headerUrl = t, null === n.vipList || void 0 === n.vipList) break;
                            if (null === n.vipList[0] || void 0 === n.vipList[0]) break;
                            let i = n.vipList[0];
							if (i.isVip == 0) {
							i.vipLevel = 10;
							i.isVip = 1;
							i.isYear = 1;							
							i.vasType = 5;
							}
                            if (this.vipData = [{
                                VIPLevel: i.vipLevel,
                                isVIP: i.isVip,
                                isYear: i.isYear,
                                uid: n.userID,
                                vasID: 2,
                                vasType: i.vasType
                            }], "update" === e) {
                                let e = {isVip: Number(i.isVip), vasType: Number(i.vasType), expireDate: i.expireDate};
                                g.VipRenewIconManagerNS.getIconManager().checkUserType(e)
                            }
                            this.isYear = Number(i.isYear), this.isVip = Number(i.isVip), this.vipLevel = Number(i.vipLevel), this.vipType = Number(i.vasType), "" !== i.vipGrow && (this.nVipGrow = Number(i.vipGrow))
                        } while (0);
                        t()
                    })
                })
            })
        }

        setChangeData(e, t) {
            if (T.information("onLoginFailed:getCurInternetState: setChangeData: ", e, t), 0 === e && 2 === t) {
                this.isLogin = !1, this.curLoginStatus = "offline", this.updateLoginStatus();
                let e = this.getUserAvatarRect();
                this.closePersonalInfoWnd(), d.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
            } else this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.rectDatas = "", this.curLoginHeaderUrl = m, this.updateLoginStatus()
        }

        checkPromptState() {
            if (T.information("islogin", this.isLogin, "currentloginstatus", this.curLoginStatus, "nickname", this.userNick), this.isLogin || "unlogin" !== this.curLoginStatus) "online" === this.curLoginStatus && (this.promptData = null); else {
                let e = p.LoginPromptManagerNS.getPromptData();
                e && (null != this.promptData && this.promptData.id === e.id || this.onPromptTitleShow(!0), this.promptData = e, this.curLoginHeaderUrl = this.promptData.imgLocalPath, T.information("prompt data", this.promptData))
            }
        }

        stat(e) {
            let t = `is_login=${this.isLogin ? 1 : 0},is_vip=${this.isVip}`;
            T.information(e, t), h.XLStatNS.trackEvent("user_info", e, "", 0, 0, 0, 0, t)
        }

        mounted() {
            l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginBefore", (e, t) => {
                if (T.information("收到onLoginBefore事件：this.oldLoginStatus = ", this.oldLoginStatus, e, t), "unlogin" === this.oldLoginStatus) if (this.rectDatas = "", this.curLoginStatus = "loging", this.updateLoginStatus(), null !== t && void 0 !== t && "" !== t && null !== e && void 0 !== e && "" !== e) {
                    this.userNick = e, this.curLoginHeaderUrl = m;
                    let n = d.LoginHelperNS.loginHelper.getUserHeader(t);
                    T.information("onLoginBefore:getUserHeader = ", n, "this.curLoginStatus:", this.curLoginStatus), "loging" === this.curLoginStatus && null !== n && void 0 !== n && "" !== n && (this.curLoginHeaderUrl = n)
                } else this.userNick = "正在登录...", this.curLoginHeaderUrl = m
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => a(this, void 0, void 0, function* () {
                if (T.information("收到 onLoginSuc 事件"), this.promptTextClicked && this.promptData && this.promptData.url) {
                    this.promptTextClicked = !1;
                    let e = this.promptData.url;
                    T.information("prompt url", e), l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", e)
                }
                yield this.updateUserInfo("login"), this.enter("onLoginSuc")
            })), l.NativeCallModule.nativeCall.AttachNativeEvent("onGetUserInfoFinished", () => a(this, void 0, void 0, function* () {
                T.information("收到 onGetUserInfoFinished 事件"), yield this.updateUserInfo("update");
                let e = yield d.LoginHelperNS.loginHelper.updateHeaderAw(this.headerUrl, this.curUserid);
                T.information("下载头像成功：", e, this.curLoginStatus), "online" === this.curLoginStatus && null !== e && void 0 !== e && "" !== e && (this.curLoginHeaderUrl = e, l.NativeCallModule.nativeCall.CallNativeFunction("NativeFireEvent", "onUserHeaderChange", e, e => {
                }))
            })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginFailed", (e, t) => {
                T.information("收到 onLoginFailed 事件, this.oldLoginStatus:", this.oldLoginStatus, ";erro:", e, ";code:", t);
                let n = Number(e), i = d.LoginHelperNS.loginHelper.getCurInternetState();
                "offline" !== this.oldLoginStatus ? 0 === i ? setTimeout(() => {
                    let e = d.LoginHelperNS.loginHelper.getCurInternetState();
                    this.setChangeData(n, e)
                }, 3e3) : this.setChangeData(n, i) : 1 === n && (this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.rectDatas = "", this.curLoginHeaderUrl = m, this.updateLoginStatus())
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                T.information("收到 onLogout 事件"), this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = m, this.rectDatas = "", this.updateLoginStatus(), this.closePersonalInfoWnd(), g.VipRenewIconManagerNS.getIconManager().onLogout(), h.XLStatNS.setUserID(0)
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onSwitchAccount", () => {
                this.switchAccount(), this.closePersonalInfoWnd()
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onInternetConnectChange", (e, t) => {
                if (2 === t) {
                    if ("online" === this.curLoginStatus) {
                        this.isLogin = !1, this.curLoginStatus = "offline", this.updateLoginStatus();
                        let e = this.getUserAvatarRect();
                        this.closePersonalInfoWnd(), d.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
                    }
                } else 1 === t && (T.information("onInternetConnectChange:", this.curLoginStatus), "offline" === this.curLoginStatus && setTimeout(() => {
                    d.LoginHelperNS.loginHelper.logIn("RetryLogin")
                }, 3e3))
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onUserDetailInfoChange", e => {
                if (null !== e && void 0 !== e && "" !== e) try {
                    let t = JSON.parse(e);
                    this.userNick = t.nickName
                } catch (e) {
                    T.warning(e)
                }
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginUpdate", (e, t) => {
                T.information("收到事件 onLoginUpdate:", e, t), "vipinfo" !== e && "userinfo" !== e || this.updateUserInfo("update").catch(), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "onUserInfoChange", e, t, e => {
                    T.information("fire onUserInfoChange:", e)
                })
            }), o.remote.ipcMain.on("onCancelRetry", () => {
                T.information("收到 onCancelRetry 事件"), this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = m, this.rectDatas = "", this.updateLoginStatus(), d.LoginHelperNS.loginHelper.logout()
            });
            let e = p.LoginPromptManagerNS.getManager();
            e.attachListener(p.LoginPromptManagerEventNS.promptDataGet, e => {
                T.information("prompt data event result", e), e && this.checkPromptState()
            }), e.init(), T.information("attach prompt data event");
            let t = g.VipRenewIconManagerNS.getIconManager();
            t.attachListener(g.UserEventNS.userTypeChanged, e => {
                if (t.$hasCash ? this.cashTipTrigger = "hover" : this.cashTipTrigger = null, 2 === e || 1 === e ? (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1) : 3 === e || 4 === e || 5 === e ? (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1) : (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1), this.isCanShowOpenVipBtn || this.isCanShowXufeiBtn) {
                    g.VipRenewIconManagerNS.getIconManager().onIconShow()
                }
            })
        }
    };
    i([r.Watch("curLoginHeaderUrl", {immediate: !0})], v.prototype, "onHeaderChange", null), v = i([r.Component({})], v), t.default = v
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(307), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(840), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentTabIndex: e => e.Tabs.current,
            bookMarks: e => e.BookMarks.bookMarks,
            allNetGroups: e => e.Group.all
        },
        mapGettersToProps: {
            currentTab: e => e.currentTab,
            currentSelectdTaskIds: e => e.currentSelectdTaskInfos.map(e => e.taskId)
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            onOriginalUrlChange: "ON_ORIGINAL_URL_CHANGE",
            addBookMarksItem: "ADD_BOOK_MARKS_ITEM",
            deleteBookMarksItem: "REMOVE_BOOK_MARKS_ITEM",
            addNetGroup: "ADD_NET_GROUP"
        },
        mapDispatchToProps: {getNetGroup: "getNetGroup"}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(309), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(311), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(857), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {bookMarks: e => e.BookMarks.bookMarks},
        mapCommitToProps: {createNewTab: "CREATE_NEW_TAB"},
        mapGettersToProps: {currentTab: e => e.currentTab}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(313), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(3), s = n(140), l = n(858), u = n(22), d = n(742), c = n(743), h = n(36), f = n(2), p = n(5),
        g = n(6), k = n(27), m = n(13), T = n(248), v = n(1), y = n(66), S = n(14), w = n(150), b = n(54), C = n(15),
        N = n(105), D = p.default(f.join(__rootDir, "../bin/ThunderHelper.node")),
        I = v.default.getLogger("system-buttons"),
        _ = T.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(), x = n(107);
    let A = class extends o.Vue {
        constructor() {
            super(...arguments), this.bSelectAutoRun = !0, this.maximized = !1, this.disableHover = !1, this.showNewIcon = !1, this.communityName = "community", this.blankPage = "http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", this.bSelectShowBookmark = !1
        }

        onMaximizedChange(e, t) {
        }

        get curUrl() {
            return x(this.currentTab, "tab", "url")
        }

        get hideCollectIcon() {
            return I.information("cur url", this.curUrl), x(this.currentTab, "tab", "type") === s.TabType.XDAS || x(this.currentTab, "tab", "name") === this.communityName || x(this.currentTab, "tab", "url") === this.blankPage
        }

        closeMainWindow() {
            m.XLStatNS.trackEvent("clienttop", "clienttop_close_click"), this.disableHover = !0, this.$nextTick(() => {
                r.ipcRenderer.send("closeMainWindow")
            })
        }

        minizeMainWindow(e) {
            this.disableHover = !0;
            let t = encodeURIComponent("button=small_get");
            m.XLStatNS.trackEvent("clienttop", "clienttop_maxminum_click", "", 0, 0, 0, 0, t), this.$nextTick(() => {
                r.ipcRenderer.send("minizeMainWindow")
            })
        }

        toggleMaximizeMainWindow() {
            this.disableHover = !0;
            let e = `button=${this.maximized ? "get_back" : "big_get"}`, t = encodeURIComponent(e);
            m.XLStatNS.trackEvent("clienttop", "clienttop_maxminum_click", "", 0, 0, 0, 0, t), this.$nextTick(() => {
                this.maximized ? r.ipcRenderer.send("restoreMainWindow") : r.ipcRenderer.send("maximizeMainWindow")
            })
        }

        showMenu(e) {
            m.XLStatNS.trackEvent("clienttop", "clienttop_dropdown_click"), this.showNewIcon = !1, u.ConfigNS.getValue("XLUpdate", "ShowMainUpdateIcon", !0) && u.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1);
            let t = D.readRegString("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder");
            this.bSelectAutoRun = "" !== t, u.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoRun", !0) !== this.bSelectAutoRun && u.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", this.bSelectAutoRun), this.bSelectShowBookmark = u.ConfigNS.getValue("Bookmark", "ShowBookmarkBar", 0) && !0;
            let n = [];
            n.push({
                type: "normal",
                label: "新建下载(&N)",
                accelerator: "CmdOrCtrl+N",
                role: "",
                icon: `${__rootDir}/static/icon/newtask.png`,
                click: () => {
                    this.menuItemClick("newtask", !0)
                }
            }, {
                type: "normal", label: "导入未完成下载", click: () => {
                    this.menuItemClick("unfinished", !0)
                }
            }, {type: "separator"}, {
                type: "checkbox", label: "开机启动", checked: this.bSelectAutoRun, click: () => {
                    this.menuItemClick("autorun", !0)
                }
            }, {
                type: "normal", label: "设置中心", icon: `${__rootDir}/static/icon/config.png`, click: () => {
                    this.menuItemClick("setting", !0)
                }
            }, {type: "separator"}, {
                type: "submenu",
                label: "更多",
                enabled: !0,
                submenu: [{
                    type: "normal", label: "关于迅雷", click: () => {
                        this.menuItemClick("more_about", !0)
                    }
                }]
            }, {type: "separator"}, {
                type: "normal",
                label: "退出(&X)",
                icon: `${__rootDir}/static/icon/exit.png`,
                click: () => {
                    this.menuItemClick("quit")
                }
            });
            let i = r.remote.Menu.buildFromTemplate(n), a = r.remote.getCurrentWindow();
            b.MenuSkinNS.setStyle(i, {}), c.ContextMenuNS.popupAt(i, {window: a}, e.target)
        }

        menuItemClick(e, t) {
            if (t) {
                let t = "button=" + e;
                m.XLStatNS.trackEvent("clienttop", "clienttop_dropdownlist_click", "", 0, 0, 0, 0, t)
            }
            if ("quit" === e) d.default.exitThunderX("system-menu"); else if ("newtask" === e) d.default.showNewTaskPanel("system-menu"); else if ("setting" === e) {
                let e = {tabType: s.TabType.XDAS, tabParam: {title: "设置中心", name: "conf-setting"}};
                m.XLStatNS.trackEvent("setting_center", "setting_panel_show", "", 0, 0, 0, 0, "entry=menu"), this.createNewTab(e)
            } else if ("autorun" === e) this.bSelectAutoRun ? this.bSelectAutoRun = !1 : this.bSelectAutoRun = !0, u.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", this.bSelectAutoRun); else if ("unfinished" === e) d.default.importUncompleted("system-menu"); else if ("check" === e) u.ConfigNS.getValue("XLUpdate", "ShowMenuUpdateIcon", !1) && u.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1), D.startManualUpdateWithUI(); else if ("personal" === e) this.showPersonalManagerPlatform(); else if ("more_about" === e) {
                let e = f.join(__rootDir, "../../Thunder.exe"), t = D.getFileVersion(e);
                h.MessageBox.custom("about", {version: t, size: "large"})
            } else if ("more_kefu" === e) g.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "http://help.xunlei.com/"); else if ("privacy" === e) g.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "https://i.xunlei.com/xluser/privacy.html"); else if ("feedback" === e) {
                let e = D.getPeerID(), t = f.join(__rootDir, "../../Thunder.exe"),
                    n = "http://misc-xl9-ssl.xunlei.com/client/view/dist/1.0/feedback.html?version=" + D.getFileVersion(t) + "&pid=" + e;
                g.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", n)
            } else "addBookmark" === e && (this.hideCollectIcon || (I.information("send handleCollent"), _.emit("handleCollent")))
        }

        bookMarkClick(e) {
            let t = `button=${e}`;
            m.XLStatNS.trackEvent("clienttop", "clienttop_dropdownlist_bookmarks_click", "", 0, 0, 0, 0, t)
        }

        loadUpgradeConfig(e) {
            if (0 === e.code && e.data) if (e.data.md5 && e.data.t) {
                u.ConfigNS.getValue("XLUpdate", "UpdateMd5", "") !== e.data.md5 && 2 === parseInt(e.data.t, 10) && (u.ConfigNS.setValue("XLUpdate", "UpdateMd5", e.data.md5), u.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !0), u.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !0)), u.ConfigNS.getValue("XLUpdate", "ShowMainUpdateIcon", !0) && (this.showNewIcon = !0)
            } else u.ConfigNS.setValue("XLUpdate", "UpdateMd5", ""), u.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1), u.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1); else u.ConfigNS.setValue("XLUpdate", "UpdateMd5", ""), u.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1), u.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1)
        }

        checkUpgrade() {
        }

        showIndividuation() {
            return a(this, void 0, void 0, function* () {
                let e = 0, t = 0;
                try {
                    e = Number(yield C.default("IsLogined"))
                } catch (e) {
                    I.warning(e)
                }
                try {
                    t = JSON.parse(yield C.default("GetUserInfo", 2)).isVip
                } catch (e) {
                    I.warning(e)
                }
                m.XLStatNS.trackEvent("user_info", "personalized_center_entrance", "", 0, 0, 0, 0, `is_login=${e},is_vip=${t},source=right_corner`), C.default("ShowIndividuation")
            })
        }

        showPersonalManagerPlatform() {
            return a(this, void 0, void 0, function* () {
                let e = yield N.default(!1, !0);
                e && "" !== e && g.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "https://vip.xunlei.com/thunder-x-custom-editon/")
            })
        }

        mounted() {
            const e = r.remote.getCurrentWindow();
            e.on("maximize", () => {
                this.maximized = !0
            }), e.on("minimize", () => {
                this.maximized = !1
            }), e.on("unmaximize", () => {
                this.maximized = !1
            }), r.ipcRenderer.on(S.ThunderChannelList.channelMRMainWndMax, function () {
                y.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !0)
            }), r.ipcRenderer.on(S.ThunderChannelList.channelMRMainWndMin, function () {
                y.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !1)
            }), r.ipcRenderer.on(S.ThunderChannelList.channelMRMainWndRestore, function () {
                y.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !0)
            }), setTimeout(() => {
                this.checkUpgrade()
            }, 3e3)
        }
    };
    i([o.Prop({})], A.prototype, "createNewTab", void 0), i([o.Prop({})], A.prototype, "currentTab", void 0), i([o.Prop({})], A.prototype, "bookMarks", void 0), i([o.Watch("maximized")], A.prototype, "onMaximizedChange", null), A = i([o.Component({components: {MessageButtonContainer: l.default}})], A), t.default = A
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(315), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(859), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            showMessageButton: e => e.Community.showMessageButton,
            unReadNums: e => e.Community.unreadNums,
            messages: e => e.Community.messages,
            chatMsgs: e => e.Community.chatMsgs,
            stars: e => e.Community.stars,
            chatUserId: e => e.Community.chatUserId,
            tabs: e => e.Tabs.tabs
        },
        mapGettersToProps: {
            currentTab: e => e.currentTab,
            unreadCount: e => e.totalUnread,
            unreadMsgsLen: e => e.UnreadMsgsLen
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            setUnreadNums: "SET_UNREAD_NUMS",
            setShowMessageButton: "SET_SHOW_MESSAGE_BUTTON",
            setUnreadMsgs: "SET_UNREAD_MESSAGES",
            setChatMsgs: "SET_CHAT_MSGS",
            setUnreadStars: "SET_UNREAD_STARS",
            selectTab: "SELECT_TAB",
            resetChatsNum: "RESET_CHATS_NUM",
            setMineId: "SET_MINE_ID"
        },
        mapDispatchToProps: {
            getUnreadNums: "getUnreadNums",
            getUnreadNoticeNum: "getUnreadNoticeNum",
            getUnreadMessages: "getUnreadMessages",
            getUnreadStars: "getUnreadStars",
            getUserSessionList: "getUserSessionList"
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(317), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(1), s = n(741), l = n(140), u = n(105), d = n(6), c = n(248), h = n(569), f = n(3), p = n(22),
        g = n(259), k = n(295), m = n(13), T = n(150), v = n(107),
        y = c.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(),
        S = r.default.getLogger("MessageButton"), w = f.remote.getGlobal("mainRendererWindow"),
        b = k.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification");
    y.registerNativeFunction();
    let C = class extends o.Vue {
        constructor() {
            super(...arguments), this.communityTabDistance = {
                x: 0,
                y: 0
            }, this.timer = null, this.userId = "", this.notifyDuration = 5e3, this.mesgLogoutkey = "mesgLogoutkey", this.previousLogoutTime = 0, this.settingNotifyFlag = "", this.canNotifyFlag = "1", this.communityMsgProperty = g.MsgQueueNS.MsgPriority.Community, this.communityShow = !1, this.isMsgTipsShowing = !1, this.width = 300, this.height = 107, this.chatMsgType = 100, this.otherUserId = "", this.communSection = "community", this.communityKey = "entry_page", this.communityDefaultPage = "http://misc.xl9.xunlei.com/community/dist/", this.isStartLogin = !1, this.envelopeTips = !0, this.communityUpdate = !1, this.entry = "clienttop_envelope", this.groupType = "", this.groupData = {}, this.loginTimer = null, this.communityData = {type: ""}
        }

        onshowMessageButtonChange(e) {
            e || null === this.timer ? "" !== this.userId && this.setGetMessageTimer(this.userId) : (clearInterval(this.timer), this.timer = null)
        }

        onunreadMsgsLenChange(e) {
            S.information("onunreadMsgsLenChange", e), (0 !== e || "" === this.userId || this.communityShow) && (this.communityUpdate = !0, this.isStartLogin && null === this.loginTimer ? this.loginTimer = setTimeout(() => {
                this.handleOpenTips(), this.isStartLogin = !1, clearTimeout(this.loginTimer), this.loginTimer = null
            }, 1500) : this.handleOpenTips())
        }

        onunreadCountChange(e) {
            if (S.information("onunreadCountChange"), 0 !== e) {
                let e = "type=envelope";
                m.XLStatNS.trackEvent("community", "comtab_unread_tips_show", "", 0, 0, 0, 0, e)
            }
        }

        get showBadge() {
            if (this.unreadCount > 0 && this.envelopeTips) {
                let e = "type=envelope";
                m.XLStatNS.trackEvent("community", "comtab_show", "", 0, 0, 0, 0, e), m.XLStatNS.trackEvent("community", "comtab_show", "", 0, 0, 0, 0, "type=comtab"), this.envelopeTips = !1
            }
            return 0 === this.unreadCount && (this.envelopeTips = !0), this.unreadCount > 0
        }

        get style() {
            if (S.information(this.showMessageButton, this.communityTabDistance), this.showMessageButton) return "";
            {
                let {x: e, y: t} = this.communityTabDistance;
                return `transform: translate3d(${e}px, ${t}px, 0px); opacity: 0; pointer-events: none;`
            }
        }

        created() {
            return a(this, void 0, void 0, function* () {
                this.initUI();
                let e = yield u.default(!0);
                this.initUser(e), null === this.timer && e && this.setGetMessageTimer(e)
            })
        }

        initUI() {
            this.$root.$on("community.show", () => {
                S.information("community.show"), this.getCommunityTabDistance(), this.setShowMessageButton(!1)
            }), this.$root.$on("tab.closeTab", ({tabInfo: e}) => {
                S.information("On tab.closeTab", e), "community" === v(e, "tab", "name") && (this.setShowMessageButton(!0), this.communityShow = !1, m.XLStatNS.trackEvent("community", "comtab_close"))
            }), this.$root.$on("tab.click", e => {
                S.information("On tab.click", e), "community" === v(e, "tab", "name") && m.XLStatNS.trackEvent("community", "comtab_click")
            })
        }

        getUserAllMsg(e) {
            this.getUnreadNums(e), this.getUnreadNoticeNum(e), this.getUnreadMessages(e), this.getUnreadStars(e)
        }

        initUser(e) {
            "" !== e && void 0 !== e && (this.userId = e, this.getUserAllMsg(e))
        }

        clickHandler() {
            return a(this, void 0, void 0, function* () {
                let e = "is_red=no";
                this.showBadge && (e = "is_red=yes"), m.XLStatNS.trackEvent("clienttop", "clienttop_envelope_click", "", 0, 0, 0, 0, e);
                let t = "";
                if ("group" !== v(this.communityData, "type") && (t = yield u.default(!1, !0)), this.userId = t, t || "group" === v(this.communityData, "type")) {
                    let e = {
                        tabType: l.TabType.Chromium,
                        tabParam: {
                            title: "社区",
                            url: T.default.getConfigInfo(this.communSection, this.communityKey) || this.communityDefaultPage,
                            name: "community",
                            index: 1,
                            showUrl: !1
                        }
                    };
                    this.createNewTab(e), this.$nextTick(() => {
                        S.information("NotifyUnreadNum emit community show"), this.$root.$emit("community.show")
                    })
                }
            })
        }

        getCommunityTabDistance() {
            let e = this.$el.getBoundingClientRect(),
                t = document.querySelectorAll(".td-browser-tab__item")[1].getBoundingClientRect();
            S.information(e, t), this.communityTabDistance = {
                x: t.left + .5 * t.width - e.left - .5 * e.width,
                y: t.top + .5 * t.height - e.top - .5 * e.height
            }
        }

        setGetMessageTimer(e) {
            this.timer = setInterval(() => {
                this.getUserAllMsg(e)
            }, 3e5)
        }

        getOpenCommunityType() {
            return "" !== v(this.communityData, "type") ? v(this.communityData, "type") : this.unReadNums.notice > 0 ? "notice" : this.unReadNums.comment > 0 ? "comment" : this.unReadNums.star > 0 ? "praise" : ""
        }

        openMessageTab() {
            if (this.communityShow = !0, this.communityData.type = this.getOpenCommunityType(), "" !== v(this.communityData, "extra", "userId") && this.unreadCount > 0) {
                let e = "type=comtab";
                m.XLStatNS.trackEvent("community", "comtab_unread_tips_show", "", 0, 0, 0, 0, e)
            }
            this.setUnreadMsgs([]), this.setUnreadStars([]), this.resetChatsNum();
            let e = this.getTabIndexByTitleAndName({name: "community", title: "社区"});
            b.clearQueuesByName("community"), y.sendOpenCommunityEvent(Object.assign({}, this.communityData), v(this.tabs, e, "tab")), this.communityData = {type: ""}, this.entry = "clienttop_envelope";
            this.communityUpdate && m.XLStatNS.trackEvent("community", "comtab_show", "", 0, 0, 0, 0, "entrypage=clienttop_envelope")
        }

        setItemNotify(e, t) {
            let n = 0;
            for (let t = 0; t < e.length; t++) void 0 !== e[t] && e[t].createTime > n && (n = e[t].createTime);
            n > 0 && window.localStorage.setItem(`${t}${this.userId}`, `${n}`)
        }

        mainWindowVisiable() {
            return w.isVisible()
        }

        showMainWindow() {
            const e = w.isMinimized(), t = w.isVisible();
            !e && (e || t) && t || (w.restore(), w.show())
        }

        getUnnotifyMsgs(e, t) {
            let n = Number(window.localStorage.getItem(`${t}${this.userId}`)) || 0;
            return e.filter(e => e.createTime > n && e.createTime > this.previousLogoutTime)
        }

        setConfNotifyFlag() {
            this.settingNotifyFlag = p.ConfigNS.getValue("UserCommunitySet", `radio_id_${this.userId}`, "1")
        }

        getTabIndexByTitleAndName(e) {
            let t = -1;
            if (void 0 === this.tabs) return t;
            for (let n = 0; n < this.tabs.length; n++) if (this.tabs[n].title === e.title && this.tabs[n].tab.name === e.name) {
                t = n;
                break
            }
            return t
        }

        openCommunityTab() {
            this.showMainWindow();
            let e = this.getTabIndexByTitleAndName({name: "community", title: "社区"});
            -1 === e ? this.clickHandler() : (this.selectTab(e), "" !== this.communityData.type && this.openMessageTab())
        }

        handleOpenTips() {
            let e = this.getUnnotifyMsgs(this.stars, "community-stars"),
                t = this.getUnnotifyMsgs(this.messages, "community-messages"),
                n = this.getUnnotifyMsgs(this.chatMsgs, "community-chatMsgs");
            if (S.information("消息数列表", [...t, ...n]), S.information("点赞列表", e), S.information("上次社区通知客户端消息时间", this.previousLogoutTime), this.setItemNotify(e, "community-stars"), this.setItemNotify(t, "community-messages"), this.setItemNotify(n, "community-chatMsgs"), this.settingNotifyFlag !== this.canNotifyFlag || this.communityShow) return;
            [...e, ...t, ...n].length > 0 && b.enQueue({
                callback: () => {
                    h.Notification.notify({
                        type: "CommunityTips",
                        duration: this.notifyDuration,
                        data: {communityMsgs: [...e, ...t, ...n], msgType: [...t, ...n].length > 0 ? 0 : 1},
                        width: this.width,
                        height: this.height
                    })
                }, name: "community", priority: this.communityMsgProperty
            });
            let i = !h.Notification.getCurrentWindow();
            if (i && !this.isMsgTipsShowing) {
                S.information("deQueue", i), b.deQueue();
                let e = "type=xltips";
                m.XLStatNS.trackEvent("community", "comtab_unread_tips_show", "", 0, 0, 0, 0, e), this.isMsgTipsShowing = !0, setTimeout(() => {
                    this.isMsgTipsShowing = !1
                }, this.notifyDuration)
            }
        }

        mounted() {
            y.on("NotifyUnreadNum", e => {
                if (S.information("NotifyUnreadNum NotifyUnreadNum", e), this.setUnreadNums({
                    star: e.detail.star,
                    comment: e.detail.comment,
                    notice: e.detail.notice,
                    chat: e.detail.chat
                }), e.detail.star + e.detail.comment + e.detail.notice + e.detail.chat > 0) {
                    let e = "type=comtab";
                    m.XLStatNS.trackEvent("community", "comtab_unread_tips_show", "", 0, 0, 0, 0, e);
                    let t = (new Date).getTime() + "";
                    window.localStorage.setItem(`${this.mesgLogoutkey}${this.userId}`, t.substring(0, t.length - 3))
                }
            }), y.on("openComunityGroup", e => {
                this.communityData = e, this.openCommunityTab()
            }), f.remote.ipcMain.on("openSettingTab", e => {
                this.showMainWindow();
                let t = this.getTabIndexByTitleAndName({name: "conf-setting", title: "设置中心"});
                if (-1 === t) {
                    let e = {tabType: l.TabType.XDAS, tabParam: {title: "设置中心", name: "conf-setting"}};
                    this.createNewTab(e), this.$nextTick(() => {
                        y.emit("selectMsgNotice")
                    })
                } else this.selectTab(t)
            }), y.on("community.pageReady", () => {
                this.communityShow || this.openMessageTab()
            }), d.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.setMineId(0), b.clearQueuesByName("community"), this.userId = "", null !== this.timer && (clearInterval(this.timer), this.timer = null), this.setUnreadNums({
                    star: 0,
                    comment: 0,
                    notice: 0,
                    chat: 0
                }), this.setUnreadMsgs([]), this.setUnreadStars([]), this.resetChatsNum()
            }), d.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                this.previousLogoutTime = Number(window.localStorage.getItem(`${this.mesgLogoutkey}${e}`)) || 0, this.isStartLogin = !0, this.setMineId(Number(e) || 0), null === this.timer && void 0 !== e && this.showMessageButton && (this.initUser(e), this.setGetMessageTimer(e), this.setConfNotifyFlag()), setTimeout(() => {
                    this.getUserSessionList(e)
                }, 1e3)
            }), d.NativeCallModule.nativeCall.AttachNativeEvent("OnConfigValueChanaged", (e, t, n, i) => {
                "radio_id_" === t && (this.settingNotifyFlag = i)
            }), w.on("hide", e => {
                void 0 !== this.userId && this.communityShow && null === this.timer && this.setGetMessageTimer(this.userId)
            }), w.on("show", e => {
                void 0 !== this.userId && this.communityShow && null !== this.timer && (clearInterval(this.timer), this.timer = null)
            })
        }
    };
    i([o.Prop({})], C.prototype, "showMessageButton", void 0), i([o.Prop({})], C.prototype, "unreadCount", void 0), i([o.Prop({})], C.prototype, "unReadNums", void 0), i([o.Prop({})], C.prototype, "currentTab", void 0), i([o.Prop({})], C.prototype, "messages", void 0), i([o.Prop({})], C.prototype, "chatMsgs", void 0), i([o.Prop({})], C.prototype, "stars", void 0), i([o.Prop({})], C.prototype, "unreadMsgsLen", void 0), i([o.Prop({})], C.prototype, "tabs", void 0), i([o.Prop({})], C.prototype, "chatUserId", void 0), i([o.Prop({})], C.prototype, "getUnreadNums", void 0), i([o.Prop({})], C.prototype, "getUnreadNoticeNum", void 0), i([o.Prop({})], C.prototype, "getUnreadMessages", void 0), i([o.Prop({})], C.prototype, "getUnreadStars", void 0), i([o.Prop({})], C.prototype, "getUserSessionList", void 0), i([o.Prop({})], C.prototype, "createNewTab", void 0), i([o.Prop({})], C.prototype, "selectTab", void 0), i([o.Prop({})], C.prototype, "setUnreadNums", void 0), i([o.Prop({})], C.prototype, "setShowMessageButton", void 0), i([o.Prop({})], C.prototype, "setUnreadMsgs", void 0), i([o.Prop({})], C.prototype, "setChatMsgs", void 0), i([o.Prop({})], C.prototype, "setMineId", void 0), i([o.Prop({})], C.prototype, "resetChatsNum", void 0), i([o.Prop({})], C.prototype, "setUnreadStars", void 0), i([o.Watch("showMessageButton")], C.prototype, "onshowMessageButtonChange", null), i([o.Watch("unreadMsgsLen")], C.prototype, "onunreadMsgsLenChange", null), i([o.Watch("unreadCount")], C.prototype, "onunreadCountChange", null), C = i([o.Component({filters: {unread: s.unread}})], C), t.default = C
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(319), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(862), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            bookMarks: e => e.BookMarks.bookMarks,
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            tabs: e => e.Tabs.tabs,
            current: e => e.Tabs.current
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            onBrowserBindWindowHandle: "ON_BIND_WND_HANDLE",
            onBrowserTitleChange: "ON_TITLE_CHANGE",
            onBrowserLoadStatusChange: "ON_LOAD_STATUS_CHANGE",
            onBrowserAddressChange: "ON_ADDRESS_CHANGE",
            onBrowserNewBrowserPopupCompleted: "ON_NEW_BROWSER_POPUP_COMPLETED",
            onBrowserLoadStart: "ON_LOAD_START",
            onBrowserLoadError: "ON_LOAD_ERROR",
            onBrowserFavIconChange: "ON_FAV_ICON_GET",
            onAppQuit: "ON_APP_QUIT",
            updateTabs: "UPDATE_TABS",
            updateCurrent: "UPDATE_CURRENT",
            updateBookMarksIconUrl: "UPDATE_BOOK_MARKS_ICONURL"
        },
        mapDispatchToProps: {
            closeTab: "closeTab",
            selectTab: "selectTab",
            onJsCallNativeFunction: "onChromiumCallNativeFunction",
            onJsCheckNativeFunction: "onChromiumCheckNativeFunction",
            onBrowserNewBrowserPopup: "onNewBrowserPopup"
        },
        mapGettersToProps: {unread: e => e.totalUnread}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(321), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(21), s = n(83), l = n(140), u = n(244), d = n(3), c = n(6), h = n(247), f = n(741), p = n(7),
        g = n(2), k = n(1), m = n(5), T = n(103), v = n(863), y = n(13), S = n(261), w = n(14), b = n(80), C = n(36),
        N = n(54), D = n(45), I = n(27), _ = n(9), x = n(739),
        A = k.default.getLogger("Thunder.Main.Renderer.view.tabs"),
        E = m.default(g.join(__rootDir, "../bin/ThunderHelper.node")), M = s.TabEventManagerNS.getEventEmitter(),
        P = n(107);
    let F = class extends o.Vue {
        constructor() {
            super(...arguments), this.finished = !1, this.finishCount = 0, this.fail = !1, this.percent = 0, this.speed = "", this.titleCue = "下载", this.isLoading = !1, this.hasDownloading = !1, this.hasNewTask = !1, this.newCount = 0, this.totalTabsOpened = !1, this.totalTabsCreated = !1, this.appendChild = null
        }

        onTabsUpdated(e) {
            d.ipcRenderer.send("total-tabs-update", {tabs: e, current: this.current})
        }

        onCurrentUpdated(e) {
            d.ipcRenderer.send("total-tabs-update", {
                tabs: this.tabs,
                current: e
            }), "downloadTab" === x.default.currentGuideOptions.name && (0 === e ? (x.default.currentElement.style.display = "block", this.$nextTick(() => {
                x.default.position()
            })) : x.default.currentElement.style.display = "none")
        }

        onDownloadingTabSelect(e) {
            v.DownloadingTabCueNS.enableTrack(!e), e ? (this.fail = !1, this.hasNewTask = !1, this.finished = !1, this.finishCount = 0, this.titleCue = "下载") : this.$nextTick(() => {
                v.DownloadingTabCueNS.getCurTasksStatus(this.onDownloadingCue);
                let e = document.querySelector(".xlx-browser-tab__progress-inner");
                A.information("get element", null !== e), e && (e.addEventListener("animationend", e => {
                    A.information("animationend", e), this.hasNewTask && (this.hasNewTask = !1), this.finished && (this.finished = !1, this.finishCount = 0, this.titleCue = "下载")
                }), e.addEventListener("webkitAnimationEnd", e => {
                    A.information("webkitAnimationEnd", e)
                }))
            })
        }

        get isDownloadingTab() {
            return 0 === this.current
        }

        get progressStyle() {
            let e = "";
            do {
                if (this.hasNewTask) break;
                if (this.finished) break;
                if (this.fail) break;
                this.hasDownloading && (e = `clip-path: polygon(0px 0px, ${this.percent}% 0px, ${this.percent}% 100%, 0% 100%)`)
            } while (0);
            return e
        }

        handleAdd() {
            y.XLStatNS.trackEvent("clienttop", "clienttop_newtab_add");
            let e = {tabType: l.TabType.Chromium, tabParam: {}};
            this.createNewTab(e), this.$root.$emit("tab.createTab", e)
        }

        handleRemove({tab: e, index: t}) {
            y.XLStatNS.trackEvent("clienttop", "clienttop_newtab_close");
            let n = {tabInfo: e, index: t};
            this.closeTab(n), this.$root.$emit("tab.closeTab", n)
        }

        handleChange({tab: e, index: t}) {
            A.verbose(e), this.selectTab(t)
        }

        handleClick() {
            A.information("tab.click", P(this.tabs, `${this.current}`)), this.$root.$emit("tab.click", P(this.tabs, `${this.current}`))
        }

        tabListeners(e, t) {
            return {
                contextmenu: () => {
                    this.handlePopInputMenu(e, t)
                }
            }
        }

        handlePopInputMenu(e, t) {
            let n = e.getTitle();
            0 !== t && "设置中心" !== n && this.popEditableDefaultContextMenu(t)
        }

        handleOpenCopyTab(e) {
            let t = {tabType: l.TabType.Chromium, tabParam: {url: e}};
            this.createNewTab(t)
        }

        handleCloseTab(e) {
            if (e > 0) {
                let t = {tabInfo: this.tabs[e], index: e};
                this.closeTab(t), this.$root.$emit("tab.closeTab", t)
            }
        }

        handleMiddleDown(e) {
            e.index > 0 && this.handleCloseTab(e.index)
        }

        popEditableDefaultContextMenu(e) {
            d.remote.getCurrentWebContents().once("context-menu", (t, n) => {
                let i = this.tabs.length > 2, a = e !== this.tabs.length - 1, o = [{
                    label: "打开新的标签页", accelerator: "CmdOrCtrl+T", click: () => {
                        this.menuItemClick("add")
                    }
                }, {type: "separator"}, {
                    label: "重新加载", accelerator: "CmdOrCtrl+R", click: () => {
                        this.menuItemClick("reload", e)
                    }
                }, {
                    label: "复制", enabled: "社区" !== this.tabs[e].tab.getTitle(), click: () => {
                        this.menuItemClick("copy", e)
                    }
                }, {
                    label: "关闭标签页", accelerator: "CmdOrCtrl+W", click: () => {
                        this.menuItemClick("close", e)
                    }
                }, {
                    label: "关闭其他标签页", enabled: i, click: () => {
                        this.menuItemClick("close-other-tabs", e)
                    }
                }, {
                    label: "关闭右侧标签页", enabled: a, click: () => {
                        this.menuItemClick("close-tabs-to-the-right", e)
                    }
                }], r = d.remote.Menu.buildFromTemplate(o), s = d.remote.getCurrentWindow();
                N.MenuSkinNS.setStyle(r, {}), r.popup({window: s})
            })
        }

        menuItemClick(e, t, n) {
            if ("add" === e) this.handleAdd(); else if ("close" === e) this.handleCloseTab(t); else if ("reload" === e) this.tabs[t].tab.refresh(!1); else if ("copy" === e) this.handleOpenCopyTab(this.tabs[t].tab.url); else if ("close-other-tabs" === e) {
                let e = t;
                for (let t = this.tabs.length - 1; t > 0; t--) t !== e && this.handleCloseTab(t)
            } else if ("close-tabs-to-the-right" === e) {
                let e = t;
                for (let t = this.tabs.length - 1; t > 0; t--) t > e && this.handleCloseTab(t)
            }
        }

        showChangeCategoryMenu() {
            0 === this.current && (y.XLStatNS.trackEvent("download_leftpanel", "top_dropdown_click"), S.downloadContextMenu.setContextInfo(this.currentCategoryId, this.currentCategoryId), S.downloadContextMenu.popMenu(S.DownloadMenuType.ChangeCategory).catch())
        }

        getTabIndexByTitleAndName(e, t, n, i) {
            do {
                if (A.information(e), p.isNullOrUndefined(e)) {
                    A.error(e);
                    break
                }
                if (p.isNullOrUndefined(t) || p.isNullOrUndefined(n)) {
                    A.error(t, n);
                    break
                }
                if (p.isNullOrUndefined(i) || p.isNullOrUndefined(i[0])) {
                    let i = e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                    !0 !== i && A.error(i);
                    break
                }
                let a = null;
                try {
                    a = JSON.parse(i[0])
                } catch (e) {
                    A.warning(e)
                }
                let o = -1;
                if (!a) break;
                if (void 0 !== this.tabs) for (let e = 0; e < this.tabs.length; e++) if (this.tabs[e].title === a.title && this.tabs[e].tab.name === a.name) {
                    o = e;
                    break
                }
                e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, o)
            } while (0)
        }

        onDownloadingCue(e, t, n) {
            do {
                if (this.isDownloadingTab) break;
                if (t < 0) {
                    this.hasDownloading = !1;
                    break
                }
                if (this.hasDownloading = !0, e) {
                    this.isLoading = !0;
                    break
                }
                this.isLoading = !1, this.percent = 100 * t, this.speed = n
            } while (0)
        }

        onNewTaskCue(e) {
            do {
                if (this.isDownloadingTab) break;
                e > 0 && (this.fail ? (this.$refs.progress.classList.remove("is-fail"), setTimeout(() => {
                    this.hasNewTask = !0, this.newCount = e
                }, 0)) : (this.hasNewTask = !0, this.newCount = e))
            } while (0)
        }

        onFinishCue() {
            do {
                if (this.isDownloadingTab) break;
                this.finished ? this.finishCount = this.finishCount + 1 : this.fail ? (this.$refs.progress.classList.remove("is-fail"), setTimeout(() => {
                    this.finished = !0
                }, 0), this.finishCount = 1) : (this.finished = !0, this.finishCount = 1), this.titleCue = `${this.finishCount}个下载任务已完成`
            } while (0)
        }

        onFailCue() {
            do {
                if (this.isDownloadingTab) break;
                this.finished || this.hasNewTask || this.fail ? (this.$refs.progress.classList.remove("is-finished"), this.$refs.progress.classList.remove("is-fail"), this.finished = !1, this.hasNewTask = !1, this.fail = !1, this.finishCount = 0, this.titleCue = "下载", setTimeout(() => {
                    this.fail = !0
                }, 0)) : this.fail = !0
            } while (0)
        }

        handleKeydownHotkey(e) {
            do {
                if (!e.ctrlKey) break;
                if ("t" === e.key || "T" === e.key) {
                    this.handleAdd();
                    break
                }
                if ("r" !== e.key && "R" !== e.key || this.tabs[this.current].tab.refresh(!1), "w" === e.key || "W" === e.key) {
                    this.handleCloseTab(this.current);
                    break
                }
            } while (0)
        }

        mounted() {
            d.remote.globalShortcut.register("ctrl+shift+f12", () => {
                this.tabs[this.current].tab.showDevTool(!0)
            }), window.addEventListener("keydown", this.handleKeydownHotkey, !0), v.DownloadingTabCueNS.track(this.onNewTaskCue, this.onDownloadingCue, this.onFinishCue, this.onFailCue), window.addEventListener("keyup", e => {
                "F5" === e.key && this.tabs[this.current].tab.refresh(!1)
            }, !0);
            let e = [{
                eventName: "OnBindWindowHandle",
                listener: this.onBindWindowHandle
            }, {eventName: "OnBeforeNavigate", listener: this.onBeforeNavigate}, {
                eventName: "OnTitleChange",
                listener: this.onTitleChange
            }, {eventName: "OnFaviconURLChange", listener: this.onFaviconURLChange}, {
                eventName: "OnAddressChange",
                listener: this.onAddressChange
            }, {
                eventName: "OnNewBrowserPopup",
                listener: this.onNewBrowserPopup
            }, {
                eventName: "OnNewBrowserPopupCompleted",
                listener: this.onNewBrowserPopupCompleted
            }, {eventName: "OnOpenURLFromTab", listener: this.onOpenURLFromTab}, {
                eventName: "OnBrowserDestroy",
                listener: this.onBrowserDestroy
            }, {eventName: "OnAfterBrowserDestroy", listener: this.onAfterBrowserDestroy}, {
                eventName: "OnLoadStart",
                listener: this.onLoadStart
            }, {eventName: "OnLoadEnd", listener: this.onLoadEnd}, {
                eventName: "OnLoadingStateChange",
                listener: this.onLoadingStateChange
            }, {eventName: "OnLoadError", listener: this.onLoadError}, {
                eventName: "OnGotFocus",
                listener: this.onGotFocus
            }, {
                eventName: "OnBeforeDownload",
                listener: this.onBeforeDownload
            }, {
                eventName: "OnCustomProtocalExecution",
                listener: this.onCustomProtocalExecution
            }, {
                eventName: "OnJsCallNativeFunction",
                listener: this.onChromiumJsCallNativeFunction
            }, {
                eventName: "OnJsCheckNativeFunction",
                listener: this.onChromiumCheckNativeFunction
            }, {eventName: "OnCloseBrowser", listener: this.onClose}, {eventName: "OnHotKey", listener: this.onHotKey}];
            s.setDefaultListeners(e);
            let t, n = [{functionName: "openNewTab", nativeFunc: this.openNewTab.bind(this)}, {
                functionName: "OpenNewTab",
                nativeFunc: this.openNewTab.bind(this)
            }, {
                functionName: "GetTabIndexByTitleAndName",
                nativeFunc: this.getTabIndexByTitleAndName.bind(this)
            }, {
                functionName: "SelectTab",
                nativeFunc: this.selectTabByIndex.bind(this)
            }, {
                functionName: "IsTabSelected",
                nativeFunc: this.isTabSelected.bind(this)
            }, {
                functionName: "CloseCurrentTab",
                nativeFunc: this.closeCurrentTab.bind(this)
            }, {functionName: "CloseTabByIndex", nativeFunc: this.closeTabByIndex.bind(this)}];
            s.setDefaultNativeFunctionMap(n), (t = p.isNullOrUndefined(u.browserSupport.browserParentWnd) ? d.remote.getCurrentWindow() : u.browserSupport.browserParentWnd).on("resize", () => {
                this.resizeCurrentBrowserWindow()
            }), t.on("move", () => {
                this.resizeCurrentBrowserWindow()
            }), t.on("show", () => {
                this.resizeCurrentBrowserWindow()
            }), h.quitPromises.add(this.quitBrowser), c.NativeCallModule.nativeCall.AttachNativeEvent("onWebEvent", (...e) => {
                if (0 === this.tabs.length) return;
                if (p.isNullOrUndefined(e) || p.isNullOrUndefined(e[0])) return;
                let t = e[0];
                e.splice(0, 1);
                for (let n = 0; n < this.tabs.length; n++) this.tabs[n].tab.fireEvent(t, ...e)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                if (0 !== this.tabs.length) for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnUserLogin", e)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                if (0 !== this.tabs.length) {
                    A.information("监听到了退出事件！onLogout");
                    for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnUserLogout", e)
                }
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLoginWndClose", e => {
                if (0 !== this.tabs.length) {
                    A.information("监听到了关闭事件：onLoginWndClose：", e);
                    for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnLoginWndClose", e)
                }
            }), t.on("hide", this.fireTabVisibleChangeEvent), t.on("minimize", this.fireTabVisibleChangeEvent), t.on("show", this.fireTabVisibleChangeEvent), t.on("restore", this.fireTabVisibleChangeEvent), t.on("maximize", this.fireTabVisibleChangeEvent), t.on("unmaximize", this.fireTabVisibleChangeEvent), M.on(s.TabEventManagerNS.EventType.RemoveTab, this.onTabEvent), M.on(s.TabEventManagerNS.EventType.AddTab, this.onTabEvent), M.on(s.TabEventManagerNS.EventType.ChangeTab, this.onTabEvent), M.on(s.TabEventManagerNS.EventType.VisibleChange, this.onTabVisibleChange)
        }

        fireTabVisibleChangeEvent() {
            let e,
                t = (e = p.isNullOrUndefined(u.browserSupport.browserParentWnd) ? d.remote.getCurrentWindow() : u.browserSupport.browserParentWnd).isVisible(),
                n = e.isMinimized();
            A.information("发送tab状态和主窗口状态改变事件 visible:", t, ", minimized:", n, ", current:", this.current);
            for (let e = 0; e < this.tabs.length; e++) this.tabs[e].tab.fireEvent("OnTabVisibleChange", t && !n, this.current === e), M.emit(s.TabEventManagerNS.EventType.VisibleChange, this.tabs[e].tab, t && !n, this.current === e)
        }

        onTabEvent() {
            this.$nextTick(() => {
                this.fireTabVisibleChangeEvent()
            })
        }

        onTabVisibleChange(e, t, n) {
            if (A.information("onTabVisibleChange", e, t, n), t && n && e.getTabType() === l.TabType.Chromium) do {
                let t = e.getBrowser();
                if (p.isNullOrUndefined(t)) {
                    A.error(t);
                    break
                }
                let n = t.getWindowHandle();
                if (!1 === E.isWindowHandle(n)) break;
                E.setWindowFocus(n, !0)
            } while (0)
        }

        quitBrowser() {
            return d.remote.globalShortcut.unregister("ctrl+shift+f12"), new Promise(e => {
                this.onAppQuit(), e(!0)
            })
        }

        onBindWindowHandle(e, t) {
            let n = {hwnd: e, browser: t};
            this.onBrowserBindWindowHandle(n)
        }

        onTitleChange(e, t) {
            let n = {title: e, browser: t};
            this.onBrowserTitleChange(n)
        }

        onBeforeNavigate(e, t, n) {
            A.information("beforenavigate"), A.information(e), A.information(t), A.information(n)
        }

        onFaviconURLChange(e, t) {
            A.information("icon"), A.information(e);
            let n = "";
            for (let e = 0; e < this.tabs.length; e++) this.tabs[e].tab.getBrowser() === t && (n = this.tabs[e].tab.url);
            let i = {iconUrl: e, browser: t};
            do {
                if (!n) break;
                if ("" === n) break;
                this.getIcon(n, e).catch(), this.onBrowserFavIconChange(i)
            } while (0)
        }

        onAddressChange(e, t, n) {
            A.information(e), A.information(t);
            let i = {isMainFrame: e, url: t, browser: n};
            this.onBrowserAddressChange(i)
        }

        onNewBrowserPopup(e, t, n) {
            let i = {url: e, refUrl: t, browser: n};
            this.onBrowserNewBrowserPopup(i)
        }

        onNewBrowserPopupCompleted(e, t) {
            A.information(e);
            let n = {url: e, browser: t};
            this.onBrowserNewBrowserPopupCompleted(n)
        }

        onOpenURLFromTab(e, t) {
            A.information(e), A.information(t)
        }

        onBrowserDestroy(e) {
            A.information("onBrowserDestroy"), p.isNullOrUndefined(u.browserSupport.browserManager) || u.browserSupport.browserManager.deleteBrowser(e), d.ipcRenderer.send(w.ThunderChannelList.channelRMSetFoucs)
        }

        onAfterBrowserDestroy(e) {
            A.information(e)
        }

        onLoadStart(e, t, n, i) {
            A.information("OnLoadStart"), A.information(e), A.information(t), A.information(n);
            let a = {isMainFrame: e, url: t, transitionType: n, browser: i};
            this.onBrowserLoadStart(a)
        }

        onLoadEnd(e, t, n) {
            A.information("onLoadEnd"), A.information(e), A.information(t), A.information(n)
        }

        onLoadingStateChange(e, t, n, i) {
            A.information("onLoadingStateChange"), A.information(e), A.information(t), A.information(n);
            let a = {isLoading: e, canGoBack: t, canGoForward: n, browser: i};
            this.onBrowserLoadStatusChange(a)
        }

        onLoadError(e, t, n, i, a, o) {
            A.information("OnLoadError"), A.information(e), A.information(n), A.information(i), A.information(a), A.information(t);
            let r = {isMainFrame: e, url: t, errorCode: n, errorText: i, failedUrl: a, browser: o};
            this.onBrowserLoadError(r)
        }

        onGotFocus(e) {
            let t = void 0;
            for (let n = 0; n < this.tabs.length; n++) p.isNullOrUndefined(this.tabs[n]) || p.isNullOrUndefined(this.tabs[n].tab) || (t = this.tabs[n].tab.getBrowser(), p.isNullOrUndefined(t) || e === t && M.emit(s.TabEventManagerNS.EventType.GotFocus, this.tabs[n].tab));
            b.ThunderWindowNS.bringWindowToTop(u.browserSupport.browserParentWndHandle)
        }

        onBeforeDownload(e, t, n, i) {
            A.information("onBeforeDownload", e, t, "suggestName:", n, "mimeType", i), T.ThunderNewTask.createTaskByUrl(e, n)
        }

        onCustomProtocalExecution(e, t) {
            T.ThunderNewTask.createTaskByUrl(e)
        }

        onChromiumJsCallNativeFunction(e, t, n, i) {
            let a = {nativeCallId: 0, functionName: e, callBackId: t, browser: n, args: i};
            this.onJsCallNativeFunction(a)
        }

        onChromiumCheckNativeFunction(e, t, n) {
            let i = {nativeCallId: 0, functionName: e, callBackId: t, browser: n};
            this.onJsCheckNativeFunction(i)
        }

        onClose(e) {
            let t = void 0;
            for (let n = 0; n < this.tabs.length; n++) if (!p.isNullOrUndefined(this.tabs[n]) && !p.isNullOrUndefined(this.tabs[n].tab) && (t = this.tabs[n].tab.getBrowser(), !p.isNullOrUndefined(t) && e === t)) {
                let e = {tabInfo: this.tabs[n], index: n};
                this.closeTab(e);
                break
            }
        }

        onHotKey(e, t, n) {
            A.information("onHotKey", t, e);
            let i = void 0;
            for (let a = 0; a < this.tabs.length; a++) if (!p.isNullOrUndefined(this.tabs[a]) && !p.isNullOrUndefined(this.tabs[a].tab) && (i = this.tabs[a].tab.getBrowser(), !p.isNullOrUndefined(i) && n === i)) {
                if (116 === e) {
                    let e = 4 === t;
                    n.refresh(e)
                }
                do {
                    if (4 !== t) break;
                    84 === e && this.handleAdd(), 82 === e && this.tabs[this.current].tab.refresh(!1), 87 === e && this.handleCloseTab(this.current)
                } while (0);
                break
            }
        }

        getIcon(e, t) {
            return a(this, void 0, void 0, function* () {
                let n = new URL(e).host, i = D.ToolsUtilitiesAWNS.genarateMd5(n),
                    a = __profilesDir + "/BookMarksIcon/" + i + ".png";
                return yield this.downloadIcon(e, t, a)
            })
        }

        downloadIcon(e, t, n) {
            return a(this, void 0, void 0, function* () {
                let i = null, a = !1;
                try {
                    i = yield I.default.get(t, {responseType: "arraybuffer"})
                } catch (e) {
                    A.error("error " + e)
                }
                if (null !== i && void 0 !== i.status && 200 === i.status && null !== i.data && (a = yield _.FileSystemAWNS.writeFileAW(n, i.data))) {
                    let t = {url: e, iconUrl: n};
                    this.updateBookMarksIconUrl(t)
                }
                return a
            })
        }

        openNewTab(e, t, n, i) {
            do {
                if (A.information(e), p.isNullOrUndefined(e)) {
                    A.error(e);
                    break
                }
                if (p.isNullOrUndefined(t) || p.isNullOrUndefined(n)) {
                    A.error(t, n);
                    break
                }
                if (p.isNullOrUndefined(i) || p.isNullOrUndefined(i[0])) {
                    let i = e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                    !0 !== i && A.error(i);
                    break
                }
                let a = i[0], o = i[1], s = {url: a};
                if (o) try {
                    s = Object.assign(s, JSON.parse(o))
                } catch (e) {
                    A.warning(e)
                }
                let u = {tabType: l.TabType.Chromium, tabParam: s};
                this.createNewTab(u), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, "create_new_tab_ok")
            } while (0)
        }

        closeCurrentTab(e, t, n, i) {
            do {
                if (A.information("closeCurrentTab", e), p.isNullOrUndefined(e)) {
                    A.error(e);
                    break
                }
                if (p.isNullOrUndefined(t) || p.isNullOrUndefined(n)) {
                    A.error(t, n);
                    break
                }
                if (e === this.tabs[this.current].tab) {
                    let e = {tabInfo: this.tabs[this.current], index: this.current};
                    this.closeTab(e)
                }
            } while (0)
        }

        closeTabByIndex(e, t, n, i) {
            if (p.isNullOrUndefined(e)) return void A.error(e);
            if (p.isNullOrUndefined(t) || p.isNullOrUndefined(n)) return void A.error(t, n);
            const a = i[0];
            if (p.isNullOrUndefined(a)) return;
            let o = {tabInfo: this.tabs[a], index: a};
            this.closeTab(o), this.$root.$emit("tab.closeTab", o), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, {
                tabs: this.tabs,
                current: this.current
            })
        }

        isTabSelected(e, t, n, i) {
            let a = !1;
            do {
                if (A.information("isTabSelected tab:", e), p.isNullOrUndefined(e)) {
                    A.error(e);
                    break
                }
                if (p.isNullOrUndefined(t) || p.isNullOrUndefined(n)) {
                    A.error(t, n);
                    break
                }
                e === this.tabs[this.current].tab && (a = !0)
            } while (0);
            return a
        }

        selectTabByIndex(e, t, n, i) {
            do {
                if (A.information("selectTabByIndex", e), p.isNullOrUndefined(e)) {
                    A.error(e);
                    break
                }
                if (p.isNullOrUndefined(t) || p.isNullOrUndefined(n)) {
                    A.error(t, n);
                    break
                }
                let a = i[0];
                this.selectTab(a), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, "create_new_tab_ok")
            } while (0)
        }

        resizeCurrentBrowserWindow() {
            do {
                if (0 === this.tabs.length) break;
                let e = this.tabs[this.current].tab;
                if (p.isNullOrUndefined(e)) break;
                if (e.getTabType() === l.TabType.Chromium) {
                    let t = e.getBrowser();
                    if (p.isNullOrUndefined(t)) break;
                    if (!0 === e.isErrorPage) break;
                    let n = t.getWindowHandle();
                    if (!1 === E.isWindowHandle(n)) {
                        A.error(n);
                        break
                    }
                    u.resizeBrowserWindow(n)
                }
            } while (0)
        }

        handleTotalClick(e) {
            if (this.totalTabsOpened) return;
            const t = e.currentTarget.getBoundingClientRect(), n = e.currentTarget.cloneNode();
            n.style.position = "fixed", n.style.zIndex = "100", n.style.opacity = "0", n.style.top = t.top + "px", n.style.left = t.left + "px", n.style.marginTop = "0", this.totalTabsCreated ? (document.body.appendChild(n), this.appendChild = n, d.ipcRenderer.send("message-box-open", {
                name: "TotalTabs",
                position: {
                    x: Math.floor(window.screenX + t.left - 147 + 28),
                    y: Math.floor(window.screenY + t.top + 28)
                }
            })) : (this.totalTabsOpened = this.totalTabsCreated = !0, document.body.appendChild(n), this.appendChild = n, C.MessageBox.custom("TotalTabs", {
                tabs: this.tabs,
                current: this.current
            }, {
                width: 147,
                height: 395,
                x: Math.floor(window.screenX + t.left - 147 + 28),
                y: Math.floor(window.screenY + t.top + 28),
                modal: !1,
                transparent: !1
            }), d.remote.ipcMain.on("total-tabs-hide", () => {
                this.totalTabsOpened = !1, this.appendChild && (document.body.removeChild(this.appendChild), this.appendChild = null)
            }))
        }
    };
    i([o.Prop({})], F.prototype, "bookMarks", void 0), i([o.Prop({})], F.prototype, "currentCategoryId", void 0), i([o.Prop({})], F.prototype, "tabs", void 0), i([o.Prop({})], F.prototype, "unread", void 0), i([o.Prop({})], F.prototype, "updateBookMarksIconUrl", void 0), i([o.Prop({})], F.prototype, "createNewTab", void 0), i([o.Prop({})], F.prototype, "onBrowserBindWindowHandle", void 0), i([o.Prop({})], F.prototype, "onBrowserTitleChange", void 0), i([o.Prop({})], F.prototype, "onBrowserFavIconChange", void 0), i([o.Prop({})], F.prototype, "onBrowserLoadStatusChange", void 0), i([o.Prop({})], F.prototype, "onBrowserAddressChange", void 0), i([o.Prop({})], F.prototype, "onBrowserNewBrowserPopup", void 0), i([o.Prop({})], F.prototype, "onBrowserNewBrowserPopupCompleted", void 0), i([o.Prop({})], F.prototype, "onBrowserLoadStart", void 0), i([o.Prop({})], F.prototype, "onBrowserLoadError", void 0), i([o.Prop({})], F.prototype, "onBrowserClose", void 0), i([o.Prop({})], F.prototype, "selectTab", void 0), i([o.Prop({})], F.prototype, "closeTab", void 0), i([o.Prop({})], F.prototype, "onAppQuit", void 0), i([o.Prop({})], F.prototype, "onJsCallNativeFunction", void 0), i([o.Prop({})], F.prototype, "onJsCheckNativeFunction", void 0), i([o.Prop({default: "transparent"})], F.prototype, "background", void 0), i([o.Prop({default: 0})], F.prototype, "current", void 0), i([o.Prop({})], F.prototype, "updateCurrent", void 0), i([o.Prop({})], F.prototype, "updateTabs", void 0), i([o.Watch("tabs", {deep: !0})], F.prototype, "onTabsUpdated", null), i([o.Watch("current")], F.prototype, "onCurrentUpdated", null), i([o.Watch("isDownloadingTab")], F.prototype, "onDownloadingTabSelect", null), F = i([o.Component({filters: {unread: f.unread}})], F), t.default = F
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(323), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(866), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            chatUsersInfo: e => e.Community.chatUsersInfo,
            showMessageButton: e => e.Community.showMessageButton,
            unReadNums: e => e.Community.unreadNums
        },
        mapCommitToProps: {setChatMsgs: "SET_CHAT_MSGS", setUserInfo: "SET_USERS_INFO", setChatsNum: "SET_CHATS_NUM"},
        mapDispatchToProps: {getUserInfo: "getUserInfo"}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(325), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(6), r = n(107), s = n(1).default.getLogger("MessageTips");
    let l = class extends a.Vue {
        constructor() {
            super(...arguments), this.serveiceType = "10007", this.chatMsgType = 100, this.msgWayType = 2, this.avatarLinkProtocol = "http", this.newMsgChatType = 1, this.isStartLogin = !1, this.msgImageType = 2, this.msgFileType = 4
        }

        getUserAvatar(e) {
            let t = e || 0;
            return `${this.avatarLinkProtocol}://img.user.kanimg.com/usrimg/${t}/300x300`
        }

        mounted() {
            o.NativeCallModule.nativeCall.AttachNativeEvent("OnMessageChannelUserLogin", () => {
                s.information("用户登录消息通道成功"), o.NativeCallModule.nativeCall.CallNativeFunction("MessageChannelRegisterService", this.serveiceType)
            }), o.NativeCallModule.nativeCall.AttachNativeEvent("OnMessageChannelServiceCallback", (e, t) => {
                s.information("收到私信,msgServiceArray", t), s.information("收到私信,serviceType", e);
                let n = [];
                try {
                    let i = JSON.parse(t);
                    if (e === this.serveiceType) for (let e = 0; e < i.length; e++) {
                        let t = i[e];
                        try {
                            let e = JSON.parse(t.data);
                            s.information("getUserInfo data", e);
                            let a = "";
                            if (a = r(e, "record", "class") === this.msgImageType ? "[图片]" : r(e, "record", "class") === this.msgFileType ? "[文件]" : r(e, "record", "content"), r(e, "message_type") === this.msgWayType) {
                                let t = !1, o = {
                                    msgType: this.chatMsgType,
                                    userId: r(e, "record", "sender") || 0,
                                    userAvatar: this.getUserAvatar(r(e, "record", "sender")),
                                    msgid: r(e, "record", "id"),
                                    messageContent: a,
                                    userName: "",
                                    createTime: r(e, "record", "created_at")
                                };
                                this.getUserInfo(r(e, "record", "sender")).then(e => {
                                    if (!e.error && "ok" === e.data.result && !t) {
                                        let i = e.data.user_info || {};
                                        o.userName = r(i, "nick_name") || r(this.chatUsersInfo[o.userId], "nick_name"), n.push(o), t = !0
                                    }
                                    s.information("私信未读数-getUserInfo chatMsgs", n), n.length === i.length && 0 !== n.length && (this.setChatMsgs(n), s.information("isStartLogin", !this.isStartLogin), !this.isStartLogin && this.showMessageButton && this.setChatsNum(this.unReadNums.chat + n.length))
                                })
                            }
                        } catch (e) {
                            s.information("json parse community error", e)
                        }
                    }
                } catch (e) {
                    s.information("json parse community error", e)
                }
            }), o.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                this.isStartLogin = !0, setTimeout(() => {
                    this.isStartLogin = !1
                }, 1e3)
            }), o.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                s.information("OnLogout"), this.isStartLogin = !1
            })
        }
    };
    i([a.Prop({})], l.prototype, "setChatMsgs", void 0), i([a.Prop({})], l.prototype, "setUserInfo", void 0), i([a.Prop({})], l.prototype, "setChatsNum", void 0), i([a.Prop({})], l.prototype, "getUserInfo", void 0), i([a.Prop({})], l.prototype, "chatUsersInfo", void 0), i([a.Prop({})], l.prototype, "showMessageButton", void 0), i([a.Prop({})], l.prototype, "unReadNums", void 0), l = i([a.Component({components: {}})], l), t.default = l
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(327), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(868), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            bookMarks: e => e.BookMarks.bookMarks,
            formData: e => e.SettingConf.formData
        },
        mapGettersToProps: {currentTab: e => e.currentTab},
        mapDispatchToProps: {initBookMarks: "initBookMarks"},
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            deleteBookMarksItem: "REMOVE_BOOK_MARKS_ITEM",
            setConfigValue: "SET_CONFIG_VALUE",
            updateBookMarksIconUrl: "UPDATE_BOOK_MARKS_ICONURL"
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(329), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(3), r = n(140), s = n(22), l = n(23), u = n(248), d = n(36), c = n(244), h = n(6), f = n(54),
        p = n(13), g = n(107), k = n(1), m = n(869), T = k.default.getLogger("book-marks"),
        v = o.remote.getGlobal("mainRendererWindow"),
        y = u.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule();
    let S = class extends a.Vue {
        constructor() {
            super(...arguments), this.bookMarksWidth = 128, this.moreBookMarkMenuWidth = 294, this.winWidth = 1, this.curWnd = null, this.bookMarkMenuUrl = "", this.bookMarkMenuTitle = "", this.bookMarkConf = !1, this.indexPageTitle = "下载", this.settingPageTitle = "设置中心", this.communityName = "community", this.blankPageTitle = "新标签页", this.headerHeight = 107, this.bookMarkBarHeight = 33, this.arrowWidth = 22, this.iconAndPaddingWidth = 32, this.fontSize = 12, this.bookMarkStrLen = 8, this.hoverMenuContext = null, this.moreBookMarkItemHeight = 28, this.moreBookMarkMaxHeight = 440, this.itemsPadding = 8, this.itemsWarpperPadding = 12
        }

        get bookMarksList() {
            return Object.values(this.bookMarks) || []
        }

        get showMarksList() {
            return this.bookMarksList.slice(0, this.barMarkEnd)
        }

        get barMarkEnd() {
            let e = 0, t = 0;
            for (let n = 0; n < this.bookMarksList.length; n++) {
                if (this.bookMarksList[n].name.length >= this.bookMarkStrLen ? t += this.bookMarksWidth : t = t + this.bookMarksList[n].name.length * this.fontSize + this.iconAndPaddingWidth, t >= this.winWidth - this.bookMarksWidth - this.arrowWidth) {
                    e = n;
                    break
                }
                e = n
            }
            return e + 1
        }

        get hideBookMarksList() {
            return this.bookMarksList.slice(this.barMarkEnd)
        }

        get isShowBookMarkBar() {
            let e = this.bookMarkConf && !this.pageHideBookMarks && 0 !== this.bookMarksList.length,
                t = g(this.currentTab, "tab", "browser");
            if (t) {
                let e = t.getWindowHandle();
                this.$nextTick(() => {
                    c.resizeBrowserWindow(e)
                })
            }
            return e
        }

        get bookMarkTemplate() {
            return [{
                label: "在新标签页中打开", click: () => {
                    this.bookMarkRightClick("open_new"), this.openNewTab(this.bookMarkMenuUrl, this.bookMarkMenuTitle, "new")
                }
            }, {
                label: "删除", click: () => {
                    this.deleteBookMarksItem(this.bookMarkMenuUrl), p.XLStatNS.trackEvent("clienttop", "bookmarks_delete")
                }
            }]
        }

        get blankBookMarkMenu() {
            return [{
                label: "将此页添加书签",
                enabled: void 0 === this.bookMarks[g(this.currentTab, "tab", "url")] && g(this.currentTab, "tab", "title") !== this.blankPageTitle,
                click: () => {
                    y.emit("handleCollent")
                }
            }, {
                label: "隐藏书签栏", click: () => {
                    s.ConfigNS.setValue("Bookmark", "ShowBookmarkBar", 0)
                }
            }]
        }

        get pageHideBookMarks() {
            return g(this.currentTab, "tab", "type") === r.TabType.XDAS || g(this.currentTab, "tab", "name") === this.communityName
        }

        showBookMarkMenu(e, t, n = {}) {
            this.bookMarkMenuUrl = e, this.bookMarkMenuTitle = t;
            let i = o.remote.Menu.buildFromTemplate(this.bookMarkTemplate);
            f.MenuSkinNS.setStyle(i, {}), i.popup(Object.assign({}, {window: this.curWnd}, n)), p.XLStatNS.trackEvent("clienttop", "bookmarks_top_right_click")
        }

        created() {
            s.ConfigNS.attachListener(l.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.initBookMarks()
            }), this.setWinWidth()
        }

        setWinWidth() {
            if (void 0 === v) return;
            let e = v.getContentSize();
            this.winWidth = e[0]
        }

        showMenu(e) {
            let t = o.remote.getCurrentWindow().getBounds(), n = {
                x: t.x + e.x - this.moreBookMarkMenuWidth,
                y: t.y + e.y + 12,
                modal: !1,
                width: this.moreBookMarkMenuWidth + 2,
                height: this.hideBookMarksList.length * this.moreBookMarkItemHeight + this.itemsPadding + this.itemsWarpperPadding > this.moreBookMarkMaxHeight ? this.moreBookMarkMaxHeight : this.hideBookMarksList.length * this.moreBookMarkItemHeight + this.itemsPadding + this.itemsWarpperPadding + 2,
                maxHeight: this.moreBookMarkMaxHeight
            };
            d.MessageBox.custom("BookList", this.hideBookMarksList, n)
        }

        openNewTab(e, t, n = "") {
            if (g(this.currentTab, "tab", "title") === this.blankPageTitle && "new" !== n) return void g(this.currentTab, "tab").navigate(e);
            let i = {tabType: r.TabType.Chromium, tabParam: {title: t, url: e, name: "", showUrl: !0}};
            this.createNewTab(i), p.XLStatNS.trackEvent("clienttop", "bookmarks_bowser_open")
        }

        showAddBookMarkMenu(e) {
            let t = o.remote.Menu.buildFromTemplate(this.blankBookMarkMenu);
            p.XLStatNS.trackEvent("clienttop", "bookmarks_bar_blank_rihgt_click"), f.MenuSkinNS.setStyle(t, {}), t.popup({window: this.curWnd})
        }

        bookMarkRightClick(e) {
            let t = `button=${e}`;
            p.XLStatNS.trackEvent("clienttop", "bookmarks_top_right_click_menu", "", 0, 0, 0, 0, t)
        }

        mounted() {
            this.curWnd = o.remote.getCurrentWindow(), v.on("resize", e => {
                this.setWinWidth()
            }), o.remote.ipcMain.on("openNewTab-book-list", (e, t) => {
                T.information("openNewTab-book-list", t), this.openNewTab(t.url, t.title)
            }), o.remote.ipcMain.on("delete-book-list", (e, t) => {
                T.information("delete-book-list", t), this.deleteBookMarksItem(t.url)
            }), s.ConfigNS.attachListener(l.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.bookMarkConf = s.ConfigNS.getValue("Bookmark", "ShowBookmarkBar", !1)
            }), h.NativeCallModule.nativeCall.AttachNativeEvent("OnConfigValueChanaged", (e, t, n, i) => {
                "Bookmark" === e && (this.bookMarkConf = i)
            })
        }
    };
    i([a.Prop({})], S.prototype, "initBookMarks", void 0), i([a.Prop({})], S.prototype, "createNewTab", void 0), i([a.Prop({})], S.prototype, "deleteBookMarksItem", void 0), i([a.Prop({})], S.prototype, "setConfigValue", void 0), i([a.Prop({})], S.prototype, "currentTab", void 0), i([a.Prop({})], S.prototype, "bookMarks", void 0), i([a.Prop({})], S.prototype, "formData", void 0), i([a.Prop({})], S.prototype, "updateBookMarksIconUrl", void 0), S = i([a.Component({components: {BookMarksItem: m.default}})], S), t.default = S
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(331), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(9), s = n(45), l = n(27), u = n(1).default.getLogger("book-marks");
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.iconExist = !1, this.existUrl = ""
        }

        onIconUrlChange(e) {
            return a(this, void 0, void 0, function* () {
                do {
                    if ("" === this.url || void 0 === this.url || -1 !== this.url.indexOf("ftp://")) {
                        this.iconExist = !1;
                        break
                    }
                    let e = new URL(this.url).host, t = s.ToolsUtilitiesAWNS.genarateMd5(e),
                        n = __profilesDir + "/BookMarksIcon/" + t + ".png";
                    if (this.iconExist = yield r.FileSystemAWNS.existsAW(n), this.existUrl = n, !this.iconExist) {
                        n = "movie.xunlei.com" !== e ? "https://" + e + "/favicon.ico" : "https://" + e + "/fav.ico";
                        let t = null;
                        try {
                            t = yield l.default.get(n, {responseType: "arraybuffer"})
                        } catch (e) {
                            u.information("error " + e), this.iconExist = !1;
                            break
                        }
                        if (null !== t && void 0 !== t.status && 200 === t.status && null !== t.data && (this.iconExist = yield r.FileSystemAWNS.writeFileAW(this.existUrl, t.data), this.iconExist)) {
                            let e = {url: this.url, iconUrl: n};
                            this.updateBookMarksIconUrl(e)
                        }
                    }
                } while (0)
            })
        }
    };
    i([o.Prop({})], d.prototype, "url", void 0), i([o.Prop({})], d.prototype, "iconUrl", void 0), i([o.Prop({})], d.prototype, "updateBookMarksIconUrl", void 0), i([o.Watch("iconUrl", {immediate: !0})], d.prototype, "onIconUrlChange", null), d = i([o.Component({})], d), t.default = d
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(333), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(872), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {tabs: e => e.Tabs.tabs},
        mapDispatchToProps: {initSettingData: "initSettingData"},
        mapGettersToProps: {currentTab: e => e.currentTab}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(335), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(873), r = n(912), s = n(140), l = n(107);
    let u = class extends a.Vue {
        get downloadShow() {
            return "" === l(this.currentTab, "tab", "url") && "下载" === l(this.currentTab, "title")
        }

        get settingViewShow() {
            return "conf-setting" === l(this.currentTab, "tab", "name") && "设置中心" === l(this.currentTab, "title")
        }

        get webviewShow() {
            return l(this.currentTab, "tab", "type") === s.TabType.Chromium
        }

        get hadSettingTab() {
            return -1 !== this.getTabIndexByTitleAndName({name: "conf-setting", title: "设置中心"})
        }

        getTabIndexByTitleAndName(e) {
            let t = -1;
            if (void 0 === this.tabs) return t;
            for (let n = 0; n < this.tabs.length; n++) if (this.tabs[n].title === e.title && this.tabs[n].tab.name === e.name) {
                t = n;
                break
            }
            return t
        }
    };
    i([a.Prop({})], u.prototype, "currentTab", void 0), i([a.Prop({})], u.prototype, "initSettingData", void 0), i([a.Prop({})], u.prototype, "tabs", void 0), u = i([a.Component({
        components: {
            HomeTabView: o.default,
            BrowserViewContainer: r.default,
            SettingViewContainer: () => Promise.resolve().then(() => n(915))
        }
    })], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(337), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(874), r = n(909);
    let s = class extends a.Vue {
    };
    s = i([a.Component({components: {HomePage: r.default, DownloadPanel: o.default}})], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(339), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(875), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage,
            showUpgradeTask: e => e.UpgradeTaskState.showUpgradeTask,
            currentTabId: e => e.Tabs.current
        },
        mapCommitToProps: {
            UPDATE_CATEGORY: "UPDATE_CATEGORY",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW",
            SHOW_PRIVATE_SPACE_OPEN_PAGE: "SHOW_PRIVATE_SPACE_OPEN_PAGE",
            SHOW_UPGRADE_TASK: "SHOW_UPGRADE_TASK"
        },
        mapDispatchToProps: {selectTab: "selectTab"},
        mapGettersToProps: {downloadingOrder: e => e.downloadingOrder}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(341), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(3), r = n(4), s = n(876), l = n(883), u = n(887), d = n(890), c = n(891), h = n(892), f = n(905),
        p = n(93), g = n(278), k = n(23), m = n(261), T = n(105), v = n(6), y = n(85), S = n(61), w = n(15), b = n(139),
        C = n(744), N = n(31), D = n(907), I = N.DownloadKernelTaskManager.getTaskManager(),
        _ = p.DownloadKernelCategoryManager.getCategoryManager(), x = C.DownloadKernelUpgradeNS.getUpgrade(), A = n(13);
    let E = class extends r.Vue {
        constructor() {
            super(...arguments), this.adShow = !1, this.isSearch = !1
        }

        onCategoryChange(e, t) {
            if (-1 !== e) {
                let t = _.getCategoryFromId(e);
                if (t) {
                    let e = t.getPassword();
                    if (!e || "" === e) return void this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!0)
                }
            }
            this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!1)
        }

        onDownloadingOrderChange(e) {
            I.isLoadStorageTaskFinish() && b.DownloadDispatchNS.updateTasksOrder(e)
        }

        handleAdShow(e) {
            this.adShow = e
        }

        get isShowPrivateSpace() {
            return -1 !== this.currentCategoryId
        }

        myComputer() {
            -1 !== this.currentCategoryId && this.UPDATE_CATEGORY(-1)
        }

        closeSearchUI() {
            this.isSearch = !1
        }

        keyOpenSearchUI() {
            A.XLStatNS.trackEvent("download_leftpanel", "search_start_click", "", 0, 0, 0, 0, "entry=ctrlf"), this.openSearchUI()
        }

        openSearchUI() {
            this.isShowPrivateSpace || (this.isSearch = !0)
        }

        privateSpace() {
            return a(this, void 0, void 0, function* () {
                let e = yield T.default(!1, !0);
                if (e && "" !== e) {
                    let t = _.getPrivateCategoryFromUserId(e);
                    if (t && this.currentCategoryId !== t.getId()) {
                        0 === (yield g.PrivateSpaceHelperNS.accessPrivateCategory(e)) && this.UPDATE_CATEGORY(t.getId())
                    }
                }
            })
        }

        handleMenuClick(e) {
            switch (e) {
                case"my_computer":
                    this.myComputer();
                    break;
                case"private_space":
                    this.privateSpace()
            }
        }

        onUpgradeProgress(e, t) {
            e > t ? this.SHOW_UPGRADE_TASK(!0) : setTimeout(() => {
                this.SHOW_UPGRADE_TASK(!1)
            }, 10)
        }

        handleSwitchCategory(e, t, n, i) {
            return a(this, void 0, void 0, function* () {
                this.isSearch = !1;
                let a = o.remote.getCurrentWindow();
                if (i && (a.isMinimized() && a.restore(), a.show(), 0 !== this.currentTabId && this.selectTab(0)), this.currentCategoryId !== e) if (-1 !== e) {
                    let t = yield w.default("GetUserID");
                    if (0 !== (yield g.PrivateSpaceHelperNS.accessPrivateCategory(t))) return;
                    this.UPDATE_CATEGORY(e)
                } else this.UPDATE_CATEGORY(e);
                this.$nextTick(() => {
                    this.currentCategoryViewId !== t && this.UPDATE_CATEGORYVIEW(t), this.$refs.downloadlist.selectTask(t, n)
                })
            })
        }

        handleOpenSearchPage(e) {
            if (e) {
                let e = "entry=morelist";
                A.XLStatNS.trackEvent("download_leftpanel", "search_start_click", "", 0, 0, 0, 0, e), this.openSearchUI()
            } else this.closeSearchUI()
        }

        needUpgradeTask() {
            let e = "", t = 0;
            for (let n = 0; n < o.remote.process.argv.length; n++) {
                if (0 === o.remote.process.argv[n].indexOf("-StartType:")) e = o.remote.process.argv[n].substr("-StartType:".length); else {
                    if (0 === o.remote.process.argv[n].indexOf("-PreVersion:")) {
                        let e = o.remote.process.argv[n].substr("-PreVersion:".length), i = e.indexOf(".");
                        i && (e = e.substr(0, i)) && (t = parseInt(e, 10))
                    }
                }
            }
            let n = !1;
            return ("Install" === e && t < 9 || "LiveUD" === e && (0 === t || t < 9)) && (n = !0), n
        }

        created() {
            g.PrivateSpaceHelperNS.init(), this.onLogoutEventId = v.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                -1 !== this.currentCategoryId && this.UPDATE_CATEGORY(-1);
                let t = _.getPrivateCategoryFromUserId(e);
                t && y.TaskOperatorNs.pauseCategoryAllTask(t.getId())
            });
            let e = o.remote.getCurrentWindow();
            e.on("hide", () => {
                this.UPDATE_CATEGORY(-1), g.PrivateSpaceHelperNS.setNeedPassword(!0)
            }), e.on("minimize", () => {
                this.UPDATE_CATEGORY(-1), g.PrivateSpaceHelperNS.setNeedPassword(!0)
            }), m.downloadContextMenu.attachListener(k.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), S.default.attachListener(k.NodeEventMesssageNS.eventDownloadSwitchCategory, this.handleSwitchCategory), S.default.attachListener(k.NodeEventMesssageNS.eventShowSearchTaskPage, this.handleOpenSearchPage), this.needUpgradeTask() && x.init() && (x.attachListener(x.eventUpgradeProgress, this.onUpgradeProgress), x.startUpgrade()), this.onLoginEventId = v.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                x.init() && x.upgradePrivateSpace(e)
            })
        }

        destroyed() {
            g.PrivateSpaceHelperNS.uninit(), void 0 !== this.onLogoutEventId && (v.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.onLogoutEventId), this.onLogoutEventId = void 0), void 0 !== this.onLoginEventId && (v.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.onLoginEventId), this.onLoginEventId = void 0), m.downloadContextMenu.detachListener(k.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), S.default.detachListener(k.NodeEventMesssageNS.eventDownloadSwitchCategory, this.handleSwitchCategory), x.detachListener(x.eventUpgradeProgress, this.onUpgradeProgress)
        }
    };
    i([r.Prop({})], E.prototype, "currentTabId", void 0), i([r.Prop({})], E.prototype, "currentCategoryId", void 0), i([r.Prop({})], E.prototype, "currentCategoryViewId", void 0), i([r.Prop({})], E.prototype, "showPrivateSpaceOpenPage", void 0), i([r.Prop({})], E.prototype, "showUpgradeTask", void 0), i([r.Prop({})], E.prototype, "downloadingOrder", void 0), i([r.Prop({})], E.prototype, "SHOW_PRIVATE_SPACE_OPEN_PAGE", void 0), i([r.Prop({})], E.prototype, "SHOW_UPGRADE_TASK", void 0), i([r.Prop({})], E.prototype, "selectTab", void 0), i([r.Prop({})], E.prototype, "UPDATE_CATEGORY", void 0), i([r.Prop({})], E.prototype, "UPDATE_CATEGORYVIEW", void 0), i([r.Watch("currentCategoryId", {immediate: !0})], E.prototype, "onCategoryChange", null), i([r.Watch("downloadingOrder", {immediate: !0})], E.prototype, "onDownloadingOrderChange", null), E = i([r.Component({
        components: {
            ToolBarContainer: s.default,
            DownloadListContainer: h.default,
            PrivateSpaceOpenPageContainer: f.default,
            DownloadSearchContainer: D.default,
            UpgradeTaskContainer: u.default,
            ToastNotify: d.default,
            StatusBarContainer: l.default,
            AdPlatformCtrl: c.default
        }
    })], E), t.default = E
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(343), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(877), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {},
        mapGettersToProps: {toolbarButtons: e => e.toolbarButtons}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(345), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(878), r = n(880);
    let s = class extends a.Vue {
    };
    i([a.Prop({})], s.prototype, "toolbarButtons", void 0), s = i([a.Component({
        components: {
            ToolBarButtonContainer: o.default,
            ToolBarVipButtonContainer: r.default
        }
    })], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(347), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(879), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage
        },
        mapCommitToProps: {CREATE_NEW_TAB: "CREATE_NEW_TAB", SORT_CATEGORY_BY_FUNCTION: "SORT_CATEGORY_BY_FUNCTION"},
        mapGettersToProps: {currentSelectdTaskInfos: e => e.currentSelectdTaskInfos}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(349), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4);
    let r = class extends o.Vue {
        constructor() {
            super(...arguments), this.disabled = !1, this.disableClass = ""
        }

        onSelectChange(e) {
            return a(this, void 0, void 0, function* () {
                "xlx-icon-nav-file" !== this.id && "xlx-icon-nav-folder" !== this.id || (this.disableClass = yield this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, e, this.showPrivateSpaceOpenPage), "" === this.disableClass ? this.disabled = !1 : this.disabled = !0)
            })
        }

        handleClick(e) {
            this.disabled || this.click(e, this)
        }

        get filterClass() {
            let e = this.disableClass;
            do {
                if ("" !== e) break;
                "string" == typeof(e = this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, this.currentSelectdTaskInfos, this.showPrivateSpaceOpenPage)) && (this.disabled = "" !== e)
            } while (0);
            return e
        }
    };
    i([o.Prop({})], r.prototype, "title", void 0), i([o.Prop({})], r.prototype, "id", void 0), i([o.Prop({})], r.prototype, "currentCategoryId", void 0), i([o.Prop({})], r.prototype, "currentCategoryViewId", void 0), i([o.Prop({})], r.prototype, "showPrivateSpaceOpenPage", void 0), i([o.Prop({})], r.prototype, "currentSelectdTaskInfos", void 0), i([o.Prop({})], r.prototype, "buttonClassFilter", void 0), i([o.Prop({})], r.prototype, "click", void 0), i([o.Prop({})], r.prototype, "CREATE_NEW_TAB", void 0), i([o.Prop({})], r.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), i([o.Watch("currentSelectdTaskInfos", {immediate: !0})], r.prototype, "onSelectChange", null), r = i([o.Component], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(351), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(881), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage
        },
        mapCommitToProps: {CREATE_NEW_TAB: "CREATE_NEW_TAB", SORT_CATEGORY_BY_FUNCTION: "SORT_CATEGORY_BY_FUNCTION"},
        mapGettersToProps: {currentSelectdTaskInfos: e => e.currentSelectdTaskInfos}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(353), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(6), s = n(1).default.getLogger("DownloadPanel.ToolBarVipButton"), l = n(882);
    let u = class extends o.Vue {
        constructor() {
            super(...arguments), this.disabled = !1, this.disableClass = "", this.vipIcon = "", this.hoverTitle = "", this.newClick = null, this.hasRedPoint = !1, this.clickUrl = "https://vip.xunlei.com/index.html?referfrom=v_pc_xlx_ggong_taskbar_vip", this.cfgType = "", this.iconMgr = null
        }

        onSelectChange(e) {
            return a(this, void 0, void 0, function* () {
                "xlx-icon-nav-file" !== this.id && "xlx-icon-nav-folder" !== this.id || (this.disableClass = yield this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, e, this.showPrivateSpaceOpenPage), "" === this.disableClass ? this.disabled = !1 : this.disabled = !0)
            })
        }

        handleClick(e) {
            this.disabled || (s.information("handleClick, clickUrl=", this.clickUrl), "" !== this.cfgType && r.NativeCallModule.nativeCall.CallNativeFunction("SetValue", "ToolBarButtonVipIcon", this.cfgType, this.clickUrl, () => {
            }), r.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", this.clickUrl, e => {
                s.information("errorCode", e)
            }), this.iconMgr.sendStat("download_leftpanel", "top_vipicon_click"), this.hasRedPoint && (this.hasRedPoint = !1))
        }

        handleError(e) {
            this.vipIcon = ""
        }

        get handleTitle() {
            return "" == this.hoverTitle ? this.title : this.hoverTitle
        }

        handleEnter(e) {
            this.iconMgr.sendStat("download_leftpanel", "top_vipicon_hover_show")
        }

        get filterClass() {
            let e = this.disableClass;
            do {
                if ("" !== e) break;
                "string" == typeof(e = this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, this.currentSelectdTaskInfos, this.showPrivateSpaceOpenPage)) && (this.disabled = "" !== e), this.hasRedPoint && (e = "is-new")
            } while (0);
            return e
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                this.iconMgr = new l.VipIconMgr(this), this.iconMgr.init()
            })
        }
    };
    i([o.Prop({})], u.prototype, "title", void 0), i([o.Prop({})], u.prototype, "id", void 0), i([o.Prop({})], u.prototype, "currentCategoryId", void 0), i([o.Prop({})], u.prototype, "currentCategoryViewId", void 0), i([o.Prop({})], u.prototype, "showPrivateSpaceOpenPage", void 0), i([o.Prop({})], u.prototype, "currentSelectdTaskInfos", void 0), i([o.Prop({})], u.prototype, "buttonClassFilter", void 0), i([o.Prop({})], u.prototype, "click", void 0), i([o.Prop({})], u.prototype, "CREATE_NEW_TAB", void 0), i([o.Prop({})], u.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), i([o.Watch("currentSelectdTaskInfos", {immediate: !0})], u.prototype, "onSelectChange", null), u = i([o.Component], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(355), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(884), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {tabs: e => e.Tabs.tabs, current: e => e.Tabs.current},
        mapCommitToProps: {},
        mapDispatchToProps: {},
        mapGettersToProps: {}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(357), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), n(1079), n(1081);
    const a = n(4), o = n(10), r = n(23), s = n(294), l = n(67), u = n(738), d = n(885), c = n(6), h = n(65), f = n(22),
        p = n(153), g = n(149), k = n(13), m = n(66), T = n(29), v = n(886).urls,
        y = p.ToastNotifyManagerNS.getToastNotifyManger();
    let S = class extends a.Vue {
        constructor() {
            super(...arguments), this.totalDownloadSpeed = 0, this.totalUploadSpeed = 0, this.todayDownSize = 0, this.todayUpSize = 0, this.downloadVipSpeed = 0, this.downloadCompleteTaskType = u.ScheduleCompleteTaskType.UnKnown, this.canShowVipSpeed = !1, this.showVipText = "会员登录", this.bDisplay = "none", this.isFreeDownload = !1, this.vipType = void 0, this.isLimit = !1, this.popUp = !1, this.limitSpeetMenuText = "限速下载", this.entryText = "下载计划", this.scheduleTaskCount = 0
        }

        onIsLimtChanged(e) {
            e ? (this.limitSpeetMenuText = "限速下载中", this.entryText = "限速下载中") : (this.limitSpeetMenuText = "限速下载", this.entryText = "下载计划")
        }

        get vipText() {
            return this.showVipText
        }

        get curHoverSpeed() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.totalDownloadSpeed, 1) + "/s"
        }

        get curSpeed() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.totalDownloadSpeed, 1) + "/s"
        }

        get curUpSpeed() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.totalUploadSpeed, 1) + "/s"
        }

        get curVipSpeed() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.downloadVipSpeed, 1) + "/s"
        }

        get downSize() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.todayDownSize)
        }

        get upSize() {
            let e = "";
            return e = o.ThunderUtil.formatSize(this.todayUpSize)
        }

        showPop() {
            k.XLStatNS.trackEvent("download_leftpanel", "bottom_speed_hover"), this.bDisplay = "block", this.popUpScheduleMenu(!1)
        }

        hidePop() {
            this.bDisplay = "none"
        }

        handClickleVipText() {
            if ("会员登录" === this.showVipText) h.LoginHelperNS.loginHelper.showLoginDlg("stausbar", !0); else if ("会员加速" === this.showVipText) {
                let e = "https://pay.xunlei.com/pay.html?bizNo=baijin&selectBizno=baijin&timeType=1001&referfrom=v_pc_xlx_hytq_js&aidfrom=bottom";
                c.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", e);
                let t = `clickid=bottom,vip_type=${this.vipType}`;
                k.XLStatNS.trackEvent("xlx_vip_event", "hyjs_click", "", 0, 0, 0, 0, t)
            }
        }

        onConfigInitFinished() {
            let e = s.DownloadModeNS.getCurrentDownloadMode();
            this.isLimit = "1" !== e, this.isFreeDownload = s.DownloadModeNS.getFreeDownLoad(), this.downloadCompleteTaskType = u.ScheduleTaskNS.getDownloadCompleteTaskType(), d.FlowMonitorNS.startMonitor(), u.ScheduleTaskNS.init(), l.DownloadKernelManager.attachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, e => {
                this.totalDownloadSpeed = d.FlowMonitorNS.getCurrentDownloadSpeed(), this.downloadVipSpeed = d.FlowMonitorNS.getCurrentVipSpeed(), this.todayDownSize = d.FlowMonitorNS.getTodayDownloadSize()
            }), l.DownloadKernelManager.attachListener(r.NodeEventMesssageNS.eventGlobalUploadSpeedChanged, e => {
                this.totalUploadSpeed = e, this.todayUpSize = d.FlowMonitorNS.getTodayUploadSize()
            })
        }

        onGetUserInfo() {
            h.LoginHelperNS.loginHelper.getAllUserInfo(e => {
                do {
                    if (null === e || void 0 === e) break;
                    let t = e.vipList[0], n = Number(t.isVip);
					this.vipType = 5;
					this.canShowVipSpeed = 1;
                    if (this.vipType = Number(t.vasType), 0 !== n) this.canShowVipSpeed = !0; else {
                        this.showVipText = "会员加速";
                        let e = `btn_type=bottom,vip_type=${this.vipType}`;
                        k.XLStatNS.trackEvent("xlx_vip_event", "hyjs_show", "", 0, 0, 0, 0, e)
                    }
                } while (0)
            })
        }

        created() {
            f.ConfigNS.attachListener(r.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished()
            }), f.ConfigNS.attachListener(r.NodeEventMesssageNS.eventConfigValueChanged, (e, t, n, i) => {
                switch (e) {
                    case"ConfigNet":
                        "ConfigNet_Type" === t && ("1" === String(i) ? this.isLimit = !1 : this.isLimit = !0)
                }
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                this.onGetUserInfo()
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => {
                "vipinfo" === e && this.onGetUserInfo()
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("getCurrentTabUrl", e => {
                let t = !1, n = T.parse(this.tabs[this.current].tab.url).hostname;
                do {
                    if ("" === n) break;
                    for (let e = 0; e < v.length; e++) if (v[e].url === n) {
                        t = !0;
                        break
                    }
                } while (0);
                m.NativeCallHostModule.nativeCallHost.fireNativeEvent(e, t)
            }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.canShowVipSpeed = !1, this.showVipText = "会员登录", this.vipType = void 0
            })
        }

        mounted() {
            this.scheduleTaskCount = u.ScheduleTaskNS.getScheduleTaskCount(), u.ScheduleTaskNS.getEventEmitter().on(u.ScheduleTaskEventType.ScheduleTaskCountChange, e => {
                this.scheduleTaskCount = e
            })
        }

        onPopUpBlur() {
            this.popUpScheduleMenu(!1)
        }

        popUpScheduleMenu(e) {
            this.popUp = e
        }

        handleClick(e) {
            let t = "";
            switch (this.isFreeDownload = s.DownloadModeNS.getFreeDownLoad(), this.downloadCompleteTaskType = u.ScheduleTaskNS.getDownloadCompleteTaskType(), e) {
                case"entry":
                    k.XLStatNS.trackEvent("download_leftpanel", "bottom_plan_click"), this.popUpScheduleMenu(!0);
                    break;
                case"totalSpeed":
                    t = "button=fullspeed", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), s.DownloadModeNS.setFullDownloadMode(), y.showNotify(p.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, g.ToastNotifyItemType.GreenNotify, "已为您切换至全速下载模式", 3e3), this.popUpScheduleMenu(!1);
                    break;
                case"limitSpeed":
                    t = "button=limitspeed", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), s.DownloadModeNS.showCustomDownloadModeDlg().then(e => {
                        e && y.showNotify(p.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, g.ToastNotifyItemType.GreenNotify, "已为您切换至限速下载模式", 3e3)
                    }).catch(), this.popUpScheduleMenu(!1);
                    break;
                case"freeDownload":
                    this.isFreeDownload ? (t = "button=freedom,status=off", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.closeFreeDownLoad(), s.DownloadModeNS.setFreeDownLoadConfig(!1)) : u.ScheduleTaskNS.popMessageBox(() => {
                        t = "button=freedom,status=on", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), s.DownloadModeNS.setFreeDownLoadConfig(!0), u.ScheduleTaskNS.startFreeDownLoad()
                    }), this.popUpScheduleMenu(!1);
                    break;
                case"scheduleTask":
                    t = "button=plan", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.showPlanTaskDlg(), this.popUpScheduleMenu(!1);
                    break;
                case"shutdown":
                    this.downloadCompleteTaskType !== u.ScheduleCompleteTaskType.ShutDown ? (t = "button=finished_close", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.setDownloadCompleteTaskType(u.ScheduleCompleteTaskType.ShutDown)) : u.ScheduleTaskNS.cancelDownloadCompleteTask(), this.popUpScheduleMenu(!1);
                    break;
                case"sleep":
                    this.downloadCompleteTaskType !== u.ScheduleCompleteTaskType.Sleep ? (t = "button=finished_sleep", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.setDownloadCompleteTaskType(u.ScheduleCompleteTaskType.Sleep)) : u.ScheduleTaskNS.cancelDownloadCompleteTask(), this.popUpScheduleMenu(!1);
                    break;
                case"exit":
                    this.downloadCompleteTaskType !== u.ScheduleCompleteTaskType.Exit ? (t = "button=finished_exit", k.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.setDownloadCompleteTaskType(u.ScheduleCompleteTaskType.Exit)) : u.ScheduleTaskNS.cancelDownloadCompleteTask(), this.popUpScheduleMenu(!1);
                    break;
                default:
                    this.popUpScheduleMenu(!1)
            }
        }
    };
    i([a.Prop({})], S.prototype, "current", void 0), i([a.Prop({})], S.prototype, "tabs", void 0), i([a.Watch("isLimit")], S.prototype, "onIsLimtChanged", null), S = i([a.Component], S), t.default = S
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(359), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(888), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {showUpgradeTask: e => e.UpgradeTaskState.showUpgradeTask},
        mapCommitToProps: {SHOW_UPGRADE_TASK: "SHOW_UPGRADE_TASK"},
        mapDispatchToProps: {},
        mapGettersToProps: {}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(361), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), n(1090);
    const a = n(4), o = n(744).DownloadKernelUpgradeNS.getUpgrade();
    let r = class extends a.Vue {
        constructor() {
            super(...arguments), this.progress = 0
        }

        onUpgradeProgress(e, t) {
            this.progress = e > 0 ? Math.floor(100 * t / e) : 0
        }

        created() {
            o.attachListener(o.eventUpgradeProgress, this.onUpgradeProgress)
        }

        destroyed() {
            o.detachListener(o.eventUpgradeProgress, this.onUpgradeProgress)
        }
    };
    r = i([a.Component], r), t.default = r
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(363), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), n(1092);
    const a = n(4), o = n(153), r = n(149), s = o.ToastNotifyManagerNS.getToastNotifyManger();
    let l = class extends a.Vue {
        constructor() {
            super(...arguments), this.show = !1, this.showNotifyItem = null, this.message = "", this.type = "send", this.durationTimer = void 0
        }

        get cancel() {
            return !!this.showNotifyItem && this.showNotifyItem.getCancel()
        }

        handleClose() {
            this.showNotifyItem && s.closeNotify(this.showNotifyItem.getId())
        }

        handleCancel() {
            if (this.showNotifyItem) {
                if (this.showNotifyItem.getCancel()) {
                    this.showNotifyItem.cancel()
                }
                s.closeNotify(this.showNotifyItem.getId())
            }
        }

        handleMouseMove() {
            void 0 !== this.durationTimer && (clearTimeout(this.durationTimer), this.durationTimer = void 0)
        }

        handleMouseOut() {
            if (this.showNotifyItem) {
                let e = this.showNotifyItem.getDuration();
                e && e > 0 && (this.durationTimer = setTimeout(() => {
                    this.durationTimer = void 0, s.closeNotify(this.showNotifyItem.getId())
                }, e))
            }
        }

        onShowNotify(e, t) {
            switch (void 0 !== this.durationTimer && (clearTimeout(this.durationTimer), this.durationTimer = void 0), this.showNotifyItem = t, this.message = t.getMessage(), t.getType()) {
                case r.ToastNotifyItemType.GreenNotify:
                    this.type = "send";
                    break;
                case r.ToastNotifyItemType.RedNotify:
                case r.ToastNotifyItemType.RedCancelNotify:
                    this.type = "fail"
            }
            this.show = !0;
            let n = t.getDuration();
            n && n > 0 && (this.durationTimer = setTimeout(() => {
                this.durationTimer = void 0, s.closeNotify(e)
            }, n))
        }

        onCloseNotify(e, t) {
            this.showNotifyItem && e === this.showNotifyItem.getId() && (this.show = !1, this.showNotifyItem = null), void 0 !== this.durationTimer && (clearTimeout(this.durationTimer), this.durationTimer = void 0)
        }

        onUpdateNotify(e, t) {
            this.onShowNotify(e, t)
        }

        created() {
            s.attachListener("OnShowNotify", this.onShowNotify), s.attachListener("OnUpdateNotify", this.onUpdateNotify), s.attachListener("OnCloseNotify", this.onCloseNotify)
        }

        destroyed() {
            s.detachListener("OnShowNotify", this.onShowNotify), s.detachListener("OnUpdateNotify", this.onUpdateNotify), s.detachListener("OnCloseNotify", this.onCloseNotify)
        }
    };
    l = i([a.Component], l), t.default = l
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(365), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(745), r = n(262), s = n(297);
    let l = class extends a.Vue {
        constructor() {
            super(...arguments), this.cookie = null, this.content = "", this.btnText = "", this.iconUrl = "", this.sceneData = {}, this.orderData = {}
        }

        onClick(e) {
            if (this.$emit("ad-show", !1), "btn" === e || "content" === e) {
                let e = this.orderData.openType, t = this.orderData.targetUrl, n = this.orderData.targetSubUrl;
                r.AdHelperNS.execute(e, t, n)
            }
            o.adPlatform.handleEvent(e)
        }

        created() {
            this.cookie = o.adPlatform.attachListener(s.AdCommonNS.eventAdShow, (e, t, n) => {
                e === s.AdCommonNS.AdName.AdPlatform && (this.sceneData = t, this.orderData = n, this.content = n.content, this.btnText = n.btnText, this.iconUrl = n.iconUrl, this.$emit("ad-show", !0), o.adPlatform.handleEvent("ad_show"))
            })
        }

        destroyed() {
            null !== this.cookie && (o.adPlatform.detachListener(s.AdCommonNS.eventAdShow, this.cookie), this.cookie = null)
        }
    };
    l = i([a.Component], l), t.default = l
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(367), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(893), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            currentTabId: e => e.Tabs.current
        },
        mapCommitToProps: {
            UPDATE_CATEGORY: "UPDATE_CATEGORY",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW",
            INIT_CATEGORY_TASKLIST: "INIT_CATEGORY_TASKLIST",
            UPDATE_DOWNLOADING_SELECTED_TASKS: "UPDATE_DOWNLOADING_SELECTED_TASKS",
            UPDATE_COMPLETED_SELECTED_TASKS: "UPDATE_COMPLETED_SELECTED_TASKS",
            UPDATE_RECYCLE_SELECTED_TASKS: "UPDATE_RECYCLE_SELECTED_TASKS",
            MOVE_TO_TOP: "MOVE_TO_TOP",
            MOVE_TO_BOTTOM: "MOVE_TO_BOTTOM",
            INSERT_TO_CATEGORY_VIEW: "INSERT_TO_CATEGORY_VIEW",
            UPDATE_TASK_STATUS: "UPDATE_TASK_STATUS",
            SORT_CATEGORY_HISTORY: "SORT_CATEGORY_HISTORY",
            SORT_CATEGORY_BY_FUNCTION: "SORT_CATEGORY_BY_FUNCTION",
            UPDATE_DOWNLOADING_TASKLIST: "UPDATE_DOWNLOADING_TASKLIST",
            UPDATE_COMPLETED_TASKLIST: "UPDATE_COMPLETED_TASKLIST",
            UPDATE_RECYCLE_TASKLIST: "UPDATE_RECYCLE_TASKLIST"
        },
        mapDispatchToProps: {attachTaskEvent: "attachTaskEvent", selectTab: "selectTab"},
        mapGettersToProps: {
            downloadingTaskList: e => e.downloadingTaskList,
            completedTaskList: e => e.completedTaskList,
            recycleTaskList: e => e.recycleTaskList,
            downloadingTaskBaseList: e => e.downloadingTaskBaseList,
            completedTaskBaseList: e => e.completedTaskBaseList,
            recycleTaskBaseList: e => e.recycleTaskBaseList,
            currentSelectdTaskInfos: e => e.currentSelectdTaskInfos,
            downloadingSelectedIndexs: e => e.downloadingSelectedIndexs,
            completedSelectedTaskIndexs: e => e.completedSelectedTaskIndexs,
            recycleSelectedTaskIndexs: e => e.recycleSelectedTaskIndexs
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(369), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(1), r = n(8), s = n(154), l = n(746), u = n(85), d = n(261), c = n(23), h = n(61), f = n(13),
        p = n(67), g = n(37), k = n(31), m = g.DownloadKernelEventManager.getEventManager(),
        T = k.DownloadKernelTaskManager.getTaskManager(), v = o.default.getLogger("DownloadList");
    let y = class extends a.Vue {
        constructor() {
            super(...arguments), this.categoryLastSelectList = [{
                category: r.DownloadKernel.CategroyViewID.Downloading,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Completed,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Recycle,
                lastIndex: 0
            }], this.bLoadDbFinish = !1, this.insertToCategoryViewEventId = void 0, this.statusChangedEventId = void 0, this.dataBaseLoadCookie = void 0, this.isHoverClass = !1
        }

        onCategoryChange(e) {
            h.default.fireEvent(c.NodeEventMesssageNS.eventDownloadItemActive, this.currentCategoryViewId, !1, 0, null, !0), this.INIT_CATEGORY_TASKLIST(), this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading)
        }

        handleCollapseChange(e) {
            let t = e, n = "";
            t === r.DownloadKernel.CategroyViewID.Downloading ? n = "downloading_click" : t === r.DownloadKernel.CategroyViewID.Completed ? n = "finished_click" : t === r.DownloadKernel.CategroyViewID.Recycle && (n = "dustbin_click"), f.XLStatNS.trackEvent("download_leftpanel", n), this.UPDATE_CATEGORYVIEW(t)
        }

        handleDelete(e, t) {
            do {
                if ("Delete" !== e.key) break;
                void 0 === t && e.shiftKey && (t = !0), t ? u.TaskOperatorNs.destroyTasks(this.currentSelectdTaskInfos) : u.TaskOperatorNs.deleteTasks(this.currentSelectdTaskInfos)
            } while (0)
        }

        get downloadingCategoryTitle() {
            let e = "正在下载";
            return 0 !== this.downloadingTaskList.length && (e = e + "(" + this.downloadingTaskList.length + ")"), e
        }

        get completedCategoryTitle() {
            let e = "已完成";
            return 0 !== this.completedTaskList.length && (e = e + "(" + this.completedTaskList.length + ")"), e
        }

        get recycleCategoryTitle() {
            let e = "垃圾箱";
            return 0 !== this.recycleTaskList.length && (e = e + "(" + this.recycleTaskList.length + ")"), e
        }

        downloadingItemDbClick() {
            s.TaskStatusHelper.canStopSelectedTask(this.currentCategoryViewId, this.currentSelectdTaskInfos) ? u.TaskOperatorNs.pauseTasks(this.currentSelectdTaskInfos) : s.TaskStatusHelper.canStartSelectedTask(this.currentCategoryViewId, this.currentSelectdTaskInfos) ? u.TaskOperatorNs.startTasks(this.currentSelectdTaskInfos) : v.information("downloaditem dbclick do nothing")
        }

        handleDownloadingItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelectdTaskInfos, this.currentCategoryId, this.downloadingTaskList.length), d.downloadContextMenu.popMenu(d.DownloadMenuType.DownloadingItem)
        }

        handleCompletedItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelectdTaskInfos, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.CompletedItem)
        }

        handleRecycleItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelectdTaskInfos, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.RecycleItem)
        }

        handleDownloadingBlankMenu() {
            -1 === this.currentCategoryId && (0 === this.currentSelectdTaskInfos.length ? (d.downloadContextMenu.setContextInfo(null, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.DownloadingBlank)) : this.handleDownloadingItemMenu())
        }

        handleRecycleBlankMenu() {
            0 === this.currentSelectdTaskInfos.length ? (d.downloadContextMenu.setContextInfo(this.recycleTaskBaseList, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.RecycleBlank)) : this.handleRecycleItemMenu()
        }

        handleDownloadingCategoryMenu() {
            this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Downloading ? -1 === this.currentCategoryId && (d.downloadContextMenu.setContextInfo(this, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.DownloadingCategory)) : this.handleCollapseChange(r.DownloadKernel.CategroyViewID.Downloading)
        }

        handleCompletedCategoryMenu() {
            this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Completed ? (d.downloadContextMenu.setContextInfo(this, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.CompletedCategory)) : this.handleCollapseChange(r.DownloadKernel.CategroyViewID.Completed)
        }

        handleRecycleCategoryMenu() {
            this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle ? (d.downloadContextMenu.setContextInfo(this, this.currentCategoryId), d.downloadContextMenu.popMenu(d.DownloadMenuType.RecycleCategory)) : this.handleCollapseChange(r.DownloadKernel.CategroyViewID.Recycle)
        }

        selectAll() {
            let e = [], t = null;
            switch (this.currentCategoryViewId) {
                case r.DownloadKernel.CategroyViewID.Downloading:
                    t = this.UPDATE_DOWNLOADING_SELECTED_TASKS, e = [...this.downloadingTaskList];
                    break;
                case r.DownloadKernel.CategroyViewID.Completed:
                    t = this.UPDATE_COMPLETED_SELECTED_TASKS, e = [...this.completedTaskList];
                    break;
                case r.DownloadKernel.CategroyViewID.Recycle:
                    t = this.UPDATE_RECYCLE_SELECTED_TASKS, e = [...this.recycleTaskList]
            }
            e.length > 0 && null !== t && t(e)
        }

        moveUp() {
            this.MOVE_TO_TOP(this.downloadingSelectedIndexs)
        }

        moveDown() {
            this.MOVE_TO_BOTTOM(this.downloadingSelectedIndexs)
        }

        handleMenuClick(e, ...t) {
            switch (e) {
                case"select_all":
                    this.selectAll();
                    break;
                case"move_up":
                    this.moveUp();
                    break;
                case"move_down":
                    this.moveDown()
            }
        }

        handleMenuPopup() {
        }

        handleMenuEnd() {
        }

        selectTask(e, t) {
            if (void 0 !== t) if (e === r.DownloadKernel.CategroyViewID.Downloading) {
                let e = this.downloadingTaskList.indexOf(t);
                -1 !== e && (1 === this.downloadingSelectedIndexs.length && this.downloadingSelectedIndexs[0] === t ? this.$refs.downloading.scrollTo(e) : e <= this.$refs.downloading.getLoadedCount() - 1 ? this.UPDATE_DOWNLOADING_SELECTED_TASKS([t]) : (this.$refs.downloading.setLoadedCount(e + 1), this.$nextTick(() => {
                    this.UPDATE_DOWNLOADING_SELECTED_TASKS([t])
                })))
            } else if (e === r.DownloadKernel.CategroyViewID.Completed) {
                let e = this.completedTaskList.indexOf(t);
                -1 !== e && (1 === this.completedSelectedTaskIndexs.length && this.completedSelectedTaskIndexs[0] === t ? this.$refs.completed.scrollTo(e) : e <= this.$refs.completed.getLoadedCount() - 1 ? this.UPDATE_COMPLETED_SELECTED_TASKS([t]) : (this.$refs.completed.setLoadedCount(e + 1), this.$nextTick(() => {
                    this.UPDATE_COMPLETED_SELECTED_TASKS([t])
                })))
            } else if (e === r.DownloadKernel.CategroyViewID.Recycle) {
                let e = this.recycleTaskList.indexOf(t);
                -1 !== e && (1 === this.recycleSelectedTaskIndexs.length && this.recycleSelectedTaskIndexs[0] === t ? this.$refs.dustbin.scrollTo(e) : e <= this.$refs.dustbin.getLoadedCount() - 1 ? this.UPDATE_RECYCLE_SELECTED_TASKS([t]) : (this.$refs.dustbin.setLoadedCount(e + 1), this.$nextTick(() => {
                    this.UPDATE_RECYCLE_SELECTED_TASKS([t])
                })))
            }
        }

        created() {
            this.attachTaskEvent(), d.downloadContextMenu.attachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), d.downloadContextMenu.attachListener(c.NodeEventMesssageNS.eventDownloadContextMenuPopup, this.handleMenuPopup), d.downloadContextMenu.attachListener(c.NodeEventMesssageNS.eventDownloadContextMenuEnd, this.handleMenuEnd)
        }

        shouldChange2Complete() {
            let e = !1;
            do {
                if (this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle && this.recycleSelectedTaskIndexs.length > 0) {
                    e = !1;
                    break
                }
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) {
                    e = !0;
                    break
                }
                if (this.downloadingSelectedIndexs.length > 0) {
                    e = !1;
                    break
                }
                e = !0;
                for (let t of this.downloadingTaskBaseList) if (t.taskStatus === r.DownloadKernel.TaskStatus.StartPending || t.taskStatus === r.DownloadKernel.TaskStatus.Started) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        shouldChangeCompleteSelect() {
            let e = !1;
            do {
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Completed) {
                    e = !0;
                    break
                }
                if (0 === this.completedSelectedTaskIndexs.length) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        onTaskDataBaseLoadEnd() {
            this.bLoadDbFinish = !0, this.$nextTick(() => {
                this.SORT_CATEGORY_HISTORY(), 0 === this.downloadingTaskList.length && this.completedTaskList.length > 0 && this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Completed)
            })
        }

        mounted() {
            this.statusChangedEventId = m.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    if (v.error("StatusChanged groupId:", t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.GroupTaskId), ", status:", t[0].getTaskStatus()), t.length > 0) {
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                        if (this.UPDATE_TASK_STATUS(t.map(e => e.getTaskBaseInfo())), t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.Background)) break;
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                        t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Succeeded && t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Seeding || this.$nextTick(() => {
                            let e = this.shouldChange2Complete(), t = this.shouldChangeCompleteSelect();
                            e && setTimeout(() => {
                                this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Completed), t && this.UPDATE_COMPLETED_SELECTED_TASKS([this.completedTaskList[0]])
                            }, 0)
                        })
                    }
                } while (0)
            }), T.isLoadStorageTaskFinish() ? (this.bLoadDbFinish = !0, this.INIT_CATEGORY_TASKLIST()) : (this.dataBaseLoadCookie = 0, p.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.insertToCategoryViewEventId = m.attachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], n = e[2], i = e[3], a = e[4], o = i.map(e => e.getTaskBaseInfo());
                    this.INSERT_TO_CATEGORY_VIEW({
                        id: n,
                        categoryId: t,
                        tasks: o
                    }), this.bLoadDbFinish && n === r.DownloadKernel.CategroyViewID.Downloading && (a === r.DownloadKernel.TaskInsertReason.Create && this.UPDATE_CATEGORY(t), this.$nextTick(() => {
                        if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading), this.$nextTick(() => {
                            setTimeout(() => {
                                let e = this.downloadingTaskList[0];
                                this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                            }, 0)
                        }); else {
                            let e = this.downloadingTaskList[0];
                            this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                        }
                    }))
                } while (0)
            })
        }

        destroyed() {
            d.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), d.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuPopup, this.handleMenuPopup), d.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuEnd, this.handleMenuEnd), void 0 !== this.insertToCategoryViewEventId && m.detachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), void 0 !== this.statusChangedEventId && m.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.statusChangedEventId), void 0 !== this.dataBaseLoadCookie && (this.dataBaseLoadCookie = void 0, p.DownloadKernelManager.detachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd))
        }
    };
    i([a.Prop({})], y.prototype, "currentTabId", void 0), i([a.Prop({})], y.prototype, "currentCategoryId", void 0), i([a.Prop({})], y.prototype, "currentCategoryViewId", void 0), i([a.Prop({})], y.prototype, "downloadingTaskList", void 0), i([a.Prop({})], y.prototype, "downloadingTaskBaseList", void 0), i([a.Prop({})], y.prototype, "completedTaskList", void 0), i([a.Prop({})], y.prototype, "completedTaskBaseList", void 0), i([a.Prop({})], y.prototype, "recycleTaskList", void 0), i([a.Prop({})], y.prototype, "recycleTaskBaseList", void 0), i([a.Prop({})], y.prototype, "downloadingSelectedIndexs", void 0), i([a.Prop({})], y.prototype, "completedSelectedTaskIndexs", void 0), i([a.Prop({})], y.prototype, "recycleSelectedTaskIndexs", void 0), i([a.Prop({})], y.prototype, "currentSelectdTaskInfos", void 0), i([a.Prop({})], y.prototype, "UPDATE_CATEGORY", void 0), i([a.Prop({})], y.prototype, "UPDATE_CATEGORYVIEW", void 0), i([a.Prop({})], y.prototype, "SORT_CATEGORY_HISTORY", void 0), i([a.Prop({})], y.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), i([a.Prop({})], y.prototype, "UPDATE_DOWNLOADING_SELECTED_TASKS", void 0), i([a.Prop({})], y.prototype, "UPDATE_COMPLETED_SELECTED_TASKS", void 0), i([a.Prop({})], y.prototype, "UPDATE_RECYCLE_SELECTED_TASKS", void 0), i([a.Prop({})], y.prototype, "MOVE_TO_TOP", void 0), i([a.Prop({})], y.prototype, "UPDATE_DOWNLOADING_TASKLIST", void 0), i([a.Prop({})], y.prototype, "UPDATE_COMPLETED_TASKLIST", void 0), i([a.Prop({})], y.prototype, "UPDATE_RECYCLE_TASKLIST", void 0), i([a.Prop({})], y.prototype, "MOVE_TO_BOTTOM", void 0), i([a.Prop({})], y.prototype, "INIT_CATEGORY_TASKLIST", void 0), i([a.Prop({})], y.prototype, "INSERT_TO_CATEGORY_VIEW", void 0), i([a.Prop({})], y.prototype, "UPDATE_TASK_STATUS", void 0), i([a.Prop({})], y.prototype, "attachTaskEvent", void 0), i([a.Prop({})], y.prototype, "selectTab", void 0), i([a.Watch("currentCategoryId")], y.prototype, "onCategoryChange", null), y = i([a.Component({components: {DownloadCategory: l.default}})], y), t.default = y
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(371), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(1), r = n(8), s = n(894), l = n(900), u = n(902), d = n(61), c = n(23), h = n(31), f = n(80),
        p = o.default.getLogger("DownloadCategory"), g = h.DownloadKernelTaskManager.getTaskManager();
    let k = class extends a.Vue {
        constructor() {
            super(...arguments), this.loadedIndex = 0, this.deleted = {}, this.opened = {}
        }

        get taskCount() {
            return this.tasklist.length
        }

        get loadedList() {
            let e = this.loadedIndex + 20;
            return e > this.taskCount && (e = this.taskCount), p.information("load more", e), this.tasklist.slice(0, e)
        }

        get loadedListWithKey() {
            return this.loadedList.map(e => Object.assign({
                key: e,
                template: {class: {"is-deleted": this.deleted[e], "is-opened": this.opened[e]}}
            }))
        }

        onLoadedListChanged(e) {
            e.forEach(e => {
                this.$set(this.deleted, String(e), e in this.deleted && this.deleted[e]), this.$set(this.opened, String(e), e in this.opened && this.opened[e])
            })
        }

        getLoadedCount() {
            return this.loadedIndex
        }

        setLoadedCount(e) {
            e > this.taskCount && (e = this.taskCount), this.loadedIndex = e
        }

        loadMore(e) {
            this.loadedIndex + 20 > this.taskCount ? this.loadedIndex = this.taskCount : this.loadedIndex += 20, e()
        }

        handleSelectChange(e) {
            this.COMMIT_SELECT(e)
        }

        handleListChange(e) {
            const t = e.map(e => {
                let t = Object.assign({}, e);
                return delete t.template, t.key
            });
            this.COMMIT_UPDATE_TASKLIST(t)
        }

        handleItemDbClick(e) {
            this.$emit("dblclick", e)
        }

        handleContextMenu(e) {
            this.$emit("contextmenu", e)
        }

        handleCancleActive(e) {
            p.information("receive eventShowHomePage", e);
            let t = g.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryViewId);
                e !== r.DownloadKernel.CategroyViewID.Unkown && e === this.currentCategoryViewId && this.COMMIT_SELECT([])
            }
        }

        handleActiveChange(e, t) {
            e && this.$nextTick(() => {
                this.scrollTo(t)
            })
        }

        handleActiveNearby(e) {
            do {
                if (0 === this.taskCount) break;
                if (e > this.taskCount) break;
                e <= this.taskCount - 1 ? this.COMMIT_SELECT([this.tasklist[e]]) : this.COMMIT_SELECT([this.tasklist[e - 1]])
            } while (0)
        }

        scrollTo(e) {
            let t = this.$el, n = t.querySelectorAll(".td-draglist-item"), i = void 0,
                a = document.querySelector("#app");
            void 0 !== a && null !== a && (i = -1 === this.currentCategoryId ? a.clientHeight - 249 : a.clientHeight - 224);
            do {
                if (null === n || void 0 === n || 0 === n.length) break;
                if (e < 0) break;
                if (e > n.length - 1) break;
                let a = n[e];
                f.ThunderWindowNS.autoAdaptScrollIntoView(a, t, i)
            } while (0)
        }

        mounted() {
            d.default.attachListener(c.NodeEventMesssageNS.eventShowHomePage, this.handleCancleActive)
        }

        destroyed() {
            d.default.detachListener(c.NodeEventMesssageNS.eventShowHomePage, this.handleCancleActive)
        }
    };
    i([a.Prop({})], k.prototype, "pulseForRename", void 0), i([a.Prop({default: ""})], k.prototype, "sharedKeyWords", void 0), i([a.Prop({})], k.prototype, "itemType", void 0), i([a.Prop({})], k.prototype, "currentCategoryId", void 0), i([a.Prop({})], k.prototype, "currentCategoryViewId", void 0), i([a.Prop({})], k.prototype, "componentName", void 0), i([a.Prop({})], k.prototype, "tasklist", void 0), i([a.Prop({})], k.prototype, "selectedTaskIds", void 0), i([a.Prop({default: !0})], k.prototype, "sortable", void 0), i([a.Prop({})], k.prototype, "COMMIT_SELECT", void 0), i([a.Prop({})], k.prototype, "COMMIT_UPDATE_TASKLIST", void 0), i([a.Watch("loadedList", {immediate: !0})], k.prototype, "onLoadedListChanged", null), k = i([a.Component({
        components: {
            DownloadingItemContainer: s.default,
            CompletedItemContainer: l.default,
            RecycleItemContainer: u.default
        }
    })], k), t.default = k
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(373), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(895), a = n(48), o = n(8);
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let n = null, i = t.taskId;
                if (-1 === t.currentCategoryId) {
                    for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Downloading) {
                        n = e.DownloadListState.taskList[t].tasksMap[i];
                        break
                    }
                } else for (let t = 0; t < e.DownloadListState.taskListPrivate.length; t++) e.DownloadListState.taskListPrivate[t].id === o.DownloadKernel.CategroyViewID.Downloading && (n = e.DownloadListState.taskListPrivate[t].tasksMap[i]);
                return n
            }
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(375), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0}), n(1094);
    const o = n(4), r = n(8), s = n(31), l = n(10), u = n(152), d = n(57), c = n(154), h = n(23), f = n(85), p = n(61),
        g = n(13), k = n(279), m = n(37), T = n(139), v = n(7), y = n(296), S = n(571), w = n(570), b = n(1),
        C = n(747), N = m.DownloadKernelEventManager.getEventManager(),
        D = s.DownloadKernelTaskManager.getTaskManager(), I = y.GroupAccelerateManagerNS.getManager(),
        _ = S.GroupAccelerateWebManagerNS.getManager(), x = w.GroupAccelerateEventManagerNS.getEventManager(),
        A = b.default.getLogger("DownloadPanel.DownloadingItem");
    let E = class extends o.Vue {
        constructor() {
            super(...arguments), this.btSubDetailCookie = -1, this.groupTaskStatusCookie = -1, this.vipTaskInfo = null, this.hover = !1, this.titleOverFlow = "", this.subTaskCount = 0, this.highLight = "", this.fileNameDefaultCursor = "cursor:default", this.percentVisible = !1, this.isShowGroupAccelerate = !1, this.isAccelerated = !1, this.groupAccelerateIconTitle = "组队加速", this.checkGroupAccelerateTimer = void 0, this.isQuerying = !1, this.startStatusPrompt = void 0, this.groupAccelerateJoinTeamListener = null, this.groupAccelerateExitTeamListener = null, this.groupAccelerateReceiveGcidListener = null, this.groupAccelerateTaskSpeedChangeListener = null, this.groupAccelerateTeamInfoUpdatedListener = null
        }

        onChosenChanged(e) {
            e && (this.percentVisible = !1)
        }

        onOptionsChanged(e, t) {
            this.active && p.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, e === r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, this.$el)
        }

        onKeyWordsChange(e, t) {
            this.highLight = l.ThunderUtil.keywordsHighLight(this.taskBase.taskName, e, null)
        }

        onRenamePulse(e, t) {
            this.highLight = l.ThunderUtil.keywordsHighLight(this.taskBase.taskName, this.sharedKeyWords, null)
        }

        get subTaskCountDesc() {
            return this.subTaskCount > 999 ? "999+文件" : this.subTaskCount + "个文件"
        }

        onActiveChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                if ("search" !== this.itemType && p.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, this.active, this.taskBase.taskId, this.$el), e && (this.percentVisible = !1), this.$emit("active-change", e), e) {
                    let e = !1;
                    do {
                        if (this.taskStatus === r.DownloadKernel.TaskStatus.Failed) break;
                        if (this.active) {
                            let t = I.getTaskUniqueIdByTaskId(this.taskId);
                            e = t && "" !== t
                        }
                    } while (0);
                    this.isShowGroupAccelerate = e;
                    let t = !1;
                    if (this.attachGroupAccelerateEvent(), this.isShowGroupAccelerate) {
                        let e = I.getTaskUniqueIdByTaskId(this.taskId);
                        e && "" !== e && (t = I.isEnterGroupAccelerate(this.taskId))
                    }
                    this.isAccelerated = t
                } else this.isShowGroupAccelerate = !1, this.detachGroupAccelerateEvent()
            })
        }

        onShowGroupAccelerate(e, t) {
            e && this.isAccelerated ? this.checkGroupAccelerateTimer = setInterval(() => {
                I.updateTaskAccelerateInfo(this.taskId)
            }, 6e4) : this.checkGroupAccelerateTimer && (clearTimeout(this.checkGroupAccelerateTimer), this.checkGroupAccelerateTimer = void 0)
        }

        updateGroupAccelerateIconTitle() {
            let e = "组队加速";
            do {
                let t = I.getTaskUniqueIdByTaskId(this.taskId);
                if (!t || "" === t) break;
                let n = I.getTaskGroupInfo(t);
                if (!n) break;
                let i = 0;
                e = "共" + (i = v.isNumber(n.memberCount) ? n.memberCount : 1) + "个队友";
                let a = n.currentIncreaseSpeed;
                v.isNumber(a) || (a = 0);
                let o = "0B";
                a > 0 && (o = l.ThunderUtil.formatSize(a)), e = e + "，加速" + o + "/s", A.information("updateGroupAccelerateIconTitle currentIncreaseSpeed:", a, ", title: ", e)
            } while (0);
            this.groupAccelerateIconTitle = e
        }

        onTaskIdChanged(e, t) {
            void 0 !== t && (this.unInitialize(), this.initialize())
        }

        get taskError() {
            return this.taskBase.taskStatus === r.DownloadKernel.TaskStatus.Failed
        }

        get isForbidden() {
            let e = !1;
            do {
                if (this.taskError) {
                    let t = 0, n = D.getTaskFromTaskId(this.taskBase.taskId);
                    if (null !== n && (t = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode)), 7 === t) {
                        e = !0;
                        break
                    }
                    if (t >= 700 && t <= 799) {
                        e = !0;
                        break
                    }
                }
            } while (0);
            return e
        }

        get errInfo() {
            let e = "";
            if (this.taskError) {
                let t = 0, n = D.getTaskFromTaskId(this.taskBase.taskId);
                null !== n && (t = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode)), e = c.TaskStatusHelper.getTaskErrorInfoByCode(t)
            }
            return e
        }

        handleFileCountClick() {
            this.active ? p.default.fireEvent(h.NodeEventMesssageNS.eventDetailSwitch2Index, this.taskBase.taskId, k.DetailIndex.FileList) : p.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, !0, this.taskBase.taskId, this.$el, void 0, k.DetailIndex.FileList)
        }

        handleItemMouseOut() {
            this.percentVisible = !1, this.hover = !1
        }

        handleItemMouseHover() {
            this.hover = !0;
            do {
                if (this.chosen) {
                    this.percentVisible = !1;
                    break
                }
                if (this.active) {
                    this.percentVisible = !1;
                    break
                }
                this.percentVisible = !0;
                break
            } while (0)
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, n = t.scrollHeight, i = t.offsetHeight;
            this.titleOverFlow = n > i ? this.taskBase.taskName : ""
        }

        get fileTypeClass() {
            return d.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType)
        }

        get canPlay() {
            let e = !1;
            if (!this.taskError) {
                let t = D.getTaskFromTaskId(this.taskBase.taskId);
                t && (e = t.isSupportPlay())
            }
            return e
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get fileSize() {
            return this.taskBase.fileSize
        }

        get fileSizeFormat() {
            return l.ThunderUtil.formatSize(this.taskBase.fileSize)
        }

        get downloadSize() {
            return this.taskBase.downloadSize
        }

        get downloadSizeFormat() {
            return l.ThunderUtil.formatSize(this.taskBase.downloadSize)
        }

        get progress() {
            let e = 0;
            return 0 !== this.taskBase.fileSize && (e = this.taskBase.downloadSize / this.taskBase.fileSize), 100 * e
        }

        get progressPercent() {
            let e = 0;
            0 !== this.taskBase.fileSize && (e = this.taskBase.downloadSize / this.taskBase.fileSize), e >= 1 && (e = .9999);
            let t = (100 * e).toFixed(2) + "%";
            return "100.00%" === t && (t = "99.99%"), t
        }

        get taskStatus() {
            return this.taskBase.taskStatus
        }

        get taskStatusSpeedInfo() {
            let e = "", t = c.TaskStatusHelper.getTaskStatusPrompt(this.taskBase);
            if (this.startStatusPrompt = c.TaskStatusHelper.getTaskStartStatusPrompt(this.taskBase), void 0 !== t || void 0 !== this.startStatusPrompt) "完成" === (e = void 0 !== this.startStatusPrompt ? this.startStatusPrompt : t) && (e = ""), "暂停" === e && (e = "已暂停"); else {
                let t = this.taskBase.downloadSpeed;
                e = l.ThunderUtil.formatSize(t, 1) + "/s"
            }
            return e
        }

        get taskType() {
            return this.taskBase.taskType
        }

        get showStartTemplate() {
            let e = !1;
            return this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StartPending && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StopPending && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.Started || (e = !0), e
        }

        get canPause() {
            let e = !1;
            return this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StartWaiting && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StartPending && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.Started || (e = !0), e
        }

        get isGroup() {
            let e = !1;
            return this.taskBase.taskType === r.DownloadKernel.TaskType.Group && (e = !0), e
        }

        get isBt() {
            let e = !1;
            return this.taskBase.taskType === r.DownloadKernel.TaskType.Bt && (e = !0), e
        }

        get bTaskCountShow() {
            let e = !1;
            return (this.isBt || this.isGroup) && (this.active || this.chosen) && (e = !0), e
        }

        get vipSpeed() {
            return "+" + l.ThunderUtil.formatSize(this.taskBase.vipSpeed, 1) + "/s"
        }

        get remain() {
            let e = "--:--:--";
            if (!this.hover || this.chosen || this.active) {
                if (this.taskBase.downloadSpeed > 0 && this.taskBase.fileSize > 0) {
                    let t = this.taskBase.fileSize - this.taskBase.downloadSize;
                    if (t > 0) {
                        let n = t / this.taskBase.downloadSpeed;
                        e = u.TimeHelperNS.formatSeconds(n)
                    }
                }
            } else e = this.progressPercent;
            return e
        }

        get isShowExpand() {
            return this.taskStatus !== r.DownloadKernel.TaskStatus.Failed && this.active
        }

        get isSuperVip() {
            return !!this.vipTaskInfo && (this.vipTaskInfo.isShowSuperSpeed && this.vipTaskInfo.isAcclerated)
        }

        onShowQueryTip(e) {
            if (e) {
                let e = C.QueryTaskInfoNS.getQueryTaskId();
                this.isQuerying = e === this.taskBase.taskId
            } else this.isQuerying = !1
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handlePlayTask() {
            g.XLStatNS.trackEvent("download_leftpanel", "bianxiabianbo_click", "", 0, 0, 0, 0, this.statExtData()), D.getTaskFromTaskId(this.taskBase.taskId) && f.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, "bianxiabianbo", "downloading", this.currentCategoryId).catch()
        }

        handleStartTask() {
            g.XLStatNS.trackEvent("download_leftpanel", "downloading_right_continue_click", "", 0, 0, 0, 0, this.statExtData()), T.DownloadDispatchNS.startTask(this.taskBase.taskId)
        }

        handlePauseTask() {
            g.XLStatNS.trackEvent("download_leftpanel", "downloading_right_pause_click", "", 0, 0, 0, 0, this.statExtData()), D.stopTask(this.taskBase.taskId, r.DownloadKernel.TaskStopReason.Button)
        }

        handleDestroyTask() {
            f.TaskOperatorNs.destroyTasks([this.taskBase])
        }

        handleDbClick(e) {
            this.$emit("dblclick", e)
        }

        handleVipTaskInfo(e) {
            this.vipTaskInfo = e
        }

        handleGroupAccelerateClick() {
            _.openGroupAccelerateTabByTaskId(this.taskId, "icon", "downloading", void 0).catch()
        }

        onBtSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                if (!e[1] || !e[2]) break;
                if (e[1] === this.taskBase.taskId) {
                    let e = D.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile();
                    e.length !== this.subTaskCount && (this.subTaskCount = e.length)
                }
            } while (0)
        }

        onGroupTaskStatusChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                if (!e[1]) break;
                let t = e[1];
                if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                for (let e = 0; e < t.length; e++) {
                    let n = t[e];
                    if (n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId) === this.taskId) {
                        let e = n.getExtraObject();
                        this.subTaskCount = e.getDownloadTaskCount();
                        break
                    }
                }
            } while (0)
        }

        attachGroupAccelerateEvent() {
            A.information("attachGroupAccelerateEvent"), this.groupAccelerateJoinTeamListener || (this.groupAccelerateJoinTeamListener = ((e, t) => {
                A.information("OnJoinTeam taskId:", e, ", this.taskId", this.taskId, ", taskUniqueId:", t), e === this.taskId && (this.isAccelerated = !0)
            }), x.on(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnJoinTeam, this.groupAccelerateJoinTeamListener)), this.groupAccelerateExitTeamListener || (this.groupAccelerateExitTeamListener = ((e, t) => {
                A.information("OnExitTeam taskId:", e, ", this.taskId", this.taskId, ", taskUniqueId:", t), e === this.taskId && (this.isAccelerated = !1)
            }), x.on(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, this.groupAccelerateExitTeamListener)), this.groupAccelerateReceiveGcidListener || (this.groupAccelerateReceiveGcidListener = ((e, t) => {
                A.information("OnGroupAccelerateReceiveGcid taskId:", e, ", this.taskId", this.taskId, ", taskUniqueId:", t), e === this.taskId && (this.isShowGroupAccelerate = !0)
            }), x.on(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnReceiveGcid, this.groupAccelerateReceiveGcidListener)), this.groupAccelerateTaskSpeedChangeListener || (this.groupAccelerateTaskSpeedChangeListener = ((e, t, n, i, a) => {
                A.information("OnGroupAccelerateTaskSpeedChange taskId:", e, ", this.taskId", this.taskId, ", increaseSpeed:", n), this.taskId
            }), x.on(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, this.groupAccelerateTaskSpeedChangeListener)), this.groupAccelerateTeamInfoUpdatedListener || (this.groupAccelerateTeamInfoUpdatedListener = (() => {
            }), x.on(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTeamInfoUpdated, this.groupAccelerateTeamInfoUpdatedListener))
        }

        detachGroupAccelerateEvent() {
            A.information("detachGroupAccelerateEvent"), this.groupAccelerateJoinTeamListener && (x.removeListener(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnJoinTeam, this.groupAccelerateJoinTeamListener), this.groupAccelerateJoinTeamListener = null), this.groupAccelerateExitTeamListener && (x.removeListener(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, this.groupAccelerateExitTeamListener), this.groupAccelerateExitTeamListener = null), this.groupAccelerateReceiveGcidListener && (x.removeListener(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnReceiveGcid, this.groupAccelerateReceiveGcidListener), this.groupAccelerateReceiveGcidListener = null), this.groupAccelerateTaskSpeedChangeListener && (x.removeListener(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, this.groupAccelerateTaskSpeedChangeListener), this.groupAccelerateTaskSpeedChangeListener = null), this.groupAccelerateTeamInfoUpdatedListener && (x.removeListener(w.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTeamInfoUpdated, this.groupAccelerateTeamInfoUpdatedListener), this.groupAccelerateTeamInfoUpdatedListener = null)
        }

        initialize() {
            return a(this, void 0, void 0, function* () {
                if (this.taskBase.taskType === r.DownloadKernel.TaskType.Bt) {
                    this.btSubDetailCookie = N.attachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.onBtSubFileDetailChanged);
                    let e = D.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile();
                    this.subTaskCount = e.length
                } else if (this.taskBase.taskType === r.DownloadKernel.TaskType.Group) {
                    this.groupTaskStatusCookie = N.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.onGroupTaskStatusChanged);
                    let e = D.getTaskFromTaskId(this.taskBase.taskId).getExtraObject();
                    this.subTaskCount = e.getDownloadTaskCount()
                }
            })
        }

        unInitialize() {
            return a(this, void 0, void 0, function* () {
                -1 !== this.btSubDetailCookie && (N.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.btSubDetailCookie), this.btSubDetailCookie = -1), -1 !== this.groupTaskStatusCookie && (N.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.groupTaskStatusCookie), this.groupTaskStatusCookie = -1), this.detachGroupAccelerateEvent(), this.checkGroupAccelerateTimer && (clearTimeout(this.checkGroupAccelerateTimer), this.checkGroupAccelerateTimer = void 0)
            })
        }

        created() {
            this.initialize()
        }

        destroyed() {
            this.unInitialize(), this.active && (p.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, !1, this.taskBase.taskId, this.$el), p.default.getNeedSelectNext() && (p.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index)))
        }
    };
    i([o.Prop({})], E.prototype, "pulseForRename", void 0), i([o.Prop({default: ""})], E.prototype, "sharedKeyWords", void 0), i([o.Prop({})], E.prototype, "itemType", void 0), i([o.Prop({})], E.prototype, "index", void 0), i([o.Prop({})], E.prototype, "taskId", void 0), i([o.Prop({})], E.prototype, "taskBase", void 0), i([o.Prop({})], E.prototype, "currentCategoryId", void 0), i([o.Prop({})], E.prototype, "currentCategoryViewId", void 0), i([o.Prop()], E.prototype, "chosen", void 0), i([o.Prop()], E.prototype, "active", void 0), i([o.Watch("chosen")], E.prototype, "onChosenChanged", null), i([o.Watch("currentCategoryViewId")], E.prototype, "onOptionsChanged", null), i([o.Watch("sharedKeyWords", {immediate: !0})], E.prototype, "onKeyWordsChange", null), i([o.Watch("pulseForRename", {immediate: !0})], E.prototype, "onRenamePulse", null), i([o.Watch("active")], E.prototype, "onActiveChanged", null), i([o.Watch("isShowGroupAccelerate", {immediate: !0})], E.prototype, "onShowGroupAccelerate", null), i([o.Watch("taskId", {immediate: !0})], E.prototype, "onTaskIdChanged", null), E = i([o.Component({
        components: {
            ItemVipExpand: () => Promise.resolve().then(() => n(896)),
            ItemVipSpeed: () => Promise.resolve().then(() => n(899))
        }, watch: {}
    })], E), t.default = E
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(377), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(115), s = n(79), l = n(897), u = n(898);
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.isVip = !1, this.authority = !1, this.taskUIStatus = "Init", this.btErrorType = "", this.taskInfo = null
        }

        onTaskIdChanged(e) {
            this.loadTaskInfo()
        }

        get isTry() {
            return !!this.taskInfo && this.taskInfo.taskType === r.VipDownloadDefineNS.VipTaskType.Try
        }

        transTaskUIStatus(e) {
            let t = "Init";
            switch (e) {
                case r.VipDownloadDefineNS.VipTaskStatus.Init:
                    t = "Init";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.CommitWait:
                case r.VipDownloadDefineNS.VipTaskStatus.Commiting:
                case r.VipDownloadDefineNS.VipTaskStatus.AcclerateWait:
                    t = "Wait";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped:
                    t = "Stoped";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                    t = "Started";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.SearchResource:
                    t = "Search";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.CommitFailed:
                case r.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed:
                    t = "Failed";
                    break;
                case r.VipDownloadDefineNS.VipTaskStatus.Finished:
                    t = "Finished"
            }
            return t
        }

        loadTaskInfo() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                let t = e.getVipTaskInfo(this.taskId);
                this.onVipTaskInfoChanged(this.taskId, t)
            })
        }

        loadUserInfo() {
            this.onUserAuthorityChanged()
        }

        onVipTaskInfoChanged(e, t) {
            if (e === this.taskId) {
                let e = t ? t.taskStatus : void 0;
                this.taskUIStatus = this.transTaskUIStatus(e), this.taskInfo = t
            }
        }

        onBtSubFileForbidden(e, t) {
            e === this.taskId && (this.btErrorType = t || "Error")
        }

        onUserAuthorityChanged(e) {
            this.isVip = s.UserHelperNS.getHelper().isVip, this.authority = s.UserHelperNS.getHelper().authority
        }

        created() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.attachTaskEvent("OnVipTaskInfoChanged", this.onVipTaskInfoChanged), e.attachTaskEvent("OnBtSubFileForbidden", this.onBtSubFileForbidden), s.UserHelperNS.getHelper().attachListener(s.UserEventNS.authorityChanged, this.onUserAuthorityChanged), this.loadTaskInfo(), this.loadUserInfo()
            })
        }

        destroyed() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.detachTaskEvent("OnVipTaskInfoChanged", this.onVipTaskInfoChanged), e.detachTaskEvent("OnBtSubFileForbidden", this.onBtSubFileForbidden), s.UserHelperNS.getHelper().detachListener(s.UserEventNS.authorityChanged, this.onUserAuthorityChanged)
            })
        }
    };
    i([o.Prop({})], d.prototype, "taskId", void 0), i([o.Watch("taskId")], d.prototype, "onTaskIdChanged", null), d = i([o.Component({
        components: {
            ItemVipStatus: l.default,
            ItemTryStatus: u.default
        }
    })], d), t.default = d
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(379), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(66);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.sceneItem = null
        }

        clickErrorScenceText() {
            r.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSwitchDetail", this.taskId, "files")
        }

        clickVipButton() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.clickVipAcclerateBtn(this.taskId, !1, "task")
            })
        }

        clickSuperVipButton() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.clickVipAcclerateBtn(this.taskId, !0, "task")
            })
        }

        get isSuper() {
            return !!this.taskInfo && this.taskInfo.isSuper
        }

        get isSuperStarted() {
            return !(!this.isSuper || "Started" !== this.taskUIStatus)
        }

        get errorSceneText() {
            let e = "部分文件无法下载，点击查看";
            return "Forbidden" === this.btErrorType && (e = "含有敏感资源，部分文件无法下载"), e
        }

        get isErrorScene() {
            return !(!this.btErrorType || "" === this.btErrorType)
        }

        get taskStatusText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Wait":
                    e = "加速准备中";
                    break;
                case"Started":
                    e = this.isSuper ? "超级加速已开启" : "会员已加速";
                    break;
                case"Stoped":
                    this.taskInfo && this.taskInfo.isAcclerated && (e = "加速暂停中");
                    break;
                case"Search":
                    e = "正在查找资源";
                    break;
                case"Failed":
                    e = this.taskErrorText
            }
            return e
        }

        get taskErrorText() {
            let e = "文件无法加速";
            return this.taskInfo && this.taskInfo.error && this.taskInfo.error.message && (e = this.taskInfo.error.message), e
        }

        get isShowVipBtn() {
            let e = !1;
            return this.isVip || (e = "Init" === this.taskUIStatus), e
        }

        get isShowSuperBtn() {
            return !this.authority && this.isShowVipBtn
        }

        get showFailed() {
            return "Failed" === this.taskUIStatus
        }

        loadTaskScene() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                let t = e.getSceneItem(this.taskId);
                this.onTaskSceneChanged(this.taskId, t)
            })
        }

        onTaskSceneChanged(e, t) {
            e === this.taskId && (this.sceneItem = t)
        }

        created() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                this.loadTaskScene(), e.attachSceneEvent("OnTaskSceneChanged", this.onTaskSceneChanged)
            })
        }

        destroyed() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.detachSceneEvent("OnTaskSceneChanged", this.onTaskSceneChanged)
            })
        }
    };
    i([o.Prop({})], s.prototype, "taskId", void 0), i([o.Prop({})], s.prototype, "taskUIStatus", void 0), i([o.Prop({})], s.prototype, "isVip", void 0), i([o.Prop({})], s.prototype, "authority", void 0), i([o.Prop({})], s.prototype, "btErrorType", void 0), i([o.Prop({})], s.prototype, "taskInfo", void 0), s = i([o.Component({})], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(381), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(245);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.progress = 0, this.remainSize = 0
        }

        clickVipButton() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                switch (this.taskUIStatus) {
                    case"Init":
                        e.clickTryAcclerateBtn(this.taskId, "task");
                        break;
                    default:
                        e.clickTryOpenVipBtn(this.taskId, this.taskUIStatus, this.isSuper)
                }
            })
        }

        get isSuper() {
            return !!this.taskInfo && this.taskInfo.isSuper
        }

        get pluginVipClass() {
            return this.isSuper ? "xlx-plugin-vip--super" : "xlx-plugin-vip--ordinary"
        }

        get taskStatusText() {
            return this.isSuper ? this.superStatusText : this.normalStatusText
        }

        get normalStatusText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Init":
                    e = "恭喜获得一次免费会员试用资格";
                    break;
                case"Wait":
                case"Stoped":
                case"Started":
                    e = "剩余试用加速流量：" + this.remainSizeFormat;
                    break;
                case"Failed":
                    e = "对不起，进入试用失败";
                    break;
                case"Finished":
                    e = "试用结束，开通会员加速不限时"
            }
            return e
        }

        get superStatusText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Init":
                    e = "试用超级会员，享用超级加速";
                    break;
                case"Wait":
                case"Stoped":
                case"Started":
                    if (this.taskInfo && this.taskInfo.careKuaiNiao) if (this.taskInfo.showKuaiNiao) {
                        e = `快鸟已帮您将宽带提升至${r.KuainiaoManagerNS.getManager().downstreamString}`
                    } else e = "超级加速等待中"; else e = "超级加速中，剩余流量：" + this.remainSizeFormat;
                    break;
                case"Failed":
                    e = "超级加速失败";
                    break;
                case"Finished":
                    e = this.isVip ? "试用结束，立即升级为超级会员" : "试用结束，立即开通为超级会员"
            }
            return e
        }

        get buttonText() {
            return this.isSuper ? this.superButtonText : this.normalButtonText
        }

        get normalButtonText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Init":
                    e = "试用加速";
                    break;
                case"Wait":
                case"Stoped":
                case"Started":
                    e = "会员无限加速";
                    break;
                case"Failed":
                case"Finished":
                    e = "开通会员"
            }
            return e
        }

        get superButtonText() {
            let e = "";
            switch (this.taskUIStatus) {
                case"Init":
                    e = "试用超会";
                    break;
                case"Wait":
                case"Stoped":
                case"Started":
                case"Failed":
                case"Finished":
                    e = this.isVip ? "升级超会" : "开通超会"
            }
            return e
        }

        get showTrying() {
            return (!this.taskInfo || !this.taskInfo.careKuaiNiao) && ("Wait" === this.taskUIStatus || "Stoped" === this.taskUIStatus || "Started" === this.taskUIStatus)
        }

        get isNormal() {
            let e = !1;
            return this.isSuper && (e = "Finished" === this.taskUIStatus || "Failed" === this.taskUIStatus), e
        }

        get isError() {
            return "Failed" === this.taskUIStatus
        }

        get remainSizeFormat() {
            return this.formatSize(this.remainSize)
        }

        get progressPercent() {
            return (100 * (1 - this.progress)).toFixed(2) + "%"
        }

        formatSize(e) {
            let t = "0B";
            if ("number" == typeof e && e > 0) {
                let n = ["B", "K", "M", "G", "T"], i = 0, a = e;
                for (; a >= 1024 && !(i >= 4);) a /= 1024, i += 1;
                t = a.toFixed(2) + n[i]
            }
            return t
        }

        onTaskTryDetailChanged(e, t) {
            e === this.taskId && (this.remainSize = t.remainSize, this.progress = t.progress)
        }

        created() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.attachTaskEvent("OnTaskTryDetailChanged", this.onTaskTryDetailChanged)
            })
        }

        destroyed() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.detachTaskEvent("OnTaskTryDetailChanged", this.onTaskTryDetailChanged)
            })
        }
    };
    i([o.Prop({})], s.prototype, "taskId", void 0), i([o.Prop({})], s.prototype, "taskUIStatus", void 0), i([o.Prop({})], s.prototype, "isVip", void 0), i([o.Prop({})], s.prototype, "taskInfo", void 0), s = i([o.Component({})], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(383), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(8), s = n(10), l = n(115), u = n(79);
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.isVip = !1, this.authority = !1, this.taskInfo = null
        }

        onActiveChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.onItemExpandChanged(this.taskId, this.active)
            })
        }

        onHoverChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                if ("Vip" === this.hoverType) {
                    const {VipStatNS: e} = yield Promise.resolve().then(() => n(561));
                    e.vipButtonShow(this.taskId, !1, "hover")
                } else if ("SuperVip" === this.hoverType) {
                    const {VipStatNS: e} = yield Promise.resolve().then(() => n(561));
                    e.vipButtonShow(this.taskId, !0, "hover")
                } else if ("Try" === this.hoverType) {
                    const {TryStatNS: e} = yield Promise.resolve().then(() => n(562));
                    e.tryButtonShow(this.taskId, "hover")
                } else if ("SuperTry" === this.hoverType) {
                    const {TryStatNS: e} = yield Promise.resolve().then(() => n(562));
                    e.superTryButtonShow(this.taskId, "hover")
                }
            })
        }

        clickVipLink() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                "Vip" === this.hoverType ? e.clickVipAcclerateBtn(this.taskId, !1, "hover") : "SuperVip" === this.hoverType ? e.clickVipAcclerateBtn(this.taskId, !0, "hover") : "Try" !== this.hoverType && "SuperTry" !== this.hoverType || e.clickTryAcclerateBtn(this.taskId, "hover")
            })
        }

        get taskId() {
            let e = void 0;
            return this.taskBase && (e = this.taskBase.taskId), e
        }

        get taskStatus() {
            return this.taskBase.taskStatus
        }

        get isShowVipSpeed() {
            if (this.taskStatus === r.DownloadKernel.TaskStatus.Started) {
                if (this.startStatusPrompt) return !1;
                if (this.taskInfo) return this.taskInfo.isShowVipSpeed
            }
            return !1
        }

        get isShowSuperSpeed() {
            return !this.taskInfo || this.taskInfo.isShowSuperSpeed
        }

        get vipSpeed() {
            return "+" + s.ThunderUtil.formatSize(this.taskBase.vipSpeed, 1) + "/s"
        }

        get isShowVipHover() {
            return void 0 !== this.hoverType
        }

        get isShowSuperHover() {
            return "SuperVip" === this.hoverType || "SuperTry" === this.hoverType
        }

        get hoverText() {
            let e = "";
            return "Vip" === this.hoverType ? e = "会员加速" : "Try" === this.hoverType ? e = "试用加速" : "SuperTry" === this.hoverType && (e = "超级试用"), e
        }

        get hoverType() {
            let e = void 0;
            if (!this.active && this.hover && (!this.taskInfo || this.taskInfo.taskStatus === l.VipDownloadDefineNS.VipTaskStatus.Init)) return e = "SuperVip", this.taskInfo && (this.taskInfo.taskType === l.VipDownloadDefineNS.VipTaskType.Vip ? !this.isVip && this.authority && (e = "Vip") : e = this.taskInfo.isSuper ? "SuperTry" : "Try"), e
        }

        loadTaskInfo() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                let t = e.getVipTaskInfo(this.taskId);
                this.onVipTaskInfoChanged(this.taskId, t)
            })
        }

        loadUserInfo() {
            this.onUserAuthorityChanged()
        }

        onVipTaskInfoChanged(e, t) {
            e === this.taskId && (this.taskInfo = t, this.$emit("vip-taskinfo", t))
        }

        onUserAuthorityChanged(e) {
            this.isVip = u.UserHelperNS.getHelper().isVip, this.authority = e
        }

        created() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.attachTaskEvent("OnVipTaskInfoChanged", this.onVipTaskInfoChanged), u.UserHelperNS.getHelper().attachListener(u.UserEventNS.authorityChanged, this.onUserAuthorityChanged), this.loadTaskInfo(), this.loadUserInfo()
            })
        }

        destroyed() {
            return a(this, void 0, void 0, function* () {
                const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
                e.detachTaskEvent("OnVipTaskInfoChanged", this.onVipTaskInfoChanged), u.UserHelperNS.getHelper().detachListener(u.UserEventNS.authorityChanged, this.onUserAuthorityChanged)
            })
        }
    };
    i([o.Prop({})], d.prototype, "taskBase", void 0), i([o.Prop({})], d.prototype, "startStatusPrompt", void 0), i([o.Prop({})], d.prototype, "active", void 0), i([o.Prop({})], d.prototype, "hover", void 0), i([o.Watch("active")], d.prototype, "onActiveChanged", null), i([o.Watch("hover")], d.prototype, "onHoverChanged", null), d = i([o.Component({components: {}})], d), t.default = d
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(385), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(901), a = n(48), o = n(8);
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let n = null, i = t.taskId;
                if (-1 === t.currentCategoryId) {
                    for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Completed) {
                        n = e.DownloadListState.taskList[t].tasksMap[i];
                        break
                    }
                } else for (let t = 0; t < e.DownloadListState.taskListPrivate.length; t++) e.DownloadListState.taskListPrivate[t].id === o.DownloadKernel.CategroyViewID.Completed && (n = e.DownloadListState.taskListPrivate[t].tasksMap[i]);
                return n
            }
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(387), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(2), r = n(20), s = n(4), l = n(1), u = n(8), d = n(31), c = n(152), h = n(10), f = n(57), p = n(201),
        g = n(85), k = n(23), m = n(13), T = n(279), v = n(61), y = n(36), S = n(30), w = n(256), b = n(9), C = n(138),
        N = l.default.getLogger("Thunder.Download.Completed"), D = d.DownloadKernelTaskManager.getTaskManager();
    let I = class extends s.Vue {
        constructor() {
            super(...arguments), this.titleOverFlow = "", this.lastFullFileName = void 0, this.fileTypeClass = "", this.isInstallFileIcon = !1, this.installFileIcon = "", this.highLight = "", this.fileNameDefaultCursor = "cursor:default"
        }

        onActiveChanged(e, t) {
            "search" !== this.itemType && v.default.fireEvent(k.NodeEventMesssageNS.eventDownloadItemActive, u.DownloadKernel.CategroyViewID.Completed, e, this.taskBase.taskId, this.$el), this.$emit("active-change", e)
        }

        onOptionsChanged(e, t) {
            this.active && v.default.fireEvent(k.NodeEventMesssageNS.eventDownloadItemActive, u.DownloadKernel.CategroyViewID.Completed, e === u.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, this.$el)
        }

        onFullFileNameChange(e, t) {
            return a(this, void 0, void 0, function* () {
                void 0 !== t && r.unwatchFile(t, this.handleWatchFile), this.handleWatchFile(), r.watchFile(e, this.handleWatchFile), this.fileTypeClass = yield this.getFileTypeClass().catch()
            })
        }

        onOpenedChange(e) {
            this.$emit("update:opened", e)
        }

        onKeyWordsChange(e, t) {
            this.highLight = h.ThunderUtil.keywordsHighLight(this.taskBase.taskName, e, null)
        }

        onRenamePulse(e, t) {
            this.highLight = h.ThunderUtil.keywordsHighLight(this.taskBase.taskName, this.sharedKeyWords, null)
        }

        get opened() {
            return 1 === this.taskBase.userRead
        }

        get markTitle() {
            let e = "标记为未打开";
            return e = this.opened ? "标记为未打开" : "标记为已打开"
        }

        get fullFileName() {
            let e = this.taskBase.savePath, t = this.taskBase.taskName;
            void 0 !== t && t.indexOf(".") === t.length - 1 && (t = t.substring(0, t.length - 1));
            let n = "";
            return n = this.taskBase.taskType === u.DownloadKernel.TaskType.Group ? e : o.join(e, t)
        }

        handleWatchFile(e, t) {
            return a(this, void 0, void 0, function* () {
                void 0 !== e && void 0 !== t && N.information("fs watchFile", e.mtime, t.mtime, this.fullFileName), (yield p.TaskCtrlOperatorNS.isExistTaskFile(this.taskBase)) ? this.$emit("update:deleted", !1) : this.$emit("update:deleted", !0)
            })
        }

        destroyed() {
            N.information("item destroyed"), r.unwatchFile(this.fullFileName, this.handleWatchFile), this.active && (v.default.fireEvent(k.NodeEventMesssageNS.eventDownloadItemActive, u.DownloadKernel.CategroyViewID.Completed, !1, this.taskBase.taskId, this.$el), v.default.getNeedSelectNext() && (v.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index)))
        }

        get isExe() {
            let e = !1;
            do {
                if (this.taskBase.taskType !== u.DownloadKernel.TaskType.Emule && this.taskBase.taskType !== u.DownloadKernel.TaskType.P2sp) break;
                let t = o.extname(this.taskBase.taskName);
                if (null === t || void 0 === t) break;
                if (".exe" === t.toLowerCase()) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        getFileTypeClass() {
            return a(this, void 0, void 0, function* () {
                let e = "xlx-icon-type";
                if (e = e + " " + f.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType), this.isGroup) {
                    let t = D.getTaskFromTaskId(this.taskBase.taskId), n = this.getInstallFileName(t);
                    if (null !== n && void 0 !== n && "" !== n) {
                        let t = p.TaskCtrlOperatorNS.getSavePathByFileName(this.taskBase.taskId, n);
                        if (null !== t && void 0 !== t && "" !== t) {
                            if (yield b.FileSystemAWNS.existsAW(t)) {
                                let n = yield g.TaskOperatorNs.getFileIcon(t).catch();
                                null !== n && void 0 !== n && "" !== n && (this.isInstallFileIcon = !0, this.installFileIcon = n, e = "xlx-icon-type")
                            }
                        }
                    }
                } else if (this.isExe && (yield b.FileSystemAWNS.existsAW(this.fullFileName))) {
                    let t = yield g.TaskOperatorNs.getFileIcon(this.fullFileName).catch();
                    null !== t && void 0 !== t && "" !== t && (this.isInstallFileIcon = !0, this.installFileIcon = t, e = "xlx-icon-type")
                }
                return e
            })
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get canPlay() {
            let e = !1;
            do {
                if (this.deleted) break;
                let t = D.getTaskFromTaskId(this.taskBase.taskId);
                t && (e = t.isSupportPlay())
            } while (0);
            return e
        }

        get fileSizeFormat() {
            return h.ThunderUtil.formatSize(this.taskBase.fileSize)
        }

        get completeTime() {
            let e = "", t = this.taskBase.completionTime;
            if (t > 0) {
                let n = new Date(t);
                e = c.TimeHelperNS.formatDate(n, "yyyy-MM-dd hh:mm")
            }
            return e
        }

        get isGroup() {
            let e = !1;
            return this.taskBase.taskType === u.DownloadKernel.TaskType.Group && (e = !0), e
        }

        get isBt() {
            let e = !1;
            return this.taskBase.taskType === u.DownloadKernel.TaskType.Bt && (e = !0), e
        }

        get bTaskCountShow() {
            let e = !1;
            return (this.isBt || this.isGroup) && (this.active || this.chosen) && (e = !0), e
        }

        get subTaskCount() {
            let e = "0个文件", t = 0;
            if (this.isBt) {
                t = D.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile().length
            } else if (this.isGroup) {
                t = D.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadTaskCount()
            }
            return e = t < 1e3 ? t + "个文件" : "999+文件"
        }

        getInstallFileName(e) {
            let t = "";
            do {
                if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                let n = e.getExtraObject().getUserData(w.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                if (void 0 === n || null === n || "" === n || "0" === n) break;
                t = n
            } while (0);
            return t
        }

        handleMark() {
            this.opened ? (m.XLStatNS.trackEvent("download_leftpanel", "finished_left_markcancel_click", "", 0, 0, 0, 0, this.statExtData()), g.TaskOperatorNs.markReadStatus([this.taskBase], 0)) : (m.XLStatNS.trackEvent("download_leftpanel", "finished_left_mark_click", "", 0, 0, 0, 0, this.statExtData()), g.TaskOperatorNs.markReadStatus([this.taskBase], 1))
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, n = t.scrollHeight, i = t.offsetHeight;
            this.titleOverFlow = n > i ? this.taskName : ""
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handlePlayTask() {
            let e = this.statExtData();
            e = `${e},panel=finished,click_source=play`, m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, e), D.getTaskFromTaskId(this.taskBase.taskId) && (g.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, "play", "finished", this.currentCategoryId).catch(), g.TaskOperatorNs.markReadStatus([this.taskBase], 1))
        }

        handleOpenFile() {
            m.XLStatNS.trackEvent("download_leftpanel", "finished_right_openfiles_click", "", 0, 0, 0, 0, this.statExtData()), g.TaskOperatorNs.markReadStatus([this.taskBase], 1), g.TaskOperatorNs.openTaskFolder(this.taskBase)
        }

        handleDestroyTask() {
            m.XLStatNS.trackEvent("download_leftpanel", "finished_right_delete_click", "", 0, 0, 0, 0, this.statExtData()), g.TaskOperatorNs.destroyTasks([this.taskBase], !1)
        }

        handleDbClick() {
            g.TaskOperatorNs.markReadStatus([this.taskBase], 1);
            do {
                if (this.deleted) {
                    y.MessageBox.confirm({
                        title: "此文件已经被删除，是否需要重新下载？",
                        type: y.MessageBox.ConfirmType.Warning,
                        okText: "重新下载",
                        cancelText: "删除任务"
                    }).then(e => {
                        e.action === S.MessageBoxNS.Action.OK ? p.TaskCtrlOperatorNS.redownloadTask([this.taskBase], !1) : e.action === S.MessageBoxNS.Action.Cancel && g.TaskOperatorNs.destroyTasks([this.taskBase], !1)
                    });
                    break
                }
                if (this.taskBase.taskType === u.DownloadKernel.TaskType.Bt) {
                    let e = D.getTaskFromTaskId(this.taskBase.taskId);
                    C.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                        e ? g.TaskOperatorNs.openTaskItem(this.taskBase) : g.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                    }).catch()
                } else if (this.taskBase.taskType === u.DownloadKernel.TaskType.Group) {
                    let e = D.getTaskFromTaskId(this.taskBase.taskId);
                    g.TaskOperatorNs.executeInstallFile(e).then(e => {
                        e || g.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                    }).catch()
                } else if (this.canPlay) {
                    let e = "double_click", t = this.statExtData();
                    t = `${t},panel=finished,click_source=${e}`, m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, t), D.getTaskFromTaskId(this.taskBase.taskId) && g.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, e, "finished", this.currentCategoryId).catch()
                } else g.TaskOperatorNs.openTaskItem(this.taskBase)
            } while (0)
        }

        handleFileCountClick() {
            this.active ? v.default.fireEvent(k.NodeEventMesssageNS.eventDetailSwitch2Index, this.taskBase.taskId, T.DetailIndex.FileList) : v.default.fireEvent(k.NodeEventMesssageNS.eventDownloadItemActive, u.DownloadKernel.CategroyViewID.Completed, !0, this.taskBase.taskId, this.$el, void 0, T.DetailIndex.FileList)
        }
    };
    i([s.Prop({})], I.prototype, "pulseForRename", void 0), i([s.Prop({})], I.prototype, "sharedKeyWords", void 0), i([s.Prop({})], I.prototype, "itemType", void 0), i([s.Prop({})], I.prototype, "index", void 0), i([s.Prop({})], I.prototype, "taskId", void 0), i([s.Prop({})], I.prototype, "taskBase", void 0), i([s.Prop({})], I.prototype, "currentCategoryId", void 0), i([s.Prop({})], I.prototype, "currentCategoryViewId", void 0), i([s.Prop()], I.prototype, "deleted", void 0), i([s.Prop()], I.prototype, "chosen", void 0), i([s.Prop()], I.prototype, "active", void 0), i([s.Watch("active")], I.prototype, "onActiveChanged", null), i([s.Watch("currentCategoryViewId")], I.prototype, "onOptionsChanged", null), i([s.Watch("fullFileName", {immediate: !0})], I.prototype, "onFullFileNameChange", null), i([s.Watch("opened", {immediate: !0})], I.prototype, "onOpenedChange", null), i([s.Watch("sharedKeyWords", {immediate: !0})], I.prototype, "onKeyWordsChange", null), i([s.Watch("pulseForRename", {immediate: !0})], I.prototype, "onRenamePulse", null), I = i([s.Component], I), t.default = I
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(389), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(903), a = n(48), o = n(8);
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let n = null, i = t.taskId;
                if (-1 === t.currentCategoryId) for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Recycle) {
                    n = e.DownloadListState.taskList[t].tasksMap[i];
                    break
                }
                return n
            }
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(391), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(2), r = n(20), s = n(4), l = n(8), u = n(31), d = n(152), c = n(10), h = n(57), f = n(201), p = n(85),
        g = n(23), k = n(61), m = n(13), T = n(36), v = n(30), y = n(9), S = n(138),
        w = u.DownloadKernelTaskManager.getTaskManager();
    let b = class extends s.Vue {
        constructor() {
            super(...arguments), this.titleOverFlow = "", this.bAttachFile = !1, this.highLight = "", this.fileNameDefaultCursor = "cursor:default", this.fileIcon = "", this.isFileIcon = !1, this.fileTypeClass = ""
        }

        onOptionsChanged(e, t) {
            this.active && k.default.fireEvent(g.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, e === l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, this.$el)
        }

        onActiveChanged(e, t) {
            "search" !== this.itemType && k.default.fireEvent(g.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, e, this.taskBase.taskId, this.$el), this.$emit("active-change", e)
        }

        onTaskIdChanged(e, t) {
            this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Succeeded && this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Seeding || (this.bAttachFile = !0, this.handleWatchFile(), r.watchFile(this.fullFileName, this.handleWatchFile))
        }

        onKeyWordsChange(e, t) {
            this.highLight = c.ThunderUtil.keywordsHighLight(this.taskBase.taskName, e, null)
        }

        onRenamePulse(e, t) {
            this.highLight = c.ThunderUtil.keywordsHighLight(this.taskBase.taskName, this.sharedKeyWords, null)
        }

        onFullFileNameChange(e, t) {
            return a(this, void 0, void 0, function* () {
                this.fileTypeClass = yield this.getFileTypeClass().catch()
            })
        }

        get fullFileName() {
            let e = this.taskBase.savePath, t = this.taskBase.taskName;
            void 0 !== t && t.indexOf(".") === t.length - 1 && (t = t.substring(0, t.length - 1));
            let n = "";
            return n = this.taskBase.taskType === l.DownloadKernel.TaskType.Group ? e : o.join(e, t)
        }

        get isExe() {
            let e = !1;
            do {
                if (this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Succeeded && this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Seeding) break;
                if (this.taskBase.taskType !== l.DownloadKernel.TaskType.Emule && this.taskBase.taskType !== l.DownloadKernel.TaskType.P2sp) break;
                let t = o.extname(this.taskBase.taskName);
                if (null === t || void 0 === t) break;
                if (".exe" === t.toLowerCase()) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        getFileTypeClass() {
            return a(this, void 0, void 0, function* () {
                let e = "";
                if (this.isExe) {
                    if (yield y.FileSystemAWNS.existsAW(this.fullFileName)) {
                        let e = yield p.TaskOperatorNs.getFileIcon(this.fullFileName).catch();
                        e && "" !== e && (this.isFileIcon = !0, this.fileIcon = e)
                    }
                } else e = h.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType);
                return e
            })
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get fileSizeFormat() {
            return c.ThunderUtil.formatSize(this.taskBase.fileSize)
        }

        get creationTime() {
            let e = "", t = this.taskBase.createTime;
            if (t > 0) {
                let n = new Date(t);
                e = d.TimeHelperNS.formatDate(n, "yyyy-MM-dd hh:mm")
            }
            return e
        }

        get canPlay() {
            let e = !1, t = w.getTaskFromTaskId(this.taskBase.taskId);
            return t && (e = t.isSupportPlay()), e
        }

        get isSingleTask() {
            let e = !0;
            if (this.taskBase.taskType === l.DownloadKernel.TaskType.Bt) {
                w.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile().length > 1 && (e = !1)
            }
            return e
        }

        handleWatchFile() {
            return a(this, void 0, void 0, function* () {
                (yield f.TaskCtrlOperatorNS.isExistTaskFile(this.taskBase)) ? this.$emit("update:deleted", !1) : this.$emit("update:deleted", !0)
            })
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, n = t.scrollHeight, i = t.offsetHeight;
            this.titleOverFlow = n > i ? this.taskName : ""
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handleRestore() {
            m.XLStatNS.trackEvent("download_leftpanel", "dustbin_right_uno_click", "", 0, 0, 0, 0, this.statExtData()), w.recoverFromRecycle(this.taskBase.taskId)
        }

        handleClear() {
            m.XLStatNS.trackEvent("download_leftpanel", "dustbin_right_completedelete_click", "", 0, 0, 0, 0, this.statExtData()), p.TaskOperatorNs.destroyTasks([this.taskBase])
        }

        handleDbClick() {
            return a(this, void 0, void 0, function* () {
                do {
                    if (this.taskBase.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskBase.taskStatus === l.DownloadKernel.TaskStatus.Seeding) {
                        if (!(yield f.TaskCtrlOperatorNS.canOpenSelectedTaskFile(this.taskBase))) {
                            T.MessageBox.confirm({
                                title: "此文件已经被删除，是否需要重新下载？",
                                type: T.MessageBox.ConfirmType.Warning,
                                okText: "重新下载",
                                cancelText: "删除任务"
                            }).then(e => {
                                e.action === v.MessageBoxNS.Action.OK ? f.TaskCtrlOperatorNS.redownloadTask([this.taskBase], !1) : e.action === v.MessageBoxNS.Action.Cancel && p.TaskOperatorNs.destroyTasks([this.taskBase], !1)
                            });
                            break
                        }
                        if (this.taskBase.taskType === l.DownloadKernel.TaskType.Bt) {
                            let e = w.getTaskFromTaskId(this.taskBase.taskId);
                            S.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                                e ? p.TaskOperatorNs.openTaskItem(this.taskBase) : p.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                            }).catch()
                        } else if (this.taskBase.taskType === l.DownloadKernel.TaskType.Group) p.TaskOperatorNs.openTaskFolder(this.taskBase, !0); else if (this.canPlay && this.isSingleTask) {
                            let e = "double_click", t = "panel=dustbin,click_source=" + e;
                            m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, t), w.getTaskFromTaskId(this.taskBase.taskId) && p.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, e, "dustbin", this.currentCategoryId).catch()
                        } else p.TaskOperatorNs.openTaskItem(this.taskBase)
                    }
                } while (0)
            })
        }

        destroyed() {
            this.bAttachFile && (this.bAttachFile = !1, r.unwatchFile(this.fullFileName, this.handleWatchFile)), this.active && (k.default.fireEvent(g.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, !1, this.taskBase.taskId, this.$el), k.default.getNeedSelectNext() && (k.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index)))
        }
    };
    i([s.Prop({})], b.prototype, "pulseForRename", void 0), i([s.Prop({})], b.prototype, "sharedKeyWords", void 0), i([s.Prop({})], b.prototype, "itemType", void 0), i([s.Prop({})], b.prototype, "index", void 0), i([s.Prop({})], b.prototype, "taskId", void 0), i([s.Prop({})], b.prototype, "taskBase", void 0), i([s.Prop({})], b.prototype, "currentCategoryId", void 0), i([s.Prop({})], b.prototype, "currentCategoryViewId", void 0), i([s.Prop()], b.prototype, "active", void 0), i([s.Prop()], b.prototype, "deleted", void 0), i([s.Watch("currentCategoryViewId")], b.prototype, "onOptionsChanged", null), i([s.Watch("active")], b.prototype, "onActiveChanged", null), i([s.Watch("taskId", {immediate: !0})], b.prototype, "onTaskIdChanged", null), i([s.Watch("sharedKeyWords", {immediate: !0})], b.prototype, "onKeyWordsChange", null), i([s.Watch("pulseForRename", {immediate: !0})], b.prototype, "onRenamePulse", null), i([s.Watch("fullFileName", {immediate: !0})], b.prototype, "onFullFileNameChange", null), b = i([s.Component], b), t.default = b
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(393), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(906), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage},
        mapCommitToProps: {
            SHOW_PRIVATE_SPACE_OPEN_PAGE: "SHOW_PRIVATE_SPACE_OPEN_PAGE",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW"
        },
        mapDispatchToProps: {},
        mapGettersToProps: {}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(395), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(4), r = n(278), s = n(15), l = n(13);
    let u = class extends o.Vue {
        constructor() {
            super(...arguments), this.privateSpaceSetPasswordListener = null
        }

        stat(e) {
            let t = `button=${e}`;
            l.XLStatNS.trackEvent("download_leftpanel", "top_private_page_click", "", 0, 0, 0, 0, t)
        }

        openPrivateSpace() {
            return a(this, void 0, void 0, function* () {
                let e = yield s.default("GetUserID");
                e && "" !== e && (this.stat("open"), r.PrivateSpaceHelperNS.openPrivateCategory(e))
            })
        }

        created() {
            let e = r.PrivateSpaceHelperNS.getEventEmitter();
            this.privateSpaceSetPasswordListener || (this.privateSpaceSetPasswordListener = (e => {
                e && this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!1)
            }), e.on(r.PrivateSpaceHelperNS.EventType.SetPassword, this.privateSpaceSetPasswordListener))
        }

        destroyed() {
            if (this.privateSpaceSetPasswordListener) {
                r.PrivateSpaceHelperNS.getEventEmitter().removeListener(r.PrivateSpaceHelperNS.EventType.SetPassword, this.privateSpaceSetPasswordListener), this.privateSpaceSetPasswordListener = null
            }
        }
    };
    i([o.Prop({})], u.prototype, "SHOW_PRIVATE_SPACE_OPEN_PAGE", void 0), i([o.Prop({})], u.prototype, "UPDATE_CATEGORYVIEW", void 0), u = i([o.Component], u), t.default = u
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(397), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(908), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            currentTabId: e => e.Tabs.current
        },
        mapCommitToProps: {
            UPDATE_CATEGORY: "UPDATE_CATEGORY",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW",
            UPDATE_DOWNLOADING_SELECTED_TASKS: "UPDATE_DOWNLOADING_SELECTED_TASKS",
            UPDATE_COMPLETED_SELECTED_TASKS: "UPDATE_COMPLETED_SELECTED_TASKS",
            UPDATE_RECYCLE_SELECTED_TASKS: "UPDATE_RECYCLE_SELECTED_TASKS",
            UPDATE_TASK_STATUS: "UPDATE_TASK_STATUS",
            UPDATE_DOWNLOADING_TASKLIST: "UPDATE_DOWNLOADING_TASKLIST",
            UPDATE_COMPLETED_TASKLIST: "UPDATE_COMPLETED_TASKLIST",
            UPDATE_RECYCLE_TASKLIST: "UPDATE_RECYCLE_TASKLIST"
        },
        mapDispatchToProps: {attachTaskEvent: "attachTaskEvent", selectTab: "selectTab"},
        mapGettersToProps: {
            downloadingTaskList: e => e.downloadingTaskList,
            completedTaskList: e => e.completedTaskList,
            recycleTaskList: e => e.recycleTaskList,
            downloadingTaskBaseList: e => e.downloadingTaskBaseList,
            completedTaskBaseList: e => e.completedTaskBaseList,
            recycleTaskBaseList: e => e.recycleTaskBaseList,
            currentSelectdTaskInfos: e => e.currentSelectdTaskInfos,
            downloadingSelectedIndexs: e => e.downloadingSelectedIndexs,
            completedSelectedTaskIndexs: e => e.completedSelectedTaskIndexs,
            recycleSelectedTaskIndexs: e => e.recycleSelectedTaskIndexs
        }
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(399), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(1), r = n(8), s = n(154), l = n(746), u = n(85), d = n(261), c = n(23), h = n(61), f = n(13),
        p = n(67), g = n(37), k = n(31), m = n(7), T = n(54), v = n(92),
        y = g.DownloadKernelEventManager.getEventManager(), S = k.DownloadKernelTaskManager.getTaskManager(),
        w = o.default.getLogger("DownloadList");
    let b = class extends a.Vue {
        constructor() {
            super(...arguments), this.categoryLastSelectList = [{
                category: r.DownloadKernel.CategroyViewID.Downloading,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Completed,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Recycle,
                lastIndex: 0
            }], this.showNoResultTip = !1, this.showResultCountTip = !1, this.bLoadDbFinish = !1, this.insertToCategoryViewEventId = void 0, this.removeFromCategoryViewEventId = void 0, this.statusChangedEventId = void 0, this.dataBaseLoadCookie = void 0, this.inputFlag = !0, this.resultCount = 0, this.escapeCode = "", this.pulseEventFlag = !1, this.downloadingSearchArray = [], this.completeSearchArray = [], this.recycleSearchArray = [], this.downloadingSearchSelIndexs = [], this.completeSearchSelIndexs = [], this.recycleSearchSelIndexs = [], this.currentSelSearchTaskIds = [], this.searchListPanel = "Downloading", this.holderTextTip = "", this.searchType = "search", this.curSearchKey = "", this.inputFocus = !1
        }

        get recycleSearchList() {
            return void 0 === this.recycleSearchArray ? [] : this.recycleSearchArray
        }

        get completeSearchList() {
            return void 0 === this.completeSearchArray ? [] : this.completeSearchArray
        }

        get downloadingSearchList() {
            return void 0 !== this.downloadingSearchArray ? this.downloadingSearchArray : []
        }

        onInputFocus(e) {
            this.holderTextTip = "", this.inputFocus = !0
        }

        onInputBlur(e) {
            this.inputFocus = !1, this.curSearchKey.length < 1 && (this.holderTextTip = "搜索下载记录", this.showResultCountTip = !1)
        }

        preHandleSearchKey() {
            let e = this.curSearchKey.split(" "), t = [];
            if (e) for (let n = 0; n < e.length; n++) e[n].trim().length > 0 && t.push(e[n].trim());
            return t
        }

        getArrayIntersection(e, t) {
            let n = [], i = new Set(t);
            return n = Array.from(new Set(e.filter(e => i.has(e))))
        }

        replaceSpecialKeyForDB(e) {
            return e !== (e = e.replace(/\/|'|\[|]|%|&|_|\(|\)/g, function (e) {
                return "/" + e
            })) && (this.escapeCode = "/"), e
        }

        internalSearch(e) {
            w.information("多关键字数组:", e);
            let t = [], n = [];
            for (let i = 0; i < e.length; i++) {
                let a = r.DownloadKernel.SearchKeyType.NameInclude;
                this.escapeCode = "";
                let o = this.replaceSpecialKeyForDB(e[i]);
                v.ThunderKernel.searchTask(a, o, -1, this.escapeCode, i => {
                    let a, o;
                    if (this.clearSearch(), n = i, t[t.length] = n, t.length === e.length) {
                        let e;
                        t.length > 0 && (e = t[0]);
                        for (let n = 1; n < t.length; n++) e = this.getArrayIntersection(e, t[n]);
                        this.resultCount = e.length;
                        for (let t = 0; t < e.length; t++) (a = S.getTaskFromTaskId(e[t])) && (o = a.getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryViewId)), o && (o === r.DownloadKernel.CategroyViewID.Downloading ? this.downloadingSearchArray.push(e[t]) : o === r.DownloadKernel.CategroyViewID.Completed ? this.completeSearchArray.push(e[t]) : o === r.DownloadKernel.CategroyViewID.Recycle && this.recycleSearchArray.push(e[t]))
                    }
                })
            }
        }

        startSearch() {
            this.inputFlag && (m.isNullOrUndefined(this.curSearchKey) || (this.curSearchKey.trim().length < 1 ? this.clearSearch() : (this.showNoResultTip = !0, this.showResultCountTip = !0, this.internalSearch(this.preHandleSearchKey()))))
        }

        onDownloadTaskSelect(e) {
            if (!e) return;
            if (!e.length) return;
            let t, n;
            this.currentSelSearchTaskIds = e, this.currentSelSearchTaskInfos = [];
            for (let i = 0; i < e.length; i++) t = (n = S.getTaskFromTaskId(e[i])).getTaskBaseInfo(), this.currentSelSearchTaskInfos.push(t)
        }

        handlePopInputMenu() {
            T.MenuSkinNS.popEditableDefaultContextMenu(void 0, -4)
        }

        onCategoryChange(e) {
            h.default.fireEvent(c.NodeEventMesssageNS.eventDownloadItemActive, this.currentCategoryViewId, !1, 0, null, !0), this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading), -1 !== this.currentCategoryId && this.closeSearch()
        }

        clearSearch() {
            this.downloadingSearchArray = [], this.completeSearchArray = [], this.recycleSearchArray = [], this.resultCount = 0, this.showResultCountTip = !1, this.showNoResultTip = !1
        }

        clickCloseSearch() {
            f.XLStatNS.trackEvent("download_leftpanel", "search_close_click", "", 0, 0, 0, 0, "entry=close"), this.closeSearch()
        }

        keyCloseSearch() {
            f.XLStatNS.trackEvent("download_leftpanel", "search_close_click", "", 0, 0, 0, 0, "entry=ctrlf"), this.closeSearch()
        }

        closeSearch() {
            this.$emit("close:keysearch"), this.clearSearch(), this.curSearchKey = ""
        }

        handleDelete(e = !1) {
            e ? u.TaskOperatorNs.destroyTasks(this.currentSelSearchTaskInfos) : u.TaskOperatorNs.deleteTasks(this.currentSelSearchTaskInfos)
        }

        get downloadingCategoryTitle() {
            let e = "正在下载";
            return 0 !== this.downloadingSearchArray.length && (e = e + "(" + this.downloadingSearchArray.length + ")"), e
        }

        get completedCategoryTitle() {
            let e = "已完成";
            return 0 !== this.completeSearchArray.length && (e = e + "(" + this.completeSearchArray.length + ")"), e
        }

        get recycleCategoryTitle() {
            let e = "垃圾箱";
            return 0 !== this.recycleSearchArray.length && (e = e + "(" + this.recycleSearchArray.length + ")"), e
        }

        downloadingItemDbClick() {
            s.TaskStatusHelper.canStopSelectedTask(this.currentCategoryViewId, this.currentSelSearchTaskInfos) ? u.TaskOperatorNs.pauseTasks(this.currentSelSearchTaskInfos) : s.TaskStatusHelper.canStartSelectedTask(this.currentCategoryViewId, this.currentSelSearchTaskInfos) ? u.TaskOperatorNs.startTasks(this.currentSelSearchTaskInfos) : w.information("downloaditem dbclick do nothing")
        }

        recycleItemDbClick() {
            w.information("垃圾箱双击")
        }

        handleDownloadingItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelSearchTaskInfos, this.currentCategoryId, this.downloadingTaskList.length, !0);
            let e = d.DownloadMenuType.DownloadingItem;
            this.currentSelSearchTaskInfos.length > 1 && (e = d.DownloadMenuType.SearchMultiSel), d.downloadContextMenu.popMenu(e)
        }

        handleCompletedItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelSearchTaskInfos, this.currentCategoryId, null, !0);
            let e = d.DownloadMenuType.CompletedItem;
            this.currentSelSearchTaskInfos.length > 1 && (e = d.DownloadMenuType.SearchMultiSel), d.downloadContextMenu.popMenu(e)
        }

        handleRecycleItemMenu() {
            d.downloadContextMenu.setContextInfo(this.currentSelSearchTaskInfos, this.currentCategoryId, null, !0);
            let e = d.DownloadMenuType.RecycleItem;
            this.currentSelSearchTaskInfos.length > 1 && (e = d.DownloadMenuType.SearchMultiSel), d.downloadContextMenu.popMenu(e)
        }

        handleMenuClick(e, ...t) {
            e
        }

        compositionStart(e) {
            this.inputFocus && (this.inputFlag = !1)
        }

        compositionEnd(e) {
            this.inputFocus && (this.inputFlag = !0, this.$nextTick(() => {
                this.startSearch()
            }))
        }

        created() {
            this.attachTaskEvent(), this.holderTextTip = "搜索下载记录", d.downloadContextMenu.attachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), this.currentSelSearchTaskInfos = [], document.addEventListener("compositionstart", this.compositionStart), document.addEventListener("compositionend", this.compositionEnd)
        }

        shouldChange2Complete() {
            let e = !1;
            do {
                if (this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle && this.recycleSelectedTaskIndexs.length > 0) {
                    e = !1;
                    break
                }
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) {
                    e = !0;
                    break
                }
                if (this.downloadingSelectedIndexs.length > 0) {
                    e = !1;
                    break
                }
                e = !0;
                for (let t of this.downloadingTaskBaseList) if (t.taskStatus === r.DownloadKernel.TaskStatus.StartPending || t.taskStatus === r.DownloadKernel.TaskStatus.Started) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        shouldChangeCompleteSelect() {
            let e = !1;
            do {
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Completed) {
                    e = !0;
                    break
                }
                if (0 === this.completedSelectedTaskIndexs.length) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        onTaskDataBaseLoadEnd() {
            this.bLoadDbFinish = !0, this.$nextTick(() => {
                0 === this.downloadingTaskList.length && this.completedTaskList.length > 0 && this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Completed)
            })
        }

        mounted() {
            this.statusChangedEventId = y.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    if (t.length > 0) {
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                        if (this.UPDATE_TASK_STATUS(t.map(e => e.getTaskBaseInfo())), t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.Background)) break;
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                        t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Succeeded && t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Seeding || this.$nextTick(() => {
                            this.startSearch()
                        })
                    }
                } while (0)
            }), S.isLoadStorageTaskFinish() ? this.bLoadDbFinish = !0 : (this.dataBaseLoadCookie = 0, p.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.removeFromCategoryViewEventId = y.attachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (e[1] !== this.currentCategoryId) break;
                    let t = e[2], n = e[3];
                    if (t === r.DownloadKernel.CategroyViewID.Downloading) {
                        if (!this.downloadingSearchArray) break;
                        for (let e of n) {
                            let t = e.getId(), n = this.downloadingSearchArray.indexOf(t);
                            -1 !== n && this.downloadingSearchArray.splice(n, 1)
                        }
                        break
                    }
                    if (t === r.DownloadKernel.CategroyViewID.Completed) {
                        if (!this.completeSearchArray) break;
                        for (let e of n) {
                            let t = e.getId(), n = this.completeSearchArray.indexOf(t);
                            -1 !== n && this.completeSearchArray.splice(n, 1)
                        }
                        break
                    }
                    if (t === r.DownloadKernel.CategroyViewID.Recycle) {
                        if (!this.recycleSearchArray) break;
                        for (let e of n) {
                            let t = e.getId(), n = this.recycleSearchArray.indexOf(t);
                            -1 !== n && this.recycleSearchArray.splice(n, 1)
                        }
                        break
                    }
                } while (0)
            }), this.insertToCategoryViewEventId = y.attachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], n = e[2], i = e[3], a = e[4];
                    i.map(e => e.getTaskBaseInfo()), this.$nextTick(() => {
                        this.startSearch()
                    }), this.bLoadDbFinish && n === r.DownloadKernel.CategroyViewID.Downloading && (a === r.DownloadKernel.TaskInsertReason.Create && this.UPDATE_CATEGORY(t), this.$nextTick(() => {
                        if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading), this.$nextTick(() => {
                            setTimeout(() => {
                                let e = this.downloadingTaskList[0];
                                this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                            }, 0)
                        }); else {
                            let e = this.downloadingTaskList[0];
                            this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                        }
                    }))
                } while (0)
            }), this.cookieOfTaskRenamed = y.attachTaskEvent(r.DownloadKernel.TaskEventType.TaskRenamed, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.TaskRenamed) break;
                    this.pulseEventFlag = !this.pulseEventFlag, this.$nextTick(() => {
                        this.startSearch()
                    })
                } while (0)
            }), this.cookieOfTaskDestroyed = y.attachTaskEvent(r.DownloadKernel.TaskEventType.TaskDestroyed, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.TaskDestroyed) break;
                    this.pulseEventFlag = !this.pulseEventFlag, this.$nextTick(() => {
                        this.startSearch()
                    })
                } while (0)
            })
        }

        destroyed() {
            d.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), document.removeEventListener("compositionstart", this.compositionStart), document.removeEventListener("compositionend", this.compositionEnd), this.clearSearch(), void 0 !== this.insertToCategoryViewEventId && y.detachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), void 0 !== this.removeFromCategoryViewEventId && y.detachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeFromCategoryViewEventId), void 0 !== this.statusChangedEventId && y.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.statusChangedEventId), void 0 !== this.dataBaseLoadCookie && (this.dataBaseLoadCookie = void 0, p.DownloadKernelManager.detachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.cookieOfTaskRenamed && (this.cookieOfTaskRenamed = void 0, y.detachTaskEvent(r.DownloadKernel.TaskEventType.TaskRenamed, this.cookieOfTaskRenamed)), this.cookieOfTaskDestroyed && (this.cookieOfTaskDestroyed = void 0, y.detachTaskEvent(r.DownloadKernel.TaskEventType.TaskDestroyed, this.cookieOfTaskDestroyed))
        }
    };
    i([a.Prop({})], b.prototype, "currentTabId", void 0), i([a.Prop({})], b.prototype, "currentCategoryId", void 0), i([a.Prop({})], b.prototype, "currentCategoryViewId", void 0), i([a.Prop({})], b.prototype, "downloadingTaskList", void 0), i([a.Prop({})], b.prototype, "downloadingTaskBaseList", void 0), i([a.Prop({})], b.prototype, "completedTaskList", void 0), i([a.Prop({})], b.prototype, "completedTaskBaseList", void 0), i([a.Prop({})], b.prototype, "recycleTaskList", void 0), i([a.Prop({})], b.prototype, "recycleTaskBaseList", void 0), i([a.Prop({})], b.prototype, "downloadingSelectedIndexs", void 0), i([a.Prop({})], b.prototype, "completedSelectedTaskIndexs", void 0), i([a.Prop({})], b.prototype, "recycleSelectedTaskIndexs", void 0), i([a.Prop({})], b.prototype, "currentSelectdTaskInfos", void 0), i([a.Prop({})], b.prototype, "downloadingResultCount", void 0), i([a.Prop({})], b.prototype, "completedResultCount", void 0), i([a.Prop({})], b.prototype, "recycleResultCount", void 0), i([a.Prop({})], b.prototype, "UPDATE_CATEGORY", void 0), i([a.Prop({})], b.prototype, "UPDATE_CATEGORYVIEW", void 0), i([a.Prop({})], b.prototype, "UPDATE_DOWNLOADING_SELECTED_TASKS", void 0), i([a.Prop({})], b.prototype, "UPDATE_COMPLETED_SELECTED_TASKS", void 0), i([a.Prop({})], b.prototype, "UPDATE_RECYCLE_SELECTED_TASKS", void 0), i([a.Prop({})], b.prototype, "UPDATE_DOWNLOADING_TASKLIST", void 0), i([a.Prop({})], b.prototype, "UPDATE_COMPLETED_TASKLIST", void 0), i([a.Prop({})], b.prototype, "UPDATE_RECYCLE_TASKLIST", void 0), i([a.Prop({})], b.prototype, "UPDATE_TASK_STATUS", void 0), i([a.Prop({})], b.prototype, "attachTaskEvent", void 0), i([a.Prop({})], b.prototype, "selectTab", void 0), i([a.Watch("currentCategoryId")], b.prototype, "onCategoryChange", null), b = i([a.Component({components: {DownloadCategory: l.default}})], b), t.default = b
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(401), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(910), a = n(48);
    t.default = a.connector.connect({
        mapStateToProps: {
            tabs: e => e.Tabs.tabs,
            homePageUrl: e => e.WebView.homePageUrl,
            preloadPath: e => `file:///${__rootDir}/out/common-preload.js`
        },
        mapCommitToProps: {onMounted: "ON_MOUNTED", createNewTab: "CREATE_NEW_TAB"},
        mapDispatchToProps: {selectTab: "selectTab"}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(403), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    }, a = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = n(2), r = n(4), s = n(140), l = n(748), u = n(1).default.getLogger("home-page"), d = n(740), c = n(66),
        h = n(743);
    let f = class extends r.Vue {
        indexOfTab(e) {
            let t = -1;
            for (let n = 0; n < this.tabs.length; n++) if (this.tabs[n].tab.getTabType() === s.TabType.Chromium && this.tabs[n].tab.getOriginalUrl() === e) {
                t = n;
                break
            }
            return t
        }

        mounted() {
            this.enableDevTools(), this.initNativeCall()
        }

        enableDevTools() {
            window.addEventListener("keyup", e => {
                "F12" === e.key && e.shiftKey && this.$refs.webview.openDevTools()
            }, !0)
        }

        initNativeCall() {
            return a(this, void 0, void 0, function* () {
                let e = l.default.getPluginUpdater(o.join(__rootDir, "plugins/ThunderXWebXDAS"));
                c.NativeCallHostModule.nativeCallHost.initialize();
                let t = {
                    onJsCallNativeFunction: d.onJsCallNativeFunction,
                    onJsCheckNativeFunction: d.onJsCheckNativeFunction
                };
                c.NativeCallHostModule.nativeCallHost.addDelegate(t);
                let i = yield e.getCurFilePath();
                u.information("url", i), this.onMounted(`file:///${o.join(i, "index.html")}#/home`), e.active();
                const a = document.querySelector("webview");
                a.addEventListener("new-window", e => {
                    let t = e.url;
                    const i = n(29).parse(t).protocol;
                    if ("http:" === i || "https:" === i) {
                        let e = {tabType: s.TabType.Chromium, tabParam: {url: t}};
                        this.createNewTab(e)
                    }
                });
                let r = void 0;
                a.addEventListener("dom-ready", e => {
                    r || (r = a.getWebContents()), r.on("context-menu", (e, t) => {
                        h.ContextMenuNS.popContextMenu(e, t)
                    })
                })
            })
        }
    };
    i([r.Prop({})], f.prototype, "tabs", void 0), i([r.Prop({})], f.prototype, "homePageUrl", void 0), i([r.Prop({})], f.prototype, "preloadPath", void 0), i([r.Prop({})], f.prototype, "onMounted", void 0), i([r.Prop({})], f.prototype, "createNewTab", void 0), i([r.Prop({})], f.prototype, "selectTab", void 0), f = i([r.Component], f), t.default = f
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(405), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(913), a = n(48);
    t.default = a.connector.connect({mapGettersToProps: {currentTab: e => e.currentTab}})(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(407), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4), o = n(7), r = n(107);
    let s = class extends a.Vue {
        get canGoBack() {
            let e = !1;
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                e = this.currentTab.tab.canGoBack
            } while (0);
            return e
        }

        goBack() {
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                this.currentTab.tab.goBack()
            } while (0)
        }

        refresh() {
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                this.currentTab.tab.refresh(!1)
            } while (0)
        }

        get isError() {
            return r(this.currentTab, "tab", "isErrorPage")
        }
    };
    i([a.Prop({})], s.prototype, "currentTab", void 0), s = i([a.Component], s), t.default = s
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(409), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(916), a = n(48);
    t.default = a.connector.connect({
        mapDispatchToProps: {initSettingData: "initSettingData"},
        mapStateToProps: {formData: e => e.SettingConf.formData, confSchema: e => e.SettingConf.confSchema},
        mapCommitToProps: {
            setConfigValue: "SET_CONFIG_VALUE",
            setFormData: "SET_FOMR_DATA",
            addFormdataItem: "ADD_FORMDATA_ITEM",
            addSchemaItem: "ADD_SCHEMA_ITEM",
            addSelectItem: "ADD_SELECT_ITEM"
        },
        mapGettersToProps: {baseSetting: "baseSetting"}
    })(i.default)
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(411), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(572), o = n(4), r = n(6), s = n(22), l = n(23), u = n(248), d = n(258), c = n(566),
        h = n(1).default.getLogger("setting-center-view"),
        f = u.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule();
    let p = class extends o.Vue {
        constructor() {
            super(...arguments), this.userId = "", this.currenIndex = 0, this.scrollSumHeight = 0, this.autoScroll = !1, this.browserSettingPosition = [1, 0], this.browsersConfSection = "Motitor", this.browserSettingItemType = "confCheckbox", this.browserSelectAll = "Motitor-MotitorAll"
        }

        handleScroll() {
            if (this.autoScroll) return;
            0 === this.getScrollTop() && (this.scrollSumHeight = 0, this.currenIndex = 0);
            let e = document.querySelectorAll(".contain-tab")[this.currenIndex];
            if (e.offsetHeight + this.scrollSumHeight < this.getScrollTop()) this.scrollSumHeight += e.offsetHeight, this.currenIndex++; else if (this.scrollSumHeight - this.getScrollTop() > e.offsetHeight || 0 === this.getScrollTop()) {
                if (0 === this.currenIndex) return;
                0 === this.getScrollTop() ? this.scrollSumHeight = 0 : this.scrollSumHeight -= e.offsetHeight, this.currenIndex--
            }
        }

        getScrollTop() {
            return this.$refs.settinContain.scrollTop
        }

        setScrollTop(e) {
            this.$refs.settinContain.scrollTop = e
        }

        clickTab(e) {
            this.scrollSumHeight = 0, this.currenIndex = e;
            let t = document.querySelectorAll(".contain-tab");
            for (let n = 0; n < e; n++) this.scrollSumHeight += t[n].offsetHeight;
            this.autoScroll = !0, this.setScrollTop(this.scrollSumHeight), this.autoScroll = !1
        }

        handleConfChange(e, t = "") {
            if ("" === t || void 0 === this.formData[t]) return;
            let n = void 0 !== this.formData[t].isReleventUser ? this.userId : "",
                i = {section: this.formData[t].section, key: this.formData[t].key, value: e, name: t, userId: n};
            this.setConfigValue(i)
        }

        created() {
            s.ConfigNS.attachListener(l.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.initSettingData()
            })
        }

        mounted() {
            this.confChangeEventId = r.NativeCallModule.nativeCall.AttachNativeEvent("OnConfigValueChanaged", (e, t, n, i) => {
                void 0 !== this.formData[`${e}-${t}`] && this.setFormData({section: e, key: t, value: i})
            }), this.loginEventId = r.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                this.userId = e;
                let t = s.ConfigNS.getValue("UserCommunitySet", `radio_id_${e}`, "1");
                h.information("setting-center:handleConfChange", t), this.handleConfChange(t, "UserCommunitySet-radio_id_")
            }), this.logoutEventId = r.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.userId = ""
            }), f.on("selectMsgNotice", () => {
                this.clickTab(3)
            }), d.SettingConfigHelperNS.configBrowserHelper.attachListener(l.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                let e = d.SettingConfigHelperNS.configBrowserHelper.getConfigShowBrowsers();
                h.information("browsers", e);
                for (let t = 0; t < e.length; t++) void 0 === this.formData[`${this.browsersConfSection}-${e[t].key}`] && (this.addFormdataItem({
                    section: this.browsersConfSection,
                    key: e[t].key,
                    type: "number",
                    value: e[t].isSelect ? 1 : 0,
                    selectAllName: this.browserSelectAll
                }), this.addSchemaItem({
                    position: this.browserSettingPosition,
                    schemaItem: {
                        name: `${this.browsersConfSection}-${e[t].key}`,
                        type: this.browserSettingItemType,
                        label: e[t].content,
                        liClasses: "inline"
                    },
                    direction: -1
                }), this.addSelectItem({
                    target: this.browserSelectAll,
                    from: `${this.browsersConfSection}-${e[t].key}`
                }));
                if (e.length > 0) {
                    let t = e[e.length - 1];
                    this.handleConfChange(t.isSelect ? 1 : 0, `${this.browsersConfSection}-${t.key}`)
                }
                if (!this.formData[`${this.browsersConfSection}-browserConfigGuideButton`]) {
                    let e = {
                        type: "confBtn",
                        text: "手动更改浏览器默认下载方式",
                        classes: "td-button--small noMargin",
                        boxType: "browserGuideConfBox",
                        style: c.default().whetherShowEntry() ? "margin-left: 0" : "display: none",
                        extEles: [{
                            type: "confTip",
                            text: "由于技术原理的限制，迅雷默认提供的“接管浏览器”功能，未能有效接管HTTPS\n协议的下载请求。建议您手动更改浏览器默认下载方式，可以完美接管浏览器的\n所有下载请求！目前支持“360安全浏览器、搜狗浏览器、QQ浏览器”",
                            classes: "td-icon-info",
                            style: c.default().whetherShowEntry() ? "margin-left: 0" : "display: none"
                        }]
                    };
                    this.addFormdataItem({
                        section: this.browsersConfSection,
                        key: "browserConfigGuideButton",
                        type: "number",
                        value: ""
                    }), this.addSchemaItem({position: this.browserSettingPosition, schemaItem: e, direction: -1})
                }
            })
        }

        beforeDestroy() {
            this.confChangeEventId && r.NativeCallModule.nativeCall.DetachNativeEvent("OnConfigValueChanaged", this.confChangeEventId), this.loginEventId && r.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.loginEventId), this.logoutEventId && r.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.logoutEventId), f.removeAllListeners("selectMsgNotice")
        }
    };
    i([o.Prop({})], p.prototype, "initSettingData", void 0), i([o.Prop({})], p.prototype, "formData", void 0), i([o.Prop({})], p.prototype, "confSchema", void 0), i([o.Prop({})], p.prototype, "setConfigValue", void 0), i([o.Prop({})], p.prototype, "setFormData", void 0), i([o.Prop({})], p.prototype, "addFormdataItem", void 0), i([o.Prop({})], p.prototype, "addSchemaItem", void 0), i([o.Prop({})], p.prototype, "addSelectItem", void 0), p = i([o.Component({components: {generatorView: a.default}})], p), t.default = p
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(413), a = n.n(i);
    for (var o in i) "default" !== o && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__decorate || function (e, t, n, i) {
        var a, o = arguments.length, r = o < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, n) : i;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, n, i); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, n, r) : a(t, n)) || r);
        return o > 3 && r && Object.defineProperty(t, n, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(4);
    let o = class extends a.Vue {
    };
    o = i([a.Component], o), t.default = o
}, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function (e, t, n) {
    var i;
    i = function () {
        return function (e) {
            var t = {};

            function n(i) {
                if (t[i]) return t[i].exports;
                var a = t[i] = {i, l: !1, exports: {}};
                return e[i].call(a.exports, a, a.exports, n), a.l = !0, a.exports
            }

            return n.m = e, n.c = t, n.i = function (e) {
                return e
            }, n.d = function (e, t, i) {
                n.o(e, t) || Object.defineProperty(e, t, {configurable: !1, enumerable: !0, get: i})
            }, n.n = function (e) {
                var t = e && e.__esModule ? function () {
                    return e.default
                } : function () {
                    return e
                };
                return n.d(t, "a", t), t
            }, n.o = function (e, t) {
                return Object.prototype.hasOwnProperty.call(e, t)
            }, n.p = "", n(n.s = 3)
        }([function (e, t, n) {
            "use strict";
            t.a = function () {
                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = "", n = "";
                if (!e || 0 === e.length) return {isVip: !1};
                var i = e.filter(function (e) {
                    return e && 2 === (e.vasId || e.vasID)
                })[0];
                if (n = i.vIPLevel || i.VIPLevel || 0, i) {
                    var a = {2: "", 3: "p", 5: "s"}[i.vasType] || "";
                    return t = "vip-icon-" + a + "vip" + n, {
                        isVip: "1" === i.isVIP,
                        isStop: "2" === i.isVIP,
                        isYear: "1" === i.isYear,
                        type: i.vasType,
                        level: n,
                        vipClass: t
                    }
                }
                return {isVip: !1}
            }
        }, function (e, t, n) {
            "use strict";
            var i = n(4), a = n.n(i);
            a.a.install = function (e) {
                e.component(a.a.name, a.a)
            }, t.a = a.a
        }, function (e, t, n) {
            "use strict";
            Object.defineProperty(t, "__esModule", {value: !0});
            var i = n(0);
            t.default = {
                name: "vip-icon",
                props: {
                    vipData: {type: Array, required: !0},
                    size: {type: String, default: "normal"},
                    disabled: {type: Boolean, default: !1}
                },
                computed: {
                    vipInfo: function () {
                        return n.i(i.a)(this.vipData)
                    }, vipClass: function () {
                        var e = this.vipInfo.vipClass;
                        return "small" === this.size && (e += " is-small"), (this.vipInfo.isStop || "0" === this.vipInfo.level || this.disabled) && (e += " is-disabled"), e
                    }
                }
            }
        }, function (e, t, n) {
            "use strict";
            Object.defineProperty(t, "__esModule", {value: !0});
            var i = n(1), a = n(0);
            n.d(t, "vipInfo", function () {
                return a.a
            });
            /**
             * vip
             * (c) 2018 shijianan
             * @license MIT
             */
            var o = {
                install: function (e, t) {
                    e.use(i.a), e.prototype.$vipInfo = function (e) {
                        return n.i(a.a)(e)
                    }
                }
            };
            t.default = o
        }, function (e, t, n) {
            var i = n(5)(n(2), n(6), null, null, null);
            i.options.__file = "/Users/nancy/Desktop/work/@xunlei/vip/src/vip-icon/VipIcon.vue", i.esModule && Object.keys(i.esModule).some(function (e) {
                return "default" !== e && "__" !== e.substr(0, 2)
            }) && console.error("named exports are not supported in *.vue files."), i.options.functional && console.error("[vue-loader] VipIcon.vue: functional components are not supported with templates, they should use render functions."), e.exports = i.exports
        }, function (e, t) {
            e.exports = function (e, t, n, i, a) {
                var o, r = e = e || {}, s = typeof e.default;
                "object" !== s && "function" !== s || (o = e, r = e.default);
                var l, u = "function" == typeof r ? r.options : r;
                if (t && (u.render = t.render, u.staticRenderFns = t.staticRenderFns), i && (u._scopeId = i), a ? (l = function (e) {
                    (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), n && n.call(this, e), e && e._registeredComponents && e._registeredComponents.add(a)
                }, u._ssrRegister = l) : n && (l = n), l) {
                    var d = u.functional, c = d ? u.render : u.beforeCreate;
                    d ? u.render = function (e, t) {
                        return l.call(t), c(e, t)
                    } : u.beforeCreate = c ? [].concat(c, l) : [l]
                }
                return {esModule: o, exports: r, options: u}
            }
        }, function (e, t, n) {
            e.exports = {
                render: function () {
                    var e = this.$createElement;
                    return (this._self._c || e)("i", {class: this.vipClass})
                }, staticRenderFns: []
            }, e.exports.render._withStripped = !0
        }])
    }, e.exports = i()
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(114).DownloadKernelCategoryViewManager.getCategoryViewManager();
    !function (e) {
        function t() {
            let e = -1, t = 0, n = 0, o = [], r = a.getCategoryViewFromId(i.DownloadKernel.CategroyViewID.Downloading);
            if (r) {
                let a = r.getTasks(), s = void 0, l = void 0;
                for (let [, e]of a) null !== e && ((s = e.getTaskStatus()) !== i.DownloadKernel.TaskStatus.PreDownloading && s !== i.DownloadKernel.TaskStatus.StartWaiting && s !== i.DownloadKernel.TaskStatus.StartPending && s !== i.DownloadKernel.TaskStatus.Started || (t += (l = e.getTaskBaseInfo()).fileSize, n += l.downloadSize, o.push(e.getId())));
                t > 0 && (e = n / t)
            }
            return o.length > 0 && -1 === e && (e = 0), e >= 1 && (e = 1), {progress: e, downloadingTaskIds: o}
        }

        e.getDownloadDetails = t, e.getDownloadProgressPercent = function () {
            let e = t().progress, n = "0.01%";
            return n = (100 * (e = e < 0 ? 0 : e)).toFixed(2) + "%"
        }
    }(t.DownloadProgressNS || (t.DownloadProgressNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(17), o = n(8), r = n(22), s = n(154);
    !function (e) {
        let t;

        function n(e, n) {
            let i = {sortBy: t.Default, asce: !0};
            do {
                if (void 0 === e || null === e) break;
                let a = "", s = "";
                if (e === o.DownloadKernel.CategroyViewID.Downloading) -1 === n ? (a = "CategoryViewId1_SortAttr", s = "CategoryViewId1_SortState") : (a = "CategoryViewId4_SortAttr", s = "CategoryViewId4_SortState"); else if (e === o.DownloadKernel.CategroyViewID.Completed) -1 === n ? (a = "CategoryViewId2_SortAttr", s = "CategoryViewId2_SortState") : (a = "CategoryViewId5_SortAttr", s = "CategoryViewId5_SortState"); else {
                    if (e !== o.DownloadKernel.CategroyViewID.Recycle) break;
                    a = "CategoryViewId3_SortAttr", s = "CategoryViewId3_SortState"
                }
                let l = r.ConfigNS.getValue("TaskList", a, t.Default);
                e !== o.DownloadKernel.CategroyViewID.Downloading && (l !== t.ByProgress && l !== t.ByState || (l = t.Default));
                let u = 0 === r.ConfigNS.getValue("TaskList", s, -1);
                i.sortBy = l, i.asce = u
            } while (0);
            return i
        }

        function l(e, t, n) {
            do {
                if (void 0 === t || null === t) break;
                let i = "", a = "";
                if (t === o.DownloadKernel.CategroyViewID.Downloading) -1 === n ? (i = "CategoryViewId1_SortAttr", a = "CategoryViewId1_SortState") : (i = "CategoryViewId4_SortAttr", a = "CategoryViewId4_SortState"); else if (t === o.DownloadKernel.CategroyViewID.Completed) -1 === n ? (i = "CategoryViewId2_SortAttr", a = "CategoryViewId2_SortState") : (i = "CategoryViewId5_SortAttr", a = "CategoryViewId5_SortState"); else {
                    if (t !== o.DownloadKernel.CategroyViewID.Recycle) break;
                    i = "CategoryViewId3_SortAttr", a = "CategoryViewId3_SortState"
                }
                r.ConfigNS.setValue("TaskList", i, e.sortBy);
                let s = e.asce ? 0 : -1;
                r.ConfigNS.setValue("TaskList", a, s)
            } while (0)
        }

        function u(e, t) {
            let n = null;
            return e === o.DownloadKernel.CategroyViewID.Downloading ? n = ((e, n) => {
                let i = e.createTime, a = n.createTime;
                return t ? i - a : a - i
            }) : e === o.DownloadKernel.CategroyViewID.Completed ? n = ((e, n) => {
                let i = e.completionTime, a = n.completionTime;
                return t ? i - a : a - i
            }) : e === o.DownloadKernel.CategroyViewID.Recycle && (n = ((e, n) => {
                let i = e.recycleTime, a = n.recycleTime;
                return t ? i - a : a - i
            })), n
        }

        function d(e) {
            return (t, n) => {
                let a = t.taskType, o = n.taskType;
                if (e) {
                    if (a === o) {
                        let e = i.extname(t.taskName).toLowerCase(), a = i.extname(n.taskName).toLowerCase();
                        return e === a ? 0 : e < a ? -1 : 1
                    }
                    return a - o
                }
                if (a === o) {
                    let e = i.extname(t.taskName).toLowerCase(), a = i.extname(n.taskName).toLowerCase();
                    return e === a ? 0 : e < a ? 1 : -1
                }
                return o - a
            }
        }

        function c(e) {
            return (t, n) => {
                let i = t.fileSize, a = n.fileSize;
                return e ? i - a : a - i
            }
        }

        function h(e) {
            return (t, n) => {
                let i = t.taskName, o = n.taskName;
                return e ? a.ThunderHelper.compareStr(o, i) : a.ThunderHelper.compareStr(i, o)
            }
        }

        function f(e) {
            return (t, n) => {
                let i = s.TaskStatusHelper.getValueForSort(t), a = s.TaskStatusHelper.getValueForSort(n);
                return e ? i - a : a - i
            }
        }

        function p(e) {
            return (t, n) => {
                if (0 === t.fileSize && n.fileSize > 0) return e ? -1 : 1;
                if (t.fileSize > 0 && 0 === n.fileSize) return e ? 1 : -1;
                if (0 === t.fileSize && 0 === n.fileSize) return 0;
                {
                    let i = t.downloadSize / t.fileSize, a = n.downloadSize / n.fileSize;
                    return e ? i - a : a - i
                }
            }
        }

        function g(e, i, a) {
            let o = null;
            void 0 !== a && null !== a || (a = n(e, i));
            do {
                if (a.asce = !1, a.sortBy === t.Default) {
                    o = u(e, !1);
                    break
                }
                if (a.sortBy === t.ByTime_Creation || a.sortBy === t.ByTime_Completion || a.sortBy === t.ByTime_Remain) {
                    o = u(e, a.asce);
                    break
                }
                if (a.sortBy === t.BySize) {
                    o = c(a.asce);
                    break
                }
                if (a.sortBy === t.ByType) {
                    o = d(a.asce);
                    break
                }
                if (a.sortBy === t.ByName) {
                    o = h(a.asce);
                    break
                }
                if (a.sortBy === t.ByProgress) {
                    o = p(a.asce);
                    break
                }
                if (a.sortBy === t.ByState) {
                    o = f(a.asce);
                    break
                }
            } while (0);
            return null === o && (o = u(e, !1)), o
        }

        function k(e, t, n) {
            let i = void 0, a = void 0;
            return e === o.DownloadKernel.CategroyViewID.Downloading ? a = 0 : e === o.DownloadKernel.CategroyViewID.Completed ? a = 1 : e === o.DownloadKernel.CategroyViewID.Recycle && (a = 2), void 0 !== a && (i = {
                compareFn: g(e, t, n),
                index: a,
                categoryId: t
            }), i
        }

        !function (e) {
            e[e.Default = -10] = "Default", e[e.ByTime_Remain = 14] = "ByTime_Remain", e[e.ByTime_Creation = 17] = "ByTime_Creation", e[e.ByTime_Completion = 19] = "ByTime_Completion", e[e.ByType = 16] = "ByType", e[e.ByName = 1] = "ByName", e[e.BySize = 9] = "BySize", e[e.ByProgress = 18] = "ByProgress", e[e.ByState = 10] = "ByState", e[e.ByTime = 99] = "ByTime"
        }(t = e.SortType || (e.SortType = {})), e.getSortConfig = n, e.setSortConfig = l, e.getSortFuncByConfig = g, e.getSortCommitParamByConfig = k, e.handleSortMenuClick = function (e, n, i, a, r) {
            let s = !1;
            n === t.ByTime && (n = a === o.DownloadKernel.CategroyViewID.Downloading ? t.ByTime_Creation : a === o.DownloadKernel.CategroyViewID.Completed ? t.ByTime_Completion : a === o.DownloadKernel.CategroyViewID.Recycle ? t.ByTime_Remain : t.Default), n !== t.Default && (s = void 0 === i || i), l({
                sortBy: n,
                asce: !s
            }, a, r), e(k(a, r))
        }
    }(t.SortNS || (t.SortNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(721), a = n(1).default.getLogger("Thunder.VipDownload.download-manager");
    !function (e) {
        let t;
        !function (e) {
            e[e.Download = 0] = "Download", e[e.Speed = 1] = "Speed", e[e.Dcdn = 2] = "Dcdn"
        }(t = e.ErrorType || (e.ErrorType = {}));

        class n {
            constructor() {
                this.codeMap = new Map
            }

            init() {
                (new i.VipTaskHttpSession).queryErrorCode().then(e => {
                    this.onErrorCodeCallback(e)
                }).catch()
            }

            getMessage(e, t) {
                let n = void 0, i = this.codeMap.get(e);
                return i && (n = i.get(t)), n
            }

            onErrorCodeCallback(e) {
                if (a.information("onErrorCodeCallback--\x3e"), e && 0 === e.result && e.task_info && e.task_info.pc_client) {
                    let n = e.task_info.pc_client;
                    n.speed_code && this.setCodeMap(t.Speed, n.speed_code), n.download_code && this.setCodeMap(t.Download, n.download_code), n.dcdn_code && this.setCodeMap(t.Dcdn, n.dcdn_code)
                }
                a.information("<--onErrorCodeCallback")
            }

            setCodeMap(e, t) {
                let n = new Map;
                for (let e of t) if (e.code) {
                    let t = e.code.length, i = e.code.search(/\-/);
                    if (i > 0 && i < t - 1) {
                        let a = Number(e.code.substring(0, i)), o = Number(e.code.substring(i + 1, t));
                        for (let t = a; t <= o; t++) n.set(t, e.message)
                    } else {
                        let t = Number(e.code);
                        n.set(t, e.message)
                    }
                }
                this.codeMap.set(e, n)
            }
        }

        e.ErrorCodeHelper = n;
        const o = new n;
        e.getHelper = function () {
            return o
        }
    }(t.ErrorCodeHelperNS || (t.ErrorCodeHelperNS = {}))
}, function (e, t, n) {
    e.exports = n(12)(67)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(5), o = n(22), r = a.default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e) {
            let t = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = "HKEY_LOCAL_MACHINE", i = "Software\\Thunder Network\\Xmp", a = e;
                t = r.queryRegValue(n, i, a);
                let o = r.getLongPathName(t);
                null !== o && void 0 !== o && "" !== o && (t = o)
            } while (0);
            return t
        }

        e.getXmpPath = function () {
            let e = "";
            return e = "1" === o.ConfigNS.getValue("DownloadAndPlay", "LanuchMediaPlayer", "0") ? t("Path") : i.join(__rootDir, "../../XMP/XMP.exe")
        }, e.getXmpReg = t
    }(t.DownloadAndPlayNS || (t.DownloadAndPlayNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(16), o = n(774), r = n(2), s = n(9), l = n(8), u = n(31), d = n(37), c = n(139), h = n(103), f = n(1),
        p = n(551), g = n(775), k = n(22), m = n(5), T = n(36), v = n(10), y = n(3), S = n(14), w = n(208), b = n(30),
        C = m.default(r.join(__rootDir, "../bin/ThunderHelper.node")), N = f.default.getLogger("DownloadAndPlayHelper"),
        D = u.DownloadKernelTaskManager.getTaskManager(), I = d.DownloadKernelEventManager.getEventManager(),
        _ = ["libcurl.dll", "libeay32.dll", "ssleay32.dll", "XLBugHandler.dll", "XLBugReport.exe"];
    const x = new class {
        constructor() {
            this.taskStatusChangedEventTable = [], this.createTaskId = null, N.information("constructor DownloadAndPlayHelper object")
        }

        init() {
            return i(this, void 0, void 0, function* () {
                if (!1 === (yield this.isCodecsIntegral())) {
                    let e = a.tmpdir(), t = "APlayerCodecs3.exe", n = r.join(e, "..\\..\\"), i = r.join(n, t);
                    (yield s.FileSystemAWNS.existsAW(i)) && (yield s.FileSystemAWNS.unlinkAW(i)), N.information("downloadplay:", n, i);
                    let o = "http://xmp.down.sandai.net/xmp/APlayerCodecs3Embed.exe";
                    N.information(n, i);
                    let u = {taskBaseInfo: {savePath: n, taskName: t}, p2spTaskInfo: {url: o}, isBackground: !0},
                        d = yield D.createTask(l.DownloadKernel.TaskType.P2sp, u);
                    if (null !== d) {
                        let e = d.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        this.attachTaskStatusChangedEvent(e), c.DownloadDispatchNS.startTask(e)
                    }
                }
                g.DownloadAndPlayIPCNS.init()
            })
        }

        uninit() {
            g.DownloadAndPlayIPCNS.uninit()
        }

        installXmp() {
            return i(this, void 0, void 0, function* () {
                let e = null;
                return "1" === k.ConfigNS.getValue("DownloadAndPlay", "LanuchMediaPlayer", "0") ? (N.information("XmpFixBoxEx: ipcMain on channelRMDownloadXmpEx"), T.MessageBox.confirm({
                    title: "您还没有安装迅雷影音，需要现在下载吗？",
                    type: T.MessageBox.ConfirmType.Warning,
                    fileName: "",
                    okText: "立即下载",
                    cancelText: "取消",
                    cancelVisible: !0
                }).then(e => i(this, void 0, void 0, function* () {
                    e.action === b.MessageBoxNS.Action.OK ? yield this.downloadXmpEx() : e.action === b.MessageBoxNS.Action.Cancel ? N.information("XmpFixBoxEx: Cancel") : e.action === b.MessageBoxNS.Action.Close && N.information("XmpFixBoxEx: Close")
                })).catch()) : e = new Promise(e => i(this, void 0, void 0, function* () {
                    let t = r.join(__rootDir, "../../MiniXmp.zip"), n = r.join(__rootDir, "../../XMP/");
                    (yield s.FileSystemAWNS.existsAW(t)) ? (y.remote.ipcMain.once(S.ThunderChannelList.channelRMDownloadXmp, this.downloadXmp), T.MessageBox.custom("XmpFixBox").catch(() => {
                        y.remote.ipcMain.removeListener(S.ThunderChannelList.channelRMDownloadXmp, this.downloadXmp)
                    }), w.UnzipUtilitiesAWNS.uncompressZipFile(n, t).then(t => i(this, void 0, void 0, function* () {
                        y.ipcRenderer.send(S.ThunderChannelList.channelMRFixXmpSuc);
                        let t = r.join(__rootDir, "../../");
                        for (let e = 0; e < _.length; e++) {
                            let i = r.join(t, _[e]), a = r.join(n, _[e]);
                            yield s.FileSystemAWNS.copyFileAW(i, a)
                        }
                        e(!0)
                    }), () => {
                        y.ipcRenderer.send(S.ThunderChannelList.channelMRFixXMPFail), e(!1)
                    })) : (this.downloadXmp(), e(!1))
                })), e
            })
        }

        openXmp(e) {
            return i(this, void 0, void 0, function* () {
                let t = 0;
                do {
                    let n = p.DownloadAndPlayNS.getXmpPath();
                    if (null === n || void 0 === n || "" === n) break;
                    let i = r.dirname(n);
                    C.shellExecute(0, "open", n, e, i, "SW_SHOW") > 32 && (t = 1)
                } while (0);
                return t
            })
        }

        getXmpCoreVersion() {
            return i(this, void 0, void 0, function* () {
                let e = "", t = p.DownloadAndPlayNS.getXmpPath();
                return (yield s.FileSystemAWNS.existsAW(t)) && (e = C.getFileVersion(t)), e
            })
        }

        getXmpUserDataPath() {
            return i(this, void 0, void 0, function* () {
                let e = "";
                do {
                    let t = yield this.getXmpCoreVersion();
                    if (null === t || void 0 === t || "" === t) break;
                    let n = r.join(__rootDir, "../../XMP");
                    t = "V" + t, e = r.join(n, t) + "\\XMP5\\" + t
                } while (0);
                return e
            })
        }

        getXmpBuildNum() {
            return i(this, void 0, void 0, function* () {
                let e = "";
                do {
                    let t = yield this.getXmpCoreVersion();
                    if (null === t || void 0 === t || "" === t) break;
                    let n = t.split(/\./);
                    null !== n && void 0 !== n && 4 === n.length && (e = n[3])
                } while (0);
                return e
            })
        }

        downloadXmp() {
            let e = [];
            e.push("http://xmp.down.sandai.net/xmp/XMPSetup-xlx.exe"), h.ThunderNewTask.createPreNewTaskWindow(e)
        }

        downloadXmpEx() {
            return i(this, void 0, void 0, function* () {
                N.information("XmpFixBoxEx: enter downloadXmpEx");
                const e = u.DownloadKernelTaskManager.getTaskManager();
                let t = e.getTaskFromTaskId(this.createTaskId), n = l.DownloadKernel.CategroyViewID.Recycle;
                if (t && (n = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryViewId)), t && n !== l.DownloadKernel.CategroyViewID.Recycle && null !== this.createTaskId) T.MessageBox.confirm({
                    title: "重复下载，该任务已存在列表中",
                    type: T.MessageBox.ConfirmType.Warning,
                    fileName: "XMPSetup-xlx.exe",
                    okText: "查看",
                    cancelText: "取消",
                    cancelVisible: !0
                }).then(e => i(this, void 0, void 0, function* () {
                    if (e.action === b.MessageBoxNS.Action.OK) {
                        let e = this.createTaskId;
                        h.ThunderNewTask.selectTask(e)
                    } else e.action, b.MessageBoxNS.Action.Cancel
                })).catch(); else {
                    let t = v.ThunderUtil.getDefaultDownloadDir(),
                        n = {taskName: "", savePath: "", taskName: "XMPSetup-xlx.exe"};
                    n.savePath = t;
                    let i = {url: "http://xmp.down.sandai.net/xmp/XMPSetup-xlx.exe", refUrl: "", cookie: ""},
                        a = yield e.createTask(l.DownloadKernel.TaskType.P2sp, {taskBaseInfo: n, p2spTaskInfo: i});
                    if (null !== a) {
                        let t = a.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        e.startTask(t), this.createTaskId = t
                    }
                }
            })
        }

        isCodecsIntegral() {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                {
                    let t = C.getPublicUserDataPath(),
                        n = r.join(t, "Thunder Network\\APlayer\\codecs\\avisplitter.dll"),
                        i = r.join(t, "Thunder Network\\APlayer\\codecs\\realmediasplitter.dll");
                    (yield s.FileSystemAWNS.existsAW(n)) && (yield s.FileSystemAWNS.existsAW(i)) && (e = !0)
                }
                return e
            })
        }

        attachTaskStatusChangedEvent(e) {
            void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = I.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...t) => {
                do {
                    if (!t) break;
                    if (t[0] !== l.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!t[1]) break;
                    let n = t[1];
                    if (n.length > 0) {
                        let t = n[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath),
                            i = n[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName), a = r.join(t, i);
                        s.FileSystemAWNS.existsAW(a).then(t => {
                            if (t && n[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId) === e) {
                                let t = n[0].getTaskStatus();
                                t !== l.DownloadKernel.TaskStatus.Succeeded && t !== l.DownloadKernel.TaskStatus.Seeding || (N.information("downloadplay:运行exe = ", a), o.spawn(a), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (N.information("downloadplay:取消监听 ", this.taskStatusChangedEventTable[e]), I.detachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null))
                            }
                        }).catch()
                    }
                } while (0)
            }))
        }
    };
    t.default = x
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(725), a = n(778), o = n(280), r = n(779);
    !function (e) {
        e.showWebWnd = function (e, ...t) {
            if ("sign" === e) {
                let e = "";
                null !== t && void 0 !== t && null !== t[0] && void 0 !== t[0] && (e = t[0]), i.signObject.createSignDlg(e, a.signNative.getNativeFunctionMap()).catch()
            } else if ("phoneAuth" === e) {
                let e = "";
                null !== t && void 0 !== t && null !== t[0] && void 0 !== t[0] && (e = t[0]), o.phoneAuthObject.createPhoneAuthDlg(e, r.phoneAuthNative.getNativeFunctionMap()).catch()
            }
        }
    }(t.EmbeddedBrowserManagerNs || (t.EmbeddedBrowserManagerNs = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(115), o = n(79), r = n(151), s = n(281), l = n(8), u = n(729), d = n(557), c = n(727), h = n(245),
        f = n(210), p = n(66), g = n(1).default.getLogger("Thunder.VipDownload.download-manager"),
        k = r.DkHelperNS.getHelper(), m = o.UserHelperNS.getHelper(), T = s.TaskManagerNS.getTaskManager(),
        v = h.KuainiaoManagerNS.getManager(), y = f.TaskEventContainerNS.getEventContainer();

    class S {
        constructor() {
            this.mExpandTaskId = void 0, this.mIsUpdateTotalAcclerateStatus = !1, this.mIsTotalAcclrating = !1
        }

        get expandTaskId() {
            return this.mExpandTaskId
        }

        init() {
            m.attachListener(o.UserEventNS.authorityChanged, (e, t) => i(this, void 0, void 0, function* () {
                yield this.onUserAuthorityChanged(e, t)
            })), this.attachDkEvents(), v.attachListener(h.KuainiaoEventNS.statusChanged, e => {
                this.onKuaiNiaoStatusChanged(e)
            }), y.attachListener(f.TaskEventNS.taskAcclerateStatusChanged, () => {
                this.onTaskAcclerateStatusChanged()
            }), this.loadTryDataBase().catch()
        }

        onTaskExpand(e) {
            return i(this, void 0, void 0, function* () {
                if (this.mExpandTaskId !== e) {
                    g.information("onTaskExpand", "taskId", e), this.mExpandTaskId = e;
                    let t = yield T.createTask(e);
                    t && (t.onExpand(), y.onEvent(f.TaskEventNS.taskExpand, e))
                }
            })
        }

        onTaskUnExpand(e) {
            e === this.mExpandTaskId && (g.information("onTaskUnExpand", "taskId", e), this.mExpandTaskId = void 0)
        }

        enterAcclerate(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = yield T.createTask(e);
                n && n.getTaskExtra().enterAcclerate(t)
            })
        }

        autoAcclerate(e) {
            return i(this, void 0, void 0, function* () {
                let t = yield T.createTask(e);
                t && t.getTaskExtra().autoAcclerate()
            })
        }

        createVipTaskInfo(e) {
            let t = null, n = T.getTask(e);
            if (n) {
                t = n.getTaskExtra().createVipTaskInfo()
            }
            return t
        }

        getVipTaskInfo(e) {
            let t = null, n = T.getTask(e);
            if (n) {
                t = n.getTaskExtra().getVipTaskInfo()
            }
            return t
        }

        attachDkEvents() {
            k.attachListener(r.DkEventNS.taskCompleted, e => {
                this.onTaskCompleted(e)
            }), k.attachListener(r.DkEventNS.taskRemoved, e => {
                this.onTaskRemoved(e)
            }), k.attachListener(r.DkEventNS.taskStatusChanged, (e, t) => i(this, void 0, void 0, function* () {
                yield this.onTaskStatusChanged(e, t)
            })), k.attachListener(r.DkEventNS.taskDetailChanged, (e, t) => {
                this.onTaskDetailChanged(e, t)
            }), k.attachListener(r.DkEventNS.taskDcdnStatusChanged, (e, t) => {
                this.onTaskDcdnStatusChanged(e, t)
            }), k.attachListener(r.DkEventNS.btSubFileDcdnStatusChanged, (e, t, n) => {
                this.onBtSubFileDcdnStatusChanged(e, t, n)
            }), k.attachListener(r.DkEventNS.btSubFileDetailChanged, (e, t) => {
                this.onBtSubFileDetailChanged(e, t)
            }), k.attachListener(r.DkEventNS.btSubFileForbidden, e => {
                this.onBtSubFileForbidden(e)
            })
        }

        onUserAuthorityChanged(e, t) {
            return i(this, void 0, void 0, function* () {
                if (e ? yield this.loadVipDataBase() : this.unloadVipDataBase(), m.offlineAuthority ? yield this.loadOfflineDataBase() : this.unloadOfflineDataBase(), T.getTaskMap().forEach(function (n) {
                    n.onUserAuthorityChanged(e, t)
                }), this.mExpandTaskId) {
                    let e = T.getTask(this.mExpandTaskId);
                    e && e.onExpand()
                }
            })
        }

        loadVipDataBase() {
            return i(this, void 0, void 0, function* () {
                g.information("loadVipDataBase");
                let e = u.VipTaskDataBaseNS.getTable();
                yield e.init(m.userId);
                let t = yield e.getTaskIds();
                for (let n of t) {
                    let t = yield k.IsTaskExist(n);
                    if (t) {
                        let e = yield k.getTaskStatus(n);
                        e !== l.DownloadKernel.TaskStatus.Succeeded && e !== l.DownloadKernel.TaskStatus.Seeding || (t = !1)
                    }
                    t ? yield this.autoAcclerate(n) : yield e.removeTask(n, -2)
                }
            })
        }

        unloadVipDataBase() {
            u.VipTaskDataBaseNS.getTable().clear()
        }

        loadOfflineDataBase() {
            return i(this, void 0, void 0, function* () {
                g.information("loadOfflineDataBase");
                let e = c.OfflineTaskDataBaseNS.getTable();
                yield e.init(m.userId);
                let t = yield e.getTaskIds();
                for (let n of t) {
                    let t = yield k.IsTaskExist(n);
                    if (t) {
                        let e = yield k.getTaskStatus(n);
                        e !== l.DownloadKernel.TaskStatus.Succeeded && e !== l.DownloadKernel.TaskStatus.Seeding || (t = !1)
                    }
                    t || (yield e.removeTask(n, -2))
                }
            })
        }

        unloadOfflineDataBase() {
            c.OfflineTaskDataBaseNS.getTable().clear()
        }

        loadTryDataBase() {
            return i(this, void 0, void 0, function* () {
                g.information("loadTryDataBase"), yield d.TryTaskDataBaseNS.getTable().init("0")
            })
        }

        onTaskCompleted(e) {
            let t = T.getTask(e);
            t && t.onTaskCompleted(), T.deleteTask(e)
        }

        onTaskRemoved(e) {
            let t = T.getTask(e);
            t && t.onTaskRemoved(), T.deleteTask(e)
        }

        onTaskStatusChanged(e, t) {
            return i(this, void 0, void 0, function* () {
                switch (t) {
                    case l.DownloadKernel.TaskStatus.DestroyPending:
                    case l.DownloadKernel.TaskStatus.Succeeded:
                        break;
                    default:
                        let n = yield T.createTask(e);
                        n && (yield n.onTaskStatusChanged(t))
                }
            })
        }

        onTaskDcdnStatusChanged(e, t) {
            let n = T.getTask(e);
            n && n.onTaskDcdnStatusChanged(-1, t)
        }

        onBtSubFileDcdnStatusChanged(e, t, n) {
            let i = T.getTask(e);
            i && i.onTaskDcdnStatusChanged(t, n)
        }

        onTaskDetailChanged(e, t) {
            let n = T.getTask(e);
            n && n.onTaskDetailChanged(t)
        }

        onBtSubFileDetailChanged(e, t) {
            let n = T.getTask(e);
            n && n.onBtSubFileDetailChanged(e, t)
        }

        onBtSubFileForbidden(e) {
            g.information("onBtSubFileForbidden", e), y.onEvent(f.TaskEventNS.btSubFileForbidden, e)
        }

        onKuaiNiaoStatusChanged(e) {
            T.getTaskMap().forEach(function (t) {
                let n = t.getTaskExtra();
                n.careKuaiNiao && n.onKuaiNiaoStatusChanged(e)
            })
        }

        onTaskAcclerateStatusChanged() {
            this.mIsUpdateTotalAcclerateStatus || (this.mIsUpdateTotalAcclerateStatus = !0, setTimeout(() => {
                let e = !1;
                if (T.getTaskMap().forEach(function (t) {
                    let n = t.getTaskExtra().getVipTaskInfo();
                    n && n.taskStatus > a.VipDownloadDefineNS.VipTaskStatus.Init && (e = !0)
                }), e !== this.mIsTotalAcclrating) {
                    let t = {acclerating: e};
                    p.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTotalVipAcclerateStatusChanged", JSON.stringify(t)), this.mIsTotalAcclrating = e
                }
                this.mIsUpdateTotalAcclerateStatus = !1
            }, 500))
        }
    }

    t.DownloadManager = S, function (e) {
        const t = new S;
        e.getDownloadManager = function () {
            return t
        }
    }(t.DownloadManagerNS || (t.DownloadManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(62), o = n(786), r = a.PluginHelperNS.getHelper(), s = n(1), l = n(787),
        u = s.default.getLogger("Thunder.VipDownload.sqlite-table"), d = "584C535343444E2E";

    class c {
        constructor() {
            this.mUserId = void 0, this.mName = "", this.mJsonify = !1, this.mEncrypt = !1, this.mEnable = !1
        }

        static execSqlite(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = void 0;
                    r.nativeCall ? r.nativeCall.CallNativeFunction("ExecSqlite", e, (e, i) => {
                        0 === e && (n = i), t(n)
                    }) : t(n)
                })
            })
        }

        static querySqlite(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let n = null;
                    r.nativeCall ? r.nativeCall.CallNativeFunction("QuerySqlite", e, (e, i) => {
                        0 === e && (n = i), t(n)
                    }) : t(n)
                })
            })
        }

        set enable(e) {
            this.mEnable = e
        }

        get enable() {
            return this.mEnable
        }

        set userId(e) {
            this.mUserId = e
        }

        get userId() {
            return this.mUserId
        }

        set name(e) {
            this.mName = e
        }

        get name() {
            return this.mName
        }

        get tableName() {
            let e = void 0;
            return this.userId && this.name && (e = "AccelerateTaskMap" + this.userId + "_" + this.name), e
        }

        get jsonify() {
            return this.mJsonify
        }

        set jsonify(e) {
            this.mJsonify = e
        }

        get encrypt() {
            return this.mEncrypt
        }

        set encrypt(e) {
            this.mEncrypt = e
        }

        init(e) {
            return i(this, void 0, void 0, function* () {
                this.userId = e;
                let t = yield this.isTableExist();
                u.information("table exist", t), t || (yield this.createTable()), this.enable = !0
            })
        }

        clear() {
            this.userId = void 0, this.enable = !1
        }

        createTable() {
            return i(this, void 0, void 0, function* () {
                let e = -1, t = this.tableName;
                if (t) {
                    let n = `create table ${t}(LocalTaskId BIGINT, AcclerateTaskId BIGINT, LocalSubFileIndex INT, UserData NVARCHAR, primary key(LocalTaskId,LocalSubFileIndex))`;
                    u.information("command", n), e = yield c.execSqlite(n), u.information("createTable", e)
                }
                return e
            })
        }

        isTableExist() {
            return i(this, void 0, void 0, function* () {
                let e = !1, t = this.tableName;
                if (t) {
                    let n = `select count(*) from sqlite_master where type='table' and name='${t}'`;
                    u.information("command", n);
                    let i = yield c.querySqlite(n);
                    if (i && i.length > 0) {
                        let t = i[0];
                        if (t && t.length > 0) {
                            let n = t[0].value;
                            n && Number(n).valueOf() > 0 && (e = !0)
                        }
                    }
                }
                return e
            })
        }

        setUserData(e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = -1, a = this.tableName;
                if (!this.enable || !a) return i;
                let r = "null";
                n && (r = this.jsonify ? JSON.stringify(n) : l.stringify(n), this.encrypt && (r = o.AesCryptoNS.encryptString(r, d)), r = `'${r}'`);
                let s = void 0, h = yield this.isTaskExist(e, t);
                return u.information("task exist", h), s = h ? `update ${a} set UserData=${r} where LocalTaskId=${e} and LocalSubFileIndex=${t}` : `insert into ${a} values(${e}, -1, ${t}, ${r})`, u.information("command", s), i = yield c.execSqlite(s)
            })
        }

        getUserData(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = null, i = this.tableName;
                if (!this.enable || !i) return n;
                let a = `select UserData from ${i} where LocalTaskId=${e} and LocalSubFileIndex=${t}`;
                u.information("command", a);
                let r = yield c.querySqlite(a);
                if (r && r.length > 0) {
                    let e = r[0];
                    if (e && e.length > 0) {
                        let t = e[0].value;
                        if (t) if (this.encrypt && (t = o.AesCryptoNS.decryptString(t, d)), this.jsonify) try {
                            n = JSON.parse(t)
                        } catch (e) {
                            u.warning(e)
                        } else n = t
                    }
                }
                return n
            })
        }

        removeTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = -1, i = this.tableName;
                if (!this.enable || !i) return n;
                let a = void 0;
                return a = -2 === t ? `delete from ${i} where LocalTaskId=${e}` : `delete from ${i} where LocalTaskId=${e} and LocalSubFileIndex=${t}`, u.information("command", a), n = yield c.execSqlite(a), u.information("removeTask", n), n
            })
        }

        getTaskIds() {
            return i(this, void 0, void 0, function* () {
                let e = [], t = this.tableName;
                if (!this.enable || !t) return e;
                let n = `select distinct LocalTaskId from ${t}`;
                u.information("command", n);
                let i = yield c.querySqlite(n);
                return i && i.length > 0 && i.forEach(function (t) {
                    if (t && t.length > 0) {
                        let n = t[0];
                        if (n.value) {
                            let t = Number(n.value).valueOf();
                            e.push(t)
                        }
                    }
                }), e
            })
        }

        getTaskIndexs(e) {
            return i(this, void 0, void 0, function* () {
                let t = [], n = this.tableName;
                if (!this.enable || !n) return t;
                let i = `select distinct LocalSubFileIndex from ${n} where LocalTaskId=${e}`;
                u.information("command", i);
                let a = yield c.querySqlite(i);
                return a && a.length > 0 && a.forEach(function (e) {
                    if (e && e.length > 0) {
                        let n = e[0];
                        if (n.value) {
                            let e = Number(n.value).valueOf();
                            t.push(e)
                        }
                    }
                }), t
            })
        }

        isTaskExist(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1, i = this.tableName;
                if (!this.enable || !i) return n;
                let a = `select count(*) from ${i} where LocalTaskId=${e} and LocalSubFileIndex=${t}`;
                u.information("command", a);
                let o = yield c.querySqlite(a);
                if (o && o.length > 0) {
                    let e = o[0];
                    if (e && e.length > 0) {
                        let t = e[0].value;
                        t && Number(t).valueOf() > 0 && (n = !0)
                    }
                }
                return n
            })
        }
    }

    t.SqliteTable = c
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(794), a = n(557), o = n(22), r = n(62), s = a.TryTaskDataBaseNS.getTable();

    class l {
        constructor() {
            this.mTryTaskId = void 0, this.mLeftCount = 100, this.mTasks = new Map
        }

        get taskId() {
            return this.mTryTaskId
        }

        get chances() {
            return this.mLeftCount
        }

        setQueryData(e, t, n) {
            let i = this.createTask(e);
            void 0 !== n.leftCount && (this.mLeftCount = n.leftCount), 0 === n.result && (i.subId = t, i.trialKey = n.trialKey, i.createTime = r.PluginHelperNS.getHelper().currentTime, i.expireTime = n.expireTime, i.type = n.type)
        }

        setTaskId(e) {
            this.mTryTaskId = e
        }

        removeTaskId(e) {
            this.mTryTaskId === e && (this.mTryTaskId = void 0)
        }

        setCommitData(e, t) {
            let n = this.getTask(e);
            if (n) if (n.commited = !0, 0 !== t.result) n.error = t; else {
                n.error = null, n.trialVerify = t.verify, this.mLeftCount -= 1;
                let e = {tryDate: (new Date).toDateString()};
                s.setUserData(this.taskId, -1, e).catch();
                let i = r.PluginHelperNS.getHelper().currentTime;
                o.ConfigNS.setValue("VipDownload", "LastTryEnterTime", i)
            }
        }

        setTokenData(e, t) {
            let n = this.getTask(e);
            n && (0 !== t.result ? n.error = t : (n.error = null, n.token = t.token, n.tokenExpire = t.expire, n.maxTime = t.maxTime))
        }

        createTask(e) {
            let t = new i.TaskCache;
            return this.mTasks.set(e, t), t
        }

        getTask(e) {
            return this.mTasks.get(e)
        }

        removeTask(e, t) {
            t && s.removeTask(e, -2).catch(), this.mTasks.delete(e)
        }
    }

    t.TryCacheManager = l, function (e) {
        const t = new l;
        e.getCacheManager = function () {
            return t
        }
    }(t.TryTaskCacheNS || (t.TryTaskCacheNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(555);
    !function (e) {
        const t = new i.SqliteTable;
        t.name = "try", t.encrypt = !0, t.jsonify = !0, e.getTable = function () {
            return t
        }
    }(t.TryTaskDataBaseNS || (t.TryTaskDataBaseNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, n;
        !function (e) {
            e[e.Vip = 1] = "Vip", e[e.Try = 2] = "Try"
        }(t = e.KuaiNiaoType || (e.KuaiNiaoType = {})), function (e) {
            e[e.Unkown = -1] = "Unkown", e[e.Init = 0] = "Init", e[e.Enable = 1] = "Enable", e[e.Commiting = 2] = "Commiting", e[e.Failed = 3] = "Failed", e[e.Alive = 4] = "Alive", e[e.Finish = 5] = "Finish"
        }(n = e.KuaiNiaoStatus || (e.KuaiNiaoStatus = {}))
    }(t.KuaiNiaoDefineNS || (t.KuaiNiaoDefineNS = {}))
}, function (e, t) {
    (function () {
        t.defaults = {
            .1: {
                explicitCharkey: !1,
                trim: !0,
                normalize: !0,
                normalizeTags: !1,
                attrkey: "@",
                charkey: "#",
                explicitArray: !1,
                ignoreAttrs: !1,
                mergeAttrs: !1,
                explicitRoot: !1,
                validator: null,
                xmlns: !1,
                explicitChildren: !1,
                childkey: "@@",
                charsAsChildren: !1,
                includeWhiteChars: !1,
                async: !1,
                strict: !0,
                attrNameProcessors: null,
                attrValueProcessors: null,
                tagNameProcessors: null,
                valueProcessors: null,
                emptyTag: ""
            },
            .2: {
                explicitCharkey: !1,
                trim: !1,
                normalize: !1,
                normalizeTags: !1,
                attrkey: "$",
                charkey: "_",
                explicitArray: !0,
                ignoreAttrs: !1,
                mergeAttrs: !1,
                explicitRoot: !0,
                validator: null,
                xmlns: !1,
                explicitChildren: !1,
                preserveChildrenOrder: !1,
                childkey: "$$",
                charsAsChildren: !1,
                includeWhiteChars: !1,
                async: !1,
                strict: !0,
                attrNameProcessors: null,
                attrValueProcessors: null,
                tagNameProcessors: null,
                valueProcessors: null,
                rootName: "root",
                xmldec: {version: "1.0", encoding: "UTF-8", standalone: !0},
                doctype: null,
                renderOpts: {pretty: !0, indent: "  ", newline: "\n"},
                headless: !1,
                chunkSize: 1e4,
                emptyTag: "",
                cdata: !1
            }
        }
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l, u, d, c, h, f, p, g = {}.hasOwnProperty;
        l = n(285), u = n(286), t = n(283), i = n(284), d = n(282), h = n(291), f = n(292), c = n(293), a = n(287), o = n(289), r = n(288), s = n(290), p = n(734), e.exports = function (e) {
            function n(e) {
                n.__super__.constructor.call(this, e)
            }

            return function (e, t) {
                for (var n in t) g.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, p), n.prototype.document = function (e) {
                var t, n, a, o, r;
                for (this.textispresent = !1, o = "", n = 0, a = (r = e.children).length; n < a; n++) t = r[n], o += function () {
                    switch (!1) {
                        case!(t instanceof l):
                            return this.declaration(t);
                        case!(t instanceof u):
                            return this.docType(t);
                        case!(t instanceof i):
                            return this.comment(t);
                        case!(t instanceof c):
                            return this.processingInstruction(t);
                        default:
                            return this.element(t, 0)
                    }
                }.call(this);
                return this.pretty && o.slice(-this.newline.length) === this.newline && (o = o.slice(0, -this.newline.length)), o
            }, n.prototype.attribute = function (e) {
                return " " + e.name + '="' + e.value + '"'
            }, n.prototype.cdata = function (e, t) {
                return this.space(t) + "<![CDATA[" + e.text + "]]>" + this.newline
            }, n.prototype.comment = function (e, t) {
                return this.space(t) + "\x3c!-- " + e.text + " --\x3e" + this.newline
            }, n.prototype.declaration = function (e, t) {
                var n;
                return n = this.space(t), n += '<?xml version="' + e.version + '"', null != e.encoding && (n += ' encoding="' + e.encoding + '"'), null != e.standalone && (n += ' standalone="' + e.standalone + '"'), n += this.spacebeforeslash + "?>", n += this.newline
            }, n.prototype.docType = function (e, n) {
                var l, u, d, h, f;
                if (n || (n = 0), h = this.space(n), h += "<!DOCTYPE " + e.root().name, e.pubID && e.sysID ? h += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (h += ' SYSTEM "' + e.sysID + '"'), e.children.length > 0) {
                    for (h += " [", h += this.newline, u = 0, d = (f = e.children).length; u < d; u++) l = f[u], h += function () {
                        switch (!1) {
                            case!(l instanceof a):
                                return this.dtdAttList(l, n + 1);
                            case!(l instanceof o):
                                return this.dtdElement(l, n + 1);
                            case!(l instanceof r):
                                return this.dtdEntity(l, n + 1);
                            case!(l instanceof s):
                                return this.dtdNotation(l, n + 1);
                            case!(l instanceof t):
                                return this.cdata(l, n + 1);
                            case!(l instanceof i):
                                return this.comment(l, n + 1);
                            case!(l instanceof c):
                                return this.processingInstruction(l, n + 1);
                            default:
                                throw new Error("Unknown DTD node type: " + l.constructor.name)
                        }
                    }.call(this);
                    h += "]"
                }
                return h += this.spacebeforeslash + ">", h += this.newline
            }, n.prototype.element = function (e, n) {
                var a, o, r, s, l, u, p, k, m, T, v, y, S;
                for (p in n || (n = 0), S = !1, this.textispresent ? (this.newline = "", this.pretty = !1) : (this.newline = this.newlinedefault, this.pretty = this.prettydefault), k = "", k += (y = this.space(n)) + "<" + e.name, m = e.attributes) g.call(m, p) && (a = m[p], k += this.attribute(a));
                if (0 === e.children.length || e.children.every(function (e) {
                    return "" === e.value
                })) this.allowEmpty ? k += "></" + e.name + ">" + this.newline : k += this.spacebeforeslash + "/>" + this.newline; else if (this.pretty && 1 === e.children.length && null != e.children[0].value) k += ">", k += e.children[0].value, k += "</" + e.name + ">" + this.newline; else {
                    if (this.dontprettytextnodes) for (r = 0, l = (T = e.children).length; r < l; r++) if (null != (o = T[r]).value) {
                        this.textispresent++, S = !0;
                        break
                    }
                    for (this.textispresent && (this.newline = "", this.pretty = !1, y = this.space(n)), k += ">" + this.newline, s = 0, u = (v = e.children).length; s < u; s++) o = v[s], k += function () {
                        switch (!1) {
                            case!(o instanceof t):
                                return this.cdata(o, n + 1);
                            case!(o instanceof i):
                                return this.comment(o, n + 1);
                            case!(o instanceof d):
                                return this.element(o, n + 1);
                            case!(o instanceof h):
                                return this.raw(o, n + 1);
                            case!(o instanceof f):
                                return this.text(o, n + 1);
                            case!(o instanceof c):
                                return this.processingInstruction(o, n + 1);
                            default:
                                throw new Error("Unknown XML node type: " + o.constructor.name)
                        }
                    }.call(this);
                    S && this.textispresent--, this.textispresent || (this.newline = this.newlinedefault, this.pretty = this.prettydefault), k += y + "</" + e.name + ">" + this.newline
                }
                return k
            }, n.prototype.processingInstruction = function (e, t) {
                var n;
                return n = this.space(t) + "<?" + e.target, e.value && (n += " " + e.value), n += this.spacebeforeslash + "?>" + this.newline
            }, n.prototype.raw = function (e, t) {
                return this.space(t) + e.value + this.newline
            }, n.prototype.text = function (e, t) {
                return this.space(t) + e.value + this.newline
            }, n.prototype.dtdAttList = function (e, t) {
                var n;
                return n = this.space(t) + "<!ATTLIST " + e.elementName + " " + e.attributeName + " " + e.attributeType, "#DEFAULT" !== e.defaultValueType && (n += " " + e.defaultValueType), e.defaultValue && (n += ' "' + e.defaultValue + '"'), n += this.spacebeforeslash + ">" + this.newline
            }, n.prototype.dtdElement = function (e, t) {
                return this.space(t) + "<!ELEMENT " + e.name + " " + e.value + this.spacebeforeslash + ">" + this.newline
            }, n.prototype.dtdEntity = function (e, t) {
                var n;
                return n = this.space(t) + "<!ENTITY", e.pe && (n += " %"), n += " " + e.name, e.value ? n += ' "' + e.value + '"' : (e.pubID && e.sysID ? n += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (n += ' SYSTEM "' + e.sysID + '"'), e.nData && (n += " NDATA " + e.nData)), n += this.spacebeforeslash + ">" + this.newline
            }, n.prototype.dtdNotation = function (e, t) {
                var n;
                return n = this.space(t) + "<!NOTATION " + e.name, e.pubID && e.sysID ? n += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.pubID ? n += ' PUBLIC "' + e.pubID + '"' : e.sysID && (n += ' SYSTEM "' + e.sysID + '"'), n += this.spacebeforeslash + ">" + this.newline
            }, n.prototype.openNode = function (e, t) {
                var n, i, a, o;
                if (t || (t = 0), e instanceof d) {
                    for (i in a = this.space(t) + "<" + e.name, o = e.attributes) g.call(o, i) && (n = o[i], a += this.attribute(n));
                    return a += (e.children ? ">" : "/>") + this.newline
                }
                return a = this.space(t) + "<!DOCTYPE " + e.rootNodeName, e.pubID && e.sysID ? a += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (a += ' SYSTEM "' + e.sysID + '"'), a += (e.children ? " [" : ">") + this.newline
            }, n.prototype.closeNode = function (e, t) {
                switch (t || (t = 0), !1) {
                    case!(e instanceof d):
                        return this.space(t) + "</" + e.name + ">" + this.newline;
                    case!(e instanceof u):
                        return this.space(t) + "]>" + this.newline
                }
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(115), o = n(736), r = n(8), s = n(79), l = n(281), u = n(554), d = n(210),
        c = n(1).default.getLogger("Thunder.VipDownload.vip-task"), h = s.UserHelperNS.getHelper();
    !function (e) {
        const t = d.TaskEventContainerNS.getEventContainer();

        function n(e, t, n) {
            c.information("vipButtonShow");
            let i = new Map, a = k(), r = m(), s = T(), l = t ? 1 : 0, u = v(e);
            i.set("is_login", a), i.set("is_vip", r), i.set("vip_type", s), i.set("is_cj_speed", l), i.set("taskid", e), i.set("gcid", u), i.set("btn_type", n);
            let d = {attribute1: "hyjs_show", extData: i};
            o.StatUtilitiesNS.trackEvent("xlx_vip_event", d)
        }

        function s(e) {
            g(e, u.DownloadManagerNS.getDownloadManager().getVipTaskInfo(e))
        }

        function f(e, t) {
            e === u.DownloadManagerNS.getDownloadManager().expandTaskId && g(e, t)
        }

        function p(e, t) {
            let n = !1;
            if (h.isVip) return n;
            if (!t || t.taskType !== a.VipDownloadDefineNS.VipTaskType.Vip) return n;
            switch (t.taskStatus) {
                case a.VipDownloadDefineNS.VipTaskStatus.Init:
                    n = !0
            }
            return n
        }

        function g(e, t) {
            p(0, t) && setTimeout(() => i(this, void 0, void 0, function* () {
                let t = u.DownloadManagerNS.getDownloadManager().getVipTaskInfo(e);
                p(0, t) && n(e, t.isSuper, "task")
            }), 1500)
        }

        function k() {
            let e = 0;
            return h.isLogin && (e = 1), e
        }

        function m() {
            let e = 0;
            return h.isVip && (e = 1), e
        }

        function T() {
            let e = 0;
            return h.isSuperVip ? e = 5 : h.isPlatinumVip ? e = 3 : h.isVip && (e = 2), e
        }

        function v(e) {
            const t = l.TaskManagerNS.getTaskManager().getTask(e);
            let n = "";
            if (t) {
                const e = t.getTaskBase();
                !e || e.taskType !== r.DownloadKernel.TaskType.P2sp && e.taskType !== r.DownloadKernel.TaskType.Emule || (n = e.gcid)
            }
            return n
        }

        t.attachListener(d.TaskEventNS.taskAcclerateStatusChanged, f), t.attachListener(d.TaskEventNS.taskExpand, s), e.vipButtonShow = n, e.vipButtonClick = function (e, t, n) {
            c.information("vipButtonClick");
            let i = new Map, a = k(), r = m(), s = T(), l = t ? 1 : 0, u = v(e);
            i.set("is_login", a), i.set("is_vip", r), i.set("vip_type", s), i.set("is_cj_speed", l), i.set("taskid", e), i.set("gcid", u), i.set("clickid", n);
            let d = {attribute1: "hyjs_click", extData: i};
            o.StatUtilitiesNS.trackEvent("xlx_vip_event", d)
        }, e.onTaskExpand = s, e.onTaskAcclerateStatusChanged = f
    }(t.VipStatNS || (t.VipStatNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(115), a = n(736), o = n(8), r = n(79), s = n(281), l = n(554), u = n(210), d = n(556), c = n(558),
        h = n(245), f = n(1).default.getLogger("Thunder.VipDownload.try-task"), p = r.UserHelperNS.getHelper();
    !function (e) {
        let t = void 0, n = !1, r = !1, g = !1, k = !1;
        const m = u.TaskEventContainerNS.getEventContainer();

        function T(e, t) {
            f.information("tryButtonShow");
            let n = new Map, i = x(), o = M(e);
            n.set("is_login", i), n.set("vip_type", 0), n.set("taskid", e), n.set("gcid", o), n.set("btn_type", t);
            let r = {attribute1: "jssy_show", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", r)
        }

        function v(e, t) {
            f.information("tryOpenVipButtonShow");
            let n = new Map, i = x(), o = M(e);
            n.set("is_login", i), n.set("is_vip", 0), n.set("vip_type", 0), n.set("taskid", e), n.set("gcid", o), n.set("btn_type", t);
            let r = {attribute1: "jssy_kthy_show", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", r)
        }

        function y(e) {
            if (r) return;
            r = !0, f.information("trySuccess");
            let n = new Map, i = x(), o = M(e);
            n.set("is_login", i), n.set("is_vip", 0), n.set("vip_type", 0), n.set("taskid", e), n.set("gcid", o), n.set("btn_type", t), n.set("js_type", 3);
            let s = {attribute1: "jssy_succ", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", s)
        }

        function S(e, i, o) {
            if (!n) return;
            n = !1, f.information("tryEnd");
            let r = new Map, s = x(), l = M(e), u = i ? "fail" : "succ";
            r.set("is_login", s), r.set("is_vip", 0), r.set("vip_type", 0), r.set("taskid", e), r.set("gcid", l), r.set("btn_type", t), r.set("result", u), o && r.set("errcode", o);
            let d = {attribute1: "jssy_end", extData: r};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", d)
        }

        function w(e, t) {
            f.information("superTryButtonShow");
            let n = new Map, i = x(), o = A(), r = E(), s = M(e);
            n.set("is_login", i), n.set("is_vip", o), n.set("vip_type", r), n.set("taskid", e), n.set("gcid", s), n.set("btn_type", t);
            let l = {attribute1: "cjjssy_show", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", l)
        }

        function b(e, t) {
            f.information("superTryOpenVipButtonShow");
            let n = new Map, i = x(), o = A(), r = E(), s = 1 === o ? "vipsj" : "vipkt", l = M(e);
            n.set("is_login", i), n.set("is_vip", o), n.set("vip_type", r), n.set("taskid", e), n.set("gcid", l), n.set("biz_type", s), n.set("btn_type", t);
            let u = {attribute1: "cjjssy_ktch_show", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", u)
        }

        function C(e) {
            if (r) return;
            r = !0, f.information("superTrySuccess");
            let n = new Map, i = x(), o = A(), s = E(), l = M(e);
            let u = h.KuainiaoManagerNS.getManager().status === c.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive ? 1 : 3;
            n.set("is_login", i), n.set("is_vip", o), n.set("vip_type", s), n.set("taskid", e), n.set("gcid", l), n.set("btn_type", t), n.set("js_type", u);
            let d = {attribute1: "cjjssy_succ", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", d)
        }

        function N(e, i, o) {
            if (!n) return;
            n = !1, f.information("superTryEnd");
            let r = new Map, s = x(), l = A(), u = E(), d = M(e), c = i ? "fail" : "succ";
            r.set("is_login", s), r.set("is_vip", l), r.set("vip_type", u), r.set("taskid", e), r.set("gcid", d), r.set("btn_type", t), r.set("result", c), o && r.set("errcode", o);
            let h = {attribute1: "cjjssy_end", extData: r};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", h)
        }

        function D(e) {
            g = !1, k = !1, _(e, l.DownloadManagerNS.getDownloadManager().getVipTaskInfo(e))
        }

        function I(e, t) {
            if (e === l.DownloadManagerNS.getDownloadManager().expandTaskId && _(e, t), t && t.taskType === i.VipDownloadDefineNS.VipTaskType.Try) switch (t.taskStatus) {
                case i.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                    t.isSuper ? C(e) : y(e);
                    break;
                case i.VipDownloadDefineNS.VipTaskStatus.CommitFailed:
                case i.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed:
                    let n = d.TryTaskCacheNS.getCacheManager().getTask(e);
                    n && n.error && (t.isSuper ? N(e, n.error.errorStep, n.error.result) : S(e, n.error.errorStep, n.error.result));
                    break;
                case i.VipDownloadDefineNS.VipTaskStatus.Finished:
                case i.VipDownloadDefineNS.VipTaskStatus.Unkown:
                    t.isSuper ? N(e) : S(e)
            }
        }

        function _(e, t) {
            t && t.taskType === i.VipDownloadDefineNS.VipTaskType.Try && (t.taskStatus === i.VipDownloadDefineNS.VipTaskStatus.Init ? t.isSuper ? w(e, "task") : T(e, "task") : t.taskStatus > i.VipDownloadDefineNS.VipTaskStatus.Init && t.taskStatus < i.VipDownloadDefineNS.VipTaskStatus.Finished ? g || (g = !0, t.isSuper ? b(e, "cjjssying") : v(e, "sying")) : t.taskStatus === i.VipDownloadDefineNS.VipTaskStatus.Finished && (k || (k = !0, t.isSuper ? b(e, "cjjssyend") : v(e, "syend"))))
        }

        function x() {
            let e = 0;
            return p.isLogin && (e = 1), e
        }

        function A() {
            let e = 0;
            return p.isVip && (e = 1), e
        }

        function E() {
            let e = 0;
            return p.isPlatinumVip ? e = 3 : p.isVip && (e = 2), e
        }

        function M(e) {
            const t = s.TaskManagerNS.getTaskManager().getTask(e);
            let n = "";
            if (t) {
                const e = t.getTaskBase();
                !e || e.taskType !== o.DownloadKernel.TaskType.P2sp && e.taskType !== o.DownloadKernel.TaskType.Emule || (n = e.gcid)
            }
            return n
        }

        m.attachListener(u.TaskEventNS.taskAcclerateStatusChanged, I), m.attachListener(u.TaskEventNS.taskExpand, D), e.tryButtonShow = T, e.tryButtonClick = function (e, i) {
            f.information("tryButtonClick"), n = !0, r = !1;
            let o = new Map, s = x(), l = M(e);
            o.set("is_login", s), o.set("vip_type", 0), o.set("taskid", e), o.set("gcid", l), o.set("clickid", i), t = i;
            let u = {attribute1: "jssy_click", extData: o};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", u)
        }, e.tryOpenVipButtonShow = v, e.tryOpenVipButtonClick = function (e, t) {
            f.information("tryOpenVipButtonClick");
            let n = new Map, i = x(), o = M(e);
            n.set("is_login", i), n.set("is_vip", 0), n.set("vip_type", 0), n.set("taskid", e), n.set("gcid", o), n.set("clickid", t);
            let r = {attribute1: "jssy_kthy_click", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", r)
        }, e.trySuccess = y, e.tryEnd = S, e.superTryButtonShow = w, e.superTryButtonClick = function (e, i) {
            f.information("superTryButtonClick"), n = !0;
            let o = new Map, r = x(), s = A(), l = E(), u = M(e);
            o.set("is_login", r), o.set("is_vip", s), o.set("vip_type", l), o.set("taskid", e), o.set("gcid", u), o.set("clickid", i), t = i;
            let d = {attribute1: "cjjssy_click", extData: o};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", d)
        }, e.superTryOpenVipButtonShow = b, e.superTryOpenVipButtonClick = function (e, t) {
            f.information("superTryOpenVipButtonClick");
            let n = new Map, i = x(), o = A(), r = E(), s = 1 === o ? "vipsj" : "vipkt", l = M(e);
            n.set("is_login", i), n.set("is_vip", o), n.set("vip_type", r), n.set("taskid", e), n.set("gcid", l), n.set("biz_type", s), n.set("clickid", t);
            let u = {attribute1: "cjjssy_ktch_click", extData: n};
            a.StatUtilitiesNS.trackEvent("xlx_vip_event", u)
        }, e.superTrySuccess = C, e.superTryEnd = N, e.onTaskExpand = D, e.onTaskAcclerateStatusChanged = I
    }(t.TryStatNS || (t.TryStatNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(27), r = n(9), s = n(1), l = n(60), u = n(8), d = n(31), c = n(37), h = n(139), f = n(57),
        p = n(14), g = n(3), k = d.DownloadKernelTaskManager.getTaskManager(),
        m = c.DownloadKernelEventManager.getEventManager(), T = s.default.getLogger("SubtiteManager");
    !function (e) {
        const t = a.resolve(__profilesDir, "SubTitleDownload/"),
            n = a.resolve(__profilesDir, "SubTitleDownload/subtitledata.json");

        class s extends l.default {
            constructor() {
                super(...arguments), this.subtitleData = {}, this.taskStatusChangedEventTable = []
            }

            init() {
                return i(this, void 0, void 0, function* () {
                    T.information("Init");
                    let e = yield r.FileSystemAWNS.existsAW(n);
                    if (e) {
                        let e = yield r.FileSystemAWNS.readFileAW(n);
                        if (e) {
                            try {
                                this.subtitleData = JSON.parse(e.toString())
                            } catch (e) {
                                T.warning(e)
                            }
                            T.information("Init, subtitle data", this.subtitleData)
                        }
                    } else (e = yield r.FileSystemAWNS.mkdirsAW(t)) && (yield r.FileSystemAWNS.writeFileAW(n, "{}"));
                    g.remote.ipcMain.on(p.ThunderChannelList.channelRMGetSutitleByCid, (e, t, n) => i(this, void 0, void 0, function* () {
                        T.information("channelRMGetSutitleByCid cid and taskid ", t, n);
                        let i = yield this.querySubtitleByCid(t, n);
                        T.information("send channelMRGetSutitleByCidResult"), e.sender.isDestroyed() || e.sender.send(p.ThunderChannelList.channelMRGetSutitleByCidResult, i)
                    })), g.remote.ipcMain.on(p.ThunderChannelList.channelRMGetSutitleByName, (e, t, n) => i(this, void 0, void 0, function* () {
                        T.information("channelRMGetSutitleByName name and taskid ", t, n);
                        let i = yield this.querySubtitleByName(t, n);
                        T.information("send channelMRGetSutitleByNameResult"), e.sender.isDestroyed() || e.sender.send(p.ThunderChannelList.channelMRGetSutitleByNameResult, i)
                    })), g.remote.ipcMain.on(p.ThunderChannelList.channelRMDownloadSutitle, (e, t, n, a) => i(this, void 0, void 0, function* () {
                        T.information("channelRMDownloadSutitle taskid ", n), yield this.downloadSubtitle(t, n, a)
                    })), g.remote.ipcMain.on(p.ThunderChannelList.channelRMGetDisplayName, (e, t) => i(this, void 0, void 0, function* () {
                        T.information("channelRMGetDisplayName taskid ", t);
                        let n = this.getDisaplayName(t);
                        e.sender.send(p.ThunderChannelList.channelMRGetDisplayNameResult, n)
                    }))
                })
            }

            getDisaplayName(e) {
                let t = [], n = k.getTaskFromTaskId(e), i = n.getTaskBaseInfo(), a = n.getType();
                if (a === u.DownloadKernel.TaskType.P2sp || a === u.DownloadKernel.TaskType.Emule) {
                    let e = i.taskName, a = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid);
                    T.information(" fileName: ", e, " cid: ", a);
                    let o = {fileName: e, cid: a};
                    o && t.push(o)
                } else if (a === u.DownloadKernel.TaskType.Bt) {
                    let e = n.getExtraObject();
                    if (0 === e.getDownloadFile().length) return null;
                    let i = e.getBtFileList();
                    for (let [e, n]of i) {
                        let i = n.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.FileName);
                        if (f.TaskUtilHelper.getTaskFileType(i) === f.TaskUtilHelper.FileExtType.Video) {
                            let a = n.getBtFileAttribute(u.DownloadKernel.BtFileAttribute.Cid);
                            T.information("btfile inde: ", e, " fileName: ", i, " cid: ", a);
                            let o = {fileName: i, cid: a};
                            o && t.push(o)
                        }
                    }
                } else if (a === u.DownloadKernel.TaskType.Group) {
                    let e = n.getExtraObject(), i = e.getSubTaskCount();
                    for (let n = 0; n < i; ++n) {
                        let i = e.getSubTaskByIndex(n), a = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName);
                        if (f.TaskUtilHelper.getTaskFileType(a) === f.TaskUtilHelper.FileExtType.Video) {
                            let e = i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid);
                            T.information(" fileName: ", a, " cid: ", e);
                            let n = {fileName: a, cid: e};
                            n && t.push(n)
                        }
                    }
                }
                return T.information("getDisaplayName ret ", t), t
            }

            querySubtitleByCid(e, t) {
                return i(this, void 0, void 0, function* () {
                    T.information("querySubtitleByCid");
                    let n = [], i = null;
                    try {
                        i = yield o.default.get(`http://sub.xmp.sandai.net:8000/subxl/${e}.json`), T.information("response: ", i)
                    } catch (e) {
                        T.warning(e)
                    }
                    if (null !== i && void 0 !== i.status && 200 === i.status && void 0 !== i.data && null !== i.data) {
                        T.information("sublist: ", i.data.sublist);
                        let e = i.data.sublist;
                        if (e && e.length > 1) for (let i of e) {
                            let e = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                            e.scid = i.scid, e.surl = i.surl, e.sname = i.sname, e.language = i.language, e.rate = i.rate, (yield this.isAlreadyDownload(e.scid, t)) ? e.status = 1 : e.status = 0, e && n.push(e)
                        }
                    }
                    return n
                })
            }

            querySubtitleByName(e, t) {
                return i(this, void 0, void 0, function* () {
                    T.information("querySubtitleByName");
                    let n = [];
                    e = encodeURI(e);
                    let i = null;
                    try {
                        i = yield o.default.get(`http://subtitle.kankan.xunlei.com:8000/search.json/mname=${e}`), T.information("querySubtitleByName response: ", i)
                    } catch (e) {
                        T.warning(e)
                    }
                    if (null !== i && void 0 !== i.status && 200 === i.status && void 0 !== i.data && null !== i.data) {
                        let e = i.data.sublist;
                        if (e && e.length >= 1) for (let i of e) if (i.scid) {
                            let e = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                            e.scid = i.scid, e.surl = i.surl, e.sname = i.sname, e.language = i.language;
                            let a = parseInt(i.simility, 10), o = 0;
                            o = (a *= 100) < 15 ? 0 : a < 35 ? 1 : a < 55 ? 2 : a < 85 ? 3 : a < 92 ? 4 : 5, e.rate = o, (yield this.isAlreadyDownload(e.scid, t)) ? e.status = 1 : e.status = 0, e && n.push(e)
                        }
                    }
                    return n
                })
            }

            downloadSubtitle(e, t, n) {
                return i(this, void 0, void 0, function* () {
                    T.information("downloadSubtitle");
                    let i = e.surl, o = i.substring(i.lastIndexOf(".")),
                        r = n.substring(0, n.lastIndexOf(".")) + ".XLSUB" + o, s = this.getSaveDir(t);
                    T.information("downloadSubtitle fileName", r), T.information("downloadSubtitle filePath", s);
                    let l = a.join(s, r);
                    T.information("downloadSubtitle:", s, l);
                    let d = {taskBaseInfo: {savePath: s, taskName: r}, p2spTaskInfo: {url: i}, isBackground: !0},
                        c = yield k.createTask(u.DownloadKernel.TaskType.P2sp, d);
                    if (null !== c) {
                        let n = c.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskId);
                        this.attachTaskStatusChangedEvent(n, e, t), h.DownloadDispatchNS.startTask(n)
                    }
                })
            }

            save(e) {
                return i(this, void 0, void 0, function* () {
                    T.information("save"), T.information(e);
                    let t = JSON.stringify(e, void 0, 2);
                    T.information("save jsonStr: ", t), yield r.FileSystemAWNS.writeFileAW(n, t)
                })
            }

            attachTaskStatusChangedEvent(e, t, n) {
                T.information("Sunbtitle taskId: ", e), T.information("item: ", t), void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = m.attachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, (...o) => i(this, void 0, void 0, function* () {
                    let i = !1;
                    do {
                        if (!o) {
                            T.information("args is null");
                            break
                        }
                        if (o[0] !== u.DownloadKernel.TaskEventType.StatusChanged) {
                            T.information("args[0] is not StatusChanged");
                            break
                        }
                        let r = o[1];
                        if (!r) {
                            T.information("taskList is null");
                            break
                        }
                        for (let o = 0; o < r.length; ++o) {
                            let s = r[o];
                            if (!s) continue;
                            if (s.getId() !== e) continue;
                            let l = s.getTaskStatus();
                            if (T.information("get status ", l), l === u.DownloadKernel.TaskStatus.Succeeded) {
                                T.information("send: channelMRDownloadSutitleSuc"), g.ipcRenderer.send(p.ThunderChannelList.channelMRDownloadSutitleSuc);
                                let i = [];
                                T.information("subtitleData: ", this.subtitleData), T.information("befor has sutitleTaskId "), this.subtitleData[n] && (T.information("has sutitleTaskId ", e), i = this.subtitleData[n]), T.information("after has sutitleTaskId ");
                                let o = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                                o.scid = t.scid, o.surl = t.surl, o.sname = s.getTaskName().replace(".XLSUB", ""), o.language = t.language, o.rate = t.rate, o.status = 1;
                                let r = this.getSaveDir(e), l = s.getTaskName();
                                o.path = a.join(r, l), i.push(o), this.subtitleData[n] = i, yield this.save(this.subtitleData), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (T.information("取消监听 ", this.taskStatusChangedEventTable[e]), m.detachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null)
                            } else l === u.DownloadKernel.TaskStatus.Failed && (T.information("send: channelMRDownloadSutitleFail"), g.ipcRenderer.send(p.ThunderChannelList.channelMRDownloadSutitleFail), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (T.information("取消监听 ", this.taskStatusChangedEventTable[e]), m.detachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null));
                            i = !0
                        }
                    } while (0);
                    return i
                })))
            }

            getSaveDir(e) {
                T.information("getSaveDir");
                let t = "", n = k.getTaskFromTaskId(e), i = n.getTaskName(), o = n.getType();
                if (n && (t = n.getSavePath()), o === u.DownloadKernel.TaskType.Bt) {
                    n.getExtraObject().getDownloadFile().length > 1 && (t = a.join(t, i))
                }
                return T.information("name and save dir: ", i, t), t
            }

            isAlreadyDownload(e, t) {
                return i(this, void 0, void 0, function* () {
                    T.information("isAlreadyDownload cid ", e);
                    let n = !1, i = this.subtitleData[t];
                    if (T.information("isAlreadyDownload subtitleList ", i), i && i.length >= 1) for (let t of i) if (t.scid === e) {
                        let e = t.path;
                        T.information("isAlreadyDownload fielPath ", e), (yield r.FileSystemAWNS.existsAW(e)) && (n = !0)
                    }
                    return T.information("isAlreadyDownload ret ", n), n
                })
            }
        }

        e.SubtitleManager = s;
        const d = new s;
        e.getSubtitleManger = function () {
            return d
        }, e.init = function () {
            return i(this, void 0, void 0, function* () {
                yield d.init()
            })
        }
    }(t.SubtitleManagerNS || (t.SubtitleManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(2), r = n(5), s = n(68), l = n(10), u = n(60), d = n(23), c = n(9), h = n(103), f = n(253),
        p = n(85), g = n(67), k = n(814), m = n(247), T = n(13), v = n(1), y = n(45), S = n(31),
        w = v.default.getLogger("command_line"), b = S.DownloadKernelTaskManager.getTaskManager(),
        C = r.default(o.join(__rootDir, "../bin/ThunderNewTask.node")),
        N = r.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    const D = new class extends u.default {
        constructor() {
            super(...arguments), this.readyToShow = !1
        }

        init() {
            a.remote.getCurrentWindow().isVisible() ? this.readyToShow = !0 : a.remote.getCurrentWindow().on("ready-to-show", () => {
                this.readyToShow = !0
            }), C.setCommandLineCallback(e => {
                if (w.information("on command ", e), this.readyToShow && this.needBringToTop(e) && this.bringMainWindowToTop(), void 0 !== e && "" !== e.trim()) {
                    let t = l.ThunderUtil.parseCommandLine(e);
                    t.length > 0 && this.executeCmdLine(t).catch()
                }
            })
        }

        onCommand(e, t, n) {
            return i(this, void 0, void 0, function* () {
                if (w.information(e, t), "path" === e) {
                    let e = o.extname(t);
                    ".torrent" === (e = e.toLowerCase()) ? (this.readyToShow && this.bringMainWindowToTop(), n = "command" === n ? "Torrent" : n, this.ensureDkLoaded(e => i(this, void 0, void 0, function* () {
                        if (e) {
                            let e = yield f.TaskUtilitiesAWNS.parserBtFileInfoAW(t);
                            if (null === e) h.ThunderNewTask.createBtTaskWindow({
                                type: "file",
                                seedFile: t
                            }, {source: n}); else {
                                let i = JSON.stringify(e);
                                h.ThunderNewTask.createBtTaskWindow({data: i, type: "file", seedFile: t}, {source: n})
                            }
                        }
                    }))) : ".td" !== e && ".bc!" !== e && ".part" !== e && ".xltd" !== e || (n = "command" === n ? "TD" : n, this.ensureDkLoaded(e => {
                        e && p.TaskOperatorNs.importUncompletedFromFile(t, n)
                    }))
                } else if ("task" === e) {
                    if ("newtask" === t) {
                        let e = "button=create";
                        T.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), T.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=taskbar"), w.information("trackEvent", "core_event", "create_task_click", "click_source=taskbar"), h.ThunderNewTask.createPreNewTaskWindow(null)
                    } else if ("startall" === t) {
                        let e = "button=start";
                        T.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), g.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                            setTimeout(() => {
                                p.TaskOperatorNs.startAll()
                            }, 0)
                        })
                    } else if ("pauseall" === t) {
                        let e = "button=pause";
                        T.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), p.TaskOperatorNs.pauseAll()
                    }
                } else if ("shell" === e) {
                    if ("exit" === t) {
                        let e = "button=exit";
                        T.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), m.quitPromises.run()
                    }
                } else if ("speedMode" === e) ; else if ("unionfile" === e) {
                    let e = t;
                    h.ThunderNewTask.createUnionTask(e).catch()
                } else "-autotestinjectfile" === e && (yield c.FileSystemAWNS.existsAW(t)) && require(t).init(k.DownloadKernelTestNS)
            })
        }

        bringMainWindowToTop() {
            if (this.readyToShow) {
                let e = a.remote.getCurrentWindow();
                null !== e && (e.isMinimized() && e.restore(), e.show(), y.ToolsUtilitiesAWNS.setForegroundWindow(N, e))
            }
        }

        ensureDkLoaded(e) {
            b.isDkLoaded() ? e(!0) : g.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, t => {
                e(0 === t)
            })
        }

        needBringToTop(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if (-1 !== e.indexOf("-window:bringtotop")) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        executeCmdLine(e) {
            return i(this, void 0, void 0, function* () {
                for (let t of e) {
                    if ("" === t) continue;
                    let e = "", n = "";
                    if (yield c.FileSystemAWNS.existsAW(t)) e = "path", n = t; else if (s.URLHelperNS.isSupportUrl(t)) e = "url", n = t; else {
                        let i = t.indexOf(":");
                        -1 === i ? e = t : i > 1 && (e = t.substring(1, i), i !== t.length - 1 && (n = t.substring(i + 1)))
                    }
                    this.onCommand(e, n, "command").catch(), this.fireEvent(d.NodeEventMesssageNS.eventOnCommand, e, n)
                }
            })
        }
    };
    t.default = D
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(5), s = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        l = r.default(a.join(__rootDir, "../bin/ThunderMsgChannel.node")), u = n(6), d = n(65), c = n(60), h = n(13),
        f = o.default.getLogger("MessageChannel");
    let p = null, g = a.join(__rootDir, "../../xluagc.dll"), k = s.getFileVersion(g);
    !function (e) {
        let t, n;
        !function (e) {
            e[e.Init = 0] = "Init", e[e.Connecting = 1] = "Connecting", e[e.Connected = 2] = "Connected", e[e.ConnectRecovering = 3] = "ConnectRecovering"
        }(t = e.LongConnectState || (e.LongConnectState = {})), function (e) {
            e[e.Init = 0] = "Init", e[e.Logining = 1] = "Logining", e[e.Login = 2] = "Login", e[e.LoginFailed = 3] = "LoginFailed", e[e.Logouting = 4] = "Logouting", e[e.Logout = 5] = "Logout", e[e.LogoutFailed = 6] = "LogoutFailed"
        }(n = e.UserState || (e.UserState = {})), e.eventUserLogin = "OnMessageChannelUserLogin", e.eventUserLoginFailed = "OnMessageChannelUserLoginFailed", e.eventUserLogout = "OnMessageChannelUserLogout", e.eventUserLogoutFailed = "OnMessageChannelUserLogoutFailed", e.eventServiceCallbackId = "OnMessageChannelServiceCallback", e.eventGroupServiceCallbackId = "OnMessageChannelGroupServiceCallback";
        const a = new class extends c.default {
            constructor() {
                super(...arguments), this.longConnectState = t.Init, this.userState = n.Init, this.userLoginEventId = void 0, this.userLogoutEventId = void 0, this.userCheckInTryTimes = 0, this.userCheckOutTryTimes = 0, this.maxTryTimes = 3, this.userId = "0", this.statDataInfo = new Map
            }

            init() {
                let e = s.getPeerID();
                f.information("[MsgChannelStat]init appid:0, peerid:", e);
                let t = l.init(e, "0", this.longConnectCallback.bind(this), this.userStateCallback.bind(this));
                f.information("init result: ", t);
                let n = "sdk_version=" + k;
                return n += t ? ",ret=1" : ",ret=0", f.information("[MsgChannelStat]longlink_xluagcinit extData: ", n), h.XLStatNS.trackEvent("community", "longlink_xluagcinit", "", 0, 0, 0, 0, n), t && (this.userLoginEventId = u.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", this.onUserLogin.bind(this)), this.userLogoutEventId = u.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", this.onUserLogout.bind(this)), p = setInterval(() => {
                    this.sendMsgCountStat()
                }, 6e4)), t
            }

            uninit() {
                return void 0 !== this.userLoginEventId && (u.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", this.userLoginEventId), this.userLoginEventId = void 0), void 0 !== this.userLogoutEventId && (u.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogout", this.userLogoutEventId), this.userLogoutEventId = void 0), p && (f.information("killTimer..."), clearInterval(p), p = null), l.uninit()
            }

            registerService(e) {
                return l.registerService(e, this.serviceCallback.bind(this))
            }

            unregisterService(e) {
                return l.unregisterService(e)
            }

            joinGroup(e) {
                return l.joinGroup(e, this.groupServiceCallback.bind(this))
            }

            leaveGroup(e) {
                return l.leaveGroup(e)
            }

            getLongConnectState() {
                return this.longConnectState
            }

            getUserState() {
                return this.userState
            }

            getCurrentTime() {
                return Math.floor((new Date).getTime() / 1e3).toString()
            }

            sendMsgCountStat() {
                for (let [e, t]of this.statDataInfo) if (e && "" !== e && t) {
                    let e = "sdk_version=" + k + ",msg_count=" + t.msgCount + ",cmdtype=" + t.cmdType + ",begin_time=" + t.beginTime + ",end_time=" + t.endTime + ",uid=" + t.userId;
                    "" !== t.serviceType ? (e = e + ",servicetype=" + t.serviceType, f.information("[MsgChannelStat]longlink_recvmessage_count extdata:", e), h.XLStatNS.trackEvent("community", "longlink_recvmessage_count", "", 0, 0, 0, 0, e)) : "" !== t.groupId && (e = e + ",groupid=" + t.groupId, f.information("[MsgChannelStat]longlink_recvmessage_count extdata:", e), h.XLStatNS.trackEvent("community", "longlink_recvmessage_count", "", 0, 0, 0, 0, e))
                }
                this.statDataInfo.clear()
            }

            getUserID() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        d.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                            f.information("getUserID:userid = ", t), e(t)
                        })
                    })
                })
            }

            getSessionID() {
                return i(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        d.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (t) {
                            f.information("getSessionID:sessionid = ", t), e(t)
                        })
                    })
                })
            }

            onUserLogin(e) {
                return i(this, void 0, void 0, function* () {
                    if (f.information("onUserLogin userState:", this.userState), this.longConnectState === t.Connected) {
                        let t = yield this.getSessionID();
                        f.information("onUserLogin userCheckIn uid = ", e, " token = ", t), this.userCheckInTryTimes = 0, this.userState = n.Logining, l.userCheckIn(e, t)
                    }
                })
            }

            onUserLogout() {
                f.information("onUserLogout userState:", this.userState), this.userState !== n.Logining && this.userState !== n.Login || (this.userCheckOutTryTimes = 0, this.userState = n.Logouting, l.userCheckOut())
            }

            onLongConnectSuccess() {
                return i(this, void 0, void 0, function* () {
                    this.longConnectState = t.Connected;
                    let e = yield this.getUserID(), i = yield this.getSessionID();
                    e && "" !== e && this.userState !== n.Logining && this.userState !== n.Login && setTimeout(() => {
                        f.information("longConnectCallback user has already logged in. userId:", e, ", sessionId:", i, ", start checking in message channel."), this.userCheckInTryTimes = 0, this.userState = n.Logining, l.userCheckIn(e, i)
                    }, 1)
                })
            }

            longConnectCallback(e) {
                return i(this, void 0, void 0, function* () {
                    f.information("longConnectCallback state:", e);
                    let n = "sdk_version=" + k;
                    1 === e ? (this.longConnectState = t.Connecting, f.information("[MsgChannelStat]longConnectCallback connecting:", this.longConnectState)) : 2 === e ? (f.information("[MsgChannelStat]longConnectCallback connect success."), yield this.onLongConnectSuccess(), n += ",ret=1", f.information("[MsgChannelStat]longlink_deviceloginend extdata:", n), h.XLStatNS.trackEvent("community", "longlink_deviceloginend", "", 0, 0, 0, 0, n)) : 3 === e && (f.information("[MsgChannelStat]longConnectCallback connect recovering."), this.longConnectState = t.ConnectRecovering, n += ",ret=0", f.information("longlink_deviceloginend extdata:", n), h.XLStatNS.trackEvent("community", "longlink_deviceloginend", "", 0, 0, 0, 0, n))
                })
            }

            onMessageChannelUserLogin() {
                f.information("userStateCallback login success, this.userState:", this.userState), this.userState = n.Login, this.userCheckInTryTimes = 0, this.fireEvent(e.eventUserLogin)
            }

            onMessageChannelUserLoginFailed() {
                return i(this, void 0, void 0, function* () {
                    if (f.information("userStateCallback login failed, this.userState:", this.userState, ", userCheckInTryTimes:", this.userCheckInTryTimes), this.userState = n.LoginFailed, this.fireEvent(e.eventUserLoginFailed), this.userCheckInTryTimes = this.userCheckInTryTimes + 1, this.userCheckInTryTimes < this.maxTryTimes) {
                        let e = yield this.getUserID(), t = yield this.getSessionID();
                        e && "" !== e && setTimeout(() => {
                            f.information("uid = ", e, " token = ", t), f.information("userStateCallback retry login userCheckInTryTimes:", this.userCheckInTryTimes), this.userState = n.Logining, l.userCheckIn(e, t)
                        }, 1)
                    }
                })
            }

            onMessageChannelUserLogout() {
                f.information("userStateCallback logout success."), this.userState = n.Logout, this.userCheckOutTryTimes = 0, this.fireEvent(e.eventUserLogout)
            }

            onMessageChannelUserLogoutFailed() {
                f.information("userStateCallback logout failed, self.UserState:", this.userState), this.userState = n.LogoutFailed, this.fireEvent(e.eventUserLogoutFailed), f.information("userStateCallback retry logout, this.userCheckOutTryTimes:", this.userCheckOutTryTimes), this.userCheckOutTryTimes = this.userCheckOutTryTimes + 1, this.userCheckOutTryTimes < this.maxTryTimes && setTimeout(() => {
                    this.userState = n.Logouting, l.userCheckOut(), f.information("userStateCallback retry logout, userCheckOutTryTimes", this.userCheckOutTryTimes)
                }, 1)
            }

            userStateCallback(e) {
                return i(this, void 0, void 0, function* () {
                    f.information("userStateCallback state = ", e);
                    let t = "sdk_version=" + k;
                    if (0 === e) {
                        this.onMessageChannelUserLogin(), t += ",ret=1";
                        let e = yield this.getUserID();
                        this.userId = e, f.information("[MsgChannelStat]longlink_userloginend extdata:", t), h.XLStatNS.trackEvent("community", "longlink_userloginend", "", 0, 0, 0, 0, t)
                    } else 1 === e ? (yield this.onMessageChannelUserLoginFailed(), this.userId = "0", t += ",ret=0", f.information("[MsgChannelStat]longlink_userloginend extdata:", t), h.XLStatNS.trackEvent("community", "longlink_userloginend", "", 0, 0, 0, 0, t)) : 2 === e ? (this.onMessageChannelUserLogout(), this.userId = "0", this.sendMsgCountStat()) : 3 === e && (this.userId = "0", this.onMessageChannelUserLogoutFailed())
                })
            }

            serviceCallback(t, n, i) {
                f.information("[MsgChannelStat]serviceCallback serviceType:", t, ", msgCount:", n, ", msgArray:", i), this.fireEvent(e.eventServiceCallbackId, t, i);
                let a = "serviceType_" + t + "_" + this.userId;
                if (this.statDataInfo.has(a)) {
                    let e = this.statDataInfo.get(a);
                    e.endTime = this.getCurrentTime(), e.msgCount = e.msgCount + n
                } else {
                    let e = {
                        serviceType: "",
                        groupId: "",
                        cmdType: "",
                        beginTime: "",
                        endTime: "",
                        msgCount: 0,
                        userId: "0"
                    };
                    e.beginTime = this.getCurrentTime(), e.endTime = this.getCurrentTime(), e.msgCount = n, e.serviceType = t, e.cmdType = "1", e.userId = this.userId, this.statDataInfo.set(a, e)
                }
            }

            groupServiceCallback(t, n, i) {
                f.information("groupServiceCallback groupId:", t, ", msgCount:", n, ", msgArray:", i), this.fireEvent(e.eventGroupServiceCallbackId, t, i);
                let a = "groupId_" + t + "_" + this.userId;
                if (this.statDataInfo.has(a)) {
                    let e = this.statDataInfo.get(a);
                    e.endTime = this.getCurrentTime(), e.msgCount = e.msgCount + n
                } else {
                    let e = {
                        serviceType: "",
                        groupId: "",
                        cmdType: "",
                        beginTime: "",
                        endTime: "",
                        msgCount: 0,
                        userId: "0"
                    };
                    e.beginTime = this.getCurrentTime(), e.endTime = this.getCurrentTime(), e.msgCount = n, e.groupId = t, e.cmdType = "2", e.userId = this.userId, this.statDataInfo.set(a, e)
                }
            }
        };
        e.init = function () {
            return a.init()
        }, e.uninit = function () {
            return a.uninit()
        }, e.registerService = function (e) {
            return a.registerService(e)
        }, e.unregisterService = function (e) {
            return a.unregisterService(e)
        }, e.attachListener = function (e, t) {
            a.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            a.detachListener(e, t)
        }, e.joinGroup = function (e) {
            return a.joinGroup(e)
        }, e.leaveGroup = function (e) {
            return a.leaveGroup(e)
        }, e.getLongConnectState = function () {
            return a.getLongConnectState()
        }, e.getUserState = function () {
            return a.getUserState()
        }
    }(t.MessageChannelNS || (t.MessageChannelNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(258), a = n(22), o = n(1), r = n(36), s = n(3), l = o.default.getLogger("Bt-task-renderer");

    class u {
        constructor() {
            this.isPopWndExist = !1
        }

        whetherShowEntry() {
            return this.getBrowserInfos().length > 0
        }

        whetherPopUp() {
            let e = a.ConfigNS.getValue("ThunderFirstInstall", "IsFirstInstall", 1);
            return l.information("是否是重新安装迅雷:", e), 1 === e && this.getBrowserInfos().length > 0
        }

        popUpBrowserGuide() {
            if (this.isPopWndExist) return;
            const e = s.remote.getGlobal("mainRendererWindow");
            e && !e.isVisible() ? e.once("show", () => {
                setTimeout(() => {
                    this.interalShow()
                }, 1e3)
            }) : this.interalShow()
        }

        interalShow() {
            r.MessageBox.custom("BrowserConfigGuide", {}, {modal: !1}).then(e => {
                this.isPopWndExist = !1
            }).catch(e => {
                this.isPopWndExist = !1
            }), this.isPopWndExist = !0
        }

        getBrowserInfos() {
            let e = [], t = i.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("360安全浏览器");
            t && e.push(t);
            let n = i.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("搜狗浏览器");
            n && e.push(n);
            let a = i.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("QQ浏览器");
            return a && e.push(a), l.information("已安装的浏览器:", e), e
        }
    }

    t.default = function () {
        return u.instance || (u.instance = new u), u.instance
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(20), o = n(2), r = n(1), s = n(5), l = n(9), u = n(23), d = n(22), c = n(817),
        h = r.default.getLogger("Config"), f = s.default(o.join(__rootDir, "../bin/ThunderHelper.node"));

    class p extends d.Config {
        init(e) {
            return i(this, void 0, void 0, function* () {
                if (!this.isInit) {
                    if (this.configPath = e, yield l.FileSystemAWNS.existsAW(e)) {
                        let t = yield l.FileSystemAWNS.readFileAW(e);
                        if (t) {
                            let e = null;
                            try {
                                e = c.IniNS.parse(t.toString())
                            } catch (e) {
                                h.warning(e)
                            }
                            this.isInit = !0, this.mergeConfigData(e), this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventBHOConfigInitFinished)
                        }
                    } else {
                        let t = o.dirname(e);
                        yield l.FileSystemAWNS.mkdirsAW(t), this.isInit = !0, this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventBHOConfigInitFinished)
                    }
                }
            })
        }

        save() {
            return i(this, void 0, void 0, function* () {
                if (null !== this.configPath && void 0 !== this.configPath && "" !== this.configPath && this.isInit) {
                    let e = c.IniNS.stringify(this.configData);
                    yield l.FileSystemAWNS.writeFileAW(this.configPath, e)
                }
            })
        }

        saveSync() {
            let e = c.IniNS.stringify(this.configData);
            null !== this.configPath && void 0 !== this.configPath && "" !== this.configPath && this.isInit && a.writeFileSync(this.configPath, e)
        }

        fireValueChangedEvent(e, t, n, i) {
            this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventBHOConfigValueChanged, e, t, n, i)
        }

        attachListener(e, t) {
            do {
                if (e === u.NodeEventMesssageNS.eventBHOConfigInitFinished) {
                    if (this.isInit) {
                        t(this.isInit);
                        break
                    }
                    this.eventContainer.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }
    }

    t.BHOConfig = p;
    const g = new p;
    !function (e) {
        e.init = function () {
            return i(this, void 0, void 0, function* () {
                let e = f.getAppDataLocalLowPath();
                if (null !== e && void 0 !== e && "" !== e) {
                    let t = o.join(e, "Thunder Network\\Thunder\\BHO\\config.ini");
                    yield g.init(t)
                }
            })
        }, e.save = function () {
            return i(this, void 0, void 0, function* () {
                yield g.save()
            })
        }, e.saveSync = function () {
            g.saveSync()
        }, e.getValue = function (e, t, n) {
            return g.getValue(e, t, n)
        }, e.setValue = function (e, t, n) {
            g.setValue(e, t, n)
        }, e.attachListener = function (e, t) {
            g.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            g.detachListener(e, t)
        }
    }(t.BHOConfigNS || (t.BHOConfigNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.colorList = [{id: 0}, {
            id: 1,
            defaultOpacity: .9,
            colors: {
                colorPreview: "196,208,232",
                colorAccordion: ["116,137,180", "116,137,180"],
                colorGradientBackground: ["191,207,230", "227,236,246"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "116,137,180",
                colorPrimaryControl1: "120,149,209",
                colorPrimaryControl2: "116,137,180",
                colorPrimaryControl3: "212,225,225",
                colorPrimaryControl4: "240,243,250",
                colorPrimaryGradient: ["168,187,226", "105,132,177"],
                colorPrimaryText: "56,66,77",
                colorSearch: "252,252,252",
                colorSecondary: "83,95,117"
            }
        }, {
            id: 2,
            defaultOpacity: .9,
            colors: {
                colorPreview: "159,204,255",
                colorAccordion: ["51,160,255", "91,179,255"],
                colorGradientBackground: ["217,236,255", "138,204,255"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "51,160,255",
                colorPrimaryControl1: "119,182,255",
                colorPrimaryControl2: "51,160,255",
                colorPrimaryControl3: "212,231,255",
                colorPrimaryControl4: "232,240,255",
                colorPrimaryGradient: ["0,137,226", "103,189,255"],
                colorPrimaryText: "73,91,104",
                colorSearch: "252,252,252",
                colorSecondary: "103,132,154"
            }
        }, {
            id: 3,
            defaultOpacity: .9,
            colors: {
                colorPreview: "255,187,128",
                colorAccordion: ["255,149,87", "255,149,87"],
                colorGradientBackground: ["255,210,142", "255,151,119"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "255,149,87",
                colorPrimaryControl1: "255,178,110",
                colorPrimaryControl2: "255,149,87",
                colorPrimaryControl3: "229,210,194",
                colorPrimaryControl4: "242,233,226",
                colorPrimaryGradient: ["255,176,39", "255,137,33"],
                colorPrimaryText: "97,64,47",
                colorSearch: "252,252,252",
                colorSecondary: "130,99,75"
            }
        }, {
            id: 4,
            defaultOpacity: .9,
            colors: {
                colorPreview: "150,200,158",
                colorAccordion: ["93,154,103", "93,154,103"],
                colorGradientBackground: ["171,207,158", "124,188,162"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "85,123,91",
                colorPrimaryControl1: "114,152,120",
                colorPrimaryControl2: "85,123,91",
                colorPrimaryControl3: "191,210,194",
                colorPrimaryControl4: "220,232,222",
                colorPrimaryGradient: ["84,123,81", "115,165,150"],
                colorPrimaryText: "67,74,61",
                colorSearch: "252,252,252",
                colorSecondary: "97,109,86"
            }
        }, {
            id: 5,
            defaultOpacity: .5,
            colors: {
                colorPreview: "47,73,141",
                colorAccordion: ["99,177,255", "121,175,244"],
                colorGradientBackground: ["56,76,140", "41,72,143"],
                colorGradientForeground: ["97,144,251", "19,34,75"],
                colorPrimary: "230,199,138",
                colorPrimaryControl1: "204,170,122",
                colorPrimaryControl2: "220,191,132",
                colorPrimaryControl3: "185,185,185",
                colorPrimaryControl4: "233,233,233",
                colorPrimaryGradient: ["111,150,255", "156,192,255"],
                colorPrimaryText: "230,207,161",
                colorSearch: "68,124,209",
                colorSecondary: "204,184,143"
            }
        }, {
            id: 6,
            defaultOpacity: .7,
            colors: {
                colorPreview: "65,17,17",
                colorAccordion: ["214,99,99", "214,99,99"],
                colorGradientBackground: ["72,29,29", "16,7,7"],
                colorGradientForeground: ["117,57,57", "30,22,22"],
                colorPrimary: "223,77,77",
                colorPrimaryControl1: "220,96,96",
                colorPrimaryControl2: "159,51,51",
                colorPrimaryControl3: "219,193,193",
                colorPrimaryControl4: "239,224,224",
                colorPrimaryGradient: ["255,86,86", "161,70,70"],
                colorPrimaryText: "235,197,197",
                colorSearch: "88,74,74",
                colorSecondary: "184,151,151"
            }
        }, {
            id: 7,
            defaultOpacity: .3,
            colors: {
                colorPreview: "75,65,129",
                colorAccordion: ["160,185,252", "103,155,207"],
                colorGradientBackground: ["29,90,151", "105,61,191"],
                colorGradientForeground: ["163,177,204", "0,0,0"],
                colorPrimary: "128,213,255",
                colorPrimaryControl1: "118,193,230",
                colorPrimaryControl2: "161,207,230",
                colorPrimaryControl3: "205,215,235",
                colorPrimaryControl4: "228,232,240",
                colorPrimaryGradient: ["142,163,245", "120,144,222"],
                colorPrimaryText: "184,197,204",
                colorSearch: "153,153,153",
                colorSecondary: "138,184,230"
            }
        }, {
            id: 8,
            defaultOpacity: .6,
            colors: {
                colorPreview: "82,39,90",
                colorAccordion: ["170,163,204", "136,122,204"],
                colorGradientBackground: ["83,42,118", "61,46,77"],
                colorGradientForeground: ["93,82,193", "0,0,0"],
                colorPrimary: "170,153,255",
                colorPrimaryControl1: "136,122,204",
                colorPrimaryControl2: "147,132,220",
                colorPrimaryControl3: "204,194,255",
                colorPrimaryControl4: "234,230,255",
                colorPrimaryGradient: ["156,149,255", "128,128,255"],
                colorPrimaryText: "191,184,230",
                colorSearch: "166,148,255",
                colorSecondary: "153,143,204"
            }
        }, {
            id: 9,
            defaultOpacity: .3,
            colors: {
                colorPreview: "74,77,83",
                colorAccordion: ["103,155,207", "160,185,252"],
                colorGradientBackground: ["69,71,77", "15,19,26"],
                colorGradientForeground: ["179,179,179", "0,34,51"],
                colorPrimary: "204,238,255",
                colorPrimaryControl1: "143,184,204",
                colorPrimaryControl2: "161,207,230",
                colorPrimaryControl3: "205,215,235",
                colorPrimaryControl4: "228,232,240",
                colorPrimaryGradient: ["140,173,205", "103,132,162"],
                colorPrimaryText: "184,197,204",
                colorSearch: "153,153,153",
                colorSecondary: "138,184,230"
            }
        }, {
            id: 10,
            defaultOpacity: .5,
            colors: {
                colorPreview: "77,62,45",
                colorAccordion: ["204,177,122", "204,191,163"],
                colorGradientBackground: ["51,44,30", "26,22,15"],
                colorGradientForeground: ["153,122,92", "0,0,0"],
                colorPrimary: "230,199,138",
                colorPrimaryControl1: "204,170,122",
                colorPrimaryControl2: "220,191,132",
                colorPrimaryControl3: "219,212,203",
                colorPrimaryControl4: "236,230,223",
                colorPrimaryGradient: ["186,152,105", "226,197,139"],
                colorPrimaryText: "230,207,161",
                colorSearch: "105,105,105",
                colorSecondary: "204,184,143"
            }
        }]
    }(t.SkinConfigNS || (t.SkinConfigNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(3), o = n(295), r = n(14), s = n(5), l = n(1),
        u = o.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        d = s.default(i.join(__rootDir, "../bin/ThunderHelper.node")), c = l.default.getLogger("notification");
    !function (e) {
        let t = null, n = null, i = !1;

        function o() {
            try {
                l(), t && t.close()
            } catch (e) {
                c.warning(e)
            }
        }

        function s(e) {
            c.information("setTimer..."), i = !1, e = e || 1e4, n && l(), n = setInterval(() => {
                i || (e -= 1e3) <= 0 && o()
            }, 1e3)
        }

        function l() {
            n && (c.information("killTimer..."), clearInterval(n), n = null)
        }

        e.notify = function (e) {
            do {
                if (d.IsInFullScreen()) break;
                let n = "development" === process.env.RUN_ENV ? "http://localhost:9080/notification-renderer/" : `file:///${__dirname}/../notification-renderer/index.html`,
                    l = a.screen.getPrimaryDisplay().workAreaSize, h = new a.remote.BrowserWindow({
                        width: e.width || 440,
                        height: e.height || 245,
                        x: l.width - (e.width || 440),
                        y: l.height - (e.height || 245),
                        frame: !1,
                        resizable: !1,
                        show: !1,
                        alwaysOnTop: !0,
                        skipTaskbar: !0
                    });
                t = h, a.remote.ipcMain.once("notification-init", n => {
                    h === t && (c.information("notification-init"), n.sender.send("notification-init-reply", e))
                }), a.remote.ipcMain.on(r.ThunderChannelList.channelMRNotificationMsg, (e, ...n) => {
                    do {
                        if (h !== t) break;
                        if (c.information("notification-event"), null === n[0] || void 0 === n[0]) break;
                        let e = n[0];
                        switch (e) {
                            case"hover":
                                c.information("msg", e, n[1]), i = n[1];
                                break;
                            case"close":
                                c.information("msg", e), o()
                        }
                    } while (0)
                }), t.loadURL(n), c.information("notification...", e), t.on("ready-to-show", () => {
                    h === t && (c.information("ready-to-show..."), t.showInactive(), t.setAlwaysOnTop(!1), s(e.duration))
                }), t.on("closed", () => {
                    h === t && (c.information("closed..."), t = null, u.deQueue())
                })
            } while (0)
        }, e.close = o, e.getCurrentWindow = function () {
            return t
        }
    }(t.Notification || (t.Notification = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(35);
    !function (e) {
        let t;
        !function (e) {
            e.Unknow = "Unknow", e.OnJoinTeam = "OnJoinTeam", e.OnExitTeam = "OnExitTeam", e.OnReceiveGcid = "OnReceiveGcid", e.OnTaskSpeedChange = "OnTaskSpeedChange", e.OnTaskStatusChange = "OnTaskStatusChange", e.OnTeamInfoUpdated = "OnTeamInfoUpdated", e.InsertToCategoryView = "InsertToCategoryView", e.RemoveFromCategoryView = "RemoveFromCategoryView", e.RequestTaskTeamInfoSuccess = "RequestTaskTeamInfoSuccess", e.RequestTaskTeamInfofailed = "RequestTaskTeamInfofailed"
        }(t = e.GroupAccelerateEventType || (e.GroupAccelerateEventType = {}));
        const n = new i.EventEmitter;
        e.getEventManager = function () {
            return n
        }
    }(t.GroupAccelerateEventManagerNS || (t.GroupAccelerateEventManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(7), r = n(6), s = n(105), l = n(570), u = n(296), d = n(83), c = n(21), h = n(22), f = n(13),
        p = n(294), g = u.GroupAccelerateManagerNS.getManager(), k = l.GroupAccelerateEventManagerNS.getEventManager(),
        m = d.TabEventManagerNS.getEventEmitter(), T = a.default.getLogger("GroupAccelerate.WebManager");
    !function (e) {
        class t {
            constructor() {
                this.entryPage = "", this.pendingShowTeamInfoArray = new Array, this.taskSpeedListenerMap = new Map, this.taskStatusListenerMap = new Map, this.nextListenerCookie = 0, T.information("constructor")
            }

            init(e) {
                T.information("init", " entryPage: ", e), e && (this.entryPage = e), k.on(l.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, (e, t, n) => {
                    T.information("init OnTaskStatusChange", " taskId: ", e, " taskStatus: ", t, " taskUniqueId: ", n), this.fireTaskStatusChangeEvent(e, t, n)
                }), k.on(l.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, (e, t, n, i, a) => {
                    T.information("init OnTaskSpeedChange", " taskId: ", e, " taskSpeed: ", t, " increaseSpeed: ", n, " extraStr: ", i, " taskUniqueId: ", a), this.fireTaskSpeedChangeEvent(e, t, n, i, a)
                }), m.on(d.TabEventManagerNS.EventType.RemoveTab, e => {
                    if ("组队加速" === e.tabInfo.title && "groupAccelerate" === e.tabInfo.tab.name) {
                        g.exitAllTeamNoTask();
                        for (let [t, n]of this.taskSpeedListenerMap) if (n.tab === e.tabInfo.tab) {
                            this.taskSpeedListenerMap.delete(t);
                            break
                        }
                        for (let [t, n]of this.taskStatusListenerMap) if (n.tab === e.tabInfo.tab) {
                            this.taskStatusListenerMap.delete(t);
                            break
                        }
                    }
                }), this.registerNativeFunction()
            }

            openGroupAccelerateTabByTaskId(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    T.information("openGroupAccelerateTabByTaskId", " taskId: ", e, " entry: ", t, " panel: ", n, " queryString: ", a);
                    let i = g.getTaskUniqueIdByTaskId(e);
                    T.information("openGroupAccelerateTabByTaskId", " taskUniqueId: ", i), i && "" !== i && this.openGroupAccelerateTabByTaskUniqueId(i, t, n, a).then(e => {
                        T.information("openGroupAccelerateTabByTaskId success")
                    }).catch(() => {
                        T.information("openGroupAccelerateTabByTaskId failed")
                    })
                })
            }

            openGroupAccelerateTabByTaskUniqueId(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    if (T.information("openGroupAccelerateTabByTaskUniqueId", " taskUniqueId: ", e, " entry: ", t, " panel: ", n, " queryString: ", a), !e) return void T.information("openGroupAccelerateTabByTaskUniqueId bad taskUniqueId");
                    o.isNullOrUndefined(t) && (t = ""), o.isNullOrUndefined(n) && (n = ""), o.isNullOrUndefined(a) && (a = "");
                    let i = yield s.default(!1, !0);
                    if (T.information("openGroupAccelerateTabByTaskUniqueId", " userId: ", i), i && "0" !== i) {
                        let o = Number(i);
                        if (!isNaN(o) && 0 !== o) {
                            let i = JSON.stringify({
                                title: "组队加速",
                                url: this.entryPage,
                                name: "groupAccelerate",
                                showUrl: !1
                            });
                            r.NativeCallModule.nativeCall.CallNativeFunction("GetTabIndexByTitleAndName", i, (o, s) => {
                                if (T.information("GetTabIndexByTitleAndName", i, o, s), o === c.NativeFunctionErrorCode.Success && s > -1) T.information("groupAccelerate tab exists", s), r.NativeCallModule.nativeCall.CallNativeFunction("SelectTab", s), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnShowTeam", e, t, n, a); else {
                                    let o = {};
                                    o.taskUniqueId = e, o.entry = t, o.panel = n, o.queryString = a, this.pendingShowTeamInfoArray.push(o), T.information("openGroupAccelerateTabByTaskUniqueId do opentab"), r.NativeCallModule.nativeCall.CallNativeFunction("OpenNewTab", this.entryPage, i)
                                }
                            }), h.ConfigNS.setValue("GroupAccelerate", "unusecount", 0);
                            let o = (new Date).getTime();
                            h.ConfigNS.setValue("GroupAccelerate", "lastusetime", o), this.sendPageShowStat(e, t, n)
                        }
                    }
                })
            }

            fireTaskStatusChangeEvent(e, t, n) {
                this.taskStatusListenerMap.forEach((i, a) => {
                    i && i.tab && "nativeCallId" in i && i.callBackId && i.gcid === n && i.tab.callNativeFunctionCallback(i.nativeCallId, i.callBackId, e, t, n)
                })
            }

            fireTaskSpeedChangeEvent(e, t, n, i, a) {
                this.taskSpeedListenerMap.forEach((o, r) => {
                    o && o.tab && "nativeCallId" in o && o.callBackId && o.gcid === a && o.tab.callNativeFunctionCallback(o.nativeCallId, o.callBackId, e, t, n, i, a)
                })
            }

            registerNativeFunction() {
                let e = [{
                    functionName: "OpenGroupAccelerateTab",
                    nativeFunc: this.externalOpenGroupAccelerateTab.bind(this)
                }, {
                    functionName: "GetGroupTaskInfo",
                    nativeFunc: this.externalGetTaskInfo.bind(this)
                }, {functionName: "JoinTeam", nativeFunc: this.externalJoinTeam.bind(this)}, {
                    functionName: "ExitTeam",
                    nativeFunc: this.externalExitTeam.bind(this)
                }, {
                    functionName: "TeamPageReady",
                    nativeFunc: this.externalTeamPageReady.bind(this)
                }, {
                    functionName: "SubscribeTaskSpeed",
                    nativeFunc: this.externalSubscribeTaskSpeed.bind(this)
                }, {
                    functionName: "UnsubscribeTaskSpeed",
                    nativeFunc: this.externalUnsubscribeTaskSpeed.bind(this)
                }, {
                    functionName: "SubscribeTaskStatus",
                    nativeFunc: this.externalSubscribeTaskStatus.bind(this)
                }, {functionName: "UnsubscribeTaskStatus", nativeFunc: this.externalUnsubscribeTaskStatus.bind(this)}];
                d.setDefaultNativeFunctionMap(e)
            }

            externalOpenGroupAccelerateTab(e, t, n, i) {
                do {
                    if (T.information("externalOpenGroupAccelerateTab enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalOpenGroupAccelerateTab bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1]) || o.isNullOrUndefined(i[2]) || o.isNullOrUndefined(i[3])) {
                        T.information("externalOpenGroupAccelerateTab bad args"), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = i[2], l = i[3];
                    this.openGroupAccelerateTabByTaskId(a, r, s, l).then(e => {
                        T.information("externalOpenGroupAccelerateTab success")
                    }).catch(() => {
                        T.information("externalOpenGroupAccelerateTab failed")
                    }), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalGetTaskInfo(e, t, n, i) {
                do {
                    if (T.information("externalGetTaskInfo enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalGetTaskInfo bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[1])) {
                        T.information("externalGetTaskInfo bad args"), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1];
                    T.information("externalGetTaskInfo", " taskId: ", a, " taskUniqueId: ", r);
                    let s = g.getTaskInfoJson(a, r);
                    T.information("externalGetTaskInfo", " taskInfoJson: ", s), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success, s)
                } while (0)
            }

            externalJoinTeam(e, t, n, i) {
                do {
                    if (T.information("externalJoinTeam enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalGetTaskInfo bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[3])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = i[2], l = i[3], u = null;
                    try {
                        u = JSON.parse(s)
                    } catch (e) {
                        T.warning(e)
                    }
                    if (null === u) break;
                    let d = u.member_count;
                    d || (d = 0);
                    let h = u.group_name;
                    if (o.isNullOrUndefined(h) && (h = ""), T.information("externalJoinTeam", " taskId: ", a, " groupId: ", r, " opts: ", s, " taskUniqueId: ", l, " memberCount: ", d, " groupName: ", h), !r || !l) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    g.joinTeam(a, "" + r, h, d, l).catch();
                    let k = !1;
                    if ("1" !== p.DownloadModeNS.getCurrentDownloadMode()) {
                        p.DownloadModeNS.setFullDownloadMode(), k = !0;
                        let e = 0,
                            t = "taskid=" + (e = l && "" !== l ? g.getTaskIdByTaskUniqueId(l) : a) + ",gcid=" + l;
                        f.XLStatNS.trackEvent("download_pannel", "groupspeedup_fullspeed_change", "", 0, 0, 0, 0, t)
                    }
                    let m = JSON.stringify({hasChangeMode: k});
                    e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success, m)
                } while (0)
            }

            externalExitTeam(e, t, n, i) {
                do {
                    if (T.information("externalExitTeam enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1]) || o.isNullOrUndefined(i[2])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = i[2];
                    g.exitTeam(a, r, s), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalTeamPageReady(e, t, n, i) {
                do {
                    if (T.information("externalTeamPageReady enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalGetTaskInfo bad external args");
                        break
                    }
                    for (let e of this.pendingShowTeamInfoArray) e && (T.information("externalTeamPageReady fire event", " taskUniqueId: ", e.taskUniqueId, " entry: ", e.entry, " panel: ", e.panel, " queryString: ", e.queryString), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnShowTeam", e.taskUniqueId, e.entry, e.panel, e.queryString));
                    this.pendingShowTeamInfoArray = [], e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalSubscribeTaskSpeed(e, t, n, i) {
                do {
                    if (T.information("externalSubscribeTaskSpeed enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalSubscribeTaskSpeed bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = {};
                    s.tab = e, s.nativeCallId = t, s.callBackId = r, s.gcid = a;
                    let l = this.nextListenerCookie;
                    this.taskSpeedListenerMap.set("" + l, s), this.nextListenerCookie += 1, e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            externalUnsubscribeTaskSpeed(e, t, n, i) {
                do {
                    if (T.information("externalUnsubscribeTaskSpeed enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalUnsubscribeTaskSpeed bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    this.taskSpeedListenerMap.delete("" + a), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalSubscribeTaskStatus(e, t, n, i) {
                do {
                    if (T.information("externalSubscribeTaskStatus enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalSubscribeTaskStatus bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], s = {};
                    s.tab = e, s.nativeCallId = t, s.callBackId = r, s.gcid = a;
                    let l = this.nextListenerCookie;
                    this.taskStatusListenerMap.set("" + l, s), this.nextListenerCookie += 1, e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            externalUnsubscribeTaskStatus(e, t, n, i) {
                do {
                    if (T.information("externalUnsubscribeTaskStatus enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) {
                        T.information("externalUnsubscribeTaskStatus bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    this.taskSpeedListenerMap.delete("" + a), e.callNativeFunctionCallback(t, n, c.NativeFunctionErrorCode.Success)
                } while (0)
            }

            sendPageShowStat(e, t, n) {
                do {
                    if (!e) break;
                    if (!t || !n) break;
                    let i = "entry=" + t + ",pannel=" + n + ",gcid=" + e;
                    f.XLStatNS.trackEvent("download_pannel", "groupspeedupdetail_show", "", 0, 0, 0, 0, i)
                } while (0)
            }
        }

        e.Manager = t;
        const n = new t;
        e.getManager = function () {
            return n
        }
    }(t.GroupAccelerateWebManagerNS || (t.GroupAccelerateWebManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(227), a = n(168);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(614);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, "69ad46c4", null);
    s.options.__file = "src\\common\\generator-view\\generator-view.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(232), a = n(170);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkbox.vue", t.default = s.exports
}, function (e, t, n) {
    e.exports = {default: n(575), __esModule: !0}
}, function (e, t, n) {
    n(576), e.exports = n(142).Object.assign
}, function (e, t, n) {
    var i = n(214);
    i(i.S + i.F, "Object", {assign: n(579)})
}, function (e, t, n) {
    var i = n(578);
    e.exports = function (e, t, n) {
        if (i(e), void 0 === t) return e;
        switch (n) {
            case 1:
                return function (n) {
                    return e.call(t, n)
                };
            case 2:
                return function (n, i) {
                    return e.call(t, n, i)
                };
            case 3:
                return function (n, i, a) {
                    return e.call(t, n, i, a)
                }
        }
        return function () {
            return e.apply(t, arguments)
        }
    }
}, function (e, t) {
    e.exports = function (e) {
        if ("function" != typeof e) throw TypeError(e + " is not a function!");
        return e
    }
}, function (e, t, n) {
    "use strict";
    var i = n(162), a = n(221), o = n(165), r = n(270), s = n(268), l = Object.assign;
    e.exports = !l || n(144)(function () {
        var e = {}, t = {}, n = Symbol(), i = "abcdefghijklmnopqrst";
        return e[n] = 7, i.split("").forEach(function (e) {
            t[e] = e
        }), 7 != l({}, e)[n] || Object.keys(l({}, t)).join("") != i
    }) ? function (e, t) {
        for (var n = r(e), l = arguments.length, u = 1, d = a.f, c = o.f; l > u;) for (var h, f = s(arguments[u++]), p = d ? i(f).concat(d(f)) : i(f), g = p.length, k = 0; g > k;) c.call(f, h = p[k++]) && (n[h] = f[h]);
        return n
    } : l
}, function (e, t, n) {
    var i = n(111), a = n(581), o = n(582);
    e.exports = function (e) {
        return function (t, n, r) {
            var s, l = i(t), u = a(l.length), d = o(r, u);
            if (e && n != n) {
                for (; u > d;) if ((s = l[d++]) != s) return !0
            } else for (; u > d; d++) if ((e || d in l) && l[d] === n) return e || d || 0;
            return !e && -1
        }
    }
}, function (e, t, n) {
    var i = n(217), a = Math.min;
    e.exports = function (e) {
        return e > 0 ? a(i(e), 9007199254740991) : 0
    }
}, function (e, t, n) {
    var i = n(217), a = Math.max, o = Math.min;
    e.exports = function (e, t) {
        return (e = i(e)) < 0 ? a(e + t, 0) : o(e, t)
    }
}, function (e, t, n) {
    e.exports = {default: n(584), __esModule: !0}
}, function (e, t, n) {
    n(585), n(591), e.exports = n(224).f("iterator")
}, function (e, t, n) {
    "use strict";
    var i = n(586)(!0);
    n(271)(String, "String", function (e) {
        this._t = String(e), this._i = 0
    }, function () {
        var e, t = this._t, n = this._i;
        return n >= t.length ? {value: void 0, done: !0} : (e = i(t, n), this._i += e.length, {value: e, done: !1})
    })
}, function (e, t, n) {
    var i = n(217), a = n(216);
    e.exports = function (e) {
        return function (t, n) {
            var o, r, s = String(a(t)), l = i(n), u = s.length;
            return l < 0 || l >= u ? e ? "" : void 0 : (o = s.charCodeAt(l)) < 55296 || o > 56319 || l + 1 === u || (r = s.charCodeAt(l + 1)) < 56320 || r > 57343 ? e ? s.charAt(l) : o : e ? s.slice(l, l + 2) : r - 56320 + (o - 55296 << 10) + 65536
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = n(273), a = n(161), o = n(223), r = {};
    n(108)(r, n(112)("iterator"), function () {
        return this
    }), e.exports = function (e, t, n) {
        e.prototype = i(r, {next: a(1, n)}), o(e, t + " Iterator")
    }
}, function (e, t, n) {
    var i = n(109), a = n(160), o = n(162);
    e.exports = n(110) ? Object.defineProperties : function (e, t) {
        a(e);
        for (var n, r = o(t), s = r.length, l = 0; s > l;) i.f(e, n = r[l++], t[n]);
        return e
    }
}, function (e, t, n) {
    var i = n(81).document;
    e.exports = i && i.documentElement
}, function (e, t, n) {
    var i = n(88), a = n(270), o = n(218)("IE_PROTO"), r = Object.prototype;
    e.exports = Object.getPrototypeOf || function (e) {
        return e = a(e), i(e, o) ? e[o] : "function" == typeof e.constructor && e instanceof e.constructor ? e.constructor.prototype : e instanceof Object ? r : null
    }
}, function (e, t, n) {
    n(592);
    for (var i = n(81), a = n(108), o = n(222), r = n(112)("toStringTag"), s = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","), l = 0; l < s.length; l++) {
        var u = s[l], d = i[u], c = d && d.prototype;
        c && !c[r] && a(c, r, u), o[u] = o.Array
    }
}, function (e, t, n) {
    "use strict";
    var i = n(593), a = n(594), o = n(222), r = n(111);
    e.exports = n(271)(Array, "Array", function (e, t) {
        this._t = r(e), this._i = 0, this._k = t
    }, function () {
        var e = this._t, t = this._k, n = this._i++;
        return !e || n >= e.length ? (this._t = void 0, a(1)) : a(0, "keys" == t ? n : "values" == t ? e[n] : [n, e[n]])
    }, "values"), o.Arguments = o.Array, i("keys"), i("values"), i("entries")
}, function (e, t) {
    e.exports = function () {
    }
}, function (e, t) {
    e.exports = function (e, t) {
        return {value: t, done: !!e}
    }
}, function (e, t, n) {
    e.exports = {default: n(596), __esModule: !0}
}, function (e, t, n) {
    n(597), n(603), n(604), n(605), e.exports = n(142).Symbol
}, function (e, t, n) {
    "use strict";
    var i = n(81), a = n(88), o = n(110), r = n(214), s = n(272), l = n(598).KEY, u = n(144), d = n(219), c = n(223),
        h = n(164), f = n(112), p = n(224), g = n(225), k = n(599), m = n(600), T = n(160), v = n(143), y = n(111),
        S = n(215), w = n(161), b = n(273), C = n(601), N = n(602), D = n(109), I = n(162), _ = N.f, x = D.f, A = C.f,
        E = i.Symbol, M = i.JSON, P = M && M.stringify, F = f("_hidden"), O = f("toPrimitive"),
        U = {}.propertyIsEnumerable, L = d("symbol-registry"), B = d("symbols"), K = d("op-symbols"),
        V = Object.prototype, R = "function" == typeof E, W = i.QObject,
        j = !W || !W.prototype || !W.prototype.findChild, H = o && u(function () {
            return 7 != b(x({}, "a", {
                get: function () {
                    return x(this, "a", {value: 7}).a
                }
            })).a
        }) ? function (e, t, n) {
            var i = _(V, t);
            i && delete V[t], x(e, t, n), i && e !== V && x(V, t, i)
        } : x, G = function (e) {
            var t = B[e] = b(E.prototype);
            return t._k = e, t
        }, z = R && "symbol" == typeof E.iterator ? function (e) {
            return "symbol" == typeof e
        } : function (e) {
            return e instanceof E
        }, q = function (e, t, n) {
            return e === V && q(K, t, n), T(e), t = S(t, !0), T(n), a(B, t) ? (n.enumerable ? (a(e, F) && e[F][t] && (e[F][t] = !1), n = b(n, {enumerable: w(0, !1)})) : (a(e, F) || x(e, F, w(1, {})), e[F][t] = !0), H(e, t, n)) : x(e, t, n)
        }, $ = function (e, t) {
            T(e);
            for (var n, i = k(t = y(t)), a = 0, o = i.length; o > a;) q(e, n = i[a++], t[n]);
            return e
        }, X = function (e) {
            var t = U.call(this, e = S(e, !0));
            return !(this === V && a(B, e) && !a(K, e)) && (!(t || !a(this, e) || !a(B, e) || a(this, F) && this[F][e]) || t)
        }, J = function (e, t) {
            if (e = y(e), t = S(t, !0), e !== V || !a(B, t) || a(K, t)) {
                var n = _(e, t);
                return !n || !a(B, t) || a(e, F) && e[F][t] || (n.enumerable = !0), n
            }
        }, Y = function (e) {
            for (var t, n = A(y(e)), i = [], o = 0; n.length > o;) a(B, t = n[o++]) || t == F || t == l || i.push(t);
            return i
        }, Q = function (e) {
            for (var t, n = e === V, i = A(n ? K : y(e)), o = [], r = 0; i.length > r;) !a(B, t = i[r++]) || n && !a(V, t) || o.push(B[t]);
            return o
        };
    R || (s((E = function () {
        if (this instanceof E) throw TypeError("Symbol is not a constructor!");
        var e = h(arguments.length > 0 ? arguments[0] : void 0), t = function (n) {
            this === V && t.call(K, n), a(this, F) && a(this[F], e) && (this[F][e] = !1), H(this, e, w(1, n))
        };
        return o && j && H(V, e, {configurable: !0, set: t}), G(e)
    }).prototype, "toString", function () {
        return this._k
    }), N.f = J, D.f = q, n(274).f = C.f = Y, n(165).f = X, n(221).f = Q, o && !n(163) && s(V, "propertyIsEnumerable", X, !0), p.f = function (e) {
        return G(f(e))
    }), r(r.G + r.W + r.F * !R, {Symbol: E});
    for (var Z = "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","), ee = 0; Z.length > ee;) f(Z[ee++]);
    for (var te = I(f.store), ne = 0; te.length > ne;) g(te[ne++]);
    r(r.S + r.F * !R, "Symbol", {
        for: function (e) {
            return a(L, e += "") ? L[e] : L[e] = E(e)
        }, keyFor: function (e) {
            if (!z(e)) throw TypeError(e + " is not a symbol!");
            for (var t in L) if (L[t] === e) return t
        }, useSetter: function () {
            j = !0
        }, useSimple: function () {
            j = !1
        }
    }), r(r.S + r.F * !R, "Object", {
        create: function (e, t) {
            return void 0 === t ? b(e) : $(b(e), t)
        },
        defineProperty: q,
        defineProperties: $,
        getOwnPropertyDescriptor: J,
        getOwnPropertyNames: Y,
        getOwnPropertySymbols: Q
    }), M && r(r.S + r.F * (!R || u(function () {
        var e = E();
        return "[null]" != P([e]) || "{}" != P({a: e}) || "{}" != P(Object(e))
    })), "JSON", {
        stringify: function (e) {
            for (var t, n, i = [e], a = 1; arguments.length > a;) i.push(arguments[a++]);
            if (n = t = i[1], (v(t) || void 0 !== e) && !z(e)) return m(t) || (t = function (e, t) {
                if ("function" == typeof n && (t = n.call(this, e, t)), !z(t)) return t
            }), i[1] = t, P.apply(M, i)
        }
    }), E.prototype[O] || n(108)(E.prototype, O, E.prototype.valueOf), c(E, "Symbol"), c(Math, "Math", !0), c(i.JSON, "JSON", !0)
}, function (e, t, n) {
    var i = n(164)("meta"), a = n(143), o = n(88), r = n(109).f, s = 0, l = Object.isExtensible || function () {
        return !0
    }, u = !n(144)(function () {
        return l(Object.preventExtensions({}))
    }), d = function (e) {
        r(e, i, {value: {i: "O" + ++s, w: {}}})
    }, c = e.exports = {
        KEY: i, NEED: !1, fastKey: function (e, t) {
            if (!a(e)) return "symbol" == typeof e ? e : ("string" == typeof e ? "S" : "P") + e;
            if (!o(e, i)) {
                if (!l(e)) return "F";
                if (!t) return "E";
                d(e)
            }
            return e[i].i
        }, getWeak: function (e, t) {
            if (!o(e, i)) {
                if (!l(e)) return !0;
                if (!t) return !1;
                d(e)
            }
            return e[i].w
        }, onFreeze: function (e) {
            return u && c.NEED && l(e) && !o(e, i) && d(e), e
        }
    }
}, function (e, t, n) {
    var i = n(162), a = n(221), o = n(165);
    e.exports = function (e) {
        var t = i(e), n = a.f;
        if (n) for (var r, s = n(e), l = o.f, u = 0; s.length > u;) l.call(e, r = s[u++]) && t.push(r);
        return t
    }
}, function (e, t, n) {
    var i = n(269);
    e.exports = Array.isArray || function (e) {
        return "Array" == i(e)
    }
}, function (e, t, n) {
    var i = n(111), a = n(274).f, o = {}.toString,
        r = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
    e.exports.f = function (e) {
        return r && "[object Window]" == o.call(e) ? function (e) {
            try {
                return a(e)
            } catch (e) {
                return r.slice()
            }
        }(e) : a(i(e))
    }
}, function (e, t, n) {
    var i = n(165), a = n(161), o = n(111), r = n(215), s = n(88), l = n(265), u = Object.getOwnPropertyDescriptor;
    t.f = n(110) ? u : function (e, t) {
        if (e = o(e), t = r(t, !0), l) try {
            return u(e, t)
        } catch (e) {
        }
        if (s(e, t)) return a(!i.f.call(e, t), e[t])
    }
}, function (e, t) {
}, function (e, t, n) {
    n(225)("asyncIterator")
}, function (e, t, n) {
    n(225)("observable")
}, function (e, t, n) {
    "use strict";
    var i = n(1104);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(241), a = n(180);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(238), a = n(182);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed-time.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(231), a = n(186);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-radio.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(236), a = n(188);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkinput.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(237), a = n(190);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkselect.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(228), a = n(192);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-textarea.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(230), a = n(194);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed-text.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1106);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1110);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1113);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1122);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1126);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(9), r = n(262), s = n(297), l = n(200), u = n(569), d = n(295), c = n(13), h = n(10),
        f = n(5).default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        p = d.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification");
    var g, k;
    !function (e) {
        e.Market = "Market", e.Functional = "Functional"
    }(g = t.OrderType || (t.OrderType = {})), function (e) {
        e[e.TextButton = 1] = "TextButton", e[e.SmallImageButton = 2] = "SmallImageButton", e[e.BigImageButton = 3] = "BigImageButton", e[e.Image = 4] = "Image", e[e.Flash = 5] = "Flash"
    }(k = t.StyleType || (t.StyleType = {}));
    t.AdTips = class {
    }
}, , , , , , , , , , , , , , , , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement;
        return (this._self._c || e)("div", {staticClass: "xlx-media"})
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("header", {staticClass: "xlx-client__header"}, [n("div", {
            staticClass: "xlx-client-header",
            class: {dragable: e.dragable}
        }, [n("login-area", {
            staticClass: "none-dragable", on: {
                "tooltip-show": function (t) {
                    e.dragable = !1
                }, "tooltip-hide": function (t) {
                    e.dragable = !0
                }
            }
        }), e._v(" "), n("address-bar-container", {staticClass: "none-dragable"}), e._v(" "), n("system-buttons-container", {staticClass: "none-dragable"}), e._v(" "), n("message-tips")], 1), e._v(" "), n("TabsContainer"), e._v(" "), n("book-marks")], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , , , , , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-client__body"}, [t("home-tab-view", {
            directives: [{
                name: "opacity",
                rawName: "v-opacity",
                value: this.downloadShow,
                expression: "downloadShow"
            }], staticStyle: {position: "absolute"}
        }), this._v(" "), t("browser-view-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: this.webviewShow,
                expression: "webviewShow"
            }]
        }), this._v(" "), this.hadSettingTab ? t("setting-view-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: this.settingViewShow,
                expression: "settingViewShow"
            }]
        }) : this._e()], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-personal"}, [n("div", {
            staticClass: "xlx-personal-concise",
            class: e.strIsOffline
        }, [n("a", {
            ref: "userAvatar",
            staticClass: "xlx-personal-concise__avatar",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.clickUserHeader("head")
                }, mouseenter: function (t) {
                    e.enter("head")
                }
            }
        }, [n("img", {
            attrs: {src: e.curLoginHeaderUrl, alt: "头像", draggable: "false"}, on: {
                error: function (t) {
                    e.setDefaultHeader()
                }
            }
        })]), e._v(" "), !1 !== e.isLogin || "unlogin" !== e.curLoginStatus || e.promptData ? !1 === e.isLogin && "unlogin" === e.curLoginStatus && e.promptData ? n("a", {
            staticClass: "xlx-personal-concise__text",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.clickPromptTitle("wzl")
                }
            }
        }, [e._v(e._s(e.promptData.title))]) : n("a", {
            ref: "userNick",
            staticClass: "xlx-personal-concise__name",
            class: e.strNickCss,
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.clickUserHeader("name")
                }, mouseenter: function (t) {
                    e.enter("name")
                }
            }
        }, [e._v(e._s(e.userNick))]) : n("a", {
            staticClass: "xlx-personal-concise__button",
            attrs: {href: "#"},
            on: {click: e.clickUserHeader}
        }, [e._v("登录")]), e._v(" "), e.vipData ? n("vip-icon", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogin && !e.isCanShowOpenVipBtn,
                expression: "isLogin && !isCanShowOpenVipBtn"
            }],
            ref: "userVip",
            staticStyle: {cursor: "pointer"},
            attrs: {vipData: e.vipData, size: "normal", disabled: 0 === e.isVip},
            nativeOn: {
                click: function (t) {
                    e.onClick("vip")
                }, mouseenter: function (t) {
                    e.enter("vip")
                }
            }
        }) : e._e(), e._v(" "), n("td-tooltip", {
            attrs: {
                trigger: "hover",
                visible: e.isShowYearTip,
                offset: {x: -5},
                placement: "bottom"
            }, on: {
                show: function (t) {
                    e.onToolYearTip(!0)
                }, hide: function (t) {
                    e.onToolYearTip(!1)
                }
            }
        }, [n("template", {slot: "content"}, [e._v(e._s(e.yearTipsText)), n("a", {
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("nian_tip")
                }
            }
        }, [e._v(e._s(e.strOpenVip))])]), e._v(" "), n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogin && !e.isCanShowOpenVipBtn,
                expression: "isLogin && !isCanShowOpenVipBtn"
            }], staticClass: "xlx-personal-concise__nian"
        }, [n("a", {
            class: e.userYearIcon, attrs: {href: "javascript:;"}, on: {
                click: function (t) {
                    e.onClick("nian")
                }
            }
        })])], 2), e._v(" "), n("td-tooltip", {
            attrs: {
                trigger: e.cashTipTrigger,
                visible: !1,
                offset: {x: -5},
                placement: "bottom"
            }
        }, [n("template", {slot: "content"}, [e._v("您有代金券可使用")]), e._v(" "), n("div", {staticClass: "xlx-personal-concise__vip"}, [n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isCanShowOpenVipBtn && "online" === e.curLoginStatus,
                expression: "isCanShowOpenVipBtn && curLoginStatus==='online'"
            }], staticClass: "xlx-personal-concise__join", attrs: {href: "javascript:;"}, on: {
                click: function (t) {
                    e.onIconClick()
                }
            }
        }, [e._v("开通会员")]), e._v(" "), n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isCanShowXufeiBtn && "online" === e.curLoginStatus,
                expression: "isCanShowXufeiBtn && curLoginStatus==='online'"
            }], staticClass: "xlx-personal-concise__refeed", attrs: {href: "javascript:;"}, on: {
                click: function (t) {
                    e.onIconClick()
                }
            }
        }, [e._v("续费")])])], 2)], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticClass: "xlx-client", attrs: {id: "app"}, on: {
                dragstart: function (e) {
                    e.preventDefault()
                }
            }
        }, [t("main-background"), this._v(" "), t("main-top"), this._v(" "), t("main-bottom")], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-client-content xlx-client-content--default"}, [t("download-panel"), this._v(" "), t("home-page")], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-client-nav"}, [n("td-browser-tab", {
            attrs: {
                tabs: e.tabs,
                sortable: "",
                "min-width": 60,
                "show-total-limit": 12,
                current: e.current,
                background: e.background,
                "tab-listeners": e.tabListeners
            },
            on: {
                "update:tabs": e.updateTabs,
                "update:current": e.updateCurrent,
                add: e.handleAdd,
                remove: e.handleRemove,
                change: e.handleChange,
                "middle-click": e.handleMiddleDown,
                "total-click": e.handleTotalClick
            },
            nativeOn: {
                click: function (t) {
                    return e.handleClick(t)
                }
            },
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var i = t.index, a = t.tab;
                    return [0 === i && 0 !== e.current && -1 === e.currentCategoryId ? [n("div", {
                        ref: "progress",
                        staticClass: "xlx-browser-tab__progress",
                        class: {"is-finished": e.finished || e.hasNewTask, "is-fail": e.fail && !e.hasNewTask},
                        style: e.progressStyle
                    }, [n("span", {staticClass: "xlx-browser-tab__progress-inner"})]), e._v(" "), n("span", {staticClass: "xlx-browser-tab__text"}, [e._v("\n          " + e._s(e.titleCue) + "\n          "), e.hasDownloading && !e.hasNewTask ? [n("i", {staticClass: "xlx-browser-tab__status"}, [e.isLoading ? n("b", {staticClass: "xlx-browser-tab__load"}) : e._e(), e._v("\n              " + e._s(e.isLoading ? "连接资源" : e.speed) + "\n            ")])] : e._e(), e._v(" "), e.fail && !e.hasNewTask ? n("i", {staticClass: "td-icon-warning"}) : e._e(), e._v(" "), e.hasNewTask ? [n("i", {staticClass: "td-browser-tab__number"}, [e._v(e._s(e.newCount))])] : e._e()], 2)] : e._e(), e._v(" "), n("span", {
                        directives: [{
                            name: "show",
                            rawName: "v-show",
                            value: 0 !== i || 0 === e.current || -1 !== e.currentCategoryId,
                            expression: "index !== 0 || current === 0 || currentCategoryId !== -1"
                        }], attrs: {id: 0 === i ? "downloadTab" : "", tabindex: "0"}, on: {
                            click: function (t) {
                                0 === i && e.showChangeCategoryMenu()
                            }
                        }
                    }, [e._v("\n        " + e._s(0 === i && -1 !== e.currentCategoryId ? "私人空间" : a.title) + "\n        "), "community" === a.tab.name && e.unread ? n("i", {staticClass: "td-browser-tab__number"}, [e._v(e._s(e._f("unread")(e.unread)))]) : 0 === i && 0 === e.current ? n("i", {staticClass: "td-icon-arrow-drop"}) : e._e()])]
                }
            }])
        })], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement;
        return (this._self._c || e)("span", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !1,
                expression: "false"
            }]
        })
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("td-input-group", {staticClass: "xlx-search"}, [n("td-input-group-button", {
            attrs: {
                slot: "prepend",
                title: "后退",
                disabled: !e.canGoBack
            }, nativeOn: {
                click: function (t) {
                    return e.goBack(t)
                }
            }, slot: "prepend"
        }, [n("td-icon", {attrs: {type: "arrow-left"}})], 1), e._v(" "), n("td-input-group-button", {
            attrs: {
                slot: "prepend",
                title: "前进",
                disabled: !e.canGoForward
            }, nativeOn: {
                click: function (t) {
                    return e.goForward(t)
                }
            }, slot: "prepend"
        }, [n("td-icon", {attrs: {type: "arrow-right"}})], 1), e._v(" "), e.isHttps ? n("td-icon", {
            attrs: {
                slot: "prepend",
                type: "security"
            }, slot: "prepend"
        }) : e._e(), e._v(" "), n("td-input", {
            ref: "input",
            attrs: {value: e.textData, placeholder: e.placeholder},
            on: {
                focus: e.onInputFocus, blur: e.onInputBlur, input: e.handle, keydown: [function (t) {
                    return "button" in t || !e._k(t.keyCode, "enter", 13, t.key, "Enter") ? e.navigate(t) : null
                }, function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? void e.$refs.input.select() : null
                }]
            },
            nativeOn: {
                contextmenu: function (t) {
                    return e.handlePopInputMenu(t)
                }
            }
        }), e._v(" "), n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.showGroupEnrty,
                expression: "showGroupEnrty"
            }], staticClass: "xlx-search__button", attrs: {href: "javascript:;"}, on: {click: e.handleClickGroup}
        }, [n("i", {staticClass: "xlx-icon-chat"}), e._v("加入社区\n  ")]), e._v(" "), n("a", {
            staticClass: "td-input__button",
            attrs: {href: "javascript:;", title: "收藏"}
        }, [n("i", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.hideCollectIcon,
                expression: "!hideCollectIcon"
            }],
            staticClass: "xlx-icon-fav",
            class: {"is-active": void 0 !== e.bookMarks[e.curUrl]},
            on: {
                click: function (t) {
                    return t.stopPropagation(), e.handleCollect(t)
                }
            }
        })]), e._v(" "), n("td-input-group-button", {
            attrs: {slot: "append", title: "刷新", disabled: !e.canRefresh},
            nativeOn: {
                click: function (t) {
                    return e.goRefresh(t)
                }
            },
            slot: "append"
        }, [n("td-icon", {attrs: {type: "refresh"}})], 1)], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            staticClass: "xlx-client-operate", on: {
                mouseenter: function (t) {
                    e.disableHover = !1
                }
            }
        }, [n("message-button-container"), e._v(" "), n("a", {
            attrs: {href: "javascript:;"},
            on: {click: e.showIndividuation}
        }, [n("i", {
            staticClass: "xlx-icon-theme",
            attrs: {title: "个性化中心"}
        })]), e._v(" "), n("a", {
            attrs: {href: "javascript:;"},
            on: {click: e.showMenu}
        }, [n("i", {
            staticClass: "xlx-icon-menu",
            attrs: {title: "主菜单"}
        }), e._v(" "), e.showNewIcon ? n("i", {staticClass: "xlx-tag-new"}) : e._e()]), e._v(" "), n("a", {
            ref: "minize",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;"},
            on: {click: e.minizeMainWindow}
        }, [n("i", {staticClass: "xlx-icon-minimize"})]), e._v(" "), n("a", {
            ref: "maximize",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;"},
            on: {click: e.toggleMaximizeMainWindow}
        }, [n("i", {
            staticClass: "xlx-icon-maximize",
            class: {"is-active": e.maximized}
        })]), e._v(" "), n("a", {
            ref: "close",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;"},
            on: {click: e.closeMainWindow}
        }, [n("i", {staticClass: "xlx-icon-close"})])], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowBookMarkBar,
                expression: "isShowBookMarkBar"
            }], staticClass: "xlx-bookmarks-bar"
        }, [n("div", {
            staticClass: "xlx-bookmarks-bar__content", on: {
                contextmenu: function (t) {
                    t.stopPropagation(), e.showAddBookMarkMenu()
                }
            }
        }, e._l(e.showMarksList, function (t) {
            return n("a", {
                key: t.url,
                staticClass: "xlx-bookmarks-bar__item",
                attrs: {href: "javascript:;", title: t.name + "\n" + t.url},
                on: {
                    click: function (n) {
                        return "button" in n || !e._k(n.keyCode, "left", 37, n.key, ["Left", "ArrowLeft"]) ? "button" in n && 0 !== n.button ? null : (n.stopPropagation(), void e.openNewTab(t.url, t.name)) : null
                    }, contextmenu: function (n) {
                        n.stopPropagation(), e.showBookMarkMenu(t.url, t.name)
                    }
                }
            }, [n("book-marks-item", {
                attrs: {
                    url: t.url,
                    iconUrl: t.iconUrl,
                    updateBookMarksIconUrl: e.updateBookMarksIconUrl
                }
            }), e._v(" "), n("span", {staticClass: "xlx-bookmarks-bar__text"}, [e._v(e._s(t.name))])], 1)
        })), e._v(" "), e.hideBookMarksList.length ? n("a", {
            staticClass: "xlx-bookmarks-bar__more",
            attrs: {href: "javascript:;"},
            on: {click: e.showMenu}
        }, [n("i", {staticClass: "xlx-icon-unfold"})]) : e._e()])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("span", {staticClass: "xlx-bookmarks__icon"}, [this.iconExist ? t("img", {attrs: {src: this.existUrl}}) : t("i", {staticClass: "xlx-icon-net"})])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-client-content"}, [n("div", {
            ref: "settinContain",
            staticClass: "xlx-setting",
            on: {scroll: e.handleScroll}
        }, [n("ul", {staticClass: "xlx-setting-nav"}, e._l(e.confSchema, function (t, i) {
            return n("li", {
                key: i,
                staticClass: "xlx-setting-nav__item",
                class: {"is-active": e.currenIndex === i},
                on: {
                    click: function (t) {
                        e.clickTab(i)
                    }
                }
            }, [n("a", {attrs: {href: "#"}}, [e._v(e._s(t.name))])])
        })), e._v(" "), n("div", {staticClass: "xlx-setting-wrapper"}, e._l(e.confSchema, function (t, i) {
            return n("div", {
                key: i,
                staticClass: "xlx-setting-content contain-tab",
                staticStyle: {display: "block"}
            }, [n("ul", e._l(t.children, function (t, i) {
                return n("li", {
                    key: i,
                    staticClass: "xlx-setting-content__item"
                }, [n("span", {staticClass: "xlx-setting-content__label"}, [e._v(e._s(t.name))]), e._v(" "), n("div", {staticClass: "xlx-setting-content__box"}, [n("ul", {class: t.classes}, e._l(t.children, function (t, i) {
                    return n("li", {key: i, class: t.liClasses || ""}, [n("generator-view", {
                        attrs: {
                            item: t,
                            formData: e.formData
                        }, on: {input: e.handleConfChange}
                    })], 1)
                }))])])
            }))])
        }))])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-client-content"}, [n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isError,
                expression: "isError"
            }], staticClass: "error-page"
        }, [e._m(0), e._v(" "), n("div", {staticClass: "error-button"}, [n("td-button", {
            attrs: {
                secondary: "",
                disabled: !e.canGoBack
            }, on: {click: e.goBack}
        }, [e._v("返回")]), e._v(" "), n("td-button", {on: {click: e.refresh}}, [e._v("刷新")])], 1)])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "error-main"}, [t("div", {staticClass: "pic-error"}), this._v(" "), t("h1", [this._v("您访问的网站飞到了外太空")]), this._v(" "), t("p")])
    }];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            staticClass: "xlx-client-side",
            class: {"is-secret": e.isShowPrivateSpace}
        }, [n("tool-bar-container"), e._v(" "), n("ad-platform-ctrl", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.adShow,
                expression: "adShow"
            }], on: {"ad-show": e.handleAdShow}
        }), e._v(" "), e.isSearch ? n("download-search-container", {on: {"close:keysearch": e.closeSearchUI}}) : e._e(), e._v(" "), e.showPrivateSpaceOpenPage ? n("private-space-open-page-container") : n("download-list-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.isSearch,
                expression: "!isSearch"
            }], ref: "downloadlist", nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyOpenSearchUI(t) : null
                }
            }
        }), e._v(" "), e.showUpgradeTask ? n("upgrade-task-container") : e._e(), e._v(" "), n("toast-notify"), e._v(" "), n("status-bar-container")], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-client-index"}, [t("webview", {
            ref: "webview",
            staticClass: "iframe-home",
            attrs: {nodeintegration: "", src: this.homePageUrl, preload: this.preloadPath}
        })], 1)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-bar xlx-bar--ad"}, [n("p", [n("span", {staticClass: "xlx-bar__image"}, [n("img", {
            attrs: {
                src: e.iconUrl,
                alt: ""
            }
        })]), n("a", {
            attrs: {href: "#"}, on: {
                click: function (t) {
                    e.onClick("content")
                }
            }
        }, [e._v(e._s(e.content))])]), e._v(" "), n("div", {staticClass: "xlx-bar__option"}, [n("a", {
            staticClass: "xlx-bar__button",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("btn")
                }
            }
        }, [e._v(e._s(e.btnText))]), e._v(" "), n("a", {
            staticClass: "xlx-bar__close",
            attrs: {href: "javascript:;", title: "关闭"},
            on: {
                click: function (t) {
                    e.onClick("close")
                }
            }
        }, [n("i", {staticClass: "td-icon-close"})])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            directives: [{name: "show", rawName: "v-show", value: e.show, expression: "show"}],
            staticClass: "xlx-bar",
            class: "xlx-bar--" + e.type,
            staticStyle: {bottom: "40px"},
            on: {mousemove: e.handleMouseMove, mouseout: e.handleMouseOut}
        }, [n("p", ["fail" === e.type ? n("i", {staticClass: "td-icon-warning"}) : e._e(), e._v(e._s(e.message))]), e._v(" "), n("div", {staticClass: "xlx-bar__option"}, [e.cancel ? n("a", {
            staticClass: "xlx-bar__button",
            attrs: {href: "javascript:;"},
            on: {click: e.handleCancel}
        }, [e._v("取消")]) : e._e(), e._v(" "), n("a", {
            staticClass: "xlx-bar__close",
            attrs: {href: "javascript:;", title: "关闭"},
            on: {click: e.handleClose}
        }, [n("i", {staticClass: "td-icon-close"})])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, , function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-side-update"}, [t("div", {staticClass: "xlx-side-update__progress"}, [this._v(this._s(this.progress) + "%")]), this._v(" "), this._m(0)])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("p", [this._v("正在升级下载引擎"), t("span", [t("i", [this._v("...")])])])
    }];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "td-collapse xlx-side"}, [t("div", {staticClass: "xlx-side__empty"}, [t("span", {staticClass: "xlx-icon-empty-secret"}), this._v(" "), t("h3", [this._v("私人空间")]), this._v(" "), t("p", {staticClass: "xlx-side__empty-text"}, [this._v("只有自己可以查看的下载任务")]), this._v(" "), t("a", {
            staticClass: "td-button",
            attrs: {href: "javascript:;"},
            on: {click: this.openPrivateSpace}
        }, [this._v("开启私人空间")])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-side-search"}, [n("div", {staticClass: "xlx-search-record"}, [n("label", {staticClass: "td-input"}, [n("td-input", {
            ref: "input",
            attrs: {placeholder: e.holderTextTip},
            on: {
                focus: e.onInputFocus, blur: e.onInputBlur, input: e.startSearch, keydown: function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? void e.$refs.input.select() : null
                }
            },
            nativeOn: {
                contextmenu: function (t) {
                    return e.handlePopInputMenu(t)
                }, keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            },
            model: {
                value: e.curSearchKey, callback: function (t) {
                    e.curSearchKey = t
                }, expression: "curSearchKey"
            }
        })], 1), e._v(" "), this.inputFlag && this.curSearchKey.trim().length > 0 ? n("p", {staticClass: "xlx-search-record__result"}, [n("span", [e._v(e._s(e.resultCount))]), e._v("个结果")]) : e._e(), e._v(" "), n("a", {
            staticClass: "xlx-search-record__clear is-danger",
            attrs: {href: "#", title: ""},
            on: {click: e.clickCloseSearch}
        }, [n("i", {staticClass: "td-icon-close"})])]), e._v(" "), n("div", {staticClass: "xlx-search-list"}, [n("td-collapse", {
            staticClass: "xlx-search-list",
            attrs: {value: e.searchListPanel, tabindex: "0"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [e.downloadingSearchList.length > 0 ? n("td-collapse-item", {
            staticClass: "xlx-side-downloading",
            attrs: {title: e.downloadingCategoryTitle, value: e.categoryLastSelectList[0].category, tabindex: "0"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [n("download-category", {
            ref: "downloading",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "DownloadingItemContainer",
                sortable: !1,
                tasklist: e.downloadingSearchList,
                selectedTaskIds: e.currentSelSearchTaskIds,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_DOWNLOADING_TASKLIST,
                COMMIT_SELECT: e.onDownloadTaskSelect,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                itemType: e.searchType,
                sharedKeyWords: e.curSearchKey,
                pulseForRename: e.pulseEventFlag
            },
            on: {dblclick: e.downloadingItemDbClick, contextmenu: e.handleDownloadingItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    if (!("button" in t) && e._k(t.keyCode, "delete", [8, 46], t.key, ["Backspace", "Delete"])) return null;
                    e.handleDelete(!1)
                }
            }
        })], 1) : e._e(), e._v(" "), e.completeSearchList.length > 0 ? n("td-collapse-item", {
            staticClass: "xlx-side-completed",
            attrs: {title: e.completedCategoryTitle, value: e.categoryLastSelectList[1].category, tabindex: "0"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [n("download-category", {
            ref: "completed",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "CompletedItemContainer",
                sortable: !1,
                tasklist: e.completeSearchList,
                selectedTaskIds: e.currentSelSearchTaskIds,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_COMPLETED_TASKLIST,
                COMMIT_SELECT: e.onDownloadTaskSelect,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                itemType: e.searchType,
                sharedKeyWords: e.curSearchKey,
                pulseForRename: e.pulseEventFlag
            },
            on: {contextmenu: e.handleCompletedItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    if (!("button" in t) && e._k(t.keyCode, "delete", [8, 46], t.key, ["Backspace", "Delete"])) return null;
                    e.handleDelete(!1)
                }
            }
        })], 1) : e._e(), e._v(" "), e.recycleSearchList.length > 0 ? n("td-collapse-item", {
            staticClass: "xlx-side-deleted",
            attrs: {title: e.recycleCategoryTitle, value: e.categoryLastSelectList[2].category, tabindex: "0"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [n("download-category", {
            ref: "dustbin",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "RecycleItemContainer",
                sortable: !1,
                tasklist: e.recycleSearchList,
                selectedTaskIds: e.currentSelSearchTaskIds,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                itemType: e.searchType,
                sharedKeyWords: e.curSearchKey,
                pulseForRename: e.pulseEventFlag,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_RECYCLE_TASKLIST,
                COMMIT_SELECT: e.onDownloadTaskSelect
            },
            on: {dblclick: e.recycleItemDbClick, contextmenu: e.handleRecycleItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    if (!("button" in t) && e._k(t.keyCode, "delete", [8, 46], t.key, ["Backspace", "Delete"])) return null;
                    e.handleDelete(!0)
                }
            }
        })], 1) : e._e(), e._v(" "), this.inputFlag && e.resultCount < 1 && this.curSearchKey.trim().length > 0 ? n("div", {staticClass: "xlx-side__empty"}, [n("p", [e._v("没有搜索到相关内容")])]) : e._e()], 1)], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("td-collapse", {
            staticClass: "xlx-side",
            class: {"is-hover": e.isHoverClass},
            attrs: {value: e.currentCategoryViewId},
            on: {change: e.handleCollapseChange}
        }, [n("td-collapse-item", {
            staticClass: "xlx-side-downloading",
            attrs: {title: e.downloadingCategoryTitle, value: e.categoryLastSelectList[0].category, tabindex: "0"},
            nativeOn: {
                contextmenu: function (t) {
                    return e.handleDownloadingCategoryMenu(t)
                }, keydown: function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? e.selectAll(t) : null
                }
            }
        }, [0 === e.downloadingTaskList.length ? n("div", {
            staticClass: "xlx-side__empty",
            staticStyle: {height: "100%"},
            on: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleDownloadingBlankMenu(t)
                }
            }
        }, [n("span", {staticClass: "xlx-icon-empty-down"}), e._v(" "), n("p", [e._v("没有正在下载任务")])]) : n("download-category", {
            ref: "downloading",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "DownloadingItemContainer",
                tasklist: e.downloadingTaskList,
                selectedTaskIds: e.downloadingSelectedIndexs,
                COMMIT_SELECT: e.UPDATE_DOWNLOADING_SELECTED_TASKS,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_DOWNLOADING_TASKLIST,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId
            },
            on: {dblclick: e.downloadingItemDbClick, contextmenu: e.handleDownloadingItemMenu},
            nativeOn: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleDownloadingBlankMenu(t)
                }, keydown: function (t) {
                    return e.handleDelete(t)
                }
            }
        })], 1), e._v(" "), n("td-collapse-item", {
            staticClass: "xlx-side-completed",
            attrs: {title: e.completedCategoryTitle, value: e.categoryLastSelectList[1].category, tabindex: "0"},
            nativeOn: {
                contextmenu: function (t) {
                    return e.handleCompletedCategoryMenu(t)
                }, keydown: function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? e.selectAll(t) : null
                }
            }
        }, [0 === e.completedTaskList.length ? n("div", {
            staticClass: "xlx-side__empty",
            staticStyle: {height: "100%"},
            on: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }
            }
        }, [n("span", {staticClass: "xlx-icon-empty-finish"}), e._v(" "), n("p", [e._v("没有已完成任务")])]) : n("download-category", {
            ref: "completed",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "CompletedItemContainer",
                tasklist: e.completedTaskList,
                selectedTaskIds: e.completedSelectedTaskIndexs,
                COMMIT_SELECT: e.UPDATE_COMPLETED_SELECTED_TASKS,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_COMPLETED_TASKLIST,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId
            },
            on: {contextmenu: e.handleCompletedItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    return e.handleDelete(t)
                }
            }
        })], 1), e._v(" "), -1 === e.currentCategoryId ? n("td-collapse-item", {
            staticClass: "xlx-side-deleted",
            attrs: {title: e.recycleCategoryTitle, value: e.categoryLastSelectList[2].category, tabindex: "0"},
            nativeOn: {
                contextmenu: function (t) {
                    return e.handleRecycleCategoryMenu(t)
                }, keydown: function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? e.selectAll(t) : null
                }
            }
        }, [0 === e.recycleTaskList.length ? n("div", {
            staticClass: "xlx-side__empty",
            staticStyle: {height: "100%"},
            on: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleRecycleBlankMenu(t)
                }
            }
        }, [n("span", {staticClass: "xlx-icon-empty-dustbin"}), e._v(" "), n("p", [e._v("没有垃圾箱任务")])]) : n("download-category", {
            ref: "dustbin",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "RecycleItemContainer",
                tasklist: e.recycleTaskList,
                selectedTaskIds: e.recycleSelectedTaskIndexs,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                COMMIT_SELECT: e.UPDATE_RECYCLE_SELECTED_TASKS,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_RECYCLE_TASKLIST
            },
            on: {contextmenu: e.handleRecycleItemMenu},
            nativeOn: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleRecycleBlankMenu(t)
                }, keydown: function (t) {
                    e.handleDelete(t, !0)
                }
            }
        })], 1) : e._e(), e._v(" "), e._t("default")], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {class: e.isLimit ? "xlx-status is-limit" : "xlx-status"}, [n("div", {staticClass: "xlx-status-control"}, [n("div", {
            staticClass: "xlx-status-plan",
            attrs: {tabindex: "0"},
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("entry")
                }, blur: e.onPopUpBlur
            }
        }, [n("p", {staticClass: "xlx-status-plan__text"}, [n("i", {staticClass: "xlx-icon-time"}), n("span", [e._v(e._s(e.entryText))]), e._v(" "), n("span", {staticClass: "xlx-status-plan__line"})]), e._v(" "), n("div", {
            staticClass: "xlx-status-control-pop",
            style: e.popUp ? "display:block;" : "display:none"
        }, [n("div", {staticClass: "td-context-menu"}, [n("ul", {staticClass: "td-context-menu__main"}, [n("li", {
            class: e.isLimit ? "td-context-menu__item is-limit" : "td-context-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("limitSpeed")
                }
            }
        }, [n("div", {staticClass: "td-context-menu__content"}, [n("i", {staticClass: "td-icon"}), e._v(" "), n("span", {staticClass: "td-context-menu__text"}, [e._v(e._s(e.limitSpeetMenuText))])])]), e._v(" "), e.isLimit ? n("li", {
            staticClass: "td-context-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("totalSpeed")
                }
            }
        }, [e._m(0)]) : e._e()]), e._v(" "), n("ul", {staticClass: "td-context-menu__main"}, [n("li", {
            staticClass: "td-context-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("freeDownload")
                }
            }
        }, [n("div", {staticClass: "td-context-menu__content"}, [n("i", {staticClass: "td-icon"}, [n("i", {class: {"td-icon-choose": e.isFreeDownload}})]), e._v(" "), n("span", {staticClass: "td-context-menu__text"}, [e._v("空闲下载")])])]), e._v(" "), n("li", {
            staticClass: "td-context-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("scheduleTask")
                }
            }
        }, [n("div", {staticClass: "td-context-menu__content"}, [n("i", {staticClass: "td-icon"}), e._v(" "), n("span", {staticClass: "td-context-menu__text"}, [e._v("计划任务")]), e._v(" "), e.scheduleTaskCount > 0 ? n("span", {staticClass: "xlx-context-menu__number"}, [e._v(e._s(e.scheduleTaskCount))]) : e._e()])])]), e._v(" "), n("ul", {staticClass: "td-context-menu__main"}, [n("li", {staticClass: "td-context-menu__item xlx-context-menu__item--customize"}, [n("div", {staticClass: "td-context-menu__content"}, [n("i", {staticClass: "td-icon"}), e._v(" "), n("span", {staticClass: "td-context-menu__text"}, [e._v("下载完成后:")]), e._v(" "), n("ul", {staticClass: "xlx-context-menu__tag"}, [n("li", {
            class: {"is-chosen": 0 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("shutdown")
                }
            }
        }, [n("a", {attrs: {href: "#"}}, [e._v("关机")])]), e._v(" "), n("li", {
            class: {"is-chosen": 1 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("sleep")
                }
            }
        }, [n("a", {attrs: {href: "#"}}, [e._v("睡眠")])]), e._v(" "), n("li", {
            class: {"is-chosen": 2 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("exit")
                }
            }
        }, [n("a", {attrs: {href: "#"}}, [e._v("退出")])])])])])])])])])]), e._v(" "), n("div", {staticClass: "xlx-status-speed"}, [e.canShowVipSpeed ? n("div", {staticClass: "xlx-status-speed__text"}, [n("p", {
            on: {
                mouseover: e.showPop,
                mouseleave: e.hidePop
            }
        }, [e._v(e._s(e.curSpeed)), n("em", [e._v("+" + e._s(e.curVipSpeed))])])]) : n("div", {staticClass: "xlx-status-speed__text"}, [n("p", {
            on: {
                mouseover: e.showPop,
                mouseleave: e.hidePop
            }
        }, [e._v(e._s(e.curSpeed)), n("em")]), n("a", {
            staticClass: "xlx-status-speed__link",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    return t.stopPropagation(), e.handClickleVipText(t)
                }
            }
        }, [e._v(e._s(e.vipText))])]), e._v(" "), n("div", {
            staticClass: "xlx-status-speed-pop",
            style: {display: e.bDisplay}
        }, [n("div", {staticClass: "xlx-status-speed-list"}, [n("div", {staticClass: "xlx-status-speed-list__item"}, [n("i", {staticClass: "xlx-icon xlx-icon-tips-download"}), n("p", [e._v("当前下载速度："), n("em", [e._v(e._s(e.curHoverSpeed))])])]), e._v(" "), n("div", {staticClass: "xlx-status-speed-list__item"}, [n("i", {staticClass: "xlx-icon xlx-icon-tips-upload"}), n("p", [e._v("当前上传速度："), n("em", [e._v(e._s(e.curUpSpeed))])])])]), e._v(" "), n("div", {staticClass: "xlx-status-speed-list"}, [n("div", {staticClass: "xlx-status-speed-list__item"}, [n("p", [e._v("今日下载流量："), n("em", [e._v(e._s(e.downSize))])])]), e._v(" "), n("div", {staticClass: "xlx-status-speed-list__item"}, [n("p", [e._v("今日上传流量："), n("em", [e._v(e._s(e.upSize))])])])])])])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "td-context-menu__content"}, [t("span", {staticClass: "td-context-menu__text"}, [this._v("全速下载")])])
    }];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-nav"}, [this._l(this.toolbarButtons, function (e) {
            return ["xlx-icon-nav-vip" != e.id ? t("tool-bar-button-container", {
                key: e.id,
                attrs: {id: e.id, title: e.title, buttonClassFilter: e.filterClass, click: e.onClick}
            }) : t("tool-bar-vip-button-container", {
                key: e.id,
                attrs: {id: e.id, title: e.title, buttonClassFilter: e.filterClass, click: e.onClick}
            })]
        })], 2)
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("td-list", {
            staticStyle: {height: "100%"},
            attrs: {
                list: e.loadedListWithKey,
                multiple: "",
                drop: "",
                sortable: e.sortable,
                "drag-selectable": "",
                "chosen-keys": e.selectedTaskIds,
                "load-more": e.loadMore,
                "scroll-speed": 6
            },
            on: {"update:chosenKeys": e.handleSelectChange, "update:list": e.handleListChange},
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var i = t.item, a = t.index, o = t.chosen, r = t.active;
                    return [n(e.componentName, {
                        tag: "component",
                        attrs: {
                            taskId: i.key,
                            itemType: e.itemType,
                            sharedKeyWords: e.sharedKeyWords,
                            pulseForRename: e.pulseForRename,
                            currentCategoryId: e.currentCategoryId,
                            currentCategoryViewId: e.currentCategoryViewId,
                            deleted: e.deleted[i.key],
                            opened: e.opened[i.key],
                            chosen: o,
                            active: r,
                            index: a
                        },
                        on: {
                            "update:deleted": function (t) {
                                e.$set(e.deleted, i.key, t)
                            }, "update:opened": function (t) {
                                e.$set(e.opened, i.key, t)
                            }, dblclick: e.handleItemDbClick, "active-change": function (t) {
                                return e.handleActiveChange(t, a)
                            }, "active-nearby": e.handleActiveNearby
                        },
                        nativeOn: {
                            contextmenu: function (t) {
                                return t.stopPropagation(), e.handleContextMenu(t)
                            }
                        }
                    })]
                }
            }])
        })
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("a", {
            staticClass: "xlx-nav-operate",
            class: this.filterClass,
            attrs: {href: "javascript:;", title: this.title},
            on: {click: this.handleClick}
        }, [t("i", {class: this.id})])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("a", {
            staticClass: "xlx-nav-operate",
            class: e.filterClass,
            attrs: {href: "javascript:;", title: e.handleTitle},
            on: {click: e.handleClick, mouseenter: e.handleEnter}
        }, ["" == e.vipIcon ? n("i", {class: e.id}) : n("img", {attrs: {src: e.vipIcon}, on: {error: e.handleError}})])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-side-item"}, [n("div", {staticClass: "xlx-side-wrapper"}, [n("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return t.stopPropagation(), e.handleDbClick(t)
                }, mouseover: function (t) {
                    return e.handleItemMouseHover(t)
                }, mouseout: function (t) {
                    return e.handleItemMouseOut(t)
                }
            }
        }, [n("i", {
            staticClass: "xlx-icon-type",
            class: e.fileTypeClass,
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), n("p", {
            staticClass: "xlx-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {mouseover: e.handleTaskNameMouseOver}
        }), e._v(" "), n("div", {staticClass: "xlx-side-operate"}, [e.isForbidden ? [n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "彻底删除"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleDestroyTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-clear"})])] : [e.canPlay ? n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "边下边播"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handlePlayTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-download-play"})]) : e._e(), e._v(" "), n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.canPause,
                expression: "!canPause"
            }],
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "下载"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleStartTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-download"})]), e._v(" "), n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.canPause,
                expression: "canPause"
            }],
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "暂停"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handlePauseTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-pause"})])]], 2), e._v(" "), n("td-progress", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.taskError,
                expression: "!taskError"
            }], class: {"is-super": e.isSuperVip}, attrs: {value: e.progress}
        }), e._v(" "), n("div", {staticClass: "xlx-file-info"}, [e.taskError ? [n("p", {staticClass: "xlx-file-error"}, [e._v(e._s(e.errInfo))])] : e.showStartTemplate ? [n("p", {staticClass: "xlx-file-size"}, [n("td-tooltip", {
            attrs: {
                content: "正在获取全部文件大小",
                offset: {x: -5},
                visible: e.isQuerying,
                placement: "bottom"
            }
        }, [n("span", {
            staticClass: "xlx-file-size__total", on: {
                mouseover: function (t) {
                    e.onShowQueryTip(!0)
                }, mouseout: function (t) {
                    e.onShowQueryTip(!1)
                }
            }
        }, [e._v(e._s(e.fileSizeFormat))])])], 1), e._v(" "), e.bTaskCountShow ? n("a", {
            staticClass: "xlx-file-num",
            attrs: {href: "javascript:;"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleFileCountClick(t)
                }, dblclick: function (e) {
                    e.stopPropagation()
                }
            }
        }, [e._v(e._s(e.subTaskCountDesc))]) : e._e(), e._v(" "), n("p", {staticClass: "xlx-file-time"}, [e._v(e._s(e.remain))]), e._v(" "), n("p", {staticClass: "xlx-file-speed"}, [n("span", {staticClass: "xlx-file-speed__total"}, [e._v(e._s(e.taskStatusSpeedInfo))]), e._v(" "), n("ItemVipSpeed", {
            attrs: {
                taskBase: e.taskBase,
                hover: e.hover,
                active: e.active,
                startStatusPrompt: e.startStatusPrompt
            }, on: {"vip-taskinfo": e.handleVipTaskInfo}
        })], 1)] : [n("p", {staticClass: "xlx-file-size"}, [n("span", {staticClass: "xlx-file-size__finish"}, [e._v(e._s(e.downloadSizeFormat))]), e._v(" "), n("span", {staticClass: "xlx-file-size__separator"}, [e._v("/")]), e._v(" "), n("td-tooltip", {
            attrs: {
                content: "正在获取全部文件大小",
                offset: {x: -5},
                visible: e.isQuerying,
                placement: "bottom"
            }
        }, [n("span", {
            staticClass: "xlx-file-size__total", on: {
                mouseover: function (t) {
                    e.onShowQueryTip(!0)
                }, mouseout: function (t) {
                    e.onShowQueryTip(!1)
                }
            }
        }, [e._v(e._s(e.fileSizeFormat))])])], 1), e._v(" "), e.bTaskCountShow ? n("a", {
            staticClass: "xlx-file-num",
            attrs: {href: "javascript:;"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, dblclick: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleFileCountClick(t)
                }
            }
        }, [e._v(e._s(e.subTaskCountDesc))]) : e._e(), e._v(" "), n("p", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.percentVisible,
                expression: "percentVisible"
            }], staticClass: "xlx-file-percent"
        }, [e._v(e._s(e.progressPercent))]), e._v(" "), n("p", {staticClass: "xlx-file-status"}, [e._v("\n            " + e._s(e.taskStatusSpeedInfo) + "\n            "), n("ItemVipSpeed", {
            attrs: {
                taskBase: e.taskBase,
                hover: e.hover,
                active: e.active
            }, on: {"vip-taskinfo": e.handleVipTaskInfo}
        })], 1)]], 2)], 1), e._v(" "), n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowExpand,
                expression: "isShowExpand"
            }], staticClass: "xlx-side-ad"
        }, [n("div", {staticClass: "xlx-side-ad__image"}, [n("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowGroupAccelerate,
                expression: "isShowGroupAccelerate"
            }], staticClass: "xlx-ad-group"
        }, [n("div", {
            staticClass: "xlx-ad-group__image",
            class: {"is-accelerated": e.isAccelerated},
            attrs: {title: e.groupAccelerateIconTitle},
            on: {click: e.handleGroupAccelerateClick}
        })])]), e._v(" "), n("ItemVipExpand", {attrs: {taskId: e.taskId}})], 1)], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-side-item"}, [n("div", {staticClass: "xlx-side-wrapper"}, [n("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return e.handleDbClick(t)
                }
            }
        }, [n("i", {
            staticClass: "xlx-icon-type",
            class: e.fileTypeClass,
            style: e.isFileIcon ? {background: "url(" + e.fileIcon + ")", "background-size": "100% 100%"} : {},
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), n("p", {
            staticClass: "xlx-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {mouseover: e.handleTaskNameMouseOver}
        }), e._v(" "), n("div", {staticClass: "xlx-side-operate"}, [n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "还原"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleRestore(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-restore"})]), e._v(" "), n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "彻底删除"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleClear(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-clear"})])]), e._v(" "), n("div", {staticClass: "xlx-file-info"}, [n("p", {staticClass: "xlx-file-size"}, [n("span", {staticClass: "xlx-file-size__total"}, [e._v(e._s(e.fileSizeFormat))])]), e._v(" "), n("p", {staticClass: "xlx-file-time"}, [e._v(e._s(e.creationTime))])])])], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-side-item"}, [n("div", {staticClass: "xlx-side-wrapper"}, [n("a", {
            staticClass: "xlx-side-completed__mark",
            attrs: {href: "javascript:;", title: e.markTitle},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleMark(t)
                }
            }
        }), e._v(" "), n("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return e.handleDbClick(t)
                }
            }
        }, [n("i", {
            class: e.fileTypeClass,
            style: e.isInstallFileIcon ? {
                background: "url(" + e.installFileIcon + ")",
                "background-size": "100% 100%"
            } : {},
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), n("p", {
            staticClass: "xlx-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {mouseover: e.handleTaskNameMouseOver}
        }), e._v(" "), n("div", {staticClass: "xlx-side-operate"}, [e.canPlay ? n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "播放"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handlePlayTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-play"})]) : e._e(), e._v(" "), e.deleted ? n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "删除任务记录"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleDestroyTask(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-clear"})]) : n("a", {
            staticClass: "xlx-side-operate__button",
            attrs: {href: "javascript:;", title: "打开文件夹"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleOpenFile(t)
                }
            }
        }, [n("i", {staticClass: "xlx-icon-file"})])]), e._v(" "), n("div", {staticClass: "xlx-file-info"}, [n("p", {staticClass: "xlx-file-size"}, [n("span", {staticClass: "xlx-file-size__total"}, [e._v(e._s(e.fileSizeFormat))])]), e._v(" "), n("p", {staticClass: "xlx-file-time"}, [e._v(e._s(e.completeTime))]), e._v(" "), e.bTaskCountShow ? n("a", {
            staticClass: "xlx-file-num",
            attrs: {href: "javascript:;"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, dblclick: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleFileCountClick(t)
                }
            }
        }, [e._v(e._s(e.subTaskCount))]) : e._e()])])], 1)])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return e.isShowVipSpeed ? n("span", {
            staticClass: "xlx-file-speed__vip",
            class: {"is-super": e.isShowSuperSpeed}
        }, [e._v("\n  " + e._s(e.vipSpeed) + "\n")]) : n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowVipHover,
                expression: "isShowVipHover"
            }],
            staticClass: "xlx-file-speed__vip-link",
            class: {"is-super": e.isShowSuperHover},
            attrs: {href: "javascript:;"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickVipLink(t)
                }
            }
        }, [e._v("\n  " + e._s(e.hoverText) + "\n")])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return e.isTry ? n("ItemTryStatus", {
            attrs: {
                taskId: e.taskId,
                taskUIStatus: e.taskUIStatus,
                isVip: e.isVip,
                taskInfo: e.taskInfo
            }
        }) : n("ItemVipStatus", {
            attrs: {
                taskId: e.taskId,
                taskUIStatus: e.taskUIStatus,
                isVip: e.isVip,
                authority: e.authority,
                taskInfo: e.taskInfo,
                btErrorType: e.btErrorType
            }
        })
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {staticClass: "xlx-plugin-vip xlx-plugin-vip--ordinary is-normal"}, [n("div", {staticClass: "xlx-plugin-vip__inner"}, [e.isErrorScene ? n("a", {
            staticClass: "xlx-plugin-vip__text is-error",
            attrs: {href: "#"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickErrorScenceText(t)
                }
            }
        }, [e._v("\n      " + e._s(e.errorSceneText) + "\n    ")]) : e.isDefaultScene ? n("p", {staticClass: "xlx-plugin-vip__text is-default"}, [e._v("\n      " + e._s(e.defaultSceneText) + "\n    ")]) : n("a", {
            staticClass: "xlx-plugin-vip__text",
            attrs: {href: " javascript:; "},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickScenceText(t)
                }
            }
        }, [e._v("\n      " + e._s(e.sceneText) + "\n    ")]), e._v(" "), e.isShowSuperBtn ? n("a", {
            staticClass: "",
        }, [e._v("\n")]) : e.isShowVipBtn ? n("a", {
            staticClass: "xlx-plugin-vip__button ",
            attrs: {href: " javascript:; "},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickVipButton(t)
                }
            }
        }, [n("span", {staticClass: "xlx-plugin-vip__logo-vip "}, [e._v("VIP")]), e._v(" "), n("span", {staticClass: "xlx-plugin-vip__button-text "}, [e._v("会员加速")])]) : n("p", {
            staticClass: "xlx-plugin-vip__status ",
            class: {"is-super": e.isSuperStarted, "is-error": e.showFailed}
        }, [e._v("\n      " + e._s(e.taskStatusText) + "\n    ")])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    var i = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            staticClass: "xlx-plugin-vip",
            class: [e.pluginVipClass, {"is-trying": e.showTrying, "is-normal": e.isNormal}]
        }, [n("div", {
            directives: [{name: "show", rawName: "v-show", value: e.showTrying, expression: "showTrying"}],
            staticClass: "td-progress-bar"
        }, [n("div", {staticClass: "td-progress-bar__outer"}, [n("div", {
            staticClass: "td-progress-bar__inner",
            style: {width: e.progressPercent}
        })])]), e._v(" "), n("div", {staticClass: "xlx-plugin-vip__inner"}, [n("p", {
            staticClass: "xlx-plugin-vip__text",
            class: {"is-error": e.isError}
        }, [e._v(e._s(e.taskStatusText))]), e._v(" "), n("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.isError,
                expression: "!isError"
            }], staticClass: "xlx-plugin-vip__button", attrs: {href: "javascript:;"}, on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickVipButton(t)
                }
            }
        }, [e.isSuper ? n("i", {staticClass: "vip-icon-svip0"}) : n("span", {staticClass: "xlx-plugin-vip__logo-vip"}, [e._v("VIP")]), e._v(" "), n("span", {staticClass: "xlx-plugin-vip__button-text"}, [e._v(e._s(e.buttonText))])])])])
    }, a = [];
    i._withStripped = !0, n.d(t, "a", function () {
        return i
    }), n.d(t, "b", function () {
        return a
    })
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(8), o = n(37), r = i.default.getLogger("DownloadKernel.CategoryView"),
        s = o.DownloadKernelEventManager.getEventManager();
    t.CategoryView = class {
        constructor(e, t) {
            this.categoryId = e, this.categoryViewId = t, this.tasks = new Map
        }

        getCategoryViewId() {
            return this.categoryViewId
        }

        getTasks() {
            return this.tasks
        }

        getTaskCount() {
            return this.tasks.size
        }

        insertTask(e, t = a.DownloadKernel.TaskInsertReason.Unknown) {
            if (null !== e) {
                let n = [];
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t];
                    if (!i) continue;
                    i.setCategoryViewId(this.categoryViewId);
                    let o = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                    0 !== o && (this.tasks.set(o, i), n.push(i)), r.information("insertTask categoryId:", this.categoryId, ", catygoryViewId:", this.categoryViewId, "taskId:", o)
                }
                s.fireTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, this.categoryId, this.categoryViewId, n, t)
            }
        }

        removeTask(e) {
            if (null !== e) {
                let t = [];
                for (let n = 0; n < e.length; ++n) {
                    let i = e[n];
                    if (!i) continue;
                    let o = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                    this.tasks.has(o) && (this.tasks.delete(o), t.push(i)), r.information("removeTask catygoryView:", this.categoryViewId, "taskId:", o)
                }
                s.fireTaskEvent(a.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.categoryId, this.categoryViewId, t)
            }
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(27);
    !function (e) {
        let t = !1, o = [];
        e.initBtTaskTrackers = function () {
            return i(this, void 0, void 0, function* () {
                if (!t) {
                    t = !0;
                    let e = null;
                    try {
                        a.default.defaults.adapter = n(28), e = yield a.default.get("http://plugin.xl7.xunlei.com/7.9/normal/trackers.json")
                    } catch (e) {
                    }
                    if (null !== e && 200 === e.status && e.data && "" !== e.data && e.data.trackers && e.data.trackers.tracker) for (let t = 0; t < e.data.trackers.tracker.length; ++t) {
                        let n = e.data.trackers.tracker[t];
                        n && "" !== n && o.push(n)
                    }
                }
            })
        }, e.getExtraTracks = function () {
            return o
        }
    }(t.BTExtraTrackNS || (t.BTExtraTrackNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(6), o = n(9), r = n(150), s = n(23), l = n(22), u = n(13), d = n(1).default.getLogger("Activity");
    t.activityObj = new class {
        constructor() {
            this.activityEnable = !1, this.activityCssPath = "", this.activityUrl = "", this.eventListener = !1, this.onLoginSucCookie = 0, this.onLoginFailedCookie = 0
        }

        getActiveConfig() {
            return i(this, void 0, void 0, function* () {
            })
        }

        isHaverActivityAw(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (null === this.activityEnable || void 0 === this.activityEnable || !1 === this.activityEnable) break;
                    if ("auto" === e) {
                        let e = yield this.getActivityTimerAw();
                        t = this.getCurDate() !== e
                    } else !0 === this.activityEnable && (t = !0)
                } while (0);
                return t
            })
        }

        getActivityInfo() {
            return {
                activityEnable: this.activityEnable,
                activityCssPath: this.activityCssPath,
                activityUrl: this.activityUrl
            }
        }

        setActivityConfig() {
            let e = this.getCurDate();
            l.ConfigNS.setValue("Activity", "Date", e)
        }

        attachListenerEvent() {
            if (this.activityEnable && !1 === this.eventListener) {
                this.eventListener = !0;
                let e = "logfrom=activity_vip_get,logtype=client";
                u.XLStatNS.trackEvent("user_info", "loginpanel_show", "", 0, 0, 0, 0, e), this.onLoginSucCookie = a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                    this.eventListener = !1, this.detachListenerEvent(), a.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", this.activityUrl)
                }), this.onLoginFailedCookie = a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginFailed", (e, t) => {
                    if ("close" === t) {
                        let e = "logfrom=activity_vip_get,logtype=client";
                        u.XLStatNS.trackEvent("user_info", "loginpanel_close", "", 0, 0, 0, 0, e)
                    }
                    this.eventListener = !1, this.detachListenerEvent()
                })
            }
        }

        detachListenerEvent() {
            a.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.onLoginSucCookie), a.NativeCallModule.nativeCall.DetachNativeEvent("onLoginFailed", this.onLoginFailedCookie)
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        getActivityTimerAw() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        let t = l.ConfigNS.getValue("Activity", "Date", "");
                        e(t)
                    })
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(254), o = n(104), r = n(766), s = n(79), l = n(255), u = n(62), d = n(45),
        c = n(1).default.getLogger("Thunder.VipDownload.vip-task"), h = s.UserHelperNS.getHelper(),
        f = u.PluginHelperNS.getHelper();

    class p extends o.HttpSession {
        constructor() {
            super(...arguments), this.mGcidTaskMap = new Map
        }

        queyToken(e) {
            return i(this, void 0, void 0, function* () {
                let t = ++p.sequence, n = h.userId, i = yield h.getSessionId(), o = f.currentTime,
                    s = a.HttpJsonCryptoNS.getUriParam(t, o, 0);
                return this.host = "speed.auth.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/speed/speedup?" + s, this.auth = a.HttpJsonCryptoNS.getAuthorization(n, i), this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = n, e.random = o, this.mGcidTaskMap.clear(), this.body = yield r.VipTaskHttpPackageNS.createTokenBuffer(e, this.mGcidTaskMap), yield this.postTokenRequest(e)
            })
        }

        queryErrorCode() {
            return i(this, void 0, void 0, function* () {
                let e = f.clientName, t = f.thunderVersionNumber || 0, n = f.currentTime, i = Math.random(),
                    a = "!@#$%^&*()QAZ" + e + t + n + i,
                    o = "client_name=" + e + "&client_version=" + t + "&ts=" + n + "&r=" + i + "&key=" + (a = (a = d.ToolsUtilitiesAWNS.genarateMd5(a)).toUpperCase());
                return c.information("key", a), this.host = "download.code.lixian.vip.xunlei.com", this.retries = 2, this.timeout = 15e3, this.path = "/errcode?" + o, yield this.getErrorCodeRequest()
            })
        }

        postTokenRequest(e) {
            return new Promise(t => {
                this.post(n => {
                    let i = [];
                    if (h.userId === e.userId) {
                        let t = n.headers["random-num"];
                        c.information("random", t);
                        let a = null, o = void 0;
                        do {
                            if (200 !== n.statusCode) {
                                o = l.HttpErrorNS.errorStatusCode;
                                break
                            }
                            if (!n.body || !t) {
                                o = l.HttpErrorNS.errorData;
                                break
                            }
                            {
                                let i = Number(t).valueOf();
                                a = r.VipTaskHttpPackageNS.praseTokenBuffer(e.userId, i, n.body)
                            }
                            if (!a) {
                                o = l.HttpErrorNS.errorPrase;
                                break
                            }
                            o = l.HttpErrorNS.errorOk
                        } while (0);
                        i = this.createTokenResponse(o, e, a)
                    }
                    t(i)
                }, n => {
                    c.information("error", n);
                    let i = [];
                    h.userId === e.userId && (i = this.createTokenResponse(l.HttpErrorNS.errorConnect, e)), t(i)
                })
            })
        }

        getErrorCodeRequest() {
            return new Promise(e => {
                this.get(t => {
                    let n = null;
                    200 === t.statusCode && t.body && (n = r.VipTaskHttpPackageNS.praseErrorCodeBuffer(t.body)), e(n)
                }, t => {
                    c.information("error", t), e(null)
                })
            })
        }

        createTokenResponse(e, t, n) {
            let i = [];
            if (e === l.HttpErrorNS.errorOk) if (0 === n.result && n.task_infos && n.task_infos.length > 0) for (let e of n.task_infos) {
                let t = this.getSubIdByGcid(e.gcid);
                if (void 0 !== t) {
                    let n = {
                        subId: t,
                        result: e.result,
                        message: e.simple_msg,
                        detailMessage: e.message,
                        token: e.token,
                        expire: e.expire
                    };
                    i.push(n)
                }
            } else for (let e of t.files) {
                let t = {subId: e.subId, result: n.result, message: n.message, detailMessage: n.detailMessage};
                i.push(t)
            } else for (let n of t.files) {
                let t = {subId: n.subId, result: e, message: l.HttpErrorNS.getMessage(e)};
                i.push(t)
            }
            return i
        }

        getSubIdByGcid(e) {
            return this.mGcidTaskMap.get(e)
        }
    }

    p.sequence = 0, t.VipTaskHttpSession = p
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(9), s = n(8), l = n(154), u = n(31), d = n(772), c = n(201), h = n(138), f = n(157),
        p = n(7), g = n(45), k = o.default.getLogger("NativeFunction.TaskInfo"),
        m = u.DownloadKernelTaskManager.getTaskManager();

    class T {
        constructor() {
            d.HistoryTaskSpeedInfoNS.init().catch()
        }

        getHistoryTaskInfoString(e) {
            return i(this, void 0, void 0, function* () {
                let t = "", n = yield this.getTaskInfo(e);
                if (n) {
                    let i = m.getTaskFromTaskId(e);
                    if (i) {
                        let a = this.getFileList(i);
                        n.fileList = a;
                        let o = n.progress, r = yield this.getHistorySpeedInfo(e, o);
                        r && (r.maxSpeed && (n.maxSpeed = r.maxSpeed), r.historySpeedMap && (n.historySpeed = r.historySpeedMap), r.historyIncreaseSpeedMap && (n.historyIncreaseSpeed = r.historyIncreaseSpeedMap), t = JSON.stringify(n), k.information("taskInfo: ", t))
                    } else k.warning("task is null")
                } else k.warning("taskInfo is null");
                return t
            })
        }

        getTaskInfoString(e) {
            return i(this, void 0, void 0, function* () {
                let t = "", n = yield this.getTaskInfo(e);
                return n ? (t = JSON.stringify(n), k.information("taskInfo: ", t)) : k.warning("taskInfo is null"), t
            })
        }

        getBtSubFileListString(e, t) {
            let n = [];
            do {
                let i = m.getTaskFromTaskId(e);
                if (!i) break;
                if (i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Bt) break;
                let a = i.getExtraObject();
                if (!a) break;
                for (let e = 0; e < t.length; ++e) {
                    let i = {}, o = t[e], r = a.getBtFileByRealIndex(o.realIndex);
                    i.index = o.realIndex, i.filePath = o.relativePath, i.fileName = "", r ? (i.fileName = r.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName), i.isNeedDownload = r.getIsDownload()) : i.isNeedDownload = 1, i.fileSize = o.fileSize, i.cid = o.cid, i.gcid = o.gcid, i.status = o.fileStatus, i.downloadSize = o.downloadSize, i.errCode = o.errorCode, i.status === s.DownloadKernel.BtFileStatus.Forbidden ? i.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(i.errCode) : i.errMessage = "", n.push(i)
                }
            } while (0);
            return JSON.stringify(n)
        }

        getGroupTaskSubFileListString(e) {
            let t = [];
            for (let n = 0; n < e.length; ++n) {
                let i = e[n];
                if (i) {
                    let e = {};
                    e.filePath = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath), e.index = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileIndex), e.taskId = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId), e.fileName = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), e.url = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), e.isNeedDownload = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask), e.fileSize = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize), e.downloadSize = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize), e.cid = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Cid), e.gcid = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid), e.status = i.getTaskStatus(), e.errCode = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode), e.status === s.DownloadKernel.TaskStatus.Failed ? e.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(e.errCode) : e.errMessage = "";
                    let n = i.getTaskChannelInfo();
                    e.dcdnStatus = n.dcdnStatus, t.push(e)
                }
            }
            return JSON.stringify(t)
        }

        calcGroupTaskUniqueId(e) {
            let t = "", n = e.getExtraObject(), i = n.getSubTaskCount();
            if (i > 0) {
                let e = [];
                for (let t = 0; t < i; ++t) {
                    let i = n.getSubTaskByIndex(t).getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl);
                    p.isString(i) && i.length > 0 && e.push(i)
                }
                if (e.length > 0) {
                    e.sort();
                    let n = e.length, i = "#" + n + "#";
                    k.information("CalcGroupTaskUniqueID urlNum: ", n);
                    for (let t = 0; t < n; ++t) i += e[t] + "#";
                    let a = Buffer.alloc(i.length);
                    a.write(i), (t = g.ToolsUtilitiesAWNS.encryptSha1Buffer(a)) && (t = t.toUpperCase())
                }
            }
            return t
        }

        getTaskInfo(e) {
            return i(this, void 0, void 0, function* () {
                let t = {}, n = m.getTaskFromTaskId(e);
                if (n) {
                    let i = n.getTaskStatus(), o = 0;
                    i !== s.DownloadKernel.TaskStatus.Succeeded && i !== s.DownloadKernel.TaskStatus.Seeding || (o = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.CompletionTime)), n.getTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime) > 0 && (i = 20);
                    let r = "", u = "", d = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType),
                        c = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName);
                    d !== s.DownloadKernel.TaskType.P2sp && d !== s.DownloadKernel.TaskType.Emule || ((r = a.extname(c)) && (r = r.substring(1)), u = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl));
                    let h = "";
                    if (d === s.DownloadKernel.TaskType.Bt) {
                        h = n.getExtraObject().getInfoId()
                    }
                    let p = "", g = n.getTaskChannelInfo(),
                        m = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                        T = g.offlineSize + g.originSize + g.p2pSize + g.p2sSize;
                    T < m && (g.p2pSize > 0 ? g.p2pSize = g.p2pSize + m - T : g.offlineSize > 0 ? g.offlineSize = g.offlineSize + m - T : g.originSize > 0 ? g.originSize = g.originSize + m - T : g.p2sSize > 0 && (g.p2sSize = g.p2sSize + m - T));
                    let v = "";
                    d === s.DownloadKernel.TaskType.P2sp || d === s.DownloadKernel.TaskType.Emule ? v = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid) : d === s.DownloadKernel.TaskType.Group && (k.information("calcGroupTaskUniqueId before"), v = this.calcGroupTaskUniqueId(n), k.information("calcGroupTaskUniqueId end, taskId: ", n.getId(), ", uniqueId: ", v));
                    let y = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                        S = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal),
                        w = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing),
                        b = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod),
                        C = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.CreateTime),
                        N = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                        D = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Description),
                        I = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode), _ = yield this.getActions(n),
                        x = this.getProgress(n), A = this.getSpeedInfo(n);
                    if (t.status = i, t.taskID = e, t.type = d, t.name = c, t.gcid = v, t.suffix = r, t.url = u, t.isFromVest = !1, "" !== u || "" !== h) {
                        let e = "" === u ? h : u, n = yield f.isVestUrl(e, "vestURL");
                        t.isFromVest = n
                    }
                    t.size = y, t.downloadSize = m, t.progress = x, t.allResourceCount = S, t.resourceCount = w, t.errCode = I, t.status === s.DownloadKernel.TaskStatus.Failed ? t.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(t.errCode) : t.errMessage = "", n.getStopReason() === s.DownloadKernel.TaskStopReason.SelectDownloadLists ? t.stopReason = "downloadSelected" : t.stopReason = "", t.actions = _, t.averageSpeed = A.averageSpeed, t.speed = A.speed, t.increaseSpeed = A.increaseSpeed, t.channelInfo = g, t.savePath = N, t.infoId = h, t.duration = b, t.createTime = C, t.completeTime = o, t.md5 = p, t.note = D
                }
                return t
            })
        }

        isForbidden(e) {
            let t = !1;
            do {
                if (e.getTaskStatus() === s.DownloadKernel.TaskStatus.Failed) {
                    let n = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode);
                    if (7 === n) {
                        t = !0;
                        break
                    }
                    if (n >= 700 && n <= 799) {
                        t = !0;
                        break
                    }
                }
            } while (0);
            return t
        }

        getActions(e) {
            return i(this, void 0, void 0, function* () {
                let t = [];
                do {
                    let n = e.getTaskStatus();
                    if (n !== s.DownloadKernel.TaskStatus.Failed && n !== s.DownloadKernel.TaskStatus.Unkown) {
                        e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Group && t.push("repost")
                    }
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime) > 0) {
                        t.push("restore"), t.push("delete");
                        break
                    }
                    if (this.isForbidden(e)) {
                        t.push("delete");
                        break
                    }
                    if (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                        if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) === s.DownloadKernel.TaskType.Group) {
                            if (!(yield c.TaskCtrlOperatorNS.isExistTaskFile(e.getTaskBaseInfo()))) {
                                t.push("delete");
                                break
                            }
                            t.push("openFolder")
                        } else {
                            let n = void 0;
                            if (yield h.SingleBtTaskNS.isSingleBtTask(e)) n = h.SingleBtTaskNS.getSinleBtTaskFilePath(e); else {
                                let t = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName),
                                    i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath);
                                n = a.join(i, t)
                            }
                            if (!(yield r.FileSystemAWNS.existsAW(n))) {
                                t.push("delete");
                                break
                            }
                            t.push("openFolder")
                        }
                        e.isSupportPlay() && (t.push("play"), t.push("subtitleDownload"));
                        break
                    }
                    if (1 === e.getTaskAttribute(s.DownloadKernel.TaskAttribute.Forbidden)) {
                        t.push("delete");
                        break
                    }
                    e.isSupportPlay() && n !== s.DownloadKernel.TaskStatus.Failed && t.push("downAndPlay"), n === s.DownloadKernel.TaskStatus.Stopped || n === s.DownloadKernel.TaskStatus.Failed || n === s.DownloadKernel.TaskStatus.Unkown ? t.push("continue") : t.push("pause"), e.isSupportPlay() && t.push("subtitleDownload")
                } while (0);
                return t
            })
        }

        getProgress(e) {
            let t = 0, n = e.getTaskStatus(), i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize);
            return 0 !== i && 0 !== a && (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding || a >= i ? t = 100 : (t = a / i * 100, t = parseInt(t.toString(), 10))), t
        }

        getFileList(e) {
            let t = [], n = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType);
            if (n === s.DownloadKernel.TaskType.Bt) {
                let n = e.getExtraObject().getBtFileList();
                for (let [, e]of n) {
                    let n = {};
                    n.index = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.RealIndex), n.filePath = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FilePath), n.fileName = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName), n.isNeedDownload = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download), n.fileSize = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileSize), n.cid = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Cid), n.gcid = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Gcid), n.status = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileStatus), n.downloadSize = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.DownloadSize), n.errCode = e.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.ErrorCode), n.status === s.DownloadKernel.BtFileStatus.Forbidden ? n.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(n.errCode) : n.errMessage = "", t.push(n)
                }
            } else if (n === s.DownloadKernel.TaskType.Group) {
                let n = e.getExtraObject(), i = n.getSubTaskCount();
                for (let e = 0; e < i; ++e) {
                    let i = n.getSubTaskByIndex(e);
                    if (i) {
                        let n = {};
                        n.index = e, n.filePath = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath), n.taskId = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId), n.fileName = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), n.url = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), n.isNeedDownload = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask), n.fileSize = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize), n.downloadSize = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize), n.cid = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Cid), n.gcid = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid), n.status = i.getTaskStatus(), n.errCode = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode), n.status === s.DownloadKernel.TaskStatus.Failed ? n.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(n.errCode) : n.errMessage = "";
                        let a = i.getTaskChannelInfo();
                        n.dcdnStatus = a.dcdnStatus, t.push(n)
                    }
                }
            }
            return t
        }

        getSpeedInfo(e) {
            let t = e.getDownloadSpeed(), n = 0, i = e.getVipSpeed(),
                a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                o = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
            o < 1 && (o = 1), n = a / o, n = parseInt(n.toString(), 10);
            let r = {};
            return r.averageSpeed = n, r.speed = t, r.increaseSpeed = i, r
        }

        getHistorySpeedInfo(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = {maxSpeed: 0, historySpeedMap: {}, historyIncreaseSpeedMap: {}},
                    i = yield d.HistoryTaskSpeedInfoNS.getTaskSpeedInfo(e);
                do {
                    if (!i) break;
                    if (!i.maxSpeed || i.maxSpeed < 0) break;
                    n.maxSpeed = i.maxSpeed;
                    let e = i.speedInfoMap;
                    if (!e) break;
                    void 0 === t && (t = 0), (!(t = parseInt(t.toString(), 10)) || t < 0) && (t = 0), t > 100 && (t = 100);
                    let a = {}, o = {};
                    for (let n in e) if (void 0 !== e[n]) {
                        let i = parseInt(n, 10);
                        if (i <= t) {
                            let t = e[n];
                            a[i] = t.downloadSpeed, o[i] = t.addSpeed
                        }
                    }
                    n.historySpeedMap = a, n.historyIncreaseSpeedMap = o
                } while (0);
                return n
            })
        }
    }

    t.TaskInfoManager = T, function (e) {
        const t = new T;
        e.getTaskInfoManager = function () {
            return t
        }
    }(t.TaskInfoManagerNS || (t.TaskInfoManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(724), r = n(21), s = n(2), l = n(6), u = n(80), d = n(777),
        c = a.remote.require(s.join(__rootDir, "../bin/ThunderHelper.node"));
    t.EmbeddedBrowser = class {
        constructor() {
            this.isAlreadyShow = !1, this.isAlreadyClose = !1, this.width = 460, this.height = 500, this.browserCtr = null, this.wnd = null, this.leftMargin = 5, this.rigthMargin = 5, this.topMargin = 58, this.bootomMargin = 2, this.callBackShow = null, this.callBackClose = null, this.attachListener()
        }

        createWnd(e, t, n, i, s, l, h, f, p, g, k, m, T) {
            do {
                if (null !== this.wnd && void 0 !== this.wnd && !this.wnd.isDestroyed()) break;
                this.isAlreadyClose = !1, this.isAlreadyShow = !1, this.width = s, this.height = l, this.leftMargin = h, this.rigthMargin = f, this.topMargin = p, this.bootomMargin = g, this.callBackShow = m, this.callBackClose = T;
                let v = "development" === a.remote.process.env.RUN_ENV ? "http://localhost:9080/embedded-browser-renderer/" : `file:///${__dirname}/../embedded-browser-renderer/index.html`;
                v += `?browserType=${i}&title=${t}`;
                let y = a.remote.getCurrentWindow();
                this.wnd = new a.remote.BrowserWindow({
                    width: this.width,
                    height: this.height,
                    resizable: !1,
                    frame: !1,
                    parent: y,
                    center: !0,
                    show: !1,
                    modal: n
                }), a.ipcRenderer.send("embedded-browser-create", this.wnd.id), this.wnd.loadURL(v), u.ThunderWindowNS.fitWindowPosInParent(this.wnd, y);
                let S = d.CommonFunctionNs.getBrowserWindowRect(this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bootomMargin);
                this.wnd.once("ready-to-show", () => {
                    let t = this.wnd.getNativeWindowHandle().readUIntLE(0, 4);
                    this.browserCtr = new o.BrowserCtrl, this.browserCtr.createChromiumBrowser(t, e, !1, S), this.attachListenerBrowser(), this.registerNativeFunctions(k), c.setWindowLong(t, r.SetWindowType.GWL_STYLE, r.WindowStyle.WS_CLIPCHILDREN)
                }), this.wnd.on("resize", () => {
                    d.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bootomMargin)
                }), this.wnd.on("move", () => {
                    d.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bootomMargin)
                }), this.wnd.hookWindowMessage(736, (e, t) => {
                    null === this.wnd || void 0 === this.wnd || this.wnd.isDestroyed() || this.wnd.setSize(this.width, this.height)
                }), this.wnd.once("show", () => {
                    this.wnd.setSize(this.width, this.height)
                }), this.wnd.once("close", () => {
                    null !== this.callBackClose && void 0 !== this.callBackClose && "function" == typeof this.callBackClose && this.callBackClose().catch(), this.browserCtr.destroyBrowser(!1)
                }), this.wnd.once("closed", () => {
                    this.isAlreadyClose = !1, this.isAlreadyShow = !1, this.wnd = null, this.browserCtr = null
                })
            } while (0)
        }

        closeWnd() {
            null === this.wnd || void 0 === this.wnd || this.wnd.isDestroyed() || !1 !== this.isAlreadyClose || (this.isAlreadyClose = !0, this.wnd.close())
        }

        showWnd() {
            return i(this, void 0, void 0, function* () {
                null === this.wnd || void 0 === this.wnd || this.wnd.isDestroyed() || (null !== this.callBackShow && void 0 !== this.callBackShow && "function" == typeof this.callBackShow ? (yield this.callBackShow()) ? this.wnd.show() : this.closeWnd() : this.wnd.show())
            })
        }

        attachListenerBrowser() {
            let e = {
                eventName: "OnLoadError", listener: (e, t, n) => {
                    null !== this.wnd && void 0 !== this.wnd && !this.wnd.isDestroyed() && e && (-3 === n && !1 === this.isAlreadyShow ? (this.isAlreadyShow = !0, setTimeout(() => i(this, void 0, void 0, function* () {
                        this.showWnd().catch()
                    }), 1e3)) : !1 === this.isAlreadyClose && this.closeWnd())
                }
            };
            this.browserCtr.attachListener(e);
            let t = {
                eventName: "OnLoadEnd", listener: (e, t, n) => {
                    null !== this.wnd && void 0 !== this.wnd && !this.wnd.isDestroyed() && !1 === this.isAlreadyShow && e && (this.isAlreadyShow = !0, this.showWnd().catch())
                }
            };
            this.browserCtr.attachListener(t)
        }

        attachListener() {
            l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.fireEvent("OnUserLogin", e)
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.fireEvent("OnUserLogout", e)
            })
        }

        registerNativeFunctions(e) {
            do {
                if (null === this.browserCtr || void 0 === this.browserCtr) break;
                if (null === e || void 0 === e || e.length <= 0) break;
                for (let t = 0; t < e.length; ++t) this.browserCtr.registerNativeFunction(e[t].functionName, e[t].nativeFunc, !0)
            } while (0)
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(21), a = n(244), o = n(7);

    class r {
        constructor() {
            this.privateNativeFunctionMap = []
        }

        createChromiumBrowser(e, t, n, i) {
            let r = null;
            do {
                if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n) || o.isNullOrUndefined(i)) break;
                if (r = a.browserSupport.browserManager.createChromiumBrowser(e, t, n, i), this.browser = r, null !== this.browser && void 0 !== this.browser) {
                    let e = {
                        eventName: "OnJsCallNativeFunction", listener: (e, t, n, i) => {
                            this.onJsCallNativeFunction(0, e, t, i)
                        }
                    };
                    this.attachListener(e)
                }
            } while (0);
            return r
        }

        showDevTool(e) {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                if (o.isNullOrUndefined(e)) break;
                this.browser.showDevTool(e)
            } while (0);
            return !1
        }

        navigate(e) {
            let t = !1;
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.navigate(e, "", "", !1), t = !0
            } while (0);
            return t
        }

        refresh(e) {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                if (o.isNullOrUndefined(e)) break;
                this.browser.refresh(e)
            } while (0);
            return !1
        }

        stop() {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.stop()
            } while (0);
            return !1
        }

        destroyBrowser(e) {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                if (o.isNullOrUndefined(a.browserSupport.browserManager)) break;
                if (o.isNullOrUndefined(e)) break;
                a.browserSupport.browserManager.destroyBrowser(this.browser, e)
            } while (0);
            return !1
        }

        attachListener(e) {
            let t = 0;
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                if (o.isNullOrUndefined(e) || o.isNullOrUndefined(e.eventName) || o.isNullOrUndefined(e.listener)) break;
                t = this.browser.attachEventListener(e.eventName, e.listener)
            } while (0);
            return t
        }

        detachListener(e, t) {
            let n = !1;
            do {
                if (0 === t) break;
                if (o.isNullOrUndefined(e) || "" === e) break;
                if (o.isNullOrUndefined(this.browser)) break;
                n = this.browser.detachEventListener(e, t)
            } while (0);
            return n
        }

        getBrowser() {
            return this.browser
        }

        attachListeners(e) {
            do {
                if (o.isNullOrUndefined(this.browser)) break;
                for (let t of e) {
                    if (o.isNullOrUndefined(t) || o.isNullOrUndefined(t.eventName) || o.isNullOrUndefined(t.listener)) continue;
                    this.browser.attachEventListener(t.eventName, t.listener)
                }
            } while (0)
        }

        registerNativeFunction(e, t, n) {
            let i = !1;
            do {
                if (o.isNullOrUndefined(e) || "" === e) break;
                if (o.isNullOrUndefined(t)) break;
                if (!0 === n) {
                    if (o.isNullOrUndefined(this.privateNativeFunctionMap)) break;
                    let n = this.privateNativeFunctionMap.filter(t => e === t.functionName);
                    if (o.isNullOrUndefined(n) || n.length <= 0) {
                        let n = {functionName: e, nativeFunc: t};
                        this.privateNativeFunctionMap.push(n), i = !0
                    }
                } else {
                    if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                    let n = r.nativeFunctionMap.filter(t => e === t.functionName);
                    if (o.isNullOrUndefined(n) || n.length <= 0) {
                        let n = {functionName: e, nativeFunc: t};
                        r.nativeFunctionMap.push(n), i = !0
                    }
                }
            } while (0);
            return i
        }

        unRegisterNativeFunction(e, t) {
            let n = !1;
            do {
                if (o.isNullOrUndefined(e) || "" === e) break;
                if (!0 === t) {
                    if (o.isNullOrUndefined(this.privateNativeFunctionMap)) break;
                    for (let t in this.privateNativeFunctionMap) if (this.privateNativeFunctionMap[Number(t)].functionName === e) {
                        this.privateNativeFunctionMap.splice(Number(t), 1), n = !0;
                        break
                    }
                } else {
                    if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                    for (let t in r.nativeFunctionMap) if (r.nativeFunctionMap[Number(t)].functionName === e) {
                        r.nativeFunctionMap.splice(Number(t), 1), n = !0;
                        break
                    }
                }
            } while (0);
            return n
        }

        callNativeFunctionCallback(e, t, ...n) {
            let i = !1;
            do {
                if (o.isNullOrUndefined(t)) break;
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.callNativeFunctionCallback(t, n), i = !0
            } while (0);
            return i
        }

        callJSFunction(e, t, ...n) {
            let i = !1;
            do {
                if (o.isNullOrUndefined(t) || "" === t) break;
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.callJSFunction(t, n), i = !0
            } while (0);
            return i
        }

        fireEvent(e, ...t) {
            let n = !1;
            do {
                if (o.isNullOrUndefined(e) || "" === e) break;
                if (o.isNullOrUndefined(this.browser)) break;
                this.browser.fireEvent(e, t), n = !0
            } while (0);
            return n
        }

        onJsCallNativeFunction(e, t, n, a) {
            let s = !1;
            do {
                if (o.isNullOrUndefined(e), o.isNullOrUndefined(t) || "" === t) break;
                if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                let l = r.nativeFunctionMap.filter(e => t === e.functionName);
                (o.isNullOrUndefined(l) || 0 === l.length || o.isNullOrUndefined(l[0].nativeFunc)) && (l = this.privateNativeFunctionMap.filter(e => t === e.functionName));
                let u = void 0, d = i.NativeFunctionErrorCode.Success;
                if (o.isNullOrUndefined(l) || 0 === l.length || o.isNullOrUndefined(l[0].nativeFunc)) {
                    if (d = i.NativeFunctionErrorCode.FunctionUnExist, o.isNullOrUndefined(n)) {
                        s = !0;
                        break
                    }
                    if (o.isNullOrUndefined(this.browser)) break;
                    this.browser.callNativeFunctionCallback(n, [d].concat(u))
                } else l[0].nativeFunc(this, e, n, a)
            } while (0);
            return s
        }

        onJsCheckNativeFunction(e, t, n) {
            do {
                if (o.isNullOrUndefined(e), o.isNullOrUndefined(n)) break;
                if (o.isNullOrUndefined(t) || "" === t) break;
                if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                let a = r.nativeFunctionMap.filter(e => t === e.functionName), s = i.NativeFunctionErrorCode.Success;
                if ((o.isNullOrUndefined(a) || o.isNullOrUndefined(a[0]) || o.isNullOrUndefined(a[0].nativeFunc)) && (s = i.NativeFunctionErrorCode.FunctionUnExist), o.isNullOrUndefined(this.browser)) break;
                this.browser.callNativeFunctionCallback(n, [].concat(s))
            } while (0);
            return !1
        }

        static registerDefaultNativeFunction(e) {
            do {
                if (null === e || void 0 === e || e.length <= 0) break;
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t].functionName, i = e[t].nativeFunc;
                    if (o.isNullOrUndefined(r.nativeFunctionMap)) break;
                    let a = r.nativeFunctionMap.filter(e => n === e.functionName);
                    if (o.isNullOrUndefined(a) || a.length <= 0) {
                        let e = {functionName: n, nativeFunc: i};
                        r.nativeFunctionMap.push(e)
                    }
                }
            } while (0)
        }
    }

    r.nativeFunctionMap = [], t.BrowserCtrl = r
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(3), o = n(723), r = n(22), s = n(1), l = n(6), u = n(65), d = n(13), c = n(726), h = n(23),
        f = s.default.getLogger("Sign");
    t.signObject = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "猜题领福利", this.url = "", this.width = 460, this.height = 500, this.curPopupType = "", this.lefttMargin = 5, this.rigthMargin = 5, this.topMargin = 58, this.bootomMargin = 2, this.embeddedBrowserObj = new o.EmbeddedBrowser, this.attachListener()
        }

        createSignDlg(e, t) {
            return i(this, void 0, void 0, function* () {
                do {
                    if ("auto" === e && !1 === this.isPopup()) {
                        f.information("不满足auto弹出条件");
                        break
                    }
                    if (yield this.isAlreadyShowTips()) {
                        f.information("createSignDlg 正在显示tips");
                        break
                    }
                    if (!1 === (yield c.CommonSignFunctionNs.isHaveSignQuestion())) {
                        f.information("不存在答题");
                        break
                    }
                    this.curPopupType = e;
                    let n = a.remote.getCurrentWindow();
                    if (n.isMinimized() || !1 === n.isVisible()) {
                        f.information("窗口最小化或者不可见");
                        break
                    }
                    this.embeddedBrowserObj.createWnd(this.url, this.title, !1, "sign", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, t, this.onWndShowResult.bind(this))
                } while (0)
            })
        }

        onWndShowResult() {
            return i(this, void 0, void 0, function* () {
                let e = !0;
                return (yield this.isAlreadyShowTips()) ? (f.information("onWndShowResult 正在显示tips"), e = !1) : (this.writeConfig(), this.statSign("sign_popup_show").catch()), e
            })
        }

        closeDialog() {
            this.embeddedBrowserObj.closeWnd()
        }

        attachListener() {
            l.NativeCallModule.nativeCall.AttachNativeEvent("showTipsWnd", () => {
                f.information("showTipsWnd:"), this.embeddedBrowserObj.closeWnd()
            }), a.remote.ipcMain.on(h.NodeEventMesssageNS.eventEmbeddedBrowserWndClick, (e, t, n) => {
                if ("sign" === t) {
                    let e = "";
                    "btn_close" === n ? e = "sign_close" : "sign_nopop" === n && (e = "sign_nopop"), this.statSign("sign_detail_click", e).catch()
                }
            })
        }

        isAlreadyShowTips() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.NativeCallModule.nativeCall.CallNativeFunction("IsTipsWndShow", t => {
                        f.information("isAlreadyShowTips:", t), e(t)
                    })
                })
            })
        }

        writeConfig() {
            if ("auto" === this.curPopupType) {
                let e = this.getCurDate();
                r.ConfigNS.setValue("ConfigPopUpPanel", "ShowDate", e)
            }
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        isPopup() {
            let e = !1;
            return e
        }

        statSign(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = "";
                if (yield u.LoginHelperNS.loginHelper.isLoginedAw()) {
                    n = "is_login=1";
                    let e = 0;
                    "0" !== (yield u.LoginHelperNS.loginHelper.getUserInfoByKeyAw("isVip", "vip_xl")) && (e = 1), n = `${n},is_vip=${e}`
                } else n = "is_login=0";
                "sign_detail_click" === e && (n = `${n},button=${t}`), f.information("statSign:", e, n), d.XLStatNS.trackEvent("business", e, "", 0, 0, 0, 0, n)
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(84), o = n(65);
    let r = void 0;
    !function (e) {
        e.isAlreadySign = function () {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                if (yield o.LoginHelperNS.loginHelper.isLoginedAw()) {
                    let t = yield o.LoginHelperNS.loginHelper.getUserInfoByKeyAw("userID");
                    try {
                        let n = yield a.fetchSlRes({url: "/sign/pc/query_piece", data: {uid: t}, method: "post"});
                        if (null !== n && void 0 !== n && 200 === n.status && null !== n.data && void 0 !== n.data) {
                            let t = n.data;
                            0 === t.err_code && "" !== t.status && (e = !0)
                        }
                    } catch (e) {
                    }
                }
                return e
            })
        }, e.isHaveSignQuestion = function () {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    if (void 0 !== r) {
                        e = !!r;
                        break
                    }
                    try {
                        let t = yield a.fetchSlRes({url: "/sign/pc/get_question", data: {}});
                        null !== t && void 0 !== t && 200 === t.status && null !== t.data && void 0 !== t.data && (0 === t.data.err_code ? (e = !0, r = !0) : (e = !1, r = !1))
                    } catch (e) {
                    }
                } while (0);
                return e
            })
        }
    }(t.CommonSignFunctionNs || (t.CommonSignFunctionNs = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(555);
    !function (e) {
        const t = new i.SqliteTable;
        t.name = "offline", t.encrypt = !0, t.jsonify = !0, e.getTable = function () {
            return t
        }
    }(t.OfflineTaskDataBaseNS || (t.OfflineTaskDataBaseNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(115), a = n(255), o = n(8);
    t.VipTaskBase = class {
        constructor(e) {
            this.mTaskId = e.getTaskId(), this.mTask = e
        }

        get taskId() {
            return this.mTaskId
        }

        get task() {
            return this.mTask
        }

        get vipTaskStatus() {
            return this.mVipTaskStatus
        }

        set vipTaskStatus(e) {
            if (this.mVipTaskStatus !== e) {
                let t = !1;
                if (e === i.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped) {
                    if (this.mVipTaskStatus === i.VipDownloadDefineNS.VipTaskStatus.CommitFailed || this.mVipTaskStatus === i.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed) return;
                    t = !0
                } else e === i.VipDownloadDefineNS.VipTaskStatus.Init || e === i.VipDownloadDefineNS.VipTaskStatus.Unkown || this.mVipTaskStatus === i.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped ? t = !0 : e > this.mVipTaskStatus && (t = !0);
                t && (this.mVipTaskStatus = e, this.task.getTaskExtra().setVipTaskStatus(this.vipTaskType, e))
            }
        }

        createDcdnError(e) {
            let t = void 0;
            switch (e) {
                case o.DownloadKernel.DcdnStatusCode.ResourceNotFound:
                    t = "正在查找资源";
                    break;
                case o.DownloadKernel.DcdnStatusCode.AuthorizingFailed:
                    t = "加速状态异常";
                    break;
                case o.DownloadKernel.DcdnStatusCode.ForbidByCopyright:
                case o.DownloadKernel.DcdnStatusCode.ForbidByPorNoGraphy:
                case o.DownloadKernel.DcdnStatusCode.ForbidByReactionary:
                case o.DownloadKernel.DcdnStatusCode.ForbidByOtherFilter:
                    t = "资源被屏蔽"
            }
            return {errorStep: a.HttpDefineNS.ErrorStep.Acclerate, result: e, message: t}
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(555);
    !function (e) {
        const t = new i.SqliteTable;
        t.name = "superspeed", t.encrypt = !0, t.jsonify = !0, e.getTable = function () {
            return t
        }
    }(t.VipTaskDataBaseNS || (t.VipTaskDataBaseNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(254), o = n(104), r = n(793), s = n(79), l = n(255), u = n(62),
        d = n(1).default.getLogger("Thunder.VipDownload.try-task"), c = s.UserHelperNS.getHelper();

    class h extends o.HttpSession {
        query(e) {
            return i(this, void 0, void 0, function* () {
                let t = ++h.sequence, n = c.userId, i = yield c.getSessionId(),
                    o = u.PluginHelperNS.getHelper().currentTime, s = a.HttpJsonCryptoNS.getUriParam(t, o);
                return this.host = "try.speed.cdn.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/speed_trial/query?" + s, this.auth = a.HttpJsonCryptoNS.getAuthorization(n, i), this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = n, e.random = o, this.body = yield r.TryTaskHttpPackageNS.createQueryBuffer(e), new Promise(t => {
                    this.post(i => {
                        let a = null;
                        if (c.userId === e.userId) {
                            let e = i.headers["random-num"];
                            if (d.information("random", e), 200 === i.statusCode && i.body && e) {
                                let t = Number(e).valueOf();
                                a = r.TryTaskHttpPackageNS.praseQueryBuffer(n, t, i.body)
                            }
                        }
                        t(a)
                    }, e => {
                        d.information("error", e), t(null)
                    })
                })
            })
        }

        commit(e) {
            return i(this, void 0, void 0, function* () {
                let t = ++h.sequence, n = c.userId, i = yield c.getSessionId(),
                    o = u.PluginHelperNS.getHelper().currentTime, s = a.HttpJsonCryptoNS.getUriParam(t, o);
                return this.host = "try.speed.cdn.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/speed_trial/commit?" + s, this.auth = a.HttpJsonCryptoNS.getAuthorization(n, i), this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = n, e.random = o, this.body = yield r.TryTaskHttpPackageNS.createCommitBuffer(e), new Promise(t => {
                    this.post(i => {
                        let a = null;
                        if (c.userId === e.userId) {
                            let e = i.headers["random-num"];
                            if (d.information("random", e), 200 === i.statusCode) if (i.body && e) {
                                let t = Number(e).valueOf();
                                (a = r.TryTaskHttpPackageNS.praseCommitBuffer(n, t, i.body)) || (a = this.createCommitResponse(l.HttpErrorNS.errorPrase))
                            } else a = this.createCommitResponse(l.HttpErrorNS.errorData); else a = this.createCommitResponse(l.HttpErrorNS.errorStatusCode);
                            t(a)
                        }
                    }, e => {
                        d.information("error", e);
                        let n = this.createCommitResponse(l.HttpErrorNS.errorConnect);
                        t(n)
                    })
                })
            })
        }

        queyToken(e) {
            return i(this, void 0, void 0, function* () {
                let t = ++h.sequence, n = c.userId, i = e.verify, o = u.PluginHelperNS.getHelper().currentTime,
                    s = a.HttpJsonCryptoNS.getUriParam(t, o, 1);
                return this.host = "speed.auth.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/speed/speedup?" + s, this.auth = a.HttpJsonCryptoNS.getAuthorization(n, i), this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = n, e.random = o, this.body = yield r.TryTaskHttpPackageNS.createTokenBuffer(e), new Promise(t => {
                    this.post(i => {
                        let a = null;
                        if (c.userId === e.userId) {
                            let e = i.headers["random-num"];
                            if (d.information("random", e), 200 === i.statusCode) if (i.body && e) {
                                let t = Number(e).valueOf();
                                (a = r.TryTaskHttpPackageNS.praseTokenBuffer(n, t, i.body)) || (a = this.createTokenResponse(l.HttpErrorNS.errorPrase))
                            } else a = this.createTokenResponse(l.HttpErrorNS.errorData); else a = this.createTokenResponse(l.HttpErrorNS.errorStatusCode);
                            t(a)
                        }
                    }, e => {
                        d.information("error", e);
                        let n = this.createTokenResponse(l.HttpErrorNS.errorConnect);
                        t(n)
                    })
                })
            })
        }

        createCommitResponse(e) {
            return {result: e, message: l.HttpErrorNS.getMessage(e)}
        }

        createTokenResponse(e) {
            return {result: e, message: l.HttpErrorNS.getMessage(e)}
        }
    }

    h.sequence = 0, t.TryTaskHttpSession = h
}, function (e, t, n) {
    (function () {
        "use strict";
        var e, i, a, o, r = {}.hasOwnProperty;
        i = n(559), e = n(803), a = n(808), o = n(735), t.defaults = i.defaults, t.processors = o, t.ValidationError = function (e) {
            function t(e) {
                this.message = e
            }

            return function (e, t) {
                for (var n in t) r.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(t, Error), t
        }(), t.Builder = e.Builder, t.Parser = a.Parser, t.parseString = a.parseString
    }).call(this)
}, function (e, t) {
    (function () {
        e.exports = function () {
            function e(e, t, n) {
                if (this.options = e.options, this.stringify = e.stringify, null == t) throw new Error("Missing attribute name of element " + e.name);
                if (null == n) throw new Error("Missing attribute value for attribute " + t + " of element " + e.name);
                this.name = this.stringify.attName(t), this.value = this.stringify.attValue(n)
            }

            return e.prototype.clone = function () {
                return Object.create(this)
            }, e.prototype.toString = function (e) {
                return this.options.writer.set(e).attribute(this)
            }, e
        }()
    }).call(this)
}, function (e, t) {
    (function () {
        var t = function (e, t) {
            return function () {
                return e.apply(t, arguments)
            }
        }, n = {}.hasOwnProperty;
        e.exports = function () {
            function e(e) {
                var i, a, o;
                for (i in this.assertLegalChar = t(this.assertLegalChar, this), e || (e = {}), this.noDoubleEncoding = e.noDoubleEncoding, a = e.stringify || {}) n.call(a, i) && (o = a[i], this[i] = o)
            }

            return e.prototype.eleName = function (e) {
                return e = "" + e || "", this.assertLegalChar(e)
            }, e.prototype.eleText = function (e) {
                return e = "" + e || "", this.assertLegalChar(this.elEscape(e))
            }, e.prototype.cdata = function (e) {
                return e = (e = "" + e || "").replace("]]>", "]]]]><![CDATA[>"), this.assertLegalChar(e)
            }, e.prototype.comment = function (e) {
                if ((e = "" + e || "").match(/--/)) throw new Error("Comment text cannot contain double-hypen: " + e);
                return this.assertLegalChar(e)
            }, e.prototype.raw = function (e) {
                return "" + e || ""
            }, e.prototype.attName = function (e) {
                return "" + e || ""
            }, e.prototype.attValue = function (e) {
                return e = "" + e || "", this.attEscape(e)
            }, e.prototype.insTarget = function (e) {
                return "" + e || ""
            }, e.prototype.insValue = function (e) {
                if ((e = "" + e || "").match(/\?>/)) throw new Error("Invalid processing instruction value: " + e);
                return e
            }, e.prototype.xmlVersion = function (e) {
                if (!(e = "" + e || "").match(/1\.[0-9]+/)) throw new Error("Invalid version number: " + e);
                return e
            }, e.prototype.xmlEncoding = function (e) {
                if (!(e = "" + e || "").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) throw new Error("Invalid encoding: " + e);
                return e
            }, e.prototype.xmlStandalone = function (e) {
                return e ? "yes" : "no"
            }, e.prototype.dtdPubID = function (e) {
                return "" + e || ""
            }, e.prototype.dtdSysID = function (e) {
                return "" + e || ""
            }, e.prototype.dtdElementValue = function (e) {
                return "" + e || ""
            }, e.prototype.dtdAttType = function (e) {
                return "" + e || ""
            }, e.prototype.dtdAttDefault = function (e) {
                return null != e ? "" + e || "" : e
            }, e.prototype.dtdEntityValue = function (e) {
                return "" + e || ""
            }, e.prototype.dtdNData = function (e) {
                return "" + e || ""
            }, e.prototype.convertAttKey = "@", e.prototype.convertPIKey = "?", e.prototype.convertTextKey = "#text", e.prototype.convertCDataKey = "#cdata", e.prototype.convertCommentKey = "#comment", e.prototype.convertRawKey = "#raw", e.prototype.assertLegalChar = function (e) {
                var t;
                if (t = e.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/)) throw new Error("Invalid character in string: " + e + " at index " + t.index);
                return e
            }, e.prototype.elEscape = function (e) {
                var t;
                return t = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, e.replace(t, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\r/g, "&#xD;")
            }, e.prototype.attEscape = function (e) {
                var t;
                return t = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, e.replace(t, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/\t/g, "&#x9;").replace(/\n/g, "&#xA;").replace(/\r/g, "&#xD;")
            }, e
        }()
    }).call(this)
}, function (e, t) {
    (function () {
        var t = {}.hasOwnProperty;
        e.exports = function () {
            function e(e) {
                var n, i, a, o, r, s, l, u, d;
                for (n in e || (e = {}), this.pretty = e.pretty || !1, this.allowEmpty = null != (i = e.allowEmpty) && i, this.pretty ? (this.indent = null != (a = e.indent) ? a : "  ", this.newline = null != (o = e.newline) ? o : "\n", this.offset = null != (r = e.offset) ? r : 0, this.dontprettytextnodes = null != (s = e.dontprettytextnodes) ? s : 0) : (this.indent = "", this.newline = "", this.offset = 0, this.dontprettytextnodes = 0), this.spacebeforeslash = null != (l = e.spacebeforeslash) ? l : "", !0 === this.spacebeforeslash && (this.spacebeforeslash = " "), this.newlinedefault = this.newline, this.prettydefault = this.pretty, u = e.writer || {}) t.call(u, n) && (d = u[n], this[n] = d)
            }

            return e.prototype.set = function (e) {
                var n, i, a;
                for (n in e || (e = {}), "pretty" in e && (this.pretty = e.pretty), "allowEmpty" in e && (this.allowEmpty = e.allowEmpty), this.pretty ? (this.indent = "indent" in e ? e.indent : "  ", this.newline = "newline" in e ? e.newline : "\n", this.offset = "offset" in e ? e.offset : 0, this.dontprettytextnodes = "dontprettytextnodes" in e ? e.dontprettytextnodes : 0) : (this.indent = "", this.newline = "", this.offset = 0, this.dontprettytextnodes = 0), this.spacebeforeslash = "spacebeforeslash" in e ? e.spacebeforeslash : "", !0 === this.spacebeforeslash && (this.spacebeforeslash = " "), this.newlinedefault = this.newline, this.prettydefault = this.pretty, i = e.writer || {}) t.call(i, n) && (a = i[n], this[n] = a);
                return this
            }, e.prototype.space = function (e) {
                var t;
                return this.pretty && (t = (e || 0) + this.offset + 1) > 0 ? new Array(t).join(this.indent) : ""
            }, e
        }()
    }).call(this)
}, function (e, t) {
    (function () {
        "use strict";
        var e;
        e = new RegExp(/(?!xmlns)^.*:/), t.normalize = function (e) {
            return e.toLowerCase()
        }, t.firstCharLowerCase = function (e) {
            return e.charAt(0).toLowerCase() + e.slice(1)
        }, t.stripPrefix = function (t) {
            return t.replace(e, "")
        }, t.parseNumbers = function (e) {
            return isNaN(e) || (e = e % 1 == 0 ? parseInt(e, 10) : parseFloat(e)), e
        }, t.parseBooleans = function (e) {
            return /^(?:true|false)$/i.test(e) && (e = "true" === e.toLowerCase()), e
        }
    }).call(this)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(62), a = n(1).default.getLogger("Thunder.VipDownload.stat-utilities");
    !function (e) {
        const t = i.PluginHelperNS.getHelper();
        e.trackEvent = function (e, n) {
            if (t.nativeCall) {
                let i = (n = n || {}).attribute1 || "", o = n.attribute2 || "", r = n.extData || new Map;
                r.set("plugin_version", t.pluginVersion);
                let s = function (e) {
                    let t = "";
                    return e.forEach((e, n) => {
                        "" !== t && (t += ","), t = t + n + "=" + e
                    }), t
                }(r);
                a.information("key", e), a.information("attribute1", i), a.information("attribute2", o), a.information("extData", s), s = encodeURIComponent(s), a.information("encode extData", s), t.nativeCall.CallNativeFunction("TrackEvent", e, i, o, 0, 0, 0, 0, s, (e, t) => {
                    a.information("trackEvent", "errorCode", e, "returnValue", t)
                })
            }
        }
    }(t.StatUtilitiesNS || (t.StatUtilitiesNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(5).default(a.join(__rootDir, "../bin/ThunderHelper.node")), r = 1;
    let s = new Map;

    function l(e, t, n, i, a) {
        o.createRegKey(e, t), o.writeRegValue(e, t, n, i, a)
    }

    function u(e) {
        do {
            if (!e || "" === e) break;
            let t = s.get(e);
            if (!t) break;
            let n = "Xunlei." + t[0] + ".6", i = a.join(__rootDir, "../../" + t[2]),
                o = a.join(__rootDir, "../../Thunder.exe"), u = "Software\\Classes\\." + e;
            l("HKEY_CURRENT_USER", u, "", n, r), l("HKEY_CURRENT_USER", u = "Software\\Classes\\" + n, "", t[1], r), l("HKEY_CURRENT_USER", u = "Software\\Classes\\" + n + "\\DefaultIcon", "", i, r), l("HKEY_CURRENT_USER", u = "Software\\Classes\\" + n + "\\Shell\\Open", "", t[3], r), l("HKEY_CURRENT_USER", u = "Software\\Classes\\" + n + "\\Shell\\Open\\command", "", '"' + o + '" "%1"', r)
        } while (0)
    }

    function d(e) {
        do {
            if (!e || "" === e) break;
            let t = s.get(e);
            if (!t) break;
            let n = "Software\\Classes\\." + e;
            o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Classes\\" + t[0], o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithList", o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithProgids", o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\UserChoice", o.deleteRegKey("HKEY_CURRENT_USER", n), n = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e, o.deleteRegKey("HKEY_CURRENT_USER", n), u(e), o.refreshIcon()
        } while (0)
    }

    s.set("td", ["TDFile", "迅雷临时数据文件", "XLTempFile.ico", "使用迅雷下载未完成文件"]), s.set("xltd", ["TDFile", "迅雷临时数据文件", "XLTempFile.ico", "使用迅雷下载未完成文件"]), s.set("downlist", ["LSTFile", "迅雷专有下载文件", "XLDownloadList.ico", "使用迅雷下载该任务列表文件"]), s.set("torrent", ["Bittorrent", "BT种子文件", "TorrentFile.ico", "使用迅雷下载该BT文件"]), s.set("thunderskin", ["ThunderSkin", "迅雷9皮肤文件", "thunderskin.ico", "为迅雷9应用该皮肤"]), s.set("xlb", ["XLB", "迅雷下载合集文件", "DownloadCollection.ico", "使用迅雷查看该下载合集文件"]), function (e) {
        function t(e) {
            do {
                if (!e || "" === e) break;
                let t = s.get(e);
                if (!t) break;
                let n = "Xunlei." + t[0] + ".6";
                if (o.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\." + e, "") === n) break;
                o.deleteRegKey("HKEY_CURRENT_USER", "Software\\Classes\\." + e), o.deleteRegKey("HKEY_CURRENT_USER", "Software\\Classes\\" + t[0]), o.deleteRegKey("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e), u(e), o.refreshIcon()
            } while (0)
        }

        function n(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let n = '"' + a.join(__rootDir, "../../Thunder.exe") + '" "%1"';
                    if (o.queryRegValue("HKEY_CURRENT_USER", "Software\\classes\\" + e + "\\Shell\\Open\\command", "") === n) break;
                    o.deleteRegKey("HKEY_CURRENT_USER", "Software\\classes\\" + e), l("HKEY_CURRENT_USER", "Software\\classes\\" + e, "URL Protocol", "", r), l("HKEY_CURRENT_USER", "Software\\classes\\" + e + "\\Shell\\Open\\command", "", n, r), t = !0
                } while (0);
                return t
            })
        }

        e.checkAndRegisterFileType = t, e.checkAndRegisterTorrentFile = function () {
            do {
                let e = a.join(__rootDir, "../../Thunder.exe"), n = "torrent",
                    i = o.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\Xunlei.Bittorrent.6\\Shell\\Open\\command", "");
                if (i && "" !== i) if (i.includes(e)) {
                    let e = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + n + "\\OpenWithList",
                        t = o.readRegString("HKEY_CURRENT_USER", e, "MRUList");
                    if (null === t || void 0 === t || "" === t) break;
                    let i = t.substring(0, 1);
                    null !== (t = o.readRegString("HKEY_CURRENT_USER", e, i)) && void 0 !== t && "" !== t && "Thunder.exe" !== t && d(n)
                } else t(n); else t(n)
            } while (0)
        }, e.doAsynCheckAndRegisterProtocal = n, e.asynCheckAndAssociate = function () {
            return i(this, void 0, void 0, function* () {
                t("td"), t("downlist"), yield n("ed2k"), yield n("magnet"), yield n("thunder"), yield n("thunderx"), yield n("xlb")
            })
        }
    }(t.FileAssociationNS || (t.FileAssociationNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(5), r = n(37), s = n(8), l = n(114), u = n(247), d = n(36), c = n(85), h = n(14), f = n(3),
        p = n(153), g = n(149), k = n(152), m = n(828), T = n(95), v = n(93), y = n(30), S = n(66), w = n(6), b = n(35),
        C = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        N = v.DownloadKernelCategoryManager.getCategoryManager(), D = r.DownloadKernelEventManager.getEventManager(),
        I = l.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        _ = p.ToastNotifyManagerNS.getToastNotifyManger();
    var x, A;
    !function (e) {
        e[e.UnKnown = -1] = "UnKnown", e[e.ShutDown = 0] = "ShutDown", e[e.Sleep = 1] = "Sleep", e[e.Exit = 2] = "Exit", e[e.StartAll = 3] = "StartAll", e[e.StopAll = 4] = "StopAll"
    }(x = t.ScheduleCompleteTaskType || (t.ScheduleCompleteTaskType = {})), function (e) {
        e.Unknow = "Unknow", e.ScheduleTaskCountChange = "ScheduleTaskCountChange"
    }(A = t.ScheduleTaskEventType || (t.ScheduleTaskEventType = {})), function (e) {
        let t = x.UnKnown, n = null, a = -1, o = -1, r = -1, l = -1, v = [], E = !1, M = !1, P = !1, F = !1;
        const O = new b.EventEmitter;

        function U() {
            n = D.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, z)
        }

        function L() {
            null !== n && (D.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, n), n = null)
        }

        function B() {
            L(), t = x.UnKnown
        }

        function K(e) {
            let t = 0, n = ["关机", "睡眠", "退出迅雷", "开始全部任务", "暂停全部任务"];
            for (let i = n.length - 1; i >= 0; --i) if (n[i] === e) {
                t = i;
                break
            }
            return t
        }

        function V() {
            if (M && P) {
                let e = 300;
                l = setInterval(() => {
                    (function () {
                        let e = !1, t = I.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Downloading).getTasks();
                        for (let [, n]of t) {
                            let t = n.getTaskStatus();
                            do {
                                if (t === s.DownloadKernel.TaskStatus.Started || t === s.DownloadKernel.TaskStatus.StartPending || t === s.DownloadKernel.TaskStatus.StartWaiting) {
                                    e = !0;
                                    break
                                }
                            } while (0)
                        }
                        return e
                    })() || function () {
                        let e = !1, t = N.getCurrentPrivateCategory();
                        t && (e = c.TaskOperatorNs.hasCategoryStartTask(t.getId()));
                        return e
                    }() ? e = 0 : e >= 300 ? (S.NativeCallHostModule.nativeCallHost.fireNativeEvent("getCurrentTabUrl", "callbackGetCurrentTabUrl"), w.NativeCallModule.nativeCall.AttachNativeEvent("callbackGetCurrentTabUrl", t => {
                        t ? e = 0 : (E = !0, c.TaskOperatorNs.startAllPausedTask(), l = W(l, "interval"))
                    })) : e++
                }, 1e3)
            }
        }

        function R(e) {
            return e && (e = !1, c.TaskOperatorNs.pauseAll(), function () {
                let e = N.getCurrentPrivateCategory();
                e && c.TaskOperatorNs.pauseCategoryAllTask(e.getId())
            }()), e
        }

        function W(e, t) {
            return -1 !== e && ("interval" === t ? clearInterval(e) : clearTimeout(e), e = -1), e
        }

        function j(e) {
            let t = !1;
            for (let n = 0; n < e.length; ++n) {
                let i = e[n];
                if (!i) continue;
                let a = i.getTaskStatus();
                if (a !== s.DownloadKernel.TaskStatus.Succeeded && a !== s.DownloadKernel.TaskStatus.Seeding && a !== s.DownloadKernel.TaskStatus.Failed) continue;
                let o = i.getTaskBaseInfo(), r = i.getTaskPreStatus();
                if (o.taskType !== s.DownloadKernel.TaskType.Bt || a !== s.DownloadKernel.TaskStatus.Succeeded && a !== s.DownloadKernel.TaskStatus.Seeding || r !== s.DownloadKernel.TaskStatus.Succeeded && r !== s.DownloadKernel.TaskStatus.Seeding) {
                    t = !0;
                    break
                }
            }
            return t
        }

        function H() {
            let e = !1;
            do {
                let t = I.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Downloading).getTasks(), n = !1;
                for (let [, e]of t) if (null !== e) {
                    let t = e.getTaskStatus();
                    if (t === s.DownloadKernel.TaskStatus.PreDownloading || t === s.DownloadKernel.TaskStatus.StartWaiting || t === s.DownloadKernel.TaskStatus.StartPending || t === s.DownloadKernel.TaskStatus.Started) {
                        n = !0;
                        break
                    }
                }
                if (n) break;
                e = !0
            } while (0);
            return e
        }

        function G(e) {
            e === x.ShutDown ? C.shutDownMachine() : e === x.Sleep ? C.suspendMachine() : e === x.Exit ? u.quitPromises.run() : e === x.StartAll ? c.TaskOperatorNs.startAll() : e === x.StopAll && c.TaskOperatorNs.pauseAll()
        }

        function z(...e) {
            do {
                if (!e) break;
                if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                if (!e[1]) break;
                if (!j(e[1])) break;
                if (!H()) break;
                setTimeout(() => {
                    G(t), B()
                }, 1e4)
            } while (0)
        }

        e.getEventEmitter = function () {
            return O
        }, e.setDownloadCompleteTaskType = function (e) {
            do {
                if (e !== x.ShutDown && e !== x.Sleep && e !== x.Exit) break;
                if (t === e) break;
                B(), t = e, U();
                let n = "";
                switch (e) {
                    case x.ShutDown:
                        n = "已开启下载完成后关机";
                        break;
                    case x.Sleep:
                        n = "已开启下载完成后睡眠";
                        break;
                    case x.Exit:
                        n = "已开启下载完成后退出迅雷"
                }
                let i = _.showNotify(p.ToastNotifyManagerNS.notifyIdScheduleTaskComplete, g.ToastNotifyItemType.RedCancelNotify, n, 5e3);
                i && i.onCancel(() => {
                    B()
                })
            } while (0)
        }, e.getDownloadCompleteTaskType = function () {
            return t
        }, e.startDownloadCompleteMonitor = U, e.stopDownloadCompleteMonitor = L, e.cancelDownloadCompleteTask = B, e.showPlanTaskDlg = function () {
            d.MessageBox.custom("PlanTask", v, {width: 400, height: 142, center: !0}).catch()
        }, e.init = function () {
            f.remote.ipcMain.on(h.ThunderChannelList.channelRMCommitPlanTask, (e, t) => i(this, void 0, void 0, function* () {
                v = t, -1 !== a && (clearInterval(a), a = -1), O.emit(A.ScheduleTaskCountChange, v.length), a = setInterval(() => {
                    for (let e = v.length - 1; e >= 0; --e) {
                        let t = v[e],
                            n = k.TimeHelperNS.convertTimeToMinutes(Number(t.hours), Number(t.minutes), Number(t.seconds));
                        if ((n -= 1) <= 0) {
                            G(K(t.operation)), v.splice(e, 1), O.emit(A.ScheduleTaskCountChange, v.length);
                            continue
                        }
                        let i = k.TimeHelperNS.convertMinuteToTime(n);
                        t.hours = i[0] + "", t.minutes = i[1] + "", t.seconds = i[2] + ""
                    }
                    v.length <= 0 && -1 !== a && (clearInterval(a), a = -1)
                }, 1e3)
            })), f.remote.ipcMain.on(h.ThunderChannelList.channelRMPerformePlanTask, (e, t) => i(this, void 0, void 0, function* () {
                G(K(t))
            }))
        }, e.getOperationIndex = K, e.getScheduleTaskCount = function () {
            return v.length
        }, e.popMessageBox = function (e) {
            F ? e() : d.MessageBox.confirm({
                title: "空闲下载",
                type: d.MessageBox.ConfirmType.Info,
                content: "当您长时间没有操作电脑时，迅雷会自动下载之前被暂停的任务",
                okText: "开启",
                cancelVisible: !1
            }, {width: 400, height: 177, center: !0}).then(t => {
                t.action === y.MessageBoxNS.Action.OK && (F = !0, e())
            }).catch()
        }, e.startFreeDownLoad = function () {
            T.mouseUse(e => {
                e && (P = !1, r = W(r), E = R(E), r = setTimeout(() => {
                    P = !0, V()
                }, 3e5))
            }), r = setTimeout(() => {
                P = !0, V()
            }, 3e5), m.keyboardUse(e => {
                e && (M = !1, o = W(o), E = R(E), o = setTimeout(() => {
                    M = !0, V()
                }, 3e5))
            }), o = setTimeout(() => {
                M = !0, V()
            }, 3e5)
        }, e.closeFreeDownLoad = function () {
            o = W(o), r = W(r), m.keyboardDestroy(), T.mouseDestroy(), E = R(E)
        }, e.excuteTask = G
    }(t.ScheduleTaskNS || (t.ScheduleTaskNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(841), a = n(13);
    let o, r = localStorage.getItem("guideDone"), s = r ? r.split(",") : [];
    (o = new i.default([{
        name: "search",
        selector: ".xlx-search .td-input__inner",
        offset: [0, -5],
        position: "left"
    }, {name: "downloadTab", selector: "#downloadTab", offset: [0, -5]}, {
        name: "downloadPlan",
        selector: ".xlx-status-plan",
        offset: [0, -5],
        style: {zIndex: 1}
    }].filter(e => !s.includes(e.name)))).on("show", e => {
        a.XLStatNS.trackEvent("download_leftpanel", "guide_show", "", 0, 0, 0, 0, {type: e})
    }), o.on("done", e => {
        s.push(e), localStorage.setItem("guideDone", s.join()), a.XLStatNS.trackEvent("download_leftpanel", "guide_click", "", 0, 0, 0, 0, {type: e})
    }), t.default = o
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(21), o = n(140), r = n(244), s = n(2), l = n(1), u = n(5), d = n(7), c = n(842), h = n(68), f = n(103),
        p = n(83), g = l.default.getLogger("Thunder.MainRenderer.stroe.Tabs"),
        k = u.default(s.join(__rootDir, "../bin/ThunderHelper.node")), m = p.TabEventManagerNS.getEventEmitter();
    let T = p.createXDASTab({pinned: !0});
    d.isNullOrUndefined(T) && g.error(T), t.onJsCallNativeFunction = function (e, t, n, i) {
        T.onJsCallNativeFunction(e, t, n, i)
    }, t.onJsCheckNativeFunction = function (e, t, n) {
        T.onJsCheckNativeFunction(e, t, n)
    };
    let v = 1;
    const y = {
        tabs: [{title: T.getTitle(), tab: T, pinned: T.getPinned(), key: v++}],
        current: 0,
        curBrowserWndHandle: 0
    }, S = {
        CREATE_NEW_TAB(e, t) {
            do {
                if (t.tabType === o.TabType.Chromium) {
                    let e = r.getBrowserWindowRect();
                    t.tabParam.rect = e
                }
                let n = p.createNewTab(t.tabType, t.tabParam);
                if (c.registerContextMenu(n), d.isNullOrUndefined(n)) {
                    g.error(n);
                    break
                }
                t.tabType === o.TabType.Chromium && n.getBrowser().queryWindowHandle();
                let i = -1;
                if (t.tabType === o.TabType.XDAS && (k.isWindowHandle(e.curBrowserWndHandle) && k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = 0), t.tabParam.name && (i = e.tabs.findIndex(e => e.tab.name === t.tabParam.name)), -1 !== i) e.current = i; else {
                    let i = "index" in t.tabParam ? t.tabParam.index : e.tabs.length;
                    e.tabs.splice(i, 0, {title: n.getTitle(), tab: n, pinned: n.getPinned(), key: v++}), e.current = i
                }
                m.emit(p.TabEventManagerNS.EventType.AddTab, t)
            } while (0)
        }, SELECT_TAB(e, t) {
            g.information("SELECT_TAB index: " + t);
            do {
                if (d.isNullOrUndefined(t)) break;
                if (t < 0) break;
                if (t >= e.tabs.length) break;
                let n = e.tabs[t];
                if (d.isNullOrUndefined(n)) break;
                let i = {tabInfo: n, index: t}, s = i.tabInfo.tab;
                if (d.isNullOrUndefined(s)) break;
                if (s.getTabType() === o.TabType.Chromium) {
                    let t = s.getBrowser();
                    if (d.isNullOrUndefined(t)) {
                        g.error(t);
                        break
                    }
                    let n = t.getWindowHandle();
                    if (!1 === k.isWindowHandle(n)) {
                        g.error(n), t.queryWindowHandle();
                        break
                    }
                    if (g.information("SELECT_TAB hwnd: " + n + " curBrowserWndHandle: " + e.curBrowserWndHandle), n === e.curBrowserWndHandle) break;
                    r.resizeBrowserWindow(n), k.isWindowHandle(n) && (s.isErrorPage ? (k.showWindow(n, a.showCmd.SW_HIDE), t.refresh(!1)) : (k.showWindow(n, a.showCmd.SW_SHOW), k.setWindowFocus(n, !0))), k.isWindowHandle(e.curBrowserWndHandle) && k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = n
                } else s.getTabType() === o.TabType.IE ? g.information("ie") : s.getTabType() === o.TabType.XDAS && (k.isWindowHandle(e.curBrowserWndHandle) && k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = 0);
                e.current = i.index, m.emit(p.TabEventManagerNS.EventType.ChangeTab, t, s)
            } while (0)
        }, ON_BIND_WND_HANDLE(e, t) {
            g.information("ON_BIND_WND_HANDLE");
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.hwnd)) {
                    g.error(t);
                    break
                }
                if (!1 === k.isWindowHandle(t.hwnd)) {
                    g.error(t.hwnd);
                    break
                }
                if (e.curBrowserWndHandle === t.hwnd) break;
                if (!0 === e.tabs[e.current].tab.isErrorPage) {
                    k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = t.hwnd;
                    break
                }
                r.resizeBrowserWindow(t.hwnd), k.showWindow(t.hwnd, a.showCmd.SW_SHOW), k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), e.curBrowserWndHandle = t.hwnd
            } while (0)
        }, ON_NEW_BROWSER_POPUP(e, t) {
            e.tabs.push({title: t.getTitle(), tab: t, pinned: t.getPinned(), key: v++}), e.current = e.tabs.length - 1
        }, ON_NEW_BROWSER_POPUP_COMPLETED(e, t) {
            g.information("ON_NEW_BROWSER_POPUP_COMPLETED");
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        e.queryWindowHandle();
                        break
                    }
                }
            } while (0)
        }, ON_TITLE_CHANGE(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser) || d.isNullOrUndefined(t.title)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        n.title = t.title, n.tab.setTitle(t.title);
                        break
                    }
                }
            } while (0)
        }, ON_FAV_ICON_GET(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser) || d.isNullOrUndefined(t.iconUrl)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        n.tab.setIconUrl(t.iconUrl);
                        break
                    }
                }
            } while (0)
        }, ON_ORIGINAL_URL_CHANGE(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser) || d.isNullOrUndefined(t.originalUrl)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        n.tab.originalUrl = t.originalUrl;
                        break
                    }
                }
            } while (0)
        }, ON_LOAD_START(e, t) {
            g.information("ON_LOAD_START");
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let i = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(i) && (i === t.browser && !0 === t.isMainFrame && (n.tab.isErrorPage = !1, n.tab === e.tabs[e.current].tab))) {
                        let t = i.getWindowHandle();
                        k.isWindowHandle(t) && (k.showWindow(t, a.showCmd.SW_SHOW), e.curBrowserWndHandle = t)
                    }
                }
            } while (0)
        }, ON_LOAD_STATUS_CHANGE(e, t) {
            g.information("ON_LOAD_STATUS_CHANGE");
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    d.isNullOrUndefined(e) || e === t.browser && (n.tab.canGoBack = t.canGoBack, n.tab.canGoForward = t.canGoForward, t.isLoading && (n.tab.isErrorPage = !1))
                }
            } while (0)
        }, ON_ADDRESS_CHANGE(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    d.isNullOrUndefined(e) || e === t.browser && !0 === t.isMainFrame && (n.tab.url = t.url)
                }
            } while (0)
        }, ON_LOAD_ERROR(e, t) {
            g.error("ON_LOAD_ERROR ", t.errorCode);
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.browser)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && (e === t.browser && !0 === t.isMainFrame && (-105 === t.errorCode || -21 === t.errorCode || -106 === t.errorCode || -118 === t.errorCode || -7 === t.errorCode || -101 === t.errorCode))) {
                        let i = e.getWindowHandle();
                        if (0 === i) {
                            n.tab.url = t.failedUrl, n.tab.isErrorPage = !0, e.queryWindowHandle();
                            break
                        }
                        g.error("ON_LOAD_ERROR HIDE hwnd: ", i), n.tab.url = t.failedUrl, n.tab.isErrorPage = !0, k.isWindowHandle(i) && k.showWindow(i, a.showCmd.SW_HIDE)
                    }
                }
            } while (0)
        }, ON_APP_QUIT(e) {
            g.information(e);
            for (let t of e.tabs) d.isNullOrUndefined(t) || d.isNullOrUndefined(t.tab) || t.tab.getTabType() === o.TabType.Chromium && t.tab.destroyBrowser(!0);
            void 0 !== r.browserSupport.browserComponent && r.browserSupport.browserComponent.uninit()
        }, REGISTER_NATIVE_FUNCTION(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(e.tabs[0]) || d.isNullOrUndefined(e.tabs[0].tab)) break;
                let n = e.tabs[0].tab.registerNativeFunction(t.functionName, t.nativeFunc);
                !1 === n && g.error(n)
            } while (0)
        }, UN_REGISTER_NATIVE_FUNCTION(e, t) {
            do {
                if (d.isNullOrUndefined(e.tabs) || d.isNullOrUndefined(e.tabs[0].tab)) break
            } while (0);
            e.tabs[0].tab.unRegisterNativeFunction(t)
        }, CLOSE_TAB(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.index) || d.isNullOrUndefined(t.tabInfo) || d.isNullOrUndefined(t.tabInfo.tab)) {
                    g.error(t);
                    break
                }
                let n = t.tabInfo.tab;
                n.getTabType() === o.TabType.Chromium && n.destroyBrowser(!1), e.tabs.splice(t.index, 1), e.current === t.index && t.index > 0 ? e.current = t.index - 1 : e.current > t.index && (e.current = e.current - 1);
                let i = e.tabs[e.current];
                (d.isNullOrUndefined(i) || d.isNullOrUndefined(i.tab)) && g.error(i);
                let s = i.tab.getBrowser();
                if (d.isNullOrUndefined(s)) break;
                let l = s.getWindowHandle();
                if (!1 === k.isWindowHandle(l)) {
                    g.error(l);
                    break
                }
                r.resizeBrowserWindow(l), g.information("CLOSE_TAB isErrorPage:", e.tabs[e.current].tab.isErrorPage), !0 === e.tabs[e.current].tab.isErrorPage && k.showWindow(l, a.showCmd.SW_HIDE), 0 !== e.curBrowserWndHandle && e.curBrowserWndHandle !== l && k.showWindow(e.curBrowserWndHandle, a.showCmd.SW_HIDE), k.setWindowFocus(l, !0), e.curBrowserWndHandle = l, m.emit(p.TabEventManagerNS.EventType.RemoveTab, t)
            } while (0)
        }, ON_CHROMIUM_CALL_NATIVE_FUNCTION(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.functionName) || d.isNullOrUndefined(t.browser)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        !1 === n.tab.onJsCallNativeFunction(0, t.functionName, t.callBackId, t.args) && g.error(t)
                    }
                }
            } while (0)
        }, ON_CHROMIUM_CHECK_NATIVE_FUNCTION(e, t) {
            do {
                if (d.isNullOrUndefined(t) || d.isNullOrUndefined(t.functionName) || d.isNullOrUndefined(t.browser)) {
                    g.error(t);
                    break
                }
                for (let n of e.tabs) {
                    if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) continue;
                    let e = n.tab.getBrowser();
                    if (!d.isNullOrUndefined(e) && e === t.browser) {
                        !1 === n.tab.onJsCheckNativeFunction(0, t.functionName, t.callBackId) && g.error(t)
                    }
                }
            } while (0)
        }, UPDATE_CURRENT(e, t) {
            e.current = t
        }, UPDATE_TABS(e, t) {
            e.tabs = t
        }
    }, w = {
        selectTab({commit: e}, t) {
            e("SELECT_TAB", t)
        }, closeTab({commit: e}, t) {
            e("CLOSE_TAB", t)
        }, onChromiumCallNativeFunction({commit: e}, t) {
            e("ON_CHROMIUM_CALL_NATIVE_FUNCTION", t)
        }, onChromiumCheckNativeFunction({commit: e}, t) {
            e("ON_CHROMIUM_CHECK_NATIVE_FUNCTION", t)
        }, onNewBrowserPopup({commit: e}, t) {
            return i(this, void 0, void 0, function* () {
                g.information("ON_NEW_BROWSER_POPUP");
                do {
                    if (d.isNullOrUndefined(t)) {
                        g.error(t);
                        break
                    }
                    if (yield h.URLHelperNS.isCustomProtocol(t.url)) {
                        f.ThunderNewTask.createTaskByUrl(t.url);
                        break
                    }
                    let n = {isFromPopup: !0, url: t.url}, i = o.TabType.Chromium, a = p.createNewTab(i, n);
                    if (c.registerContextMenu(a), d.isNullOrUndefined(a)) {
                        g.error(a);
                        break
                    }
                    a.getBrowser().queryWindowHandle(), e("ON_NEW_BROWSER_POPUP", a)
                } while (0)
            })
        }
    }, b = {
        currentTab: e => {
            let t = null;
            do {
                if (d.isNullOrUndefined(e) || d.isNullOrUndefined(e.current) || d.isNullOrUndefined(e.tabs)) {
                    g.error(e);
                    break
                }
                let n = e.tabs[e.current];
                if (d.isNullOrUndefined(n) || d.isNullOrUndefined(n.tab)) break;
                t = n
            } while (0);
            return t
        }
    };
    t.default = {state: y, mutations: S, actions: w, getters: b}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.unread = function (e) {
        return e > 99 ? "..." : e ? String(e) : ""
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(247), a = n(85), o = n(103), r = n(13), s = n(1).default.getLogger("MenuContextHelper");
    const l = new class {
        constructor() {
            s.information("constructor MenuContextHelper object")
        }

        exitThunderX(e) {
            i.quitPromises.run()
        }

        showNewTaskPanel(e) {
            s.information("trackEvent", "core_event", "create_task_click", "click_source=other"), r.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=other"), o.ThunderNewTask.createPreNewTaskWindow(null)
        }

        importUncompleted(e) {
            a.TaskOperatorNs.importUncompleted()
        }

        initAccelerator() {
            window.addEventListener("keyup", e => {
                "n" !== e.key && "N" !== e.key || !e.ctrlKey || this.showNewTaskPanel("system-menu")
            }, !0)
        }
    };
    t.default = l
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(54), o = n(1).default.getLogger("ConTextMenu");
    !function (e) {
        e.popContextMenu = function (e, t) {
            t && (o.information("params", t), t.isEditable ? function (e, t) {
                let n = [{label: "撤销", role: "undo", enabled: t.editFlags.canUndo}, {type: "separator"}, {
                    label: "剪切",
                    role: "cut",
                    enabled: t.editFlags.canCut
                }, {label: "复制", role: "copy", enabled: t.editFlags.canCopy}, {
                    label: "粘贴",
                    role: "paste",
                    enabled: t.editFlags.canPaste
                }, {label: "删除", role: "delete", enabled: t.editFlags.canDelete}, {type: "separator"}, {
                    label: "全选",
                    role: "selectall",
                    enabled: t.editFlags.canSelectAll
                }], o = i.remote.Menu.buildFromTemplate(n);
                a.MenuSkinNS.setStyle(o, {}), o.popup({window: i.remote.getCurrentWindow()})
            }(0, t) : "" !== t.selectionText && function (e, t) {
                let n = [{label: "复制", role: "copy", enabled: t.editFlags.canCopy}],
                    o = i.remote.Menu.buildFromTemplate(n);
                a.MenuSkinNS.setStyle(o, {}), o.popup({window: i.remote.getCurrentWindow()})
            }(0, t))
        }, e.popCustomContextMenu = function (e) {
            i.remote.getCurrentWebContents().once("context-menu", (t, n) => {
                o.information("event", t, "params", n);
                let r = [];
                if (void 0 !== e && "function" == typeof e && (r = e(n)), r.length > 0) {
                    let e = i.remote.Menu.buildFromTemplate(r);
                    a.MenuSkinNS.setStyle(e, {}), e.popup({window: i.remote.getCurrentWindow()})
                }
            })
        }, e.popupAt = function (e, t, n) {
            do {
                if (t.x && t.y) break;
                let e = n.getBoundingClientRect();
                t.x = Math.round(e.left), t.y = Math.round(e.bottom)
            } while (0);
            e.popup(t)
        }
    }(t.ContextMenuNS || (t.ContextMenuNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(5), s = n(8), l = n(93), u = n(889), d = n(67), c = n(23), h = n(114), f = n(60),
        p = n(82), g = n(9), k = o.default.getLogger("DownloadKernel.Upgrade"),
        m = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        T = l.DownloadKernelCategoryManager.getCategoryManager(), v = u.PrivateSpaceUpgradeNS.getUpgrade(),
        y = h.DownloadKernelCategoryViewManager.getCategoryViewManager();

    class S extends f.default {
        constructor() {
            super(...arguments), this.eventUpgradeProgress = "OnUpgradeProgress", this.totalTaskCount = 0, this.upgradeTaskCount = 0
        }

        upgradeP2sp(e) {
            let t = e.getSavePath(), n = e.getTaskName();
            return k.information("upgradeP2sp savePath:", t, ", taskName:", n), new Promise(e => {
                m.asyncUpgradeP2spTask(t, n, t => {
                    e(t)
                })
            })
        }

        upgradeBt(e) {
            let t = e.getExtraObject(), n = t.getFileCount(), o = t.getSeedFilePath(), r = a.parse(o), s = r.dir,
                l = r.name + r.ext, u = e.getSavePath(), d = t.getDisplayName(), c = "";
            if (1 !== n) u = a.join(u, d); else {
                let e = t.getBtFileInfoList();
                c = e[0].fileName
            }
            return k.information("upgradeBt savePath:", u, ", taskName:", d, ", fileCount:", n, ", seedFilePath:", o, ", seedFileName:", l), new Promise(e => {
                m.asyncUpgradeBtTask(u, l, s, t => i(this, void 0, void 0, function* () {
                    if (t && 1 === n) {
                        let e = a.join(u, d);
                        (yield g.FileSystemAWNS.existsAW(e)) || (yield g.FileSystemAWNS.mkdirAW(e));
                        let t = a.join(u, c), n = a.join(e, c);
                        t += ".bt.xltd", n += ".bt.xltd", (yield g.FileSystemAWNS.existsAW(n)) || (yield g.FileSystemAWNS.renameAW(t, n));
                        let i = a.join(u, l), o = a.join(e, l);
                        (yield g.FileSystemAWNS.existsAW(o)) || (yield g.FileSystemAWNS.renameAW(i, o))
                    }
                    e(t)
                }))
            })
        }

        upgradeEmule(e) {
            let t = e.getSavePath(), n = e.getTaskName(),
                i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl);
            return p.Common.isThunderPrivateUrl(i) && (i = p.Common.parseThunderPrivateUrl(i)), k.information("upgradeEmule url:", i, ", savePath:", t, ", taskName:", n), new Promise(e => {
                m.asyncUpgradeEmuleTask(i, t, n, t => {
                    e(t)
                })
            })
        }

        upgradeGroup(e) {
            return new Promise(t => {
                let n = e.getExtraObject(), i = n.getSubTaskCount();
                if (i > 0) for (let e = 0; e < i; e++) {
                    let i = n.getSubTaskByIndex(e);
                    i.getType() !== s.DownloadKernel.TaskType.Group && this.upgradeCategoryViewTask(i).then(e => {
                        t(e)
                    }).catch()
                } else t(!0)
            })
        }

        upgradeCategoryViewTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = e.getType();
                return t === s.DownloadKernel.TaskType.P2sp ? this.upgradeP2sp(e) : t === s.DownloadKernel.TaskType.Bt ? this.upgradeBt(e) : t === s.DownloadKernel.TaskType.Emule && this.upgradeEmule(e)
            })
        }

        upgradeCategoryView(e) {
            let t = e.getTasks();
            if (t.size <= 0) return !1;
            this.totalTaskCount += t.size, this.fireEvent(this.eventUpgradeProgress, this.totalTaskCount, this.upgradeTaskCount);
            for (let [, e]of t) {
                e.getType() === s.DownloadKernel.TaskType.Group ? this.upgradeGroup(e).then(t => {
                    this.upgradeTaskCount += 1, k.information("upgradeGroup return. this.upgradeTaskCount:", this.upgradeTaskCount, ", result:", t, ", taskName:", e.getTaskName()), this.fireEvent(this.eventUpgradeProgress, this.totalTaskCount, this.upgradeTaskCount)
                }).catch() : this.upgradeCategoryViewTask(e).then(t => {
                    this.upgradeTaskCount += 1, k.information("upgradeCategoryViewTask return. this.upgradeTaskCount:", this.upgradeTaskCount, ", result:", t, ", taskName:", e.getTaskName()), this.fireEvent(this.eventUpgradeProgress, this.totalTaskCount, this.upgradeTaskCount)
                }).catch()
            }
            return !0
        }

        init() {
            let e = a.join(__rootDir, "../bin/SDK/");
            return m.initUpgrade(e)
        }

        upgradePrivateSpace(e) {
            return v.upgradePrivateSpace(e)
        }

        startUpgrade() {
            this.totalTaskCount = 0, this.upgradeTaskCount = 0, d.DownloadKernelManager.attachOnceListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                let e = y.getCategoryViews();
                for (let t = 0; t < e.length; t++) {
                    let n = e[t], i = n.getCategoryViewId();
                    i !== s.DownloadKernel.CategroyViewID.Downloading && i !== s.DownloadKernel.CategroyViewID.Recycle || this.upgradeCategoryView(n)
                }
                let t = T.getCategorys();
                for (let [, e]of t) {
                    let t = e.getCategoryViews();
                    for (let e = 0; e < t.length; e++) {
                        let n = t[e], i = n.getCategoryViewId();
                        i !== s.DownloadKernel.CategroyViewID.Downloading && i !== s.DownloadKernel.CategroyViewID.Recycle || this.upgradeCategoryView(n)
                    }
                }
            })
        }
    }

    t.DownloadKernelUpgrade = S, function (e) {
        const t = new S;
        e.getUpgrade = function () {
            return t
        }
    }(t.DownloadKernelUpgradeNS || (t.DownloadKernelUpgradeNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(60), r = n(45), s = n(9), l = n(262), u = n(297), d = n(22), c = n(200), h = n(1), f = n(13),
        p = h.default.getLogger("AdPlatform");
    var g;
    !function (e) {
        e.waiting = "waiting", e.abort = "abort", e.ready = "ready"
    }(g || (g = {}));
    t.adPlatform = new class extends o.default {
    }
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(708), a = n(370);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(904);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-category.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(8), o = n(61), r = n(23), s = n(31), l = n(82), u = s.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        let t = null, s = -1, d = null;
        e.init = function () {
            o.default.attachListener(r.NodeEventMesssageNS.eventDownloadItemActive, (e, o, r, c, h) => {
                o && e === a.DownloadKernel.CategroyViewID.Downloading ? (-1 !== s && null !== t && (clearTimeout(t), t = null), s = r, t = setTimeout(() => i(this, void 0, void 0, function* () {
                    if (-1 !== s) {
                        let e = u.getTaskFromTaskId(s);
                        if (e) {
                            let t = e.getTaskBaseInfo();
                            if (t.gcid && "" !== t.gcid) return;
                            const {QueryTaskInfoHelperNS: i} = yield Promise.resolve().then(() => n(263));
                            if (t.taskType === a.DownloadKernel.TaskType.P2sp) {
                                let n = e.getExtraObject().getDisplayUrl();
                                "" === n && (n = t.url), l.Common.isThunderPrivateUrl(n) && (n = l.Common.parseThunderPrivateUrl(n)), i.queryResInfo("url", n).then(t => {
                                    t && 200 === t.status && null !== t.data && null !== t.data.code && 0 === t.data.code && "" !== t.data.gcid && (e.beginBatchSetTaskAttribute(), e.setFileSize(t.data.file_size), e.setGcid(t.data.gcid), e.commitBatchSetTaskAttribute())
                                }).catch()
                            } else if (t.taskType === a.DownloadKernel.TaskType.Emule) {
                                let n = t.url;
                                l.Common.isThunderPrivateUrl(n) && (n = l.Common.parseThunderPrivateUrl(n)), i.postRequestEd2kTaskInfoByEd2kLink(n).then(t => {
                                    t && t.gcid && "" !== t.gcid && "1111111111111111111111111111111111111111" !== t.gcid && e.setGcid(t.gcid)
                                }).catch()
                            }
                            if (t.taskType === a.DownloadKernel.TaskType.Group) {
                                let e = [], n = "", o = u.getTaskFromTaskId(t.taskId).getExtraObject(),
                                    r = o.getSubTaskCount(), s = new Map;
                                for (let t = 0; t < r; ++t) {
                                    let i = o.getSubTaskByIndex(t);
                                    if (i.getType() === a.DownloadKernel.TaskType.P2sp) {
                                        let a = i.getTaskBaseInfo();
                                        if (a.fileSize && a.fileSize > 0) continue;
                                        a.url && a.url.length > 0 && (n = a.url, l.Common.isThunderPrivateUrl(n) && (n = l.Common.parseThunderPrivateUrl(n)), e.push(n), s.set(n, t))
                                    }
                                }
                                e.length > 0 && !d && (d = t.taskId, i.asyncBatchQueryP2spTaskInfoByUrl(e, (e, t, n) => {
                                    o.setSubTaskFileSize(s.get(e), t.fileSize)
                                }, () => {
                                    d = null
                                }).catch())
                            }
                        }
                    }
                }), 100)) : s === r && (null !== t && (clearTimeout(t), t = null), s = -1)
            })
        }, e.getQueryTaskId = function () {
            return d
        }
    }(t.QueryTaskInfoNS || (t.QueryTaskInfoNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(9), s = o.default.getLogger("plugin-updater");

    class l {
        constructor(e) {
            this.dir = "", this.versionsDir = "", s.verbose("constructor", "dir", e), this.dir = e, this.versionsDir = a.join(e, "versions")
        }

        static getPluginUpdater(e) {
            return new l(e)
        }

        install(e, t) {
            return i(this, void 0, void 0, function* () {
                s.information("install", "version", e, "src", t);
                try {
                    if ((yield this.getCurVersion()) >= e) return;
                    yield this.save(e, t), yield this.setCurVersion(e)
                } catch (e) {
                    s.warning(e)
                }
            })
        }

        active() {
            return i(this, void 0, void 0, function* () {
                s.information("active");
                try {
                    const e = yield this.getCurVersion();
                    yield this.clear(this.versionsDir, e)
                } catch (e) {
                    s.warning(e)
                }
            })
        }

        getCurFilePath() {
            return i(this, void 0, void 0, function* () {
                s.information("getCurFilePath");
                const e = yield this.getCurVersion();
                return e ? a.join(this.versionsDir, e) : ""
            })
        }

        clear(e, t) {
            return i(this, void 0, void 0, function* () {
                return s.information("clear", "src", e, "exclude", t), (yield r.FileSystemAWNS.readdirAW(e)).filter(e => e !== t).map(e => r.FileSystemAWNS.rmdirsAW(a.join(this.versionsDir, e)))
            })
        }

        save(e, t) {
            return i(this, void 0, void 0, function* () {
                yield r.FileSystemAWNS.mkdirsAW(this.dir), yield r.FileSystemAWNS.mkdirsAW(this.versionsDir);
                const n = a.join(this.versionsDir, e);
                return r.FileSystemAWNS.copyDirsAW(t, n)
            })
        }

        getCurVersion() {
            return i(this, void 0, void 0, function* () {
                return (yield r.FileSystemAWNS.readFileAW(`${this.dir}/VERION.txt`)).toString()
            })
        }

        setCurVersion(e) {
            return i(this, void 0, void 0, function* () {
                return r.FileSystemAWNS.writeFileAW(`${this.dir}/VERION.txt`, e)
            })
        }
    }

    t.default = l
}, , function (e, t, n) {
    n(40), e.exports = n(751)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(24), o = n(25);
    o.CommonIPCRenderer.rendererCommunicator.initialize(a.CommonIPCBase.mainRendererContext), o.CommonIPCRenderer.rendererCommunicator.connect();
    const r = n(41), s = n(6), l = n(3), u = n(2), d = n(35), c = n(32), h = n(1);
    n(752);
    const f = n(103), p = n(67), g = n(770), k = n(23), m = n(771), T = n(66), v = n(819), y = n(820), S = n(821),
        w = n(822), b = n(823), C = n(279), N = n(14), D = n(85), I = n(826), _ = n(139), x = n(65), A = n(720),
        E = n(61), M = n(22), P = n(567), F = n(827), O = n(258), U = n(564), L = n(247), B = n(552), K = n(829),
        V = n(13), R = n(46), W = n(926), j = n(742), H = n(927), G = n(737), z = n(150), q = n(565), $ = n(928),
        X = n(36), J = n(153), Y = n(149), Q = n(296), Z = n(571), ee = n(748), te = n(563),
        ne = n(5).default(u.join(__rootDir, "../bin/ThunderHelper.node")), ie = n(929), ae = n(747), oe = n(566),
        re = n(933), se = n(15), le = n(38);
    n(935), n(936);
    const ue = n(937), de = n(553), ce = Q.GroupAccelerateManagerNS.getManager(),
        he = Z.GroupAccelerateWebManagerNS.getManager(), fe = J.ToastNotifyManagerNS.getToastNotifyManger();
    r.PerformanceMonitorStatNS.init("main-renderer"), l.ipcRenderer.send(N.ThunderChannelList.channelRMProcessSend, process.pid);
    const pe = h.default.getLogger("Thunder.Main");
    R.ThunderToolsNS.enableDevTools().catch(e => {
        pe.warning(e)
    });
    let ge = "";
    for (let e = 0; e < l.remote.process.argv.length; e++) {
        let t = l.remote.process.argv[e];
        if ("-StartType:Install" === t ? ge = "Install" : "-StartType:AutoRun" === t && (ge = "AutoRun"), 0 === t.indexOf("thunderx://", 0)) {
            let e = `newthunder=${encodeURIComponent(t)}`;
            V.XLStatNS.trackEvent("core_operate", "newthunder_startup", "", 0, 0, 0, 0, e)
        }
    }
    L.quitPromises.add(function () {
        return new Promise(e => {
            H.default.saveMainWndData(), ne.stopListenLocalNet(), e(!0)
        })
    }), L.quitPromises.add(function () {
        return new Promise(e => {
            f.ThunderNewTask.uninit(), e(!0)
        })
    }), L.quitPromises.add(function () {
        return i(this, void 0, void 0, function* () {
            return yield M.ConfigNS.save(), yield P.BHOConfigNS.save(), !0
        })
    }), L.quitPromises.add(function () {
        return new Promise(e => {
            e(!0)
        })
    }), L.quitPromises.add(function () {
        return i(this, void 0, void 0, function* () {
            return q.MessageChannelNS.uninit(), !0
        })
    }), L.quitPromises.add(function () {
        return i(this, void 0, void 0, function* () {
            return B.default.uninit(), !0
        })
    });
    let ke = l.remote.getCurrentWindow();
    z.default.init().catch(e => {
        pe.warning(e)
    }), ke.on("ready-to-show", () => i(this, void 0, void 0, function* () {
        const {VipDownloadPlugin: e} = yield Promise.resolve().then(() => n(53));
        j.default.initAccelerator(), p.DownloadKernelManager.init().catch(e => {
            pe.warning(e)
        }), q.MessageChannelNS.init(), E.default.trackWin7NewTrait(), R.ThunderToolsNS.enableDragOpenFile(!0), F.ConfigHandlerNS.init(), O.SettingConfigHelperNS.configBrowserHelper.init().catch(), I.TaskHelperNS.init(), _.DownloadDispatchNS.init(), C.TaskDetailNS.init(), G.FileAssociationNS.asynCheckAndAssociate().catch(), B.default.init().then().catch(), ce.init(), he.init("http://misc-xl9-ssl.xunlei.com/acc_xdas/dist/#/"), W.ClipBoardNS.init(), ae.QueryTaskInfoNS.init(), te.SubtitleManagerNS.init().catch(e => {
            pe.warning(e)
        }), ne.startListenLocalNet(e => {
            if (pe.information("startListenLocalNet, result = ", e), "OnInternetConnectSuc" === e || "OnInternetFallLine" === e) {
                let t = 1, n = 1;
                "OnInternetConnectSuc" === e ? (n = 1, t = 2) : (n = 2, t = 1), pe.information("返回值：0 初始化状态，1 在线状态， 2 断网状态 onInternetConnectChange:", t, n), T.NativeCallHostModule.nativeCallHost.fireNativeEvent("onInternetConnectChange", t, n)
            } else pe.information("返回数据错误！")
        }), setTimeout(() => {
            ne.startAutoUpdateWithUI()
        }, 12e4);
        let t = new d.EventEmitter;
        e.init(), setTimeout(() => {
            try {
                let e = ne.getPeerID(), n = ne.getOSVersion(), i = u.join(__rootDir, "../../Thunder.exe"),
                    a = ne.getFileVersion(i), o = ne.getChannelID();
                g.PluginLoaderNS.pluginLoader.startDownloadPlugins(e, n, "21", a, o, t)
            } catch (e) {
            }
        }, 1e4), t.on(k.NodeEventMesssageNS.eventPluginLoderPluginReady, e => i(this, void 0, void 0, function* () {
            let t = yield g.PluginLoaderNS.pluginLoader.loadPlugin(e);
            "addTest4" === e && t.add("plugin loader")
        })), setTimeout(() => {
            if (oe.default().whetherPopUp()) {
                let e = M.ConfigNS.getValue("ThunderFirstInstall", "IsFirstInstall", 0), t = e + 1;
                M.ConfigNS.setValue("ThunderFirstInstall", "IsFirstInstall", t), pe.information("迅雷第一次启动标志值:", t, e), oe.default().popUpBrowserGuide()
            }
        }, 1e4);
        let a = document.querySelector(".xlx-search").getBoundingClientRect();
        l.ipcRenderer.send(N.ThunderChannelList.channelRMCreateSearchWindow, Math.round(a.left), Math.round(a.top + a.height + 3), Math.round(a.width))
    })), ne.allowSetForegroundWindow(), global.AsyncGetNativeCallModuleObj = function (e) {
        e(s.NativeCallModule)
    }, global.xlNativeCallModule = s.NativeCallModule, m.NaviteFunctionNS.registerNativeFunction(), U.default.init(), f.ThunderNewTask.init(), c.default.config.ignoredElements = ["webview"], new c.default({
        components: {App: K.default},
        render: e => e("app")
    }).$mount("#app"), x.LoginHelperNS.loginSDKHelper.init().then(() => {
        g.PluginLoaderNS.pluginLoader.loadPlugin("ThunderXLogin").catch(), x.LoginHelperNS.loginHelper.isAutologin(e => i(this, void 0, void 0, function* () {
            let t = yield A.activityObj.isHaverActivityAw("auto");
            pe.information("isAutologin:", e, ge, t), !e && ("Install" === ge || t && "AutoRun" !== ge) && setTimeout(() => {
                x.LoginHelperNS.loginHelper.showLoginDlg("Install", !0), t && A.activityObj.setActivityConfig()
            }, 1e3)
        }))
    }).catch(e => {
        pe.warning(e)
    }), M.ConfigNS.init(u.join(__profilesDir, "config.json")).catch(e => {
        pe.warning(e)
    }), P.BHOConfigNS.init().catch(e => {
        pe.warning(e)
    }), H.default.initMainRendererHelper(), y.DKNaviteFunctionNS.registerNativeFunction(), S.ConfigNaviteFunctionNS.registerNativeFunction(), w.DownloadAndPlayNaviteFunctionNS.registerNativeFunction(), b.SkinNaviteFunctionNS.registerNativeFunction(), $.MessageChannelNaviteFunctionNS.init(), v.LoginNaviteFunctionNS.registerNativeFunction(), re.TipsNaviteFunctionNS.registerNativeFunction(), ie.AdManageNS.init(), ue.defaultNavite.registerDefaultNativeFunction(), l.ipcRenderer.on(N.ThunderChannelList.channelMRGetConfigValue, (e, ...t) => {
        do {
            if (!t || !t[0] || !t[1]) {
                l.ipcRenderer.send(N.ThunderChannelList.channelRMGetConfigValueReject);
                break
            }
            let e = t[0], n = t[1], i = t[2], a = M.ConfigNS.getValue(e, n, i);
            l.ipcRenderer.send(N.ThunderChannelList.channelRMGetConfigValueResolve, a)
        } while (0)
    }), l.ipcRenderer.on(N.ThunderChannelList.channelMRSetConfigValue, (e, ...t) => {
        do {
            if (!t || !t[0] || !t[1]) {
                l.ipcRenderer.send(N.ThunderChannelList.channelRMGetConfigValueReject);
                break
            }
            let e = t[0], n = t[1], i = t[2];
            M.ConfigNS.setValue(e, n, i), M.ConfigNS.save().catch()
        } while (0)
    }), l.ipcRenderer.on(N.ThunderChannelList.channelMRTrayMenuClick, (e, t, n) => {
        pe.verbose(e), "-task:newtask" === t ? (n = void 0 === n ? "other" : n, V.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=" + n), pe.information("trackEvent", "core_event", "create_task_click", "click_source=" + n), f.ThunderNewTask.createPreNewTaskWindow(null)) : "-task:startall" === t ? D.TaskOperatorNs.startAll() : "-task:pauseall" === t ? D.TaskOperatorNs.pauseAll() : "-task:quitprocess" === t && L.quitPromises.run()
    }), l.ipcRenderer.on(N.ThunderChannelList.channelMRFileCopyResult, (e, t, n) => {
        pe.information("channelMRFileCopyResult", t, n), t && fe.showNotify(J.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, Y.ToastNotifyItemType.GreenNotify, "复制成功", 3e3)
    }), l.remote.ipcMain.on("onShowMessageBox", (e, t) => {
        pe.verbose(e), "retryLogin" === t && X.MessageBox.confirm({
            title: "登录失败，请检查网络是否正常",
            type: X.MessageBox.ConfirmType.Warning,
            content: "如果通过代理访问网络，请确认代理已正确设置。<br>如果是办公网络，请确认网络是否限制迅雷登录。",
            okText: "我知道了",
            cancelVisible: !1
        }).catch()
    }), window.getPluginUpdater = ee.default.getPluginUpdater, se.default("GetSkinInfo").then(e => {
        pe.information("GetSkinInfo", e)
    }).catch(e => {
        pe.warning("GetSkinInfo Error", e)
    }), s.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSkin", e => {
        pe.information("OnChangeSkin", e)
    }), window.setSkinInfo = (() => {
        se.default("SetSkinInfo", {type: le.SkinHelperNS.SkinType.Color, colorID: 1}).catch(e => {
            pe.warning("SetSkinInfo Error", e)
        })
    }), setTimeout(() => i(this, void 0, void 0, function* () {
        let e = M.ConfigNS.getValue("Install", "PersonalUid", "");
        if (e && "" !== e) try {
            const t = yield n(27);
            t.defaults.adapter = n(28);
            let i = "https://msg-vip-ssl.xunlei.com/individuation/Clinetreport?userid=";
            i += e, i += "&param=active_user", yield t.get(i, {responseType: "arraybuffer"})
        } catch (e) {
            pe.warning(e)
        }
    }), 5e3), setTimeout(() => {
        de.EmbeddedBrowserManagerNs.showWebWnd("sign", "auto")
    }, 15e3)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(753), a = n(754), o = n(32);
    n(42);
    const r = n(51);
    n(755), n(1063);
    const s = n(251), l = n(546);
    o.default.directive("visibility", i.default), o.default.directive("opacity", a.default), o.default.use(r.default), o.default.use(s), o.default.use(l.default)
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        bind(e, {value: t}, n) {
            e.__vOriginalVisibility = e.style.visiblity, e.style.visibility = t ? "visible" : "hidden"
        }, update(e, {value: t, oldValue: n}, i) {
            t !== n && (e.style.visibility = t ? "visible" : "hidden")
        }, unbind(e, t, n, i, a) {
            a || (e.style.visiblity = e.__vOriginalVisibility)
        }
    };
    t.default = i
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        bind(e, {value: t}, n) {
            e.__vOriginalOpacity = e.style.opacity, e.__vOriginalPointerEvents = e.style.pointerEvents, e.style.opacity = t ? "1" : "0", e.style.pointerEvents = t ? "auto" : "none"
        }, update(e, {value: t, oldValue: n}, i) {
            t !== n && (e.style.opacity = t ? "1" : "0", e.style.pointerEvents = t ? "auto" : "none")
        }, unbind(e, t, n, i, a) {
            a || (e.style.opacity = e.__vOriginalOpacity, e.style.pointerEvents = e.__vOriginalPointerEvents)
        }
    };
    t.default = i
}, function (e, t) {
    !function (e) {
        var t,
            n = '<svg><symbol id="td-icon-svg-file" viewBox="0 0 1204 1024"><path d="M180.705882 1024c-102.4 0-180.705882-78.305882-180.705882-180.705882V180.705882c0-102.4 78.305882-180.705882 180.705882-180.705882h240.941177c102.4 0 180.705882 78.305882 180.705882 180.705882h421.647059c102.4 0 180.705882 78.305882 180.705882 180.705883v481.882353c0 102.4-78.305882 180.705882-180.705882 180.705882H180.705882z" fill="#FFC25A" ></path><path d="M301.176471 361.411765h602.352941c66.258824 0 120.470588 54.211765 120.470588 120.470588v361.411765c0 66.258824-54.211765 120.470588-120.470588 120.470588H301.176471c-66.258824 0-120.470588-54.211765-120.470589-120.470588V481.882353c0-66.258824 54.211765-120.470588 120.470589-120.470588z" fill="#FFFFFF" ></path><path d="M180.705882 542.117647h843.294118c102.4 0 180.705882 78.305882 180.705882 180.705882v120.470589c0 102.4-78.305882 180.705882-180.705882 180.705882H180.705882c-102.4 0-180.705882-78.305882-180.705882-180.705882v-120.470589c0-102.4 78.305882-180.705882 180.705882-180.705882z" fill="#FFD68F" ></path></symbol></svg>',
            i = function (e, t) {
                t.firstChild ? function (e, t) {
                    t.parentNode.insertBefore(e, t)
                }(e, t.firstChild) : t.appendChild(e)
            };
        if ((t = document.getElementsByTagName("script"))[t.length - 1].getAttribute("data-injectcss") && !e.__iconfont__svg__cssinject__) {
            e.__iconfont__svg__cssinject__ = !0;
            try {
                document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")
            } catch (e) {
                console && console.log(e)
            }
        }
        !function (t) {
            if (document.addEventListener) if (~["complete", "loaded", "interactive"].indexOf(document.readyState)) setTimeout(t, 0); else {
                var n = function () {
                    document.removeEventListener("DOMContentLoaded", n, !1), t()
                };
                document.addEventListener("DOMContentLoaded", n, !1)
            } else document.attachEvent && function (e, t) {
                var n = e.document, i = !1, a = function () {
                    i || (i = !0, t())
                }, o = function () {
                    try {
                        n.documentElement.doScroll("left")
                    } catch (e) {
                        return void setTimeout(o, 50)
                    }
                    a()
                };
                o(), n.onreadystatechange = function () {
                    "complete" == n.readyState && (n.onreadystatechange = null, a())
                }
            }(e, t)
        }(function () {
            var e, t;
            (e = document.createElement("div")).innerHTML = n, n = null, (t = e.getElementsByTagName("svg")[0]) && (t.setAttribute("aria-hidden", "true"), t.style.position = "absolute", t.style.width = 0, t.style.height = 0, t.style.overflow = "hidden", i(t, document.body))
        })
    }(window)
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(9), s = n(8), l = n(92), u = n(757), d = n(759), c = n(761), h = n(762), f = n(252),
        p = n(37), g = n(82), k = n(93), m = n(719), T = n(138), v = o.default.getLogger("DownloadKernel.Task"),
        y = p.DownloadKernelEventManager.getEventManager(), S = k.DownloadKernelCategoryManager.getCategoryManager(),
        w = [".asf", ".mpg", ".rmvb", ".rm", ".wmv", ".avi", ".mp4", ".mpeg", ".mkv", ".mov", ".ts", ".flv", ".3gp"];
    var b;
    !function (e) {
        e[e.None = 0] = "None", e[e.Create = 1] = "Create", e[e.StartPending = 2] = "StartPending", e[e.Downloading = 3] = "Downloading", e[e.StopPending = 4] = "StopPending", e[e.Pause = 5] = "Pause", e[e.CompletePending = 6] = "CompletePending", e[e.Complete = 7] = "Complete", e[e.Error = 8] = "Error", e[e.ErrorStopPending = 9] = "ErrorStopPending"
    }(b || (b = {}));
    t.Task = class {
        constructor() {
            this.taskId = 0, this.virtualTaskId = 0, this.isBackground = !1, this.taskType = s.DownloadKernel.TaskType.Unkown, this.preStatus = s.DownloadKernel.TaskStatus.Stopped, this.taskStatus = s.DownloadKernel.TaskStatus.Stopped, this.taskExtra = null, this.speed = 0, this.vipSpeed = 0, this.downloadSizeList = [], this.vipSizeList = [], this.startTime = 0, this.downloadingPeriod = 0, this.dispatchStrategy = void 0, this.freeFromSchedule = void 0, this.originOnlyStrategy = void 0, this.originThreadCount = void 0, this.vipCert = void 0, this.taskStatusChangedReason = s.DownloadKernel.TaskStopReason.Unknown, this.batchSetTaskAttribute = !1, this.batchDetailChangedFlags = s.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.attribute = new Map;
            for (let e = s.DownloadKernel.TaskAttribute.NumberStrart; e < s.DownloadKernel.TaskAttribute.NumberEnd; ++e) this.attribute.set(e, 0);
            for (let e = s.DownloadKernel.TaskAttribute.BooleanStart; e < s.DownloadKernel.TaskAttribute.BooleanEnd; ++e) this.attribute.set(e, !1);
            for (let e = s.DownloadKernel.TaskAttribute.StringStart; e < s.DownloadKernel.TaskAttribute.StringEnd; ++e) this.attribute.set(e, "");
            for (let e = s.DownloadKernel.TaskAttribute.ObjectStart; e < s.DownloadKernel.TaskAttribute.ObjectEnd; ++e) this.attribute.set(e, null);
            this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, -1), this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryViewId, s.DownloadKernel.CategroyViewID.Unkown), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, s.DownloadKernel.TaskType.Unkown), this.attribute.set(s.DownloadKernel.TaskAttribute.ErrorCode, s.DownloadKernel.TaskError.Unkown), this.attribute.set(s.DownloadKernel.TaskAttribute.NameType, 1), this.attribute.set(s.DownloadKernel.TaskAttribute.CreateTime, (new Date).getTime()), this.channelInfo = {
                originSize: 0,
                p2pSize: 0,
                p2sSize: 0,
                offlineSize: 0,
                dcdnSize: 0,
                dcdnStatus: s.DownloadKernel.DcdnStatusCode.Unkown
            }, this.historyChannelInfo = {originSize: 0, p2pSize: 0, p2sSize: 0, offlineSize: 0, dcdnSize: 0}
        }

        getId() {
            return this.taskId
        }

        getType() {
            return this.taskType
        }

        reName(e) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (!e || "" === e) break;
                    if (this.taskStatus !== s.DownloadKernel.TaskStatus.Succeeded && this.taskStatus !== s.DownloadKernel.TaskStatus.Seeding) break;
                    let t = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                    if (t === e) break;
                    if (!(yield T.SingleBtTaskNS.isSingleBtTask(this)) && this.taskType !== s.DownloadKernel.TaskType.Group) {
                        let n = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath), i = a.join(n, t),
                            o = a.join(n, e), l = yield r.FileSystemAWNS.existsAW(i);
                        l && (o = g.Common.getMaxFilePath(o), yield r.FileSystemAWNS.renameAW(i, o), (l = yield r.FileSystemAWNS.existsAW(o)) && (e = a.basename(o)))
                    }
                    this.setTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName, e), this.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskRenamed)
                } while (0)
            })
        }

        setUserRead(e) {
            0 !== e && (e = 1), e !== this.attribute.get(s.DownloadKernel.TaskAttribute.UserRead) && (this.attribute.set(s.DownloadKernel.TaskAttribute.UserRead, e), this.saveTaskInfo(this.taskId, f.StatementType.SetTaskUserRead, f.ValueType.ValueInt, e), this.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskUserRead))
        }

        setDescription(e) {
            let t = this.attribute.get(s.DownloadKernel.TaskAttribute.Description);
            e && t !== e && (this.attribute.set(s.DownloadKernel.TaskAttribute.Description, e), this.saveTaskInfo(this.taskId, f.StatementType.SetTaskDescription, f.ValueType.ValueString, e), this.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskDescriptionChanged))
        }

        setOriginThreadCount(e) {
            this.taskType === s.DownloadKernel.TaskType.P2sp && this.getExtraObject().setOriginThreadCount(e)
        }

        setOriginOnlyStrategy(e) {
            if (this.taskType === s.DownloadKernel.TaskType.P2sp) {
                let t = this.getExtraObject();
                e ? (t.setUseOriginOnly(1), this.originOnlyStrategy = 1) : (t.setUseOriginOnly(0), this.originOnlyStrategy = 0)
            }
        }

        getOriginOnlyStrategy() {
            let e = !1;
            return this.taskType === s.DownloadKernel.TaskType.P2sp && 1 === this.getExtraObject().getUseOriginOnly() && (e = !0), e
        }

        setDispatchStrategy(e) {
            this.dispatchStrategy = e
        }

        setDownloadStrategy(e) {
            l.ThunderKernel.setDownloadStrategy(this.virtualTaskId, e)
        }

        setFreeFromSchedule(e) {
            this.freeFromSchedule !== e && (this.freeFromSchedule = e)
        }

        setOpenOnComplete(e) {
            this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, e), this.saveTaskInfo(this.taskId, f.StatementType.SetTaskOpenOnCompelete, f.ValueType.ValueInt, e)
        }

        getExtraObject() {
            return this.taskExtra
        }

        getTaskStatus() {
            return this.taskStatus
        }

        getTaskPreStatus() {
            return this.preStatus
        }

        getDownloadSpeed() {
            return this.speed
        }

        getVipSpeed() {
            let e = this.vipSpeed;
            return this.vipSpeed > this.speed && (e = this.speed), e
        }

        getTaskAttribute(e) {
            return this.attribute.get(e)
        }

        getTaskChannelInfo() {
            let e = {};
            return e.originSize = this.historyChannelInfo.originSize + this.channelInfo.originSize, e.p2pSize = this.historyChannelInfo.p2pSize + this.channelInfo.p2pSize, e.p2sSize = this.historyChannelInfo.p2sSize + this.channelInfo.p2sSize, e.offlineSize = this.historyChannelInfo.offlineSize + this.channelInfo.offlineSize, e.dcdnSize = this.historyChannelInfo.dcdnSize + this.channelInfo.dcdnSize, e.dcdnStatus = this.channelInfo.dcdnStatus, e.dcdnResult = this.channelInfo.dcdnResult, e.enableDcdn = this.channelInfo.enableDcdn, e
        }

        getTaskBaseInfo() {
            let e = {};
            return e.taskId = this.taskId, e.taskType = this.taskType, e.downloadSpeed = this.speed, this.vipSpeed > this.speed ? e.vipSpeed = this.speed : e.vipSpeed = this.vipSpeed, e.taskStatus = this.getTaskStatus(), e.savePath = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath), e.createTime = this.attribute.get(s.DownloadKernel.TaskAttribute.CreateTime), e.url = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskUrl), e.refUrl = this.attribute.get(s.DownloadKernel.TaskAttribute.RefUrl), e.cid = this.attribute.get(s.DownloadKernel.TaskAttribute.Cid), e.gcid = this.attribute.get(s.DownloadKernel.TaskAttribute.Gcid), e.taskName = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName), e.description = this.attribute.get(s.DownloadKernel.TaskAttribute.Description), e.nameType = this.attribute.get(s.DownloadKernel.TaskAttribute.NameType), e.categoryId = this.attribute.get(s.DownloadKernel.TaskAttribute.CategoryId), e.userRead = this.attribute.get(s.DownloadKernel.TaskAttribute.UserRead), e.openOnComplete = this.attribute.get(s.DownloadKernel.TaskAttribute.OpenOnComplete), e.ownerProduct = this.attribute.get(s.DownloadKernel.TaskAttribute.OwnerProduct), e.downloadingPeriod = this.attribute.get(s.DownloadKernel.TaskAttribute.DownloadingPeriod), e.errorCode = this.attribute.get(s.DownloadKernel.TaskAttribute.ErrorCode), e.groupTaskId = this.attribute.get(s.DownloadKernel.TaskAttribute.GroupTaskId), e.downloadSubTask = this.attribute.get(s.DownloadKernel.TaskAttribute.DownloadSubTask), e.productInfo = this.attribute.get(s.DownloadKernel.TaskAttribute.ProductInfo), e.origin = this.attribute.get(s.DownloadKernel.TaskAttribute.Origin), e.fileCreated = this.attribute.get(s.DownloadKernel.TaskAttribute.FileCreated), e.recycleTime = this.attribute.get(s.DownloadKernel.TaskAttribute.RecycleTime), e.forbidden = this.attribute.get(s.DownloadKernel.TaskAttribute.Forbidden), e.fileSize = this.attribute.get(s.DownloadKernel.TaskAttribute.FileSize), e.receiveSize = this.attribute.get(s.DownloadKernel.TaskAttribute.ReceivedSize), e.downloadSize = this.attribute.get(s.DownloadKernel.TaskAttribute.DownloadSize), e.srcTotal = this.attribute.get(s.DownloadKernel.TaskAttribute.SrcTotal), e.srcUsing = this.attribute.get(s.DownloadKernel.TaskAttribute.SrcUsing), e.completionTime = this.attribute.get(s.DownloadKernel.TaskAttribute.CompletionTime), e.channelInfo = this.getTaskChannelInfo(), e
        }

        isSupportPlay() {
            let e = !1;
            if (this.taskStatus === s.DownloadKernel.TaskStatus.Failed) {
                let t = this.attribute.get(s.DownloadKernel.TaskAttribute.ErrorCode);
                e = !(t && t > 700) && this.isVideoFile()
            } else e = this.isVideoFile();
            return e
        }

        isFreeFromSchedule() {
            return this.freeFromSchedule
        }

        getPlayUrl(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    this.virtualTaskId && this.virtualTaskId > 0 ? l.ThunderKernel.queryPlayInfo(this.virtualTaskId, e, (n, i) => {
                        e === n && t(i)
                    }) : t(void 0)
                })
            })
        }

        enableDcdnWithVipCert(e) {
            if (this.vipCert = e, this.taskType === s.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject(), n = t.getSubTaskCount();
                for (let i = 0; i < n; ++i) {
                    let n = t.getSubTaskByIndex(i);
                    n && n.enableDcdnWithVipCert(e)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && l.ThunderKernel.enableDcdnWithVipCert(this.virtualTaskId, -1, e)
        }

        updateDcdnWithVipCert(e) {
            if (this.vipCert = e, this.taskType === s.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject(), n = t.getSubTaskCount();
                for (let i = 0; i < n; ++i) {
                    let n = t.getSubTaskByIndex(i);
                    n && n.updateDcdnWithVipCert(e)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && l.ThunderKernel.updateDcdnWithVipCert(this.virtualTaskId, -1, e)
        }

        disableDcdnWithVipCert() {
            if (this.vipCert = void 0, this.taskType === s.DownloadKernel.TaskType.Group) {
                let e = this.getExtraObject(), t = e.getSubTaskCount();
                for (let n = 0; n < t; ++n) {
                    let t = e.getSubTaskByIndex(n);
                    t && t.disableDcdnWithVipCert()
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && l.ThunderKernel.disableDcdnWithVipCert(this.virtualTaskId, -1)
        }

        start() {
            v.information("start this.taskStatus:", this.taskStatus, ", this.taskType:", this.taskType);
            let e = !1;
            return this.taskStatus !== s.DownloadKernel.TaskStatus.Stopped && this.taskStatus !== s.DownloadKernel.TaskStatus.StartWaiting && this.taskStatus !== s.DownloadKernel.TaskStatus.Failed && this.taskStatus !== s.DownloadKernel.TaskStatus.Unkown || (this.taskType === s.DownloadKernel.TaskType.Group ? (e = this.getExtraObject().start()) && (e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StartPending)) : (this.createDownloadSdkTask().then(() => {
                if (this.virtualTaskId && this.virtualTaskId > 0) {
                    if (this.taskType === s.DownloadKernel.TaskType.P2sp) {
                        let e = this.getExtraObject(), t = e.getThreadCount();
                        void 0 !== this.originOnlyStrategy && e.setUseOriginOnly(this.originOnlyStrategy), 1 === this.originOnlyStrategy ? l.ThunderKernel.setTaskStrategy(this.virtualTaskId, 1) : void 0 !== this.dispatchStrategy && l.ThunderKernel.setTaskStrategy(this.virtualTaskId, this.dispatchStrategy), void 0 !== this.originThreadCount ? l.ThunderKernel.setTaskThreadCount(this.virtualTaskId, this.originThreadCount) : l.ThunderKernel.setTaskThreadCount(this.virtualTaskId, t)
                    } else if (void 0 !== this.dispatchStrategy && l.ThunderKernel.setTaskStrategy(this.virtualTaskId, this.dispatchStrategy), this.taskType === s.DownloadKernel.TaskType.Bt) {
                        let e = m.BTExtraTrackNS.getExtraTracks();
                        e.length > 0 && l.ThunderKernel.setBTExtraTrackers(this.virtualTaskId, e)
                    }
                    this.setTaskExtInfoBeforeStart(), void 0 !== this.vipCert && l.ThunderKernel.enableDcdnWithVipCert(this.virtualTaskId, -1, this.vipCert), this.taskExtra && this.taskExtra.setTaskPriorityLevel(-1), l.ThunderKernel.startTask(this.virtualTaskId)
                } else v.error("createDownloadSdkTask failed! virtualTaskId:", this.virtualTaskId)
            }).catch(), e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StartPending))), e
        }

        startWaiting() {
            v.information("startWaiting this.taskStatus:", this.taskStatus);
            let e = !1;
            return this.taskStatus !== s.DownloadKernel.TaskStatus.Stopped && this.taskStatus !== s.DownloadKernel.TaskStatus.Failed && this.taskStatus !== s.DownloadKernel.TaskStatus.Unkown || (e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StartWaiting)), e
        }

        stop() {
            v.information("stop");
            let e = !1;
            if (this.taskStatus === s.DownloadKernel.TaskStatus.StartWaiting) e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Stopped); else if (this.taskType === s.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject();
                if (e = t.stop()) {
                    let n = t.getTaskStatus();
                    n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding && n !== s.DownloadKernel.TaskStatus.Stopped && (e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StopPending))
                }
            } else this.taskStatus !== s.DownloadKernel.TaskStatus.Succeeded && this.taskStatus !== s.DownloadKernel.TaskStatus.Seeding && this.taskStatus !== s.DownloadKernel.TaskStatus.Stopped && this.taskStatus !== s.DownloadKernel.TaskStatus.Failed && (this.virtualTaskId && this.virtualTaskId > 0 ? (e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.StopPending), l.ThunderKernel.stopTask(this.virtualTaskId)) : e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Stopped));
            return e
        }

        delete(e) {
            return i(this, void 0, void 0, function* () {
                v.information("delete");
                let t = !1;
                return this.taskType === s.DownloadKernel.TaskType.Group ? (t = yield this.getExtraObject().delete(e), this.deleteStorageTask()) : (t = !0, this.deleteStorageTask(), e && (t = yield this.destroy())), t
            })
        }

        commit() {
        }

        updateTaskStatus(e) {
            let t = !1;
            return this.taskStatus !== e && (this.taskStatus === s.DownloadKernel.TaskStatus.StartPending ? e === s.DownloadKernel.TaskStatus.Stopped || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0) : this.taskStatus === s.DownloadKernel.TaskStatus.StopPending ? e === s.DownloadKernel.TaskStatus.Started || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0) : (this.taskStatus === s.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === s.DownloadKernel.TaskStatus.Seeding) && e !== s.DownloadKernel.TaskStatus.Stopped && e !== s.DownloadKernel.TaskStatus.DestroyPending || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0)), e !== s.DownloadKernel.TaskStatus.Started && (this.speed = 0, this.vipSpeed = 0, this.downloadSizeList = [], this.vipSizeList = []), t && (this.startTime = 0, this.downloadingPeriod = this.attribute.get(s.DownloadKernel.TaskAttribute.DownloadingPeriod), this.taskStatus !== s.DownloadKernel.TaskStatus.DestroyPending && this.saveTaskInfo(this.taskId, f.StatementType.SetTaskStatus, f.ValueType.ValueInt, this.taskStatus)), t
        }

        createP2spTask(e, t, n, i) {
            if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.P2sp, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskUrl, n.url), this.attribute.set(s.DownloadKernel.TaskAttribute.RefUrl, n.refUrl), this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, n.origin), this.attribute.set(s.DownloadKernel.TaskAttribute.Cookie, n.cookie), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), t.groupTaskId && this.attribute.set(s.DownloadKernel.TaskAttribute.GroupTaskId, t.groupTaskId), 1 === n.downloadSubTask && this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadSubTask, 1), i) {
                let e = S.getCurrentPrivateCategory();
                e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
            }
            return t.fileSize && this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, t.fileSize), t.gcid && this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, t.gcid), t.cid && this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, t.cid), e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new u.P2spTask(this, !e, n.useOriginResourceOnly, n.originResourceThreadCount), this.taskId
        }

        createBtTask(e, t, n, o) {
            return i(this, void 0, void 0, function* () {
                if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.Bt, t.taskName || (t.taskName = n.displayName), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), o) {
                    let e = S.getCurrentPrivateCategory();
                    e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
                }
                let i = a.join(__profilesDir, "Torrents"), u = yield r.FileSystemAWNS.existsAW(i);
                u || (yield r.FileSystemAWNS.mkdirsAW(i));
                let c = n.infoId + ".torrent", h = a.join(i, c);
                yield r.FileSystemAWNS.copyFileAW(n.seedFile, h), (u = yield r.FileSystemAWNS.existsAW(h)) && (n.seedFile = h), e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new d.BtTask(this, !e, n);
                let f = this.getExtraObject().getFileSize();
                this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, f), this.saveAttribute(s.DownloadKernel.TaskAttribute.FileSize, f)
            })
        }

        createEmuleTask(e, t, n, i) {
            if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.Emule, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskUrl, n.url), this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, n.origin), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), t.groupTaskId && this.attribute.set(s.DownloadKernel.TaskAttribute.GroupTaskId, t.groupTaskId), 1 === n.downloadSubTask && this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadSubTask, 1), i) {
                let e = S.getCurrentPrivateCategory();
                e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
            }
            if (t.fileSize) this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, t.fileSize); else {
                let e = g.Common.parseEd2kUrl(n.url);
                e && e.fileSize && this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, e.fileSize)
            }
            return t.gcid && this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, t.gcid), t.cid && this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, t.cid), e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new c.EmuleTask(this, !e), this.taskId
        }

        createGroupTask(e, t, n, i) {
            if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.Group, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), i) {
                let e = S.getCurrentPrivateCategory();
                e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
            }
            let a = 0;
            for (let e = 0; e < n.subTaskList.length; ++e) {
                let t = n.subTaskList[e].taskBaseInfo.fileSize;
                t && (a += t)
            }
            return a && this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, a), e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new h.GroupTask(this, !e), this.taskId
        }

        createMagnetTask(e, t, n, i) {
            if (this.taskId = l.ThunderKernel.createTaskId(), this.taskType = s.DownloadKernel.TaskType.Magnet, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskUrl, n.url), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, n.torrentFilePath), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, t.origin), i) {
                let e = S.getCurrentPrivateCategory();
                e && this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.getId())
            }
            return e ? (this.isBackground = e, this.attribute.set(s.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskId
        }

        loadStorageP2spTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new u.P2spTask(this, !1, 0, 5)
        }

        loadStorageBtTaskAW(e) {
            return new Promise(t => i(this, void 0, void 0, function* () {
                this.setTaskBaseInfo(e), this.taskExtra = new d.BtTask(this, !1, null), this.getExtraObject().loadBtTask(e => {
                    if (e) {
                        let t = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                        void 0 !== t && "" !== t || void 0 !== e.displayName && this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, e.displayName)
                    }
                    t()
                })
            }))
        }

        loadStorageEmuleTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new c.EmuleTask(this, !1)
        }

        loadStorageGroupTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new h.GroupTask(this, !1)
        }

        updateTaskSavePath(e) {
            this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath, e)
        }

        updateTaskRelativePath(e) {
            this.setTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath, e)
        }

        updateTaskName(e) {
            this.setTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName, e)
        }

        updateDownloadSubTask(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask, e)
        }

        queryTaskInfo(e, t, n) {
            let i = !1;
            switch (this.taskType) {
                case s.DownloadKernel.TaskType.P2sp:
                    i = this.queryP2spTaskInfo(e, t, n);
                    break;
                case s.DownloadKernel.TaskType.Bt:
                    i = this.queryBtTaskInfo(e, t, n);
                    break;
                case s.DownloadKernel.TaskType.Emule:
                    i = this.queryEmuleTaskInfo(e, t, n);
                    break;
                case s.DownloadKernel.TaskType.Group:
                    i = this.queryGroupTaskInfo(e, t, n);
                    break;
                case s.DownloadKernel.TaskType.Magnet:
                    i = this.queryMagnetTaskInfo(e, t, n)
            }
            return i
        }

        updateTaskInfo(e, t, n) {
            let i = 0, a = s.DownloadKernel.TaskDetailChangedFlags.UnKnown;
            if (void 0 !== e.finalName && "" !== e.finalName && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName, e.finalName) && (a |= s.DownloadKernel.TaskDetailChangedFlags.TaskName), a |= this.updateDownloadSpeed(e.downloadSize), e.downloadSize) {
                let t = this.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize);
                this.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize) === e.fileSize && t > e.downloadSize || this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize, e.downloadSize) && (a |= s.DownloadKernel.TaskDetailChangedFlags.DownloadSize)
            }
            e.receivedSize && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.ReceivedSize, e.receivedSize) && (a |= s.DownloadKernel.TaskDetailChangedFlags.ReceivedSize), e.fileSize && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize, e.fileSize) && (a |= s.DownloadKernel.TaskDetailChangedFlags.FileSize), this.setTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode, e.taskError) && (a |= s.DownloadKernel.TaskDetailChangedFlags.ErrorCode), e.cid && "" !== e.cid && this.updateCid(e.cid) && (a |= s.DownloadKernel.TaskDetailChangedFlags.Cid), e.gcid && "" !== e.gcid && this.updateGcid(e.gcid) && (a |= s.DownloadKernel.TaskDetailChangedFlags.Gcid), e.srcTotal && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal, e.srcTotal) && (a |= s.DownloadKernel.TaskDetailChangedFlags.SrcTotal), e.srcUsing && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing, e.srcUsing) && (a |= s.DownloadKernel.TaskDetailChangedFlags.SrcUsing), e.taskStatus !== b.Error || e.taskError !== s.DownloadKernel.TaskError.FileCreate ? this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileCreated, 1) : this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileCreated, 0);
            let o = this.changeToDownloadKernelTaskStatus(e.taskStatus), r = this.updateTaskStatus(o),
                l = e.channelInfo;
            return l && this.updateChannelInfo(l) && (a |= s.DownloadKernel.TaskDetailChangedFlags.ChannelInfo), 0 === e.fileSize && (a = s.DownloadKernel.TaskDetailChangedFlags.UnKnown), r && (i |= 1, t(this)), a !== s.DownloadKernel.TaskDetailChangedFlags.UnKnown && (i |= 2, n(this, a)), i
        }

        updateCid(e) {
            let t = !1, n = this.attribute.get(s.DownloadKernel.TaskAttribute.Cid);
            return n && "" !== n || (n !== e && (this.saveAttribute(s.DownloadKernel.TaskAttribute.Cid, e), t = !0), "0000000000000000000000000000000000000000" === e ? this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, "") : this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, e)), t
        }

        updateGcid(e) {
            let t = !1, n = this.attribute.get(s.DownloadKernel.TaskAttribute.Gcid);
            return n && "" !== n || (n !== e && (this.saveAttribute(s.DownloadKernel.TaskAttribute.Gcid, e), t = !0), "0000000000000000000000000000000000000000" === e ? this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, "") : this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, e)), t
        }

        onFinish() {
            let e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Succeeded);
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.CompletionTime, (new Date).getTime()), this.virtualTaskId > 0 && (l.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(s.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        onStop() {
            let e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Stopped);
            return this.virtualTaskId > 0 && (l.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(s.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        onFail() {
            let e = this.updateTaskStatus(s.DownloadKernel.TaskStatus.Failed);
            return this.virtualTaskId > 0 && (l.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(s.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        moveToRecycle() {
            let e = (new Date).getTime();
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime, e)
        }

        recover() {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime, 0)
        }

        destroy() {
            return i(this, void 0, void 0, function* () {
                let e = !1;
                switch (this.taskType) {
                    case s.DownloadKernel.TaskType.P2sp:
                        e = yield this.deleteP2spTaskFile();
                        break;
                    case s.DownloadKernel.TaskType.Bt:
                        e = yield this.deleteBtTaskFile();
                        break;
                    case s.DownloadKernel.TaskType.Emule:
                        e = yield this.deleteEmuleTaskFile();
                        break;
                    case s.DownloadKernel.TaskType.Group:
                        e = yield this.deleteGroupTaskFile()
                }
                return e
            })
        }

        setSavePath(e) {
            this.taskStatus !== s.DownloadKernel.TaskStatus.StartPending && this.taskStatus !== s.DownloadKernel.TaskStatus.Started && this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath, e)
        }

        setCategoryViewId(e) {
            this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryViewId, e)
        }

        getIsPrivate() {
            let e = this.attribute.get(s.DownloadKernel.TaskAttribute.CategoryId);
            return void 0 !== e && e > -1
        }

        getUserName() {
            let e = this.attribute.get(s.DownloadKernel.TaskAttribute.CategoryId);
            if (void 0 !== e && e > -1) {
                let t = S.getCategoryFromId(e);
                if (t) return t.getUserName()
            }
            return ""
        }

        setCategoryId(e) {
            this.isBackground || (this.setTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryId, e), l.ThunderKernel.setCategoryId(e, this.taskId))
        }

        getTaskName() {
            return this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName)
        }

        getSavePath() {
            return this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath)
        }

        fireTaskDetailChanged(e) {
            let t = this.attribute.get(s.DownloadKernel.TaskAttribute.GroupTaskId);
            if (t > 0) {
                let e = new Map;
                e.set(t, [this]), y.fireTaskEvent(s.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
            } else this.fireTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, e)
        }

        getVirtualTaskId() {
            return this.virtualTaskId
        }

        setStopReason(e) {
            this.taskStatusChangedReason = e
        }

        getStopReason() {
            return this.taskStatusChangedReason
        }

        internalSetTaskSpeed(e, t) {
            let n = !1;
            return e = Math.round(e), t = Math.round(t), this.speed !== e && (n = !0, this.speed = e), this.vipSpeed !== t && (n = !0, this.vipSpeed = t), n
        }

        internalSetFileSize(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize, e)
        }

        internalSetGcid(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid, e)
        }

        internalSetDownloadingPeriod(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod, e)
        }

        internalSetDownloadSize(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize, e)
        }

        internalSetReceivedSize(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.ReceivedSize, e)
        }

        internalSetSrcUsing(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing, e)
        }

        internalSetSrcTotal(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal, e)
        }

        internalSetFileIndex(e) {
            return this.setTaskAttribute(s.DownloadKernel.TaskAttribute.FileIndex, e)
        }

        internalSetTaskChannelInfo(e) {
            return (this.channelInfo.originSize !== e.originSize || this.channelInfo.p2sSize !== e.p2sSize || this.channelInfo.p2pSize !== e.p2pSize || this.channelInfo.offlineSize !== e.offlineSize || this.channelInfo.dcdnSize !== e.dcdnSize || this.channelInfo.dcdnStatus !== e.dcdnStatus) && (this.channelInfo = e, l.ThunderKernel.saveTaskChannelInfo(this.taskId, e.originSize, e.p2pSize, e.p2sSize, e.offlineSize, e.dcdnSize), !0)
        }

        setFileSize(e) {
            let t = this.internalSetFileSize(e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.FileSize : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.FileSize)), t
        }

        setGcid(e) {
            let t = this.internalSetGcid(e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.Gcid : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.Gcid)), t
        }

        setDownloadingPeriod(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)), t
        }

        setDownloadSize(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.DownloadSize : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.DownloadSize)), t
        }

        setReceivedSize(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.ReceivedSize, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.ReceivedSize : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.ReceivedSize)), t
        }

        setSrcUsing(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.SrcUsing : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.SrcUsing)), t
        }

        setSrcTotal(e) {
            let t = this.setTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= s.DownloadKernel.TaskDetailChangedFlags.SrcTotal : this.fireTaskDetailChanged(s.DownloadKernel.TaskDetailChangedFlags.SrcTotal)), t
        }

        beginBatchSetTaskAttribute() {
            v.information("beginBatchSetTaskAttribute taskId:", this.taskId), this.batchSetTaskAttribute = !0
        }

        commitBatchSetTaskAttribute() {
            if (this.batchSetTaskAttribute && (this.batchSetTaskAttribute = !1, v.information("commitBatchSetTaskAttribute taskId:", this.taskId), this.batchDetailChangedFlags !== s.DownloadKernel.TaskDetailChangedFlags.UnKnown)) {
                let e = this.batchDetailChangedFlags;
                this.batchDetailChangedFlags = s.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.fireTaskDetailChanged(e)
            }
        }

        createDownloadSdkTask() {
            return i(this, void 0, void 0, function* () {
                switch (this.taskType) {
                    case s.DownloadKernel.TaskType.P2sp: {
                        let e = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskUrl),
                            t = this.attribute.get(s.DownloadKernel.TaskAttribute.RefUrl),
                            n = this.attribute.get(s.DownloadKernel.TaskAttribute.Cookie),
                            i = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                            a = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                        this.virtualTaskId = l.ThunderKernel.createP2spTask(e, t, n, i, a), v.information("createP2spTask virtualTaskId:", this.virtualTaskId, ", url:", e, ", refUrl: ", t, ", cookie:", n, ", savePath:", i, ", fileName:", a)
                    }
                        break;
                    case s.DownloadKernel.TaskType.Bt: {
                        let e = this.getExtraObject(), t = e.getSeedFilePath(), n = e.getDownloadFile(),
                            i = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                            o = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                        (yield T.SingleBtTaskNS.isSingleBtTask(this)) || (i = a.join(i, o)), this.virtualTaskId = l.ThunderKernel.createBtTask(t, i, n), v.information("createBtTask virtualTaskId:", this.virtualTaskId, ", torrentFilePath:", t, ", savePath: ", i, ", downloadIndexs:", n)
                    }
                        break;
                    case s.DownloadKernel.TaskType.Emule: {
                        let e = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskUrl),
                            t = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                            n = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName);
                        this.virtualTaskId = l.ThunderKernel.createEmuleTask(e, t, n), v.information("createEmuleTask virtualTaskId:", this.virtualTaskId, ", url:", e, ", savePath: ", t, ", fileName:", n)
                    }
                        break;
                    case s.DownloadKernel.TaskType.Magnet: {
                        let e = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskUrl),
                            t = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath);
                        this.virtualTaskId = l.ThunderKernel.createMagnetTask(e, t), v.information("createMagnetTask virtualTaskId:", this.virtualTaskId, ", url:", e, ", savePath: ", t)
                    }
                }
                return v.information("createDownloadSdkTask virtualTaskId:", this.virtualTaskId), this.attribute.set(s.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId), this.virtualTaskId
            })
        }

        queryP2spTaskInfo(e, t, n) {
            let i = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (i = l.ThunderKernel.queryTaskInfo(this.virtualTaskId, i => {
                null !== i && this.updateTaskInfo(i, e, t), n()
            })), i
        }

        queryBtTaskInfo(e, t, n) {
            let i = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (i = l.ThunderKernel.queryBtTaskInfo(this.virtualTaskId, i => {
                null !== i && (this.updateTaskInfo(i, e, t), this.getExtraObject().updateSubFileInfo(i.fileLists)), n()
            })), i
        }

        queryEmuleTaskInfo(e, t, n) {
            let i = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (i = l.ThunderKernel.queryTaskInfo(this.virtualTaskId, i => {
                null !== i && this.updateTaskInfo(i, e, t), n()
            })), i
        }

        queryGroupTaskInfo(e, t, n) {
            let i = !1;
            return this.taskExtra && (i = this.getExtraObject().querySubTaskInfo(e, t, n)), i
        }

        queryMagnetTaskInfo(e, t, n) {
            let i = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (i = l.ThunderKernel.queryTaskInfo(this.virtualTaskId, i => {
                null !== i && this.updateTaskInfo(i, e, t), n()
            })), i
        }

        setTaskBaseInfo(e) {
            e && (this.taskId = e.taskId, this.taskType = e.taskType, this.taskStatus = e.taskStatus, this.attribute.set(s.DownloadKernel.TaskAttribute.TaskId, e.taskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskType, e.taskType), this.attribute.set(s.DownloadKernel.TaskAttribute.FileCreated, e.fileCreated), this.attribute.set(s.DownloadKernel.TaskAttribute.RecycleTime, e.recycleTime), this.attribute.set(s.DownloadKernel.TaskAttribute.Forbidden, e.forbidden), this.attribute.set(s.DownloadKernel.TaskAttribute.FileSize, e.fileSize), this.attribute.set(s.DownloadKernel.TaskAttribute.ReceivedSize, e.receiveSize), this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadSize, e.downloadSize), this.attribute.set(s.DownloadKernel.TaskAttribute.CreateTime, e.createTime), this.attribute.set(s.DownloadKernel.TaskAttribute.CompletionTime, e.completionTime), this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadingPeriod, e.downloadingPeriod), this.attribute.set(s.DownloadKernel.TaskAttribute.ErrorCode, e.errorCode), this.attribute.set(s.DownloadKernel.TaskAttribute.NameType, e.nameType), this.attribute.set(s.DownloadKernel.TaskAttribute.CategoryId, e.categoryId), this.attribute.set(s.DownloadKernel.TaskAttribute.UserRead, e.userRead), this.attribute.set(s.DownloadKernel.TaskAttribute.OpenOnComplete, e.openOnComplete), this.attribute.set(s.DownloadKernel.TaskAttribute.OwnerProduct, e.ownerProduct), this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadSubTask, e.downloadSubTask), this.attribute.set(s.DownloadKernel.TaskAttribute.GroupTaskId, e.groupTaskId), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskName, e.taskName), this.attribute.set(s.DownloadKernel.TaskAttribute.SavePath, e.savePath), this.attribute.set(s.DownloadKernel.TaskAttribute.TaskUrl, e.url), this.attribute.set(s.DownloadKernel.TaskAttribute.RefUrl, e.refUrl), this.attribute.set(s.DownloadKernel.TaskAttribute.Description, e.description), this.attribute.set(s.DownloadKernel.TaskAttribute.ProductInfo, e.productInfo), this.attribute.set(s.DownloadKernel.TaskAttribute.Origin, e.origin), this.attribute.set(s.DownloadKernel.TaskAttribute.UserData, e.userData), "0000000000000000000000000000000000000000" === e.cid ? this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, "") : this.attribute.set(s.DownloadKernel.TaskAttribute.Cid, e.cid), "0000000000000000000000000000000000000000" === e.gcid ? this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, "") : this.attribute.set(s.DownloadKernel.TaskAttribute.Gcid, e.gcid), e.channelInfo && (this.historyChannelInfo = e.channelInfo))
        }

        setTaskAttribute(e, t) {
            let n = !1;
            return this.getTaskAttribute(e) !== t && void 0 !== t && (this.attribute.set(e, t), n = !0, this.saveAttribute(e, t)), n
        }

        updateDownloadSpeed(e) {
            let t = s.DownloadKernel.TaskDetailChangedFlags.UnKnown;
            if (e) {
                let n = e - this.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize);
                (0 === e || n < 0) && (n = 0);
                let i = this.calculateDownloadSpeed(n);
                (i = Math.round(i)) !== this.speed && (this.speed = i, t |= s.DownloadKernel.TaskDetailChangedFlags.TaskSpeed)
            }
            if (this.taskStatus === s.DownloadKernel.TaskStatus.Started) if (0 === this.startTime) this.startTime = (new Date).getTime(); else {
                let e = ((new Date).getTime() - this.startTime) / 1e3, n = this.downloadingPeriod + Math.round(e);
                this.saveAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod, n), this.attribute.set(s.DownloadKernel.TaskAttribute.DownloadingPeriod, n), this.attribute.get(s.DownloadKernel.TaskAttribute.GroupTaskId) < 1 && (t |= s.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)
            }
            return t
        }

        saveAttribute(e, t) {
            switch (e) {
                case s.DownloadKernel.TaskAttribute.TaskName:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskName, f.ValueType.ValueString, t);
                    break;
                case s.DownloadKernel.TaskAttribute.SavePath:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskSavePath, f.ValueType.ValueString, t);
                    break;
                case s.DownloadKernel.TaskAttribute.ReceivedSize:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskReceiveSize, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.DownloadSize:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskDownloadSize, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.FileSize:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskFileSize, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.RecycleTime:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskRemovingToRecycleTime, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.FileCreated:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskFileCreated, f.ValueType.ValueInt, t);
                    break;
                case s.DownloadKernel.TaskAttribute.CompletionTime:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskCompletionTime, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.DownloadingPeriod:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskDownloadingPeriod, f.ValueType.ValueBigint, t);
                    break;
                case s.DownloadKernel.TaskAttribute.ErrorCode:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskFailureErrorCode, f.ValueType.ValueInt, t);
                    break;
                case s.DownloadKernel.TaskAttribute.Cid:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskCid, f.ValueType.ValueBlob, t);
                    break;
                case s.DownloadKernel.TaskAttribute.Gcid:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskGcid, f.ValueType.ValueBlob, t);
                    break;
                case s.DownloadKernel.TaskAttribute.DownloadSubTask:
                    this.saveTaskInfo(this.taskId, f.StatementType.SetTaskDownload, f.ValueType.ValueInt, t)
            }
        }

        insertStorageTaskBase() {
            let e = this.getTaskBaseInfo();
            l.ThunderKernel.insertTaskBase(e)
        }

        deleteStorageTask() {
            l.ThunderKernel.deleteStorageTask(this.taskId, f.StatementType.DestroyTaskBase);
            let e = f.StatementType.StatementBengin;
            switch (this.taskType) {
                case s.DownloadKernel.TaskType.P2sp:
                    e = f.StatementType.DestroyP2spTask;
                    break;
                case s.DownloadKernel.TaskType.Bt:
                    e = f.StatementType.DestroyBtTask, this.getExtraObject().deleteStorageBtFile();
                    break;
                case s.DownloadKernel.TaskType.Emule:
                    e = f.StatementType.DestroyEmuleTask;
                    break;
                case s.DownloadKernel.TaskType.Group:
                    e = f.StatementType.DestroyGroupTask;
                    break;
                case s.DownloadKernel.TaskType.Magnet:
                    e = f.StatementType.DestroyMagnetTask
            }
            e !== f.StatementType.StatementBengin && l.ThunderKernel.deleteStorageTask(this.taskId, e)
        }

        saveTaskInfo(e, t, n, i) {
            this.isBackground || l.ThunderKernel.saveTaskBaseInfo(e, t, n, i)
        }

        updateChannelInfo(e) {
            let t = !1;
            if ((this.channelInfo.originSize !== e.originSize || this.channelInfo.p2sSize !== e.p2sSize || this.channelInfo.p2pSize !== e.p2pSize || this.channelInfo.offlineSize !== e.offlineSize || this.channelInfo.dcdnSize !== e.dcdnSize || this.channelInfo.dcdnStatus !== e.dcdnStatus) && (t = !0, e.offlineSize > 0 || e.dcdnSize > 0)) {
                let t = e.offlineSize - this.channelInfo.offlineSize + (e.dcdnSize - this.channelInfo.dcdnSize);
                t < 0 && (t = 0);
                let n = this.calculateVipSpeed(t);
                n = Math.round(n), this.vipSpeed !== n && (this.vipSpeed = n)
            }
            let n = !1, i = e.dcdnStatus;
            if (this.channelInfo.dcdnStatus !== i && (n = !0), this.taskStatus === s.DownloadKernel.TaskStatus.Stopped || this.taskStatus === s.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === s.DownloadKernel.TaskStatus.Seeding) {
                this.channelInfo = {originSize: 0, p2pSize: 0, p2sSize: 0, offlineSize: 0, dcdnSize: 0};
                let t = this.historyChannelInfo.originSize + e.originSize,
                    n = this.historyChannelInfo.p2pSize + e.p2pSize, i = this.historyChannelInfo.p2sSize + e.p2sSize,
                    a = this.historyChannelInfo.offlineSize + e.offlineSize,
                    o = this.historyChannelInfo.dcdnSize + e.dcdnSize;
                this.historyChannelInfo = {originSize: t, p2pSize: n, p2sSize: i, offlineSize: a, dcdnSize: o}
            } else this.channelInfo = e;
            return t && this.saveChannelInfo(), n && this.fireTaskEvent(s.DownloadKernel.TaskEventType.DcdnStatusChanged), t
        }

        saveChannelInfo() {
            let e = this.getTaskChannelInfo();
            l.ThunderKernel.saveTaskChannelInfo(this.taskId, e.originSize, e.p2pSize, e.p2sSize, e.offlineSize, e.dcdnSize)
        }

        deleteP2spTaskFile() {
            return i(this, void 0, void 0, function* () {
                let e = !0, t = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                    n = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName), i = a.join(t, n);
                if (this.taskStatus === s.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === s.DownloadKernel.TaskStatus.Seeding || this.taskStatus === s.DownloadKernel.TaskStatus.DestroyPending && this.preStatus === s.DownloadKernel.TaskStatus.Succeeded || this.preStatus === s.DownloadKernel.TaskStatus.Seeding) (yield r.FileSystemAWNS.existsAW(i)) && (e = yield r.FileSystemAWNS.unlinkAW(i)); else {
                    let t = i + ".xltd", n = i + ".xltd.cfg";
                    (yield r.FileSystemAWNS.existsAW(t)) && (e = yield r.FileSystemAWNS.unlinkAW(t)), (yield r.FileSystemAWNS.existsAW(n)) && (e = (yield r.FileSystemAWNS.unlinkAW(n)) && e)
                }
                return e
            })
        }

        deleteBtTaskFile() {
            return i(this, void 0, void 0, function* () {
                let e = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                    t = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName),
                    n = a.join(__profilesDir, "Torrents"), i = this.getExtraObject().getInfoId(), o = i + ".xlbt.cfg",
                    l = i + ".xlbt.dat", u = a.join(e, t), d = a.join(n, o), c = a.join(n, l), h = !0;
                return (yield T.SingleBtTaskNS.isSingleBtTask(this)) ? yield this.deleteSingleBtTaskFile() : (yield r.FileSystemAWNS.existsAW(u)) && (h = yield r.FileSystemAWNS.rmdirsAW(u)), yield r.FileSystemAWNS.unlinkAW(d), yield r.FileSystemAWNS.unlinkAW(c), h
            })
        }

        deleteEmuleTaskFile() {
            return i(this, void 0, void 0, function* () {
                let e = !0, t = this.attribute.get(s.DownloadKernel.TaskAttribute.SavePath),
                    n = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName), i = a.join(t, n);
                if (this.taskStatus === s.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === s.DownloadKernel.TaskStatus.Seeding || this.taskStatus === s.DownloadKernel.TaskStatus.DestroyPending && this.preStatus === s.DownloadKernel.TaskStatus.Succeeded || this.preStatus === s.DownloadKernel.TaskStatus.Seeding) (yield r.FileSystemAWNS.existsAW(i)) && (e = yield r.FileSystemAWNS.unlinkAW(i)); else {
                    let t = i + ".emule.xltd", n = i + ".xlemule.cfg";
                    (yield r.FileSystemAWNS.existsAW(t)) && (e = yield r.FileSystemAWNS.unlinkAW(t)), (yield r.FileSystemAWNS.existsAW(n)) && (e = (yield r.FileSystemAWNS.unlinkAW(n)) && e)
                }
                return e
            })
        }

        deleteGroupTaskFile() {
            return i(this, void 0, void 0, function* () {
                return yield this.getExtraObject().destroy()
            })
        }

        deleteSingleBtTaskFile() {
            return i(this, void 0, void 0, function* () {
                let e = T.SingleBtTaskNS.getSinleBtTaskFilePath(this);
                if (yield r.FileSystemAWNS.existsAW(e)) yield r.FileSystemAWNS.unlinkAW(e); else {
                    let t = e + ".bt.xltd";
                    (yield r.FileSystemAWNS.existsAW(t)) ? yield r.FileSystemAWNS.unlinkAW(t) : (t = e + ".bt.td", yield r.FileSystemAWNS.unlinkAW(t))
                }
                let t = this.getExtraObject().getInfoId(), n = this.getSavePath(), i = t + ".torrent", o = a.join(n, i);
                yield r.FileSystemAWNS.unlinkAW(o)
            })
        }

        fireTaskEvent(e, ...t) {
            y.fireTaskEvent(e, [this], ...t)
        }

        isVideoFileExt(e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let n = a.extname(e);
                for (let e = 0; e < w.length; ++e) if (n.toLowerCase() === w[e]) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        isVideoFile() {
            let e = !1;
            do {
                let t = "";
                if (this.taskType === s.DownloadKernel.TaskType.P2sp || this.taskType === s.DownloadKernel.TaskType.Emule) t = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskName), e = this.isVideoFileExt(t); else if (this.taskType === s.DownloadKernel.TaskType.Bt) {
                    let t = this.getExtraObject();
                    if (t.getDownloadFile().length <= 0) break;
                    let n = t.getBtFileList();
                    for (let [, t]of n) {
                        let n = t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download),
                            i = t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName);
                        if (1 === n && (e = this.isVideoFileExt(i))) break
                    }
                } else if (this.taskType === s.DownloadKernel.TaskType.Group) {
                    let t = this.getExtraObject();
                    if (null !== t && void 0 !== t) {
                        let n = t.getSubTaskCount();
                        for (let i = 0; i < n; ++i) {
                            let n = t.getSubTaskByIndex(i),
                                a = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName);
                            if (1 === n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask) && (e = this.isVideoFileExt(a))) break
                        }
                    }
                }
            } while (0);
            return e
        }

        setTaskExtInfoBeforeStart() {
            if (this.virtualTaskId > 0) {
                let e = this.attribute.get(s.DownloadKernel.TaskAttribute.TaskId),
                    t = this.attribute.get(s.DownloadKernel.TaskAttribute.Origin);
                this.attribute.get(s.DownloadKernel.TaskAttribute.Background) && (t = "background");
                let n = "parentid=" + e.toString();
                n = n + ",taskorigin=" + t, l.ThunderKernel.setTaskExtInfo(this.virtualTaskId, n)
            }
        }

        calculateDownloadSpeed(e) {
            this.downloadSizeList.length > 5 && this.downloadSizeList.splice(0, 1), this.downloadSizeList.push(e);
            let t = 0;
            for (let e = 0; e < this.downloadSizeList.length; ++e) t += this.downloadSizeList[e];
            let n = t / this.downloadSizeList.length;
            return this.taskStatus !== s.DownloadKernel.TaskStatus.Started && (n = 0, this.downloadSizeList = []), n
        }

        calculateVipSpeed(e) {
            this.vipSizeList.length > 5 && this.vipSizeList.splice(0, 1), this.vipSizeList.push(e);
            let t = 0;
            for (let e = 0; e < this.vipSizeList.length; ++e) t += this.vipSizeList[e];
            let n = t / this.vipSizeList.length;
            return this.taskStatus !== s.DownloadKernel.TaskStatus.Started && (n = 0, this.vipSizeList = []), n
        }

        changeToDownloadKernelTaskStatus(e) {
            let t = this.taskStatus;
            switch (e) {
                case b.None:
                case b.Create:
                case b.StartPending:
                    break;
                case b.Downloading:
                case b.StopPending:
                case b.CompletePending:
                case b.ErrorStopPending:
                    t = s.DownloadKernel.TaskStatus.Started;
                    break;
                case b.Pause:
                    t = s.DownloadKernel.TaskStatus.Stopped;
                    break;
                case b.Complete:
                    t = s.DownloadKernel.TaskStatus.Succeeded;
                    break;
                case b.Error:
                    t = s.DownloadKernel.TaskStatus.Failed;
                    break;
                default:
                    t = s.DownloadKernel.TaskStatus.Unkown
            }
            return t
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(92), o = n(252), r = n(277), s = n(7);
    t.P2spTask = class {
        constructor(e, t, n, s) {
            this.task = e, this.downloadSpeedLimit = 0, this.threadCount = s || 5, this.useOriginOnly = n || 0, this.taskId = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId), this.cookie = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.Cookie), this.displayUrl = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskUrl), t ? a.ThunderKernel.insertP2spTask(this.taskId, this.downloadSpeedLimit, this.useOriginOnly, this.threadCount, void 0 === this.cookie ? "" : this.cookie, this.displayUrl) : a.ThunderKernel.loadStorageTask(this.taskId, o.StatementType.LoadP2spTask, e => {
                this.useOriginOnly = e.originOnly, this.threadCount = e.threadCount, this.downloadSpeedLimit = e.speedLimit, this.displayUrl = e.displayUrl, this.cookie = e.cookie
            });
            let l = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.UserData);
            this.userData = new r.TaskUserData(e, l)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            s.isNullOrUndefined(t) ? t = this.priority : this.priority = t;
            let n = this.task.getVirtualTaskId();
            n && n > 0 && !s.isNullOrUndefined(t) && a.ThunderKernel.setTaskPriorityLevel(n, e, t)
        }

        setUserData(e, t, n) {
            return this.userData.setUserData(e, t, n)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        setUseOriginOnly(e) {
            e !== this.useOriginOnly && (this.useOriginOnly = e, a.ThunderKernel.setP2spTaskOriginOnly(this.taskId, e))
        }

        setOriginThreadCount(e) {
            e !== this.threadCount && (this.threadCount = e, a.ThunderKernel.setP2spTaskThreadCount(this.taskId, e))
        }

        getUseOriginOnly() {
            return this.useOriginOnly
        }

        getThreadCount() {
            return this.threadCount
        }

        getSpeedLimit() {
            return this.downloadSpeedLimit
        }

        getDisplayUrl() {
            return this.displayUrl
        }

        getCookie() {
            return this.cookie
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(7);
    !function (e) {
        let t;
        !function (e) {
            e[e.LowerBound = -1] = "LowerBound", e[e.Integer = 0] = "Integer", e[e.String = 1] = "String", e[e.List = 2] = "List", e[e.Map = 3] = "Map", e[e.UpperBound = 4] = "UpperBound"
        }(t = e.BencodeDataType || (e.BencodeDataType = {}));

        class n {
            constructor(e) {
                this.type = t.LowerBound, this.type = e
            }

            getType() {
                return this.type
            }
        }

        e.BencodeObject = n;

        class a extends n {
            constructor() {
                super(t.Integer), this.value = 0
            }

            getValue() {
                return this.value
            }

            setValue(e) {
                return this.value !== e && (this.value = e, !0)
            }

            decode(e) {
                if (e.length < 2 || "i" !== e[0]) return -1;
                this.value = 0;
                let t = 1;
                for ("-" === e[1] && t++; t < e.length; t++) {
                    if (!(e[t] >= "0" && e[t] <= "9")) return "e" === e[t] ? ("-" === e[1] && (this.value = -this.value), t + 1) : -1;
                    this.value = 10 * this.value + parseInt(e[t], 10)
                }
                return -1
            }

            encode(e) {
                return e += "i", e += this.value, e += "e"
            }
        }

        e.BencodeInteger = a;

        class o extends n {
            constructor() {
                super(t.String), this.value = ""
            }

            getValue() {
                return this.value
            }

            setValue(e) {
                return this.value !== e && (this.value = e, !0)
            }

            decode(e) {
                let t = 0, n = 0;
                for (; n < e.length; n++) {
                    if (!(e[n] >= "0" && e[n] <= "9")) {
                        if (":" !== e[n]) return -1;
                        break
                    }
                    t = 10 * t + parseInt(e[n], 10)
                }
                return t + n + 1 > e.length ? -1 : (this.value = e.substr(n + 1, t), t + n + 1)
            }

            encode(e) {
                return e += this.value.length, e += ":", e += this.value
            }
        }

        e.BencodeString = o;

        class r extends n {
            constructor() {
                super(t.List), this.value = []
            }

            getItemList() {
                return this.value
            }

            decode(e) {
                return 0
            }

            encode(e) {
                return e
            }
        }

        e.BencodeList = r;

        class s extends n {
            constructor() {
                super(t.Map), this.value = new Map
            }

            getValue() {
                return this.value
            }

            getItem(e) {
                return this.value.get(e)
            }

            addMapItem(e) {
                let n = null, i = this.value.get(e);
                return i && i.getType() === t.Map ? n = i : (n = new s, this.value.set(e, n)), n
            }

            addItem(e, n) {
                if (i.isNumber(n)) {
                    let i = null, o = this.value.get(e);
                    o && o.getType() === t.Integer ? i = o : (i = new a, this.value.set(e, i)), i.setValue(n)
                } else if (i.isString(n)) {
                    let i = null, a = this.value.get(e);
                    a && a.getType() === t.String ? i = a : (i = new o, this.value.set(e, i)), i.setValue(n)
                }
                return !0
            }

            removeItem(e) {
                let n = this.value.get(e);
                if (n) {
                    let i = !0;
                    if (n.getType() === t.Map) {
                        0 === n.getValue().size && (i = !0)
                    }
                    return this.value.delete(e), i
                }
                return !1
            }

            decode(e) {
                if (!e) return -1;
                let t = e.length;
                if (t < 2 || "d" !== e[0]) return -1;
                let n = 1, i = new o, r = null, l = -1, u = -1;
                for (; n < t && "e" !== e[n];) {
                    if (!((l = i.decode(e.substr(n))) >= 0)) return -1;
                    if ("i" === e[n += l]) {
                        let t = new a;
                        u = t.decode(e.substr(n)), r = t
                    } else if ("d" === e[n]) {
                        let t = new s;
                        u = t.decode(e.substr(n)), r = t
                    } else {
                        let t = new o;
                        u = t.decode(e.substr(n)), r = t
                    }
                    if (!(u >= 0)) return -1;
                    n += u, this.value.set(i.getValue(), r)
                }
                return n < t && "e" === e[n] ? n + 1 : -1
            }

            encode(e) {
                e += "d";
                let t = new o;
                return this.value.forEach(function (n, i) {
                    t.setValue(i), e = t.encode(e), e = n.encode(e)
                }), e += "e"
            }
        }

        e.BencodeMap = s;
        e.Bencode = class {
            constructor() {
                this.objectList = []
            }

            getItemList() {
                return this.objectList
            }

            encode(e) {
                for (let t = 0; t < this.objectList.length; t++) e = this.objectList[t].encode(e);
                return e
            }

            decode(e) {
                let t = null, n = -1, i = 0, l = e.length;
                for (; i < l; i++) (n = (t = "i" === e[i] ? new a : "l" === e[i] ? new r : "d" === e[i] ? new s : new o).decode(e.substr(i))) >= 0 && (i += n, this.objectList.push(t));
                return e
            }
        }
    }(t.BencodeMap || (t.BencodeMap = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(92), o = n(252), r = n(760), s = n(37), l = n(277), u = n(7),
        d = s.DownloadKernelEventManager.getEventManager();
    t.BtTask = class {
        constructor(e, t, n) {
            this.subError = !1, this.fileLists = new Map, this.priorityMap = new Map, this.downloadIndexLists = [], this.task = e;
            let o = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
            if (n) {
                this.infoId = n.infoId, this.tracker = n.tracker, this.seedFile = n.seedFile, this.displayName = n.displayName, this.downloadIndexLists = n.fileRealIndexLists, t && a.ThunderKernel.insertBtTask(o, this.infoId, this.tracker, this.seedFile, this.displayName);
                let e = n.fileLists, i = a.ThunderKernel.beginTransaction();
                for (let n = 0; n < e.length; ++n) {
                    let i = e[n], a = i.realIndex, o = 0;
                    this.downloadIndexLists.indexOf(a) > -1 && (o = 1);
                    let s = new r.BtFile(this);
                    s.saveBtFileInfo(t, o, i), this.fileLists.set(a, s)
                }
                a.ThunderKernel.commitTransaction(i)
            }
            let s = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.UserData);
            this.userData = new l.TaskUserData(e, s)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            u.isNullOrUndefined(t) ? t = this.priorityMap.get(e) : this.priorityMap.set(e, t);
            let n = this.task.getVirtualTaskId();
            if (n && n > 0 && !u.isNullOrUndefined(t)) if (-1 === e) for (let e = 0; e < this.downloadIndexLists.length; ++e) a.ThunderKernel.setTaskPriorityLevel(n, this.downloadIndexLists[e], t); else a.ThunderKernel.setTaskPriorityLevel(n, e, t)
        }

        setUserData(e, t, n) {
            return this.userData.setUserData(e, t, n)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        getFileCount() {
            return this.fileLists.size
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        getBtFileByRealIndex(e) {
            return this.fileLists.get(e)
        }

        getInfoId() {
            return this.infoId
        }

        getDisplayName() {
            return this.displayName
        }

        getTrackerUrls() {
            return this.tracker
        }

        getSeedFilePath() {
            return this.seedFile
        }

        getDownloadFile() {
            return this.downloadIndexLists
        }

        getFileSize() {
            let e = 0;
            for (let t of this.fileLists) {
                let n = t[1];
                if (1 === n.getIsDownload()) {
                    let t = n.getBtFileAttribute(i.DownloadKernel.BtFileAttribute.FileSize);
                    t && (e += t)
                }
            }
            return e
        }

        setDownloadFile(e) {
            for (let t of this.fileLists) {
                let n = t[1], i = n.getFileIndex();
                e.indexOf(i) > -1 ? n.setIsDownload(1) : n.setIsDownload(0)
            }
            this.downloadIndexLists = e
        }

        getBtFileList() {
            return this.fileLists
        }

        getBtFileInfoList() {
            let e = [];
            for (let t of this.fileLists) {
                let n = t[1].getBtFileInfo();
                e.push(n)
            }
            return e
        }

        updateSubFileInfo(e) {
            if (e && e.length > 0) {
                let t = !1, n = !1, a = [];
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t], o = n.realIndex, r = this.getFileStatus(n.fileStatus), s = n.errorCode;
                    0 !== s && (r = s > 700 ? i.DownloadKernel.BtFileStatus.Forbidden : i.DownloadKernel.BtFileStatus.Error, a.push(o)), n.fileStatus = r;
                    let l = this.fileLists.get(o);
                    l && l.updateFileInfo(n)
                }
                if (a.length > 0) {
                    let e = this.getDownloadFile();
                    for (let o = 0; o < a.length; ++o) for (let r = 0; r < e.length; ++r) if (e[r] === a[o]) {
                        e.splice(r, 1), this.subError || (this.subError = !0, n = !0);
                        let s = a[o], l = this.fileLists.get(s);
                        l && l.getBtFileAttribute(i.DownloadKernel.BtFileAttribute.ErrorCode) > 700 && (t = !0);
                        break
                    }
                    this.setDownloadFile(e)
                }
                let o = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
                if (d.fireTaskEvent(i.DownloadKernel.TaskEventType.BtSubFileDetailChanged, o, e), n) {
                    let e = "Error";
                    t && (e = "Forbidden"), d.fireTaskEvent(i.DownloadKernel.TaskEventType.BtSubFileForbidden, o, e)
                }
            }
        }

        deleteStorageBtFile() {
            let e = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
            a.ThunderKernel.deleteStorageTask(e, o.StatementType.DestroyBtFile)
        }

        loadBtTask(e) {
            let t = this.task.getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
            a.ThunderKernel.loadStorageTask(t, o.StatementType.LoadBtTask, n => {
                n ? (this.infoId = n.infoId, this.tracker = n.tracker, this.seedFile = n.seedFile, this.displayName = n.displayName, a.ThunderKernel.loadStorageTask(t, o.StatementType.LoadBtFile, t => {
                    if (t) for (let e = 0; e < t.length; ++e) {
                        let n = t[e], i = new r.BtFile(this);
                        i.setFileData(n), this.fileLists.set(n.realIndex, i), 1 === n.download && this.downloadIndexLists.push(n.realIndex)
                    }
                    e(n, t)
                })) : e(null, null)
            })
        }

        getFileStatus(e) {
            let t = i.DownloadKernel.BtFileStatus.Stopped;
            switch (e) {
                case 0:
                    break;
                case 1:
                    t = i.DownloadKernel.BtFileStatus.Stopped;
                    break;
                case 2:
                    t = i.DownloadKernel.BtFileStatus.Started;
                    break;
                case 3:
                    t = i.DownloadKernel.BtFileStatus.Complete
            }
            return t
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(8), a = n(92), o = n(37).DownloadKernelEventManager.getEventManager();
    t.BtFile = class {
        constructor(e) {
            this.attribute = new Map;
            for (let e = i.DownloadKernel.BtFileAttribute.NumberStrart; e < i.DownloadKernel.BtFileAttribute.NumberEnd; ++e) this.attribute.set(e, 0);
            for (let e = i.DownloadKernel.BtFileAttribute.StringStart; e < i.DownloadKernel.BtFileAttribute.StringEnd; ++e) this.attribute.set(e, "");
            this.attribute.set(i.DownloadKernel.BtFileAttribute.DcdnStatus, i.DownloadKernel.DcdnStatusCode.Unkown), this.btTask = e;
            let t = this.btTask.getTask().getTaskAttribute(i.DownloadKernel.TaskAttribute.TaskId);
            this.taskId = t, this.attribute.set(i.DownloadKernel.BtFileAttribute.TaskId, t)
        }

        getBtFileAttribute(e) {
            return this.attribute.get(e)
        }

        updateFileInfo(e) {
            this.realIndex = e.realIndex, this.attribute.set(i.DownloadKernel.BtFileAttribute.FileSize, e.fileSize), this.attribute.set(i.DownloadKernel.BtFileAttribute.RealIndex, e.realIndex), this.attribute.set(i.DownloadKernel.BtFileAttribute.EnableDcdn, e.enableDcdn), this.setAttribute(i.DownloadKernel.BtFileAttribute.ErrorCode, e.errorCode) && a.ThunderKernel.setBtFileFailureErrorCode(this.realIndex, this.taskId, this.attribute.get(i.DownloadKernel.BtFileAttribute.ErrorCode)), e.relativePath && this.attribute.set(i.DownloadKernel.BtFileAttribute.RelativePath, e.relativePath), e.finalName && "" !== e.finalName && (this.attribute.set(i.DownloadKernel.BtFileAttribute.FinalName, e.finalName), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileName, e.finalName));
            let t = this.setAttribute(i.DownloadKernel.BtFileAttribute.FileStatus, e.fileStatus),
                n = this.setAttribute(i.DownloadKernel.BtFileAttribute.DownloadSize, e.downloadSize);
            (t || n) && a.ThunderKernel.saveBtFileInfo(this.taskId, this.realIndex, this.attribute.get(i.DownloadKernel.BtFileAttribute.FileStatus), this.download, this.attribute.get(i.DownloadKernel.BtFileAttribute.DownloadSize)), e.cid && "" !== e.cid && e.gcid && "" !== e.gcid && this.updateCidAndGcid(e.cid, e.gcid);
            let r = this.attribute.get(i.DownloadKernel.BtFileAttribute.DcdnStatus);
            if (r !== e.dcdnStatus) {
                this.attribute.set(i.DownloadKernel.BtFileAttribute.DcdnStatus, e.dcdnStatus);
                let t = this.btTask.getTask().getId();
                o.fireTaskEvent(i.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, t, this.realIndex, e.dcdnStatus, r)
            }
        }

        saveBtFileInfo(e, t, n) {
            if (this.download = t, this.realIndex = n.realIndex, this.attribute.set(i.DownloadKernel.BtFileAttribute.Download, t), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileSize, n.fileSize), this.attribute.set(i.DownloadKernel.BtFileAttribute.RealIndex, n.realIndex), this.attribute.set(i.DownloadKernel.BtFileAttribute.RealIndex, n.realIndex), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileOffset, n.fileOffset), n.fileName && this.attribute.set(i.DownloadKernel.BtFileAttribute.FileName, n.fileName), n.filePath && this.attribute.set(i.DownloadKernel.BtFileAttribute.FilePath, n.filePath), e) {
                let e = {
                    taskId: this.taskId,
                    status: 0,
                    realIndex: n.realIndex,
                    visible: 1,
                    download: t,
                    fileSize: n.fileSize,
                    fileOffset: n.fileOffset,
                    filePath: void 0 === n.filePath ? "" : n.filePath,
                    fileName: void 0 === n.fileName ? "" : n.fileName
                };
                a.ThunderKernel.insertBtFile(this.taskId, e)
            }
        }

        getBtFileInfo() {
            let e = {};
            return e.fileSize = this.attribute.get(i.DownloadKernel.BtFileAttribute.FileSize), e.realIndex = this.attribute.get(i.DownloadKernel.BtFileAttribute.RealIndex), e.fileOffset = this.attribute.get(i.DownloadKernel.BtFileAttribute.FileOffset), e.fileName = this.attribute.get(i.DownloadKernel.BtFileAttribute.FileName), e.filePath = this.attribute.get(i.DownloadKernel.BtFileAttribute.FilePath), e
        }

        getBtDownloadFileInfo() {
            return {
                realIndex: this.attribute.get(i.DownloadKernel.BtFileAttribute.RealIndex),
                fileStatus: this.attribute.get(i.DownloadKernel.BtFileAttribute.FileStatus),
                downloadSize: this.attribute.get(i.DownloadKernel.BtFileAttribute.DownloadSize),
                fileSize: this.attribute.get(i.DownloadKernel.BtFileAttribute.FileSize),
                enableDcdn: this.attribute.get(i.DownloadKernel.BtFileAttribute.EnableDcdn),
                errorCode: this.attribute.get(i.DownloadKernel.BtFileAttribute.ErrorCode),
                dcdnStatus: this.attribute.get(i.DownloadKernel.BtFileAttribute.DcdnStatus),
                relativePath: this.attribute.get(i.DownloadKernel.BtFileAttribute.RelativePath),
                finalName: this.attribute.get(i.DownloadKernel.BtFileAttribute.FinalName),
                cid: this.attribute.get(i.DownloadKernel.BtFileAttribute.Cid),
                gcid: this.attribute.get(i.DownloadKernel.BtFileAttribute.Gcid)
            }
        }

        getIsDownload() {
            return this.download
        }

        setIsDownload(e) {
            this.download = e, this.attribute.set(i.DownloadKernel.BtFileAttribute.Download, e), a.ThunderKernel.saveBtFileInfo(this.taskId, this.realIndex, this.attribute.get(i.DownloadKernel.BtFileAttribute.FileStatus), this.download, this.attribute.get(i.DownloadKernel.BtFileAttribute.DownloadSize))
        }

        getFileIndex() {
            return this.realIndex
        }

        setFileData(e) {
            this.download = e.download, this.taskId = e.taskId, this.realIndex = e.realIndex, this.attribute.set(i.DownloadKernel.BtFileAttribute.TaskId, e.taskId), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileSize, e.fileSize), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileOffset, e.fileOffset), this.attribute.set(i.DownloadKernel.BtFileAttribute.DownloadSize, e.receivedSize), this.attribute.set(i.DownloadKernel.BtFileAttribute.RealIndex, e.realIndex), this.attribute.set(i.DownloadKernel.BtFileAttribute.FileStatus, e.status), this.attribute.set(i.DownloadKernel.BtFileAttribute.Visible, e.visible), this.attribute.set(i.DownloadKernel.BtFileAttribute.Download, e.download), e.filePath && this.attribute.set(i.DownloadKernel.BtFileAttribute.FilePath, e.filePath), e.fileName && this.attribute.set(i.DownloadKernel.BtFileAttribute.FileName, e.fileName), e.cid && this.attribute.set(i.DownloadKernel.BtFileAttribute.Cid, e.cid), e.gcid && this.attribute.set(i.DownloadKernel.BtFileAttribute.Gcid, e.gcid), this.attribute.set(i.DownloadKernel.BtFileAttribute.ErrorCode, e.failureErrorCode)
        }

        updateCidAndGcid(e, t) {
            let n = !1, o = this.attribute.get(i.DownloadKernel.BtFileAttribute.Cid),
                r = this.attribute.get(i.DownloadKernel.BtFileAttribute.Gcid);
            o && "" !== o || ("0000000000000000000000000000000000000000" === e ? this.setAttribute(i.DownloadKernel.BtFileAttribute.Cid, "") : this.setAttribute(i.DownloadKernel.BtFileAttribute.Cid, e), o = e, n = !0), r && "" !== r || ("0000000000000000000000000000000000000000" === t ? this.setAttribute(i.DownloadKernel.BtFileAttribute.Gcid, "") : this.setAttribute(i.DownloadKernel.BtFileAttribute.Gcid, t), r = t, n = !0), n && a.ThunderKernel.saveBtFileCid(this.taskId, this.realIndex, o, r)
        }

        setAttribute(e, t) {
            let n = !1;
            return this.attribute.get(e) !== t && void 0 !== t && (this.attribute.set(e, t), n = !0), n
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(82), a = n(8), o = n(92), r = n(252), s = n(277), l = n(7), u = n(2);
    t.EmuleTask = class {
        constructor(e, t) {
            if (this.task = e, this.configPath = u.join(__profilesDir, "Emule"), this.taskId = e.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId), t) {
                let e = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId),
                    t = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskUrl);
                i.Common.isThunderPrivateUrl(t) && (t = i.Common.parseThunderPrivateUrl(t)), this.fileHash = o.ThunderKernel.getFileHashByUrl(t), o.ThunderKernel.insertEmuleTask(e, this.fileHash, this.configPath)
            } else o.ThunderKernel.loadStorageTask(this.taskId, r.StatementType.LoadEmuleTask, e => {
                this.fileHash = e.fileHash, this.configPath = e.configPath
            });
            let n = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.UserData);
            this.userData = new s.TaskUserData(e, n)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            l.isNullOrUndefined(t) ? t = this.priority : this.priority = t;
            let n = this.task.getVirtualTaskId();
            n && n > 0 && !l.isNullOrUndefined(t) && o.ThunderKernel.setTaskPriorityLevel(n, e, t)
        }

        setUserData(e, t, n) {
            return this.userData.setUserData(e, t, n)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        getFileHash() {
            return this.fileHash
        }

        getConfigPath() {
            return this.configPath
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(9), r = n(8), s = n(92), l = n(252), u = n(37), d = n(277), c = n(1),
        h = u.DownloadKernelEventManager.getEventManager(), f = c.default.getLogger("DownloadKernel.TaskGroup");
    t.GroupTask = class {
        constructor(e, t) {
            this.startTime = 0, this.downloadingPeriod = 0, this.startTaskCount = 5, this.task = e, this.subTasks = [], this.moveTimeout = 120, this.downloadingSubCount = 5, this.subTaskOrder = "", this.taskId = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId), t ? s.ThunderKernel.insertGroupTask(this.taskId, this.moveTimeout, this.downloadingSubCount, this.subTaskOrder) : (this.downloadingPeriod = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadingPeriod), s.ThunderKernel.loadStorageTask(this.taskId, l.StatementType.LoadGroupTask, e => {
                this.moveTimeout = e.moveTimeout, this.downloadingSubCount = e.downloadingSubCount
            }));
            let n = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.UserData);
            this.userData = new d.TaskUserData(e, n)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            if (-1 === e) for (let e = 0; e < this.subTasks.length; ++e) {
                let n = this.subTasks[e].getExtraObject();
                n && n.setTaskPriorityLevel(-1, t)
            } else {
                let n = this.getSubTaskByIndex(e);
                if (n) {
                    let e = n.getExtraObject();
                    e && e.setTaskPriorityLevel(-1, t)
                }
            }
        }

        setSubTaskFileSize(e, t) {
            let n = !1, i = this.subTasks[e];
            if (i && (n = i.setFileSize(t))) {
                let e = 0;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let n = this.subTasks[t];
                    if (n) {
                        if (0 === n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                        let t = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize);
                        t && (e += t)
                    }
                }
                this.task.setFileSize(e)
            }
            return n
        }

        setUserData(e, t, n) {
            return this.userData.setUserData(e, t, n)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        getSubTaskCount() {
            return this.subTasks.length
        }

        getDownloadTaskCount() {
            let e = 0;
            for (let t = 0; t < this.subTasks.length; ++t) {
                let n = this.subTasks[t];
                n && 1 === n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask) && e++
            }
            return e
        }

        getSubTaskByIndex(e) {
            return this.subTasks[e]
        }

        addSubTask(e) {
            e && (this.subTasks.push(e), e.internalSetFileIndex(this.subTasks.length - 1))
        }

        start() {
            let e = !1, t = 0, n = 0;
            for (let i = 0; i < this.subTasks.length; ++i) {
                let a = this.subTasks[i];
                if (!a) continue;
                if (0 === a.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                    n++;
                    continue
                }
                let o = a.getTaskStatus();
                if (o !== r.DownloadKernel.TaskStatus.Succeeded && o !== r.DownloadKernel.TaskStatus.Seeding) if (o !== r.DownloadKernel.TaskStatus.Failed) {
                    if (a.start() && (e = !0, ++t >= this.startTaskCount)) break
                } else a.start() && (e = !0); else n++
            }
            return n === this.subTasks.length && (e = !0), e
        }

        stop() {
            let e = !1;
            for (let t = 0; t < this.subTasks.length; ++t) {
                let n = this.subTasks[t];
                if (!n) continue;
                let i = n.getTaskStatus();
                i !== r.DownloadKernel.TaskStatus.Succeeded && i !== r.DownloadKernel.TaskStatus.Seeding && n.stop() && (e = !0)
            }
            return e
        }

        delete(e) {
            return i(this, void 0, void 0, function* () {
                let t = !0;
                for (let n = 0; n < this.subTasks.length; ++n) {
                    let i = this.subTasks[n];
                    i && (t = (yield i.delete(e)) && t)
                }
                if (e) {
                    let e = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath), n = [e];
                    for (let t = 0; t < this.subTasks.length; ++t) {
                        let i = this.subTasks[t];
                        if (i) {
                            let t = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath);
                            for (; t.length > e.length && !n.includes(t);) n = n.concat([t]), t = a.parse(t).dir
                        }
                    }
                    n.sort((e, t) => e.length > t.length ? -1 : e.length < t.length ? 1 : 0), f.information("task.delete savePaths:", n);
                    for (let e = 0; e < n.length; ++e) {
                        let i = n[e];
                        (yield o.FileSystemAWNS.existsAW(i)) && (t = (yield o.FileSystemAWNS.rmdirAW(i)) && t)
                    }
                }
                return t
            })
        }

        destroy() {
            return i(this, void 0, void 0, function* () {
                let e = !0;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let n = this.subTasks[t];
                    if (n) {
                        let t = yield n.destroy();
                        e && !t && (e = !1)
                    }
                }
                return e
            })
        }

        querySubTaskInfo(e, t, n) {
            let i = !1, a = 0, o = 0, l = !1, u = [];
            for (let d = 0; d < this.subTasks.length; ++d) {
                let c = this.subTasks[d];
                if (!c) continue;
                let f = c.getTaskStatus();
                if (f === r.DownloadKernel.TaskStatus.Stopped || f === r.DownloadKernel.TaskStatus.Succeeded || f === r.DownloadKernel.TaskStatus.Seeding || f === r.DownloadKernel.TaskStatus.Failed) continue;
                let p = c.getTaskAttribute(r.DownloadKernel.TaskAttribute.VirtualId);
                p < 1 || (a++, i = s.ThunderKernel.queryTaskInfo(p, i => {
                    if (o++, null !== i) {
                        let n = c.updateTaskInfo(i, e, t);
                        1 & n && (l = !0), n > 0 && u.push(c)
                    }
                    if (a === o && (this.updateTaskDetail(), l && this.checkSubTaskStatus(), this.updateTaskStatus() && e(this.task), n(), u.length > 0)) {
                        let e = new Map;
                        e.set(this.taskId, u), h.fireTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
                    }
                }))
            }
            return 0 === a && (this.subTasks.length > 0 && e(this.subTasks[0]), this.updateTaskDetail(), this.updateTaskStatus(), n()), i
        }

        getTaskStatus() {
            let e = 0, t = 0, n = 0, i = 0, a = 0, o = 0, s = 0, l = this.task.getTaskStatus();
            if (l === r.DownloadKernel.TaskStatus.StartWaiting || l === r.DownloadKernel.TaskStatus.DestroyPending) return l;
            let u = 0;
            for (let l = 0; l < this.subTasks.length; ++l) {
                let d = this.subTasks[l], c = !1;
                if (d) {
                    if (0 === d.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                        u++;
                        continue
                    }
                    switch (d.getTaskStatus()) {
                        case r.DownloadKernel.TaskStatus.Unkown:
                            e++;
                            break;
                        case r.DownloadKernel.TaskStatus.Started:
                            n++, c = !0;
                            break;
                        case r.DownloadKernel.TaskStatus.StartPending:
                            i++;
                            break;
                        case r.DownloadKernel.TaskStatus.Stopped:
                            t++;
                            break;
                        case r.DownloadKernel.TaskStatus.StopPending:
                            a++;
                            break;
                        case r.DownloadKernel.TaskStatus.Succeeded:
                            o++;
                            break;
                        case r.DownloadKernel.TaskStatus.Failed:
                            s++;
                            break;
                        case r.DownloadKernel.TaskStatus.Seeding:
                            o++
                    }
                }
                if (c) break
            }
            let d = !1;
            l !== r.DownloadKernel.TaskStatus.StopPending && (n > 0 ? (l = r.DownloadKernel.TaskStatus.Started, d = !0) : i > 0 && (l = r.DownloadKernel.TaskStatus.StartPending, d = !0));
            let c = this.subTasks.length - u;
            return d || (a > 0 ? l = r.DownloadKernel.TaskStatus.StopPending : e === c ? l = r.DownloadKernel.TaskStatus.Unkown : o === c ? l = r.DownloadKernel.TaskStatus.Succeeded : s === c ? l = r.DownloadKernel.TaskStatus.Failed : s + o === c ? l = r.DownloadKernel.TaskStatus.Failed : t > 0 && (l = r.DownloadKernel.TaskStatus.Stopped)), l
        }

        setDownloadTask(e) {
            let t = [];
            for (let n = 0; n < this.subTasks.length; ++n) {
                let i = this.subTasks[n], a = !1, o = !1;
                for (let t = 0; t < e.length; ++t) if (n === e[t]) {
                    o = i.updateDownloadSubTask(1), a = !0;
                    break
                }
                a || (o = i.updateDownloadSubTask(0)), o && t.push(i)
            }
            if (t.length > 0) {
                let e = new Map;
                e.set(this.taskId, t), h.fireTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
            }
        }

        getTaskSizeInfo() {
            let e = {
                downloadSpeed: 0,
                vipSpeed: 0,
                fileSize: 0,
                downloadSize: 0,
                receivedSize: 0,
                usingResCount: 0,
                totalResCount: 0,
                channelInfo: {originSize: 0, p2pSize: 0, p2sSize: 0, offlineSize: 0, dcdnSize: 0}
            };
            for (let t = 0; t < this.subTasks.length; ++t) {
                let n = this.subTasks[t];
                if (n) {
                    if (0 === n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                    let t = n.getDownloadSpeed(), i = n.getVipSpeed(),
                        a = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize),
                        o = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize),
                        s = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.ReceivedSize),
                        l = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.SrcUsing),
                        u = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.SrcTotal), d = n.getTaskChannelInfo();
                    d && (e.channelInfo.p2pSize += d.p2pSize, e.channelInfo.p2sSize += d.p2sSize, e.channelInfo.offlineSize += d.offlineSize, e.channelInfo.originSize += d.originSize, e.channelInfo.dcdnSize += d.dcdnSize), t && (e.downloadSpeed += t), i && (e.vipSpeed += i), a && (e.fileSize += a), o && (e.downloadSize += o), s && (e.receivedSize += s), l && (e.usingResCount += l), u && (e.totalResCount += u)
                }
            }
            return e
        }

        updateTaskStatus() {
            let e = this.getTaskStatus();
            return this.task.updateTaskStatus(e)
        }

        checkSubTaskStatus() {
            let e = this.task.getTaskStatus();
            e !== r.DownloadKernel.TaskStatus.Stopped && e !== r.DownloadKernel.TaskStatus.StopPending && this.startWaittingTasks()
        }

        startWaittingTasks() {
            let e = 0, t = 0;
            for (let n = 0; n < this.subTasks.length; ++n) {
                let i = this.subTasks[n];
                if (!i) continue;
                if (0 === i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                let a = i.getTaskStatus();
                a !== r.DownloadKernel.TaskStatus.Started && a !== r.DownloadKernel.TaskStatus.StartPending || (e++, t = n)
            }
            if (e < this.startTaskCount && t < this.subTasks.length) for (let n = t + 1; n < this.subTasks.length; ++n) {
                let t = this.subTasks[n];
                if (!t) continue;
                if (0 === t.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                let i = t.getTaskStatus();
                if (i !== r.DownloadKernel.TaskStatus.Succeeded && i !== r.DownloadKernel.TaskStatus.Seeding && i !== r.DownloadKernel.TaskStatus.Failed && t.start() && ++e >= this.startTaskCount) break
            }
        }

        updateTaskDetail() {
            let e = r.DownloadKernel.TaskDetailChangedFlags.UnKnown, t = this.getTaskSizeInfo();
            if (t.downloadSpeed > 0) if (0 === this.startTime) this.startTime = (new Date).getTime(), this.downloadingPeriod = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadingPeriod); else {
                let t = ((new Date).getTime() - this.startTime) / 1e3, n = this.downloadingPeriod + Math.round(t);
                this.task.internalSetDownloadingPeriod(n) && (e |= r.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)
            } else this.startTime = 0;
            this.task.internalSetTaskSpeed(t.downloadSpeed, t.vipSpeed) && (e |= r.DownloadKernel.TaskDetailChangedFlags.TaskSpeed), this.task.internalSetFileSize(t.fileSize) && (e |= r.DownloadKernel.TaskDetailChangedFlags.FileSize), this.task.internalSetDownloadSize(t.downloadSize) && (e |= r.DownloadKernel.TaskDetailChangedFlags.DownloadSize), this.task.internalSetReceivedSize(t.receivedSize) && (e |= r.DownloadKernel.TaskDetailChangedFlags.ReceivedSize), this.task.internalSetSrcUsing(t.usingResCount) && (e |= r.DownloadKernel.TaskDetailChangedFlags.SrcUsing), this.task.internalSetSrcTotal(t.totalResCount) && (e |= r.DownloadKernel.TaskDetailChangedFlags.SrcTotal), this.task.internalSetTaskChannelInfo(t.channelInfo) && (e |= r.DownloadKernel.TaskDetailChangedFlags.ChannelInfo), h.fireTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, [this.task], e)
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(8), o = n(718), r = n(764), s = i.default.getLogger("DownloadKernel.PrivateCategory");

    class l extends r.Category {
        constructor(e) {
            super(e);
            let t = new o.CategoryView(e, a.DownloadKernel.CategroyViewID.Downloading),
                n = new o.CategoryView(e, a.DownloadKernel.CategroyViewID.Completed);
            this.categoryViews.push(t), this.categoryViews.push(n)
        }

        static createCategoryFromData(e) {
            let t = e.categoryId;
            if (void 0 === t || t < 0) return null;
            s.information("createCategoryFromData ", e);
            let n = new l(t);
            return n.setParentId(e.parentId), n.setNextId(e.nextId), n.setStatus(e.status), n.setDescription(e.description), n.setDefaultPath(e.defaultPath), n.setUserName(e.userName), n.setPassword(e.password, e.passwordV2), n.setAccountPassword(e.accountPassword), n
        }
    }

    t.PrivateCategory = l
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(92), a = n(26);
    t.Category = class {
        constructor(e) {
            this.categoryViews = [], this.id = e, this.parentId = -1, this.nextId = -1, this.status = 0
        }

        getCategoryViews() {
            return this.categoryViews
        }

        getCategoryViewCount() {
            return this.categoryViews.length
        }

        getCategoryViewFromId(e) {
            let t = null;
            for (let n = 0; n < this.categoryViews.length; ++n) {
                let i = this.categoryViews[n];
                if (i && e === i.getCategoryViewId()) {
                    t = i;
                    break
                }
            }
            return t
        }

        getId() {
            return this.id
        }

        setParentId(e) {
            e && (this.parentId = e)
        }

        getParentId() {
            return this.parentId
        }

        setNextId(e) {
            e && (this.nextId = e)
        }

        getNextId() {
            return this.nextId
        }

        setStatus(e) {
            e && (this.status = e)
        }

        getStatus() {
            return this.status
        }

        setName(e) {
            this.name = e
        }

        getName() {
            return this.name
        }

        setDescription(e) {
            this.description = e
        }

        getDescription() {
            return this.description
        }

        setDefaultPath(e) {
            this.defaultPath = e
        }

        getDefaultPath() {
            return this.defaultPath
        }

        setUserName(e) {
            this.userName = e
        }

        getUserName() {
            return this.userName
        }

        setPassword(e, t = "", n = !1, o = null) {
            if (this.password = e, "" !== this.password && "" === t) {
                let e = a.createHash("md5");
                e.update(this.password), t = e.digest("hex")
            }
            this.passwordV2 = t, n && i.ThunderKernel.setCategoryPassword(this.id, this.password, this.passwordV2, o)
        }

        getPassword() {
            return this.password
        }

        getPasswordV2() {
            return this.passwordV2
        }

        setAccountPassword(e) {
            this.accountPassword !== e && (this.accountPassword = e)
        }

        getAccountPassword() {
            return this.accountPassword
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = new class {
        getUserInfo(e, t) {
            let n = "string" == typeof e ? e : "", i = "function" == typeof e ? e : t;
            this.getXdasDatas("memory", "userinfo", function (e) {
                if (e) {
                    let t = "" !== n ? e[n] : e;
                    i && i(t)
                } else i && i(null)
            })
        }

        getAllUserInfo(e, t) {
            let n = "string" == typeof e ? e : "", i = "function" == typeof e ? e : t;
            this.getXdasDatas("memory", "allUserInfo", function (e) {
                if (e) {
                    let t = "" !== n ? e[n] : e;
                    i && i(t)
                } else i && i(null)
            })
        }

        logout() {
            this.saveToXdas("memory", "userinfo", JSON.stringify({userid: "", sessionid: "", loginType: "1"}))
        }

        switchAccount() {
            this.saveToXdas("memory", "userinfo", JSON.stringify({userid: "", sessionid: "", loginType: "2"}))
        }

        retryLogin() {
            this.saveToXdas("memory", "userinfo", JSON.stringify({loginType: "3"}))
        }

        saveToXdas(e, t, n) {
            global.xlNativeCallModule.nativeCall.CallNativeFunction("SaveLoginData", e, t, n, function (e, t) {
            })
        }

        isLogined(e) {
            this.getUserInfo(null, function (t) {
                t && t.userid && "" !== t.userid ? e(!0) : e(!1)
            })
        }

        isAutologin(e) {
            this.getXdasDatas("file", "users", function (t) {
                let n = t || [];
                if (0 == n.length) e(!1); else {
                    let t = n[0];
                    e(!!t.xl_autologin)
                }
            })
        }

        getXdasDatas(e, t, n) {
            global.xlNativeCallModule.nativeCall.CallNativeFunction("LoadLoginData", e, t, function (e, t) {
                let i = "" !== t ? JSON.parse(t) : null;
                n && n(i)
            })
        }

        channel(e) {
            this.saveToXdas("memory", "channel", e)
        }
    };
    t.xlQuickLogin = i
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(254), o = n(151), r = n(1).default.getLogger("Thunder.VipDownload.vip-task"),
        s = o.DkHelperNS.getHelper();
    !function (e) {
        e.createTokenBuffer = function (e, t) {
            return i(this, void 0, void 0, function* () {
                r.information("--\x3ecreateTokenBuffer");
                let n = [];
                for (let i of e.files) {
                    let a = {
                        url: i.url,
                        filename: i.fileName,
                        gcid: i.gcid,
                        cid: i.cid,
                        filesize: i.fileSize,
                        refer_url: i.refUrl,
                        cookies: "",
                        file_index: 2 === e.taskType ? i.subId : void 0
                    };
                    n.push(a), t.set(i.gcid, i.subId)
                }
                let i = {peer_id: yield s.getTpPeerId(), infohash: e.infoId, bt_title: e.btTitle, task_infos: n},
                    o = a.HttpJsonCryptoNS.getKey(e.userId, e.random), l = a.HttpJsonCryptoNS.encryptHttpBuffer(i, o);
                return r.information("<--createTokenBuffer"), l
            })
        }, e.praseTokenBuffer = function (e, t, n) {
            r.information("--\x3epraseTokenBuffer");
            let i = a.HttpJsonCryptoNS.getKey(e, t), o = a.HttpJsonCryptoNS.decryptHttpBuffer(n, i), s = null;
            return o && ((s = o).detailMessage = o.message, s.message = o.simple_msg), r.information("<--praseTokenBuffer"), s
        }, e.praseErrorCodeBuffer = function (e) {
            r.information("--\x3epraseErrorCodeBuffer");
            let t = null;
            if (e) try {
                let n = e.toString();
                r.information("jsonStr", n), n && (t = JSON.parse(n))
            } catch (e) {
            }
            return r.information("<--praseErrorCodeBuffer"), t
        }
    }(t.VipTaskHttpPackageNS || (t.VipTaskHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(104), o = n(768), r = n(1).default.getLogger("Thunder.VipDownload.user-info");
    t.UserHttpSession = class extends a.HttpSession {
        queryFlux(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    this.host = "service.cdn.vip.xunlei.com", this.retries = 2, this.timeout = 15e3, this.body = o.UserHttpPackageNS.createUserFluxBuffer(e), this.post(e => {
                        let n = null;
                        200 === e.statusCode && e.body && e.body.length > 12 && (n = o.UserHttpPackageNS.praseUserFluxBuffer(e.body)), t(n)
                    }, e => {
                        r.information("error", e), t(null)
                    })
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(206), a = n(207), o = n(62), r = n(1).default.getLogger("Thunder.VipDownload.user-info");
    !function (e) {
        e.createUserFluxBuffer = function (e) {
            r.information("--\x3ecreateUserFluxBuffer");
            let t = 0, n = Buffer.alloc(1024);
            t = n.writeUInt32LE(0, t), r.information("protocolVersion:", 0), t = n.writeUInt32LE(1, t), r.information("sequence:", 1), t = n.writeUInt32LE(0, t), r.information("commandLegth:", 0);
            let s = o.PluginHelperNS.getHelper().thunderVersionNumber;
            t = n.writeUInt32LE(s, t), r.information("thunderVersion:", s), t = n.writeUInt16LE(0, t), r.information("compressFlag:", 0), t = n.writeUInt16LE(12, t), r.information("commandType:", 12);
            let l = Number(e.userId).valueOf();
            t = a.BufferUtilitiesNS.writeUInt64LE(n, l, t), r.information("userId:", l);
            let u = e.jumpKey;
            t = a.BufferUtilitiesNS.writeString(n, u, t, "gbk"), r.information("jumpKey:", u);
            let d = e.peerId;
            return t = a.BufferUtilitiesNS.writeString(n, d, t, "gbk"), r.information("peerId:", d), t = n.writeUInt32LE(0, t), r.information("taskCount:", 0), t = n.writeUInt32LE(0, t), r.information("businessFlag:", 0), n = n.slice(0, t), n = i.ShubCryptoNS.encryptHttpBuffer(n), r.information("<--createUserFluxBuffer"), n
        }, e.praseUserFluxBuffer = function (e) {
            r.information("--\x3epraseUserFluxBuffer");
            let t = null;
            try {
                e = i.ShubCryptoNS.decryptHttpBuffer(e);
                let n = 0, o = e.readUInt32LE(n);
                r.information("protocolVersion:", o), n += 4;
                let s = e.readUInt32LE(n);
                r.information("sequence:", s), n += 4;
                let l = e.readUInt32LE(n);
                r.information("commandLegth:", l), n += 4;
                let u = e.readUInt32LE(n);
                r.information("thunderVersion:", u), n += 4;
                let d = e.readUInt16LE(n);
                r.information("compressFlag:", d), n += 2;
                let c = e.readUInt16LE(n);
                r.information("commandType:", c), n += 2;
                let h = e.readUInt32LE(n);
                r.information("result:", h), n += 4;
                let f = a.BufferUtilitiesNS.readString(e, n, "gbk"), p = f[1];
                r.information("message:", p), n = f[0];
                let g = a.BufferUtilitiesNS.readUInt64LE(e, n), k = g[1];
                r.information("capacity:", k), n = g[0];
                let m = (g = a.BufferUtilitiesNS.readUInt64LE(e, n))[1];
                r.information("remain:", m), n = g[0];
                let T = (g = a.BufferUtilitiesNS.readUInt64LE(e, n))[1];
                r.information("need:", T), n = g[0], t = {result: h, capacity: k}
            } catch (e) {
                r.warning("praseUserFluxBuffer", e)
            }
            return r.information("<--praseUserFluxBuffer"), t
        }
    }(t.UserHttpPackageNS || (t.UserHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(8), r = n(31), s = n(37), l = a.default.getLogger("magnet-listener"),
        u = r.DownloadKernelTaskManager.getTaskManager(), d = s.DownloadKernelEventManager.getEventManager();
    const c = new class {
        constructor() {
            this.listenerMap = {}
        }

        addRef(e, t) {
            this.listenerMap.hasOwnProperty(e) ? l.information("listener addRef") : (l.information("listener addRef not in map to attachTaskStatus"), this.attachTaskStatus(e));
            let n = this.listenerMap[e];
            n.callbacks.push(t), n.counter++
        }

        release(e) {
            do {
                if (!this.listenerMap.hasOwnProperty(e)) break;
                let t = this.listenerMap[e];
                t.counter--, 0 === t.counter ? (l.information("release listener to remove"), this.detachTaskStatus(t.cookie), t.cookie = -1, u.stopTask(e), u.deleteTask(e, !1).catch(), delete this.listenerMap[e]) : l.information("release listener remain", t.counter)
            } while (0)
        }

        fireAll(e, t) {
            do {
                if (!this.listenerMap.hasOwnProperty(e)) {
                    l.information("fire callback but maybe already release");
                    break
                }
                let n = this.listenerMap[e];
                if (0 === n.counter) break;
                for (let i of n.callbacks) i(e, t).catch(), this.release(e)
            } while (0)
        }

        attachTaskStatus(e) {
            let t = d.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...t) => i(this, void 0, void 0, function* () {
                do {
                    if (!t) break;
                    if (t[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!t[1]) break;
                    let n = t[1];
                    for (let t = 0; t < n.length; ++t) {
                        let i = n[t];
                        if (!i) continue;
                        let a = i.getTaskStatus(), r = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskType),
                            s = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        l.information("magnet channelRMNewTaskDownloadTorrent taskStatus", a, s, e), r === o.DownloadKernel.TaskType.Magnet && s === e && (a === o.DownloadKernel.TaskStatus.Succeeded || a === o.DownloadKernel.TaskStatus.Seeding ? this.fireAll(s, !0) : a === o.DownloadKernel.TaskStatus.Failed && this.fireAll(s, !1))
                    }
                } while (0)
            }));
            l.information("attachTaskEvent StatusChanged", t);
            let n = {cookie: t, counter: 0, callbacks: []};
            this.listenerMap[e] = n
        }

        detachTaskStatus(e) {
            l.information("detachTaskEvent StatusChanged", e), d.detachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, e)
        }
    };
    !function (e) {
        e.addRef = function (e, t) {
            return c.addRef(e, t)
        }, e.release = function (e) {
            return c.release(e)
        }
    }(t.MagnetListenerNS || (t.MagnetListenerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(27), o = n(9), r = n(45), s = n(23), l = n(1).default.getLogger("Thunder.plugin-loader");
    !function (e) {
        e.pluginLoader = new class {
            constructor() {
                this.plugins = null, this.map = null, this.currentDir = `${__rootDir}/plugins/`, this.configName = `${this.currentDir}plugin-loader-config.json`, this.unzipConfig = `${this.currentDir}plugin-unzip-config.json`, this.isUnzipConfigLoad = !1, this.unzipPlugins = {}, this.downloadTryTimes = 3, this.emitter = null, this.map = new Map
            }

            loadUnzipConfig() {
                return i(this, void 0, void 0, function* () {
                    l.information("loadUnzipConfig enter");
                    do {
                        if (this.isUnzipConfigLoad) break;
                        let e = yield o.FileSystemAWNS.readFileAW(`${this.unzipConfig}`);
                        if (null !== e) try {
                            this.unzipPlugins = JSON.parse(e.toString()), this.isUnzipConfigLoad = !0
                        } catch (e) {
                            l.warning(e)
                        }
                    } while (0);
                    return this.isUnzipConfigLoad
                })
            }

            saveUnzipConfig() {
                return i(this, void 0, void 0, function* () {
                    let e = void 0;
                    try {
                        e = JSON.stringify(this.unzipPlugins)
                    } catch (e) {
                        l.warning(e)
                    }
                    void 0 !== e && (l.information(e), yield o.FileSystemAWNS.writeFileAW(`${this.unzipConfig}`, e))
                })
            }

            isPluginUnzip(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1;
                    yield this.loadUnzipConfig();
                    let n = e.name;
                    return null !== this.unzipPlugins && null !== this.unzipPlugins[`${n}`] && void 0 !== this.unzipPlugins[`${n}`] && this.unzipPlugins[`${n}`].md5 === e.md5 && (t = this.unzipPlugins[`${n}`].unzipstate), t
                })
            }

            updatePluginUnzip(e, t) {
                return i(this, void 0, void 0, function* () {
                    let n = e.name;
                    null !== this.unzipPlugins && (this.unzipPlugins[`${n}`] = t), yield this.saveUnzipConfig()
                })
            }

            startDownloadPlugins(e, t, r, s, u, d) {
                return i(this, void 0, void 0, function* () {
                })
            }

            loadPlugin(e) {
                return i(this, void 0, void 0, function* () {
                    l.information("loadPlugin enter");
                    let t = null;
                    const n = `${this.currentDir}${e}/index`;
                    return (yield o.FileSystemAWNS.existsAW(`${n}.js`)) && (t = require(n)), t
                })
            }

            loadConfig(e, t) {
                return i(this, void 0, void 0, function* () {
                    if (l.information("loadConfig enter"), this.plugins = e, t) {
                        let t = void 0;
                        try {
                            t = JSON.stringify(e)
                        } catch (e) {
                            l.warning(e)
                        }
                        void 0 !== t && (l.information(t), yield o.FileSystemAWNS.writeFileAW(`${this.configName}`, t))
                    }
                    yield this.downloadPlugins()
                })
            }

            checkFile(e) {
                return i(this, void 0, void 0, function* () {
                    l.information("checkFile enter");
                    const t = `${this.currentDir}${e.name}.zip`;
                    let n = yield o.FileSystemAWNS.existsAW(t);
                    return n && (n = yield r.ToolsUtilitiesAWNS.matchFileMd5(t, e.md5)), n
                })
            }

            checkLoadPlugin(e) {
                return i(this, void 0, void 0, function* () {
                    l.information("checkLoadPlugin enter"), void 0 !== e.loadtype && (1 === e.loadtype && void 0 !== e.time && e.time >= 0 ? setTimeout(() => {
                        this.loadPlugin(e.name)
                    }, 1e3 * e.time) : 2 === e.loadtype && null !== this.emitter && this.emitter.emit(s.NodeEventMesssageNS.eventPluginLoderPluginReady, e.name))
                })
            }

            checkDownloadPlugin(e) {
                return i(this, void 0, void 0, function* () {
                    const {UnzipUtilitiesAWNS: t} = yield Promise.resolve().then(() => n(208));
                    l.information("checkDownloadPlugin enter");
                    const i = `${this.currentDir}${e.name}.zip`, a = `${this.currentDir}${e.name}/`;
                    let r = !1, s = !1, u = !1;
                    if (yield this.checkFile(e)) {
                        let t = yield o.FileSystemAWNS.existsAW(a);
                        t && (u = yield this.isPluginUnzip(e)), r = !u, s = t
                    } else r = yield this.downloadPlugin(e);
                    if (r && (s = yield t.uncompressZipFile(a, i)), s) {
                        let t = {version: e.version, md5: e.md5, unzipstate: !0};
                        yield this.updatePluginUnzip(e, t), yield this.checkLoadPlugin(e)
                    }
                })
            }

            downloadPlugin(e) {
                return i(this, void 0, void 0, function* () {
                    l.information("downloadPlugin enter");
                    let t = !1;
                    const i = `${this.currentDir}${e.name}.zip`;
                    for (; !t && void 0 !== e.url;) {
                        let r = null;
                        try {
                            a.default.defaults.adapter = n(28), r = yield a.default.get(e.url, {responseType: "arraybuffer"})
                        } catch (e) {
                            break
                        }
                        if (null === r || void 0 === r.status || 200 !== r.status || null === r.data) break;
                        if (!(yield o.FileSystemAWNS.writeFileAW(i, r.data))) break;
                        {
                            t = yield this.checkFile(e);
                            let n = this.map.get(e.name);
                            if (l.information(n), n < 1) break;
                            let i = n - 1;
                            this.map.set(e.name, i)
                        }
                    }
                    return t
                })
            }

            downloadPlugins() {
                return i(this, void 0, void 0, function* () {
                    if (l.information("downloadPlugins enter"), null !== this.plugins && null !== this.plugins.data && void 0 !== this.plugins.data) for (let e = 0; e < this.plugins.data.length; ++e) {
                        let t = this.plugins.data[e];
                        null !== t && void 0 !== t.name && void 0 !== t.status && t.status && (this.map.set(t.name, this.downloadTryTimes), yield this.checkDownloadPlugin(t))
                    }
                })
            }
        }
    }(t.PluginLoaderNS || (t.PluginLoaderNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(3), r = n(2), s = n(45), l = n(83), u = n(21), d = n(279), c = n(722), h = n(773), f = n(13),
        p = n(8), g = n(61), k = n(23), m = n(7), T = n(564), v = n(103), y = n(248), S = n(17), w = n(66), b = n(294),
        C = n(154), N = n(5), D = n(566), I = n(22), _ = n(9), x = n(10), A = n(553), E = n(280), M = n(818),
        P = N.default(r.join(__rootDir, "../bin/ThunderHelper.node")),
        F = y.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(),
        O = a.default.getLogger("NativeFunction.NativeFunction"), U = c.TaskInfoManagerNS.getTaskInfoManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, this.isPersonalPageTrackEvent = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "PageReady", nativeFunc: this.pageReady}, {
                        functionName: "GetTaskInfo",
                        nativeFunc: this.getTaskInfo
                    }, {functionName: "OperateTask", nativeFunc: this.operateTask}, {
                        functionName: "ShellOpen",
                        nativeFunc: this.shellOpen
                    }, {
                        functionName: "OpenFolderWithSelectFile",
                        nativeFunc: this.openFolderWithSelectFile
                    }, {functionName: "GetFileMd5", nativeFunc: this.getFileMd5}, {
                        functionName: "GetPeerID",
                        nativeFunc: this.getPeerID
                    }, {functionName: "GetDeviceID", nativeFunc: this.getDeviceID}, {
                        functionName: "GetThunderVersion",
                        nativeFunc: this.getThunderVersion
                    }, {functionName: "TrackEvent", nativeFunc: this.trackEvent}, {
                        functionName: "GetCurrentCategoryId",
                        nativeFunc: this.getCurrentCategoryId
                    }, {
                        functionName: "SelectCategoryView",
                        nativeFunc: this.switchCategoryView
                    }, {
                        functionName: "GetCurInternetState",
                        nativeFunc: this.getCurInternetState
                    }, {functionName: "DropOpenFile", nativeFunc: this.dragOpenFile}, {
                        functionName: "DropOpenUrl",
                        nativeFunc: this.dragOpenUrl
                    }, {
                        functionName: "GetCurPlatform",
                        nativeFunc: this.getCurPlatform
                    }, {
                        functionName: "CreateNewTask",
                        nativeFunc: this.createNewTask
                    }, {
                        functionName: "CreateNewTaskEx",
                        nativeFunc: this.createNewTaskEx
                    }, {
                        functionName: "FireEventFunction",
                        nativeFunc: this.fireEventFunction
                    }, {
                        functionName: "ShowCustomDownloadModeDlg",
                        nativeFunc: this.showCustomDownloadModeDlg
                    }, {
                        functionName: "GetTaskStartStatusPrompt",
                        nativeFunc: this.getTaskStartStatusPrompt
                    }, {
                        functionName: "ShowBrowserGuideDlg",
                        nativeFunc: this.showBrowserGuideDlg
                    }, {
                        functionName: "OpenURLByIEorDefault",
                        nativeFunc: this.openURLByIEorDefault
                    }, {
                        functionName: "GetDownloadDir",
                        nativeFunc: this.getDownloadDir
                    }, {
                        functionName: "ShowPersonalPage",
                        nativeFunc: this.showPersonalPage
                    }, {functionName: "ShowWebWnd", nativeFunc: this.showWebWnd}, {
                        functionName: "IsPhoneAuth",
                        nativeFunc: this.isPhoneAuth
                    }, {
                        functionName: "GetSearchRecommends",
                        nativeFunc: this.getSearchRecommends
                    }, {functionName: "SetSearchRecommends", nativeFunc: this.setSearchRecommends}];
                    l.setDefaultNativeFunctionMap(e)
                }
            }

            pageReady(e, t, n, i) {
                do {
                    if (!e || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    "taskDetail" === a ? (d.TaskDetailNS.pageReady(), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)) : "community" === a ? (F.emit("community.pageReady"), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskInfo(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[2]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    "taskDetail" === i[2] ? U.getHistoryTaskInfoString(a).then(i => {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                    }).catch() : e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            operateTask(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (!e || !t || !n) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let i = a[0], o = a[1], r = a[2];
                        yield h.TaskOperate.operateTaskActions(i, o, r), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            shellOpen(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    o.remote.shell.openItem(a), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            openFolderWithSelectFile(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    o.remote.shell.showItemInFolder(a), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            getFileMd5(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    s.ToolsUtilitiesAWNS.calculateFileMd5(a).then(i => {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                    }).catch()
                } while (0)
            }

            getPeerID(e, t, n, i) {
                O.information(i);
                let a = P.getPeerID();
                e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
            }

            getDeviceID(e, t, n, i) {
                O.information(i);
                let a = P.getPeerID();
                e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
            }

            getThunderVersion(e, t, n, i) {
                O.information(i);
                let a = r.join(__rootDir, "../../Thunder.exe"), o = P.getFileVersion(a);
                e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, o)
            }

            trackEvent(e, t, n, i) {
                O.information(i);
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = void 0 === i[1] ? "" : i[1], r = void 0 === i[2] ? "" : i[2],
                        s = void 0 === i[3] ? 0 : i[3], l = void 0 === i[4] ? 0 : i[4], d = void 0 === i[5] ? 0 : i[5],
                        c = void 0 === i[6] ? 0 : i[6], h = void 0 === i[7] ? "" : i[7], p = void 0 === i[8] ? 0 : i[8],
                        g = f.XLStatNS.trackEvent(a, o, r, s, l, d, c, h, p);
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, g)
                } while (0)
            }

            getCurrentCategoryId(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let i = g.default.getCurrentCategoryId();
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                } while (0)
            }

            switchCategoryView(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0]) || m.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], r = void 0;
                    void 0 !== i[2] && (r = i[2]);
                    let s = i[3];
                    O.information(a, o, r), g.default.fireEvent(k.NodeEventMesssageNS.eventDownloadSwitchCategory, a, o, r, s)
                } while (0)
            }

            dragOpenFile(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    if (void 0 === a || null === a || "" === a) break;
                    T.default.onCommand("path", a, "file_drag").catch()
                } while (0)
            }

            dragOpenUrl(e, t, n, i) {
                do {
                    if (void 0 === e || null === e) break;
                    if (void 0 === t || null === t) break;
                    if (void 0 === n || null === n) break;
                    let a = i[0];
                    if (void 0 === a || null === a || "" === a) break;
                    let o = S.ThunderHelper.getTaskTypeFromUrl(a);
                    o === p.DownloadKernel.TaskType.P2sp || o === p.DownloadKernel.TaskType.Emule ? v.ThunderNewTask.createPreNewTaskWindow([a], "url_drag") : o !== p.DownloadKernel.TaskType.Bt && o !== p.DownloadKernel.TaskType.Magnet || v.ThunderNewTask.createBtTaskWindow({
                        url: a,
                        type: "url"
                    }, {source: "url_drag"})
                } while (0)
            }

            getCurInternetState(e, t, n, i) {
                do {
                    if (O.information(i), m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let a = P.getCurInternetState();
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            getCurPlatform(e, t, n, i) {
                do {
                    if (O.information(i), m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let a = "pc-xdas";
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            createNewTask(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let a = i[0], o = null;
                    try {
                        o = JSON.parse(a)
                    } catch (e) {
                        O.warning(e)
                    }
                    if (O.information("createNewTask", o), m.isNullOrUndefined(o)) break;
                    for (let e in o) {
                        let t = o[e];
                        if ("com" === t.type) {
                            let e = void 0;
                            for (let t in o) {
                                void 0 === e && (e = []), O.information("createNewTask url", o[t].url);
                                let n = o[t].url.split("%0A");
                                if (1 === n.length && (n = o[t].url.split(/[\n\r\n]/)), O.information("createNewTask urls", n), 1 === n.length) e.push({
                                    url: o[t].url,
                                    referer: o[t].refer,
                                    fileName: o[t].name,
                                    statClick: "outline",
                                    browser: "xlbrowser.exe"
                                }); else for (let i of n) e.push({
                                    url: i,
                                    referer: o[t].refer,
                                    statClick: "outline",
                                    browser: "xlbrowser.exe"
                                })
                            }
                            v.ThunderNewTask.createPreNewTaskWindow(e);
                            break
                        }
                        if ("bt" === t.type) {
                            let e = t.url;
                            v.ThunderNewTask.createBtTaskWindow({url: e, type: "url"}, {
                                source: "outline",
                                browser: "xlbrowser.exe"
                            });
                            break
                        }
                    }
                } while (0)
            }

            createNewTaskEx(e, t, n, i) {
                do {
                    if (O.information("createNewTaskEx 接口 enter 第一个参数:", i[0]), m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let a = i[0];
                    if (m.isNullOrUndefined(a)) break;
                    let o = [];
                    for (let e in a) {
                        let t = a[e], n = S.ThunderHelper.getTaskTypeFromUrl(t.url);
                        if (O.information(" createNewTaskEx", t.url, " type:", n), n === p.DownloadKernel.TaskType.P2sp || n === p.DownloadKernel.TaskType.Emule) o.push({
                            url: a[e].url,
                            referer: a[e].refer,
                            fileName: a[e].name,
                            statClick: a[e].stat
                        }); else if (n === p.DownloadKernel.TaskType.Bt || n === p.DownloadKernel.TaskType.Magnet) {
                            let e = t.url;
                            v.ThunderNewTask.createBtTaskWindow({url: e, type: "url"}, {source: t.stat})
                        }
                    }
                    o.length > 0 && v.ThunderNewTask.createPreNewTaskWindow(o)
                } while (0)
            }

            fireEventFunction(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    w.NativeCallHostModule.nativeCallHost.fireNativeEvent("onWebEvent", ...i), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showCustomDownloadModeDlg(e, t, n) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    b.DownloadModeNS.showCustomDownloadModeDlg().catch(), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showBrowserGuideDlg(e, t, n) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    D.default().popUpBrowserGuide()
                } while (0)
            }

            getTaskStartStatusPrompt(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    try {
                        let a = JSON.parse(i[0]), o = C.TaskStatusHelper.getTaskStartStatusPrompt(a);
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, o)
                    } catch (i) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError)
                    }
                } while (0)
            }

            openURLByIEorDefault(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = P.openURLByIEorDefault(i[0]);
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            getDownloadDir(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                        let i = "";
                        do {
                            if (void 0 !== (i = I.ConfigNS.getValue("TaskDefaultSettings", "UseLastCatalog", !0) ? I.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "") : I.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")) && null !== i && "" !== i && (yield _.FileSystemAWNS.mkdirsAW(i))) break;
                            i = x.ThunderUtil.getDefaultDownloadDir()
                        } while (0);
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                    } while (0)
                })
            }

            showPersonalPage(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = 0, o = i[0];
                    if (!this.isPersonalPageTrackEvent) {
                        this.isPersonalPageTrackEvent = !0;
                        let e = I.ConfigNS.getValue("Install", "PersonalUid", "");
                        void 0 !== e && null !== e || (e = "");
                        let t = "uid=" + e + ",start_page=" + (o ? "Individualization_home_page" : "official_home_page");
                        a = f.XLStatNS.trackEvent("core_event", "startup_page", "", 0, 0, 0, 0, t)
                    }
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            showWebWnd(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (m.isNullOrUndefined(i) || m.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    i.splice(0, 1), A.EmbeddedBrowserManagerNs.showWebWnd(a, ...i), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isPhoneAuth(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    E.phoneAuthObject.isPhoneAuthAw().then(i => {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                    }).catch()
                } while (0)
            }

            getSearchRecommends(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    let i = M.SearchConfigNS.getRecommends();
                    e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success, i)
                } while (0)
            }

            setSearchRecommends(e, t, n, i) {
                do {
                    if (m.isNullOrUndefined(e) || m.isNullOrUndefined(t) || m.isNullOrUndefined(n)) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    M.SearchConfigNS.setRecommends(a), e.callNativeFunctionCallback(t, n, u.NativeFunctionErrorCode.Success)
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.NaviteFunctionNS || (t.NaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(1), r = n(9), s = n(8), l = n(37), u = n(31), d = n(7),
        c = o.default.getLogger("NativeFunction.TaskInfoHistory"), h = l.DownloadKernelEventManager.getEventManager(),
        f = u.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isInit = !1
            }

            init() {
                return i(this, void 0, void 0, function* () {
                    this.isInit || (this.isInit = !0, this.taskSpeedMap = new Map, this.dataPath = a.join(__profilesDir, "TaskSpeedInfo"), (yield r.FileSystemAWNS.existsAW(this.dataPath)) || (yield r.FileSystemAWNS.mkdirsAW(this.dataPath)), h.attachTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                        this.onTaskDetailChanged(...e)
                    }), h.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                        this.onTaskStatusChanged(...e)
                    }))
                })
            }

            getTaskSpeedInfo(e) {
                return i(this, void 0, void 0, function* () {
                    let t = this.taskSpeedMap.get(e);
                    return t || (yield this.loadTaskSpeedInfo(e), t = this.taskSpeedMap.get(e)), t && this.checkTaskSpeedInfo(e, t), t
                })
            }

            onTaskDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== s.DownloadKernel.TaskEventType.DetailChanged) break;
                    let t = e[1], n = e[2];
                    if (!t || !n) break;
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let i = 0, a = 0, o = n.getDownloadSpeed(), r = n.getVipSpeed(),
                            l = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                            u = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                            d = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                        d < 1 && (d = 1), i = Math.round(u / d);
                        let h = n.getTaskStatus();
                        if (h === s.DownloadKernel.TaskStatus.Succeeded || h === s.DownloadKernel.TaskStatus.Seeding) a = 100; else {
                            let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize);
                            0 !== e && (a = u / e * 100, (a = parseInt(a.toString(), 10)) > 100 ? a = 100 : a < 0 && (a = 0))
                        }
                        this.updateProgress(l, i, a, o, r).catch(e => {
                            c.warning(e)
                        })
                    }
                } while (0)
            }

            onTaskStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let i = n.getTaskStatus(), o = n.getTaskPreStatus();
                        if (i !== s.DownloadKernel.TaskStatus.StartWaiting && i !== s.DownloadKernel.TaskStatus.StartPending || o !== s.DownloadKernel.TaskStatus.StandBy) {
                            if (i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding) {
                                let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                    t = this.taskSpeedMap.get(e);
                                if (t) {
                                    let i = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                                        a = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                                    a < 1 && (a = 1), t.aveSpeed = Math.round(i / a), this.checkTaskSpeedInfo(e, t)
                                }
                            } else if (i === s.DownloadKernel.TaskStatus.DestroyPending) {
                                let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                    t = a.join(this.dataPath, "TaskInfoEx_" + e + ".txt");
                                c.information("destroy task taskId:", e, ", taskinfo file:", t), r.FileSystemAWNS.unlinkAW(t).catch(), this.taskSpeedMap.delete(e)
                            }
                        } else {
                            let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                t = this.taskSpeedMap.get(e);
                            t && (t.speedInfoMap = {}, this.taskSpeedMap.set(e, t), this.saveTaskSpeedInfo(e).catch(e => {
                                c.warning(e)
                            }))
                        }
                    }
                } while (0)
            }

            updateProgress(e, t, n, a, o) {
                return i(this, void 0, void 0, function* () {
                    let i = this.taskSpeedMap.get(e);
                    i || (i = this.newTaskSpeedInfo(e)), i.aveSpeed = t, a > i.maxSpeed && (i.maxSpeed = a), i.progress = n;
                    let r = {progress: n, downloadSpeed: a, addSpeed: o}, s = Math.floor(n);
                    100 === s && i.speedInfoMap[s] || (i.speedInfoMap[s] = r, this.taskSpeedMap.set(e, i), yield this.saveTaskSpeedInfo(e))
                })
            }

            newTaskSpeedInfo(e) {
                let t = {};
                return t.taskId = e, t.aveSpeed = 0, t.maxSpeed = 0, t.progress = 0, t.speedInfoMap = {}, t
            }

            loadTaskSpeedInfo(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1, n = "TaskInfoEx_" + e.toString() + ".txt", i = a.join(this.dataPath, n);
                    if (yield r.FileSystemAWNS.existsAW(i)) {
                        let n = yield r.FileSystemAWNS.readFileAW(i);
                        if (n) {
                            let i = null;
                            try {
                                i = JSON.parse(n.toString())
                            } catch (e) {
                                c.warning(e)
                            }
                            null !== i && (this.taskSpeedMap.set(e, i), t = !0)
                        }
                    }
                    return t
                })
            }

            checkTaskSpeedInfo(e, t) {
                let n = f.getTaskFromTaskId(e);
                if (!n) return;
                let i = n.getTaskStatus(), a = !1;
                if (d.isNumber(t.aveSpeed) || (c.warning("checkTaskSpeedInfo bad aveSpeed", ", taskId: ", e), t.aveSpeed = 0, a = !0), d.isNumber(t.maxSpeed) || (c.warning("checkTaskSpeedInfo bad maxSpeed", ", taskId: ", e), t.maxSpeed = 0, a = !0), t.aveSpeed > t.maxSpeed && (c.warning("checkTaskSpeedInfo aveSpeed > maxSpeed", ", taskId: ", e), t.aveSpeed = t.maxSpeed, a = !0), i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding) {
                    c.information("checkTaskSpeedInfo check complete data");
                    let i = t.speedInfoMap[100], o = t.speedInfoMap[0];
                    if (!(d.isObject(i) && d.isObject(o) || 0 !== t.aveSpeed)) {
                        let i = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                            o = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                        o < 1 && (o = 1), t.aveSpeed = Math.round(i / o), c.information("checkTaskSpeedInfo recalc aveSpeed:", t.aveSpeed, ", taskId: ", e), a = !0
                    }
                }
                a && this.saveTaskSpeedInfo(e).catch()
            }

            saveTaskSpeedInfo(e) {
                return i(this, void 0, void 0, function* () {
                    let t = !1, n = this.taskSpeedMap.get(e);
                    if (n) {
                        let i = JSON.stringify(n), o = "TaskInfoEx_" + e.toString() + ".txt",
                            s = a.join(this.dataPath, o);
                        t = yield r.FileSystemAWNS.writeFileAW(s, i)
                    }
                    return t
                })
            }
        };
        e.init = function () {
            return i(this, void 0, void 0, function* () {
                yield t.init()
            })
        }, e.getTaskSpeedInfo = function (e) {
            return i(this, void 0, void 0, function* () {
                return yield t.getTaskSpeedInfo(e)
            })
        }
    }(t.HistoryTaskSpeedInfoNS || (t.HistoryTaskSpeedInfoNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(23), r = n(8), s = n(31), l = n(85), u = n(36), d = n(61), c = n(139), h = n(563), f = n(22),
        p = n(30), g = s.DownloadKernelTaskManager.getTaskManager(), k = h.SubtitleManagerNS.getSubtitleManger();
    t.TaskOperate = class {
        static operateTaskActions(e, t, n) {
            return i(this, void 0, void 0, function* () {
                switch (t) {
                    case"play":
                        this.playTask(e, n);
                        break;
                    case"downAndPlay":
                        this.downloadAndPlayTask(e, n);
                        break;
                    case"openFolder":
                        this.openFolder(e);
                        break;
                    case"open":
                        this.open(e, n);
                        break;
                    case"continue":
                        this.startTask(e);
                        break;
                    case"pause":
                        this.stopTask(e);
                        break;
                    case"restore":
                        this.restoreTask(e);
                        break;
                    case"delete":
                        this.deleteTask(e);
                        break;
                    case"note":
                        this.noteTask(e, n);
                        break;
                    case"downloadSelectFiles":
                        yield this.downloadSelectFiles(e, n);
                        break;
                    case"showHomePage":
                        this.showHomePage(e);
                        break;
                    case"install":
                        this.installFile(e, n);
                        break;
                    case"subtitleDownload":
                        this.openSubtitleDlg(e);
                        break;
                    case"repost":
                        this.createBirdKey(e)
                }
            })
        }

        static playTask(e, t) {
            let n = g.getTaskFromTaskId(e);
            n && (null !== t && void 0 !== t && "object" == typeof t ? l.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, t.panel, t.categoryId).catch() : l.TaskOperatorNs.downloadAndPlay(e).catch(), n.setUserRead(1))
        }

        static downloadAndPlayTask(e, t) {
            g.getTaskFromTaskId(e) && (null !== t && void 0 !== t && "object" == typeof t ? l.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, t.panel, t.categoryId).catch() : l.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, "downloading").catch())
        }

        static openFolder(e) {
            let t = g.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskBaseInfo();
                l.TaskOperatorNs.markReadStatus([e], 1), l.TaskOperatorNs.openTaskFolder(e, !0).catch()
            }
        }

        static open(e, t) {
            let n = g.getTaskFromTaskId(e);
            if (n) {
                let e = n.getTaskBaseInfo(), i = -1;
                i = null === t || void 0 === t || "" === t ? -1 : Number(t), l.TaskOperatorNs.openTaskItem(e, i).catch(), n.setUserRead(1)
            }
        }

        static startTask(e) {
            c.DownloadDispatchNS.startTask(e)
        }

        static stopTask(e) {
            g.stopTask(e, r.DownloadKernel.TaskStopReason.TaskDetail)
        }

        static restoreTask(e) {
            g.recoverFromRecycle(e)
        }

        static deleteTask(e) {
            let t = g.getTaskFromTaskId(e);
            if (t) if (t.getTaskAttribute(r.DownloadKernel.TaskAttribute.RecycleTime) > 0) {
                let t = f.ConfigNS.getValue("ConfigMsg", "ConfigMsg_DeleteFile", !0);
                u.MessageBox.confirm({
                    title: "您确定要删除此任务吗？",
                    type: u.MessageBox.ConfirmType.Warning,
                    checkboxEnabled: !0,
                    checkboxChecked: t,
                    checkboxLabel: "同时删除文件"
                }).then(t => {
                    t.action === p.MessageBoxNS.Action.OK && (f.ConfigNS.setValue("ConfigMsg", "ConfigMsg_DeleteFile", t.checkboxChecked), g.deleteTask(e, t.checkboxChecked).catch())
                }).catch()
            } else g.deleteTask(e, !1).catch()
        }

        static noteTask(e, t) {
            if (t) {
                let n = g.getTaskFromTaskId(e);
                n && n.setDescription(t)
            }
        }

        static downloadSelectFiles(e, t) {
            return i(this, void 0, void 0, function* () {
                (yield g.downloadTaskSelectFiles(e, t)) && c.DownloadDispatchNS.startTask(e)
            })
        }

        static showHomePage(e) {
            d.default.fireEvent(o.NodeEventMesssageNS.eventShowHomePage, e)
        }

        static installFile(e, t) {
            if (null !== t && void 0 !== t && "" !== t) try {
                let n = JSON.parse(t), i = n.path, a = "";
                null !== n.runParams && void 0 !== n.runParams && "" !== n.runParams && (a = n.runParams);
                let o = g.getTaskFromTaskId(e);
                l.TaskOperatorNs.executeInstallFile(o, i, a).catch()
            } catch (e) {
            }
        }

        static openSubtitleDlg(e) {
            let t = g.getTaskFromTaskId(e);
            if (t) {
                let n = t.getTaskName(), i = t.getType(), o = "";
                t && (o = t.getSavePath()), i === r.DownloadKernel.TaskType.Bt && t.getExtraObject().getDownloadFile().length > 1 && (o = a.join(o, n));
                let s = t.getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryViewId), l = k.getDisaplayName(e),
                    d = 0;
                (d = l.length) > 1 ? u.MessageBox.custom("SubtitleTaskFilelist", {
                    size: "large",
                    taskId: e,
                    taskName: n,
                    taskType: i,
                    fileList: l,
                    saveDir: o,
                    categoryViewId: s
                }, {
                    center: !0,
                    width: 460,
                    height: 358
                }).catch() : u.MessageBox.custom("SubtitleSearch", {
                    size: "large",
                    taskId: e,
                    taskName: n,
                    cid: l[0].cid,
                    saveDir: o,
                    from: "taskList",
                    categoryViewId: s
                }, {center: !0, width: 460, height: 358}).catch()
            }
        }

        static createBirdKey(e) {
            l.TaskOperatorNs.createBirdKey(e)
        }
    }
}, function (e, t) {
    e.exports = require("child_process")
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(776), a = n(8), o = n(37), r = n(31), s = n(65), l = n(150), u = n(22), d = n(7), c = n(1), h = n(6),
        f = n(280), p = n(553), g = n(3), k = n(5), m = n(2),
        T = k.default(m.join(__rootDir, "../bin/ThunderHelper.node")), v = i.XLIPCManagerNS.getManager(),
        y = o.DownloadKernelEventManager.getEventManager(), S = r.DownloadKernelTaskManager.getTaskManager(),
        w = c.default.getLogger("Thunder.DownloadAndPlayIPC");
    !function (e) {
        let t = null, n = null, o = void 0, r = void 0, c = void 0, k = void 0;

        function m() {
            let e = l.default.getConfigInfo("downloadAndPlay", "enableIPC");
            return w.information("configModules.getConfigInfo ipcEnable:", e), d.isBoolean(e) ? u.ConfigNS.setValue("DownloadAndPlay", "EnableIPC", e) : (e = u.ConfigNS.getValue("DownloadAndPlay", "EnableIPC", !0), w.information("ConfigNS.getValue ipcEnable:", e)), e
        }

        function b() {
            w.information("internalInit");
            do {
                let e = v.getFactory();
                if (!e) break;
                if (!(t = e.createIPCServer(i.XLIPCManagerNS.xlipcDownloadAndPlayId))) {
                    w.error("createIPCServer failed!");
                    break
                }
                if (0 !== t.start()) {
                    w.error("server start failed!");
                    break
                }
                t.onAccept(C), t.onDisconnect(N)
            } while (0)
        }

        function C(e) {
            w.information("onAccept");
            let t = [{name: "SetOrderDownload", func: D}, {name: "SetDisorderDownload", func: I}, {
                name: "OnStopPlay",
                func: _
            }, {name: "IsLogin", func: x}, {name: "IsVip", func: A}, {
                name: "GetUserID",
                func: F
            }, {name: "GetSessionID", func: O}, {name: "OpenUserCenterTab", func: U}];
            (n = e).registerInterfaces(t), o = y.attachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    e[1].forEach(e => {
                        let t = e.getTaskStatus();
                        t === a.DownloadKernel.TaskStatus.StopPending ? n.call("OnTaskStopPending", e.getId()) : t === a.DownloadKernel.TaskStatus.Stopped ? n.call("OnTaskStopped", e.getId()) : t === a.DownloadKernel.TaskStatus.Started ? n.call("OnTaskStarted", e.getId()) : t === a.DownloadKernel.TaskStatus.Succeeded || t === a.DownloadKernel.TaskStatus.Seeding ? n.call("OnTaskSuccess", e.getId()) : t === a.DownloadKernel.TaskStatus.DestroyPending ? n.call("OnTaskDestroyPending", e.getId()) : t === a.DownloadKernel.TaskStatus.Failed && n.call("OnTaskFailed", e.getId())
                    })
                } while (0)
            })
        }

        function N(e) {
            w.information("onDisconnect"), n = null, void 0 !== o && (y.detachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, o), o = void 0)
        }

        function D(e) {
            w.information("setOrderDownload taskId:", e);
            do {
                let t = S.getTaskFromTaskId(e);
                if (!t) break;
                t.setDownloadStrategy(1)
            } while (0)
        }

        function I(e) {
            w.information("setDisorderDownload taskId:", e);
            do {
                let t = S.getTaskFromTaskId(e);
                if (!t) break;
                t.setDownloadStrategy(0)
            } while (0)
        }

        function _(e) {
            w.information("onStopPlay taskId:", e)
        }

        function x() {
            return !0
        }

        function A() {
            return !1
        }

        function E() {
            let e = g.remote.getGlobal("mainRendererWindow");
            if (null !== e && void 0 !== e) {
                e.show();
                let t = e.getNativeWindowHandle().readUIntLE(0, 4);
                null !== T && void 0 !== T && T.setForegroundWindow(t)
            }
        }

        function M(e) {
            n.call("OnUserInterrupt", e)
        }

        function P(e, t) {
            var i;
            !function (e) {
                f.phoneAuthObject.isPhoneAuthAw().then(t => {
                    w.information("当前账号认证状态:", t), e(t)
                }).catch(e => ({error: e}))
            }(a => {
                a ? n.call("OnGetUserID", e, t) : (t = "auth", E(), setTimeout(() => {
                    p.EmbeddedBrowserManagerNs.showWebWnd("phoneAuth")
                }, 500), i = (i => {
                    1 === i ? n.call("OnGetUserID", e, t) : 0 === i && M("authwndclose")
                }), void 0 === c && (c = h.NativeCallModule.nativeCall.AttachNativeEvent("OnPhoneAuthResult", e => {
                    h.NativeCallModule.nativeCall.DetachNativeEvent("OnPhoneAuthResult", c), c = void 0, i(e)
                })))
            })
        }

        function F() {
            s.LoginHelperNS.loginHelper.getUserInfo("userid", function (e) {
                var t;
                "" === e || void 0 === e || null === e ? (E(), s.LoginHelperNS.loginHelper.showLoginDlg("XMPComment", !0), t = function (e) {
                    h.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", r), r = void 0, P(e, "login")
                }, void 0 === r && (r = h.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", t)), function (e) {
                    void 0 === k && (k = h.NativeCallModule.nativeCall.AttachNativeEvent("OnLoginWndClose", t => {
                        "close" === t && "function" == typeof e && e(t)
                    }))
                }(e => {
                    "close" === e && M("loginwndclose")
                })) : P(e, "ok")
            })
        }

        function O() {
            s.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (e) {
                if (null === e || void 0 === e || "" === e) {
                    let e = -1;
                    e = h.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", t => {
                        h.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", e), h.NativeCallModule.nativeCall.CallNativeFunction("GetSessionID", (e, t) => {
                            0 === e && n.call("OnGetSessionID", t)
                        })
                    })
                } else n.call("OnGetSessionID", e)
            })
        }

        function U() {
            w.information("调用openUserCenterTab"), s.LoginHelperNS.loginHelper.getUserInfo("userid", function (e) {
                if (w.information("调用getUserInfo userid=", e), "" !== e || void 0 !== e || null !== e) {
                    let t = "" + e + "?entrypage=xmp_comment_dialog&entry=xmp_comment_dialog_viewbutton";
                    w.information("调用openNewTab url=", t), E(), h.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t)
                }
            })
        }

        e.init = function () {
            l.default.isInited() ? m() && b() : l.default.getEventEmitter().once("OnConfigModulesLoaded", e => {
                m() && b()
            })
        }, e.uninit = function () {
            let e = v.getFactory();
            e && t && (e.destroyIPCServer(t), t = null), void 0 !== o && (y.detachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, o), o = void 0)
        }
    }(t.DownloadAndPlayIPCNS || (t.DownloadAndPlayIPCNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(5).default(i.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        class t {
            constructor() {
                this.xlipcFactory = null
            }

            getFactory() {
                return this.xlipcFactory || (this.xlipcFactory = a.xlipcFactory), this.xlipcFactory
            }
        }

        e.Manager = t, e.getManager = function () {
            return new t
        }, e.xlipcDownloadAndPlayId = "DownloadAndPlay"
    }(t.XLIPCManagerNS || (t.XLIPCManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(21), o = n(2), r = n(244),
        s = i.remote.require(o.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e, t, n, i, a, o) {
            let l = {x: 0, y: 0, width: 0, height: 0}, u = function () {
                let e = 1;
                return e = r.browserSupport.dpiAwareSupport ? s.getMonitorDPIFactor(r.browserSupport.browserParentWndHandle) : r.browserSupport.systemDpiFactor
            }();
            return l.x = Math.ceil(n * u), l.y = Math.ceil(a * u), l.width = Math.ceil((e - n - i) * u), l.height = Math.ceil((t - a - o) * u), l
        }

        e.resizeBrowserWindow = function (e, n, i, o, r, l, u) {
            let d = !1;
            {
                let c = t(n, i, o, r, l, u);
                s.setWindowPos(e, a.OptionOfhwndInAfter.HWND_TOP, Math.round(c.x), Math.round(c.y), Math.round(c.width), Math.round(c.height), a.Uflags.SWP_SHOWWINDOW), d = !0
            }
            return d
        }, e.getBrowserWindowRect = t
    }(t.CommonFunctionNs || (t.CommonFunctionNs = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(21), a = n(725), o = n(6);
    t.signNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "CloseDialog", nativeFunc: this.closeDialog}, {
                functionName: "ShowLoginPanel",
                nativeFunc: this.showLoginPanel
            }]
        }

        closeDialog(e, t, n, o) {
            a.signObject.closeDialog(), e.callNativeFunctionCallback(t, n, i.NativeFunctionErrorCode.Success)
        }

        showLoginPanel(e, t, n, a) {
            o.NativeCallModule.nativeCall.CallNativeFunction("ShowLoginDlg"), e.callNativeFunctionCallback(t, n, i.NativeFunctionErrorCode.Success)
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(21), a = n(280);
    t.phoneAuthNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "HideWebDlg", nativeFunc: this.hideWebDlg}]
        }

        hideWebDlg(e, t, n, o) {
            do {
                if (null === e || void 0 === e) break;
                if (null === o || void 0 === o) break;
                let r = o[0], s = o[1];
                a.phoneAuthObject.closeDialog(s, r), e.callNativeFunctionCallback(t, n, i.NativeFunctionErrorCode.Success)
            } while (0)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(781), o = n(8), r = n(151), s = n(1).default.getLogger("Thunder.VipDownload.task"),
        l = r.DkHelperNS.getHelper();
    t.Task = class {
        constructor(e, t) {
            this.mTaskBase = null, this.mTaskStatus = void 0, this.mDcdnStatus = void 0, this.mIsGcidOk = !1, this.mIsSubGcidOk = new Map, this.mTaskDetail = null, this.mTaskExtra = null, this.mTaskId = e, this.mTaskExtra = new a.TaskExtra(this), this.init(t).catch()
        }

        getTaskId() {
            return this.mTaskId
        }

        getTaskBase() {
            return this.mTaskBase
        }

        getTaskStatus() {
            return this.mTaskStatus
        }

        getDcdnStatus() {
            return this.mDcdnStatus
        }

        setDcdnStatus(e) {
            let t = this.getDcdnStatusPriority(this.mDcdnStatus);
            this.getDcdnStatusPriority(e) > t && (this.mDcdnStatus = e)
        }

        getTaskDetail() {
            return this.mTaskDetail
        }

        getTaskExtra() {
            return this.mTaskExtra
        }

        getFilesWithFilter(e, t) {
            let n = [];
            if (!this.mTaskBase) return n;
            let i = void 0, a = void 0;
            switch (t && (i = t.get("downloading"), a = t.get("select")), this.mTaskBase.taskType) {
                case o.DownloadKernel.TaskType.P2sp:
                case o.DownloadKernel.TaskType.Emule:
                    if (i && this.mTaskStatus !== o.DownloadKernel.TaskStatus.Started) break;
                    let r = this.getP2pFile();
                    n.push(r);
                    break;
                case o.DownloadKernel.TaskType.Bt:
                case o.DownloadKernel.TaskType.Group:
                    if (!this.mTaskDetail) break;
                    if (e) {
                        for (let t of e) {
                            let e = this.mTaskDetail.files.get(t);
                            e && (i && !this.isSubTaskDownloading(t) || a && 1 !== e.isNeedDownload || n.push(e))
                        }
                        break
                    }
                    this.mTaskDetail.files.forEach(e => {
                        i && !this.isSubTaskDownloading(e.subId) || a && 1 !== e.isNeedDownload || n.push(e)
                    })
            }
            return n
        }

        getAllFiles() {
            return this.getFilesWithFilter()
        }

        getSelectFiles(e) {
            let t = new Map;
            return t.set("select", !0), this.getFilesWithFilter(e, t)
        }

        getDownloadingFiles(e) {
            let t = new Map;
            return t.set("downloading", !0), this.getFilesWithFilter(e, t)
        }

        getFile(e) {
            let t = null;
            if (!this.mTaskBase) return t;
            switch (this.mTaskBase.taskType) {
                case o.DownloadKernel.TaskType.P2sp:
                case o.DownloadKernel.TaskType.Emule:
                    t = this.getP2pFile();
                    break;
                case o.DownloadKernel.TaskType.Bt:
                case o.DownloadKernel.TaskType.Group:
                    this.mTaskDetail && (t = this.mTaskDetail.files.get(e))
            }
            return t
        }

        remove() {
            this.mTaskExtra.remove()
        }

        select() {
            return i(this, void 0, void 0, function* () {
                let e = yield l.getCurrentCategoryId();
                e && l.selectCategoryView(e, o.DownloadKernel.CategroyViewID.Downloading, this.mTaskId)
            })
        }

        onExpand() {
            this.mTaskExtra.onExpand()
        }

        onUserAuthorityChanged(e, t) {
            this.mTaskExtra.onUserAuthorityChanged(e, t).catch()
        }

        onTaskStatusChanged(e) {
            return i(this, void 0, void 0, function* () {
                switch (s.information("onTaskStatusChanged", "taskId", this.mTaskId, "taskStatus", e), this.mTaskStatus = e, e) {
                    case o.DownloadKernel.TaskStatus.Started:
                        yield this.initTaskDetail();
                        break;
                    case o.DownloadKernel.TaskStatus.Stopped:
                        this.mDcdnStatus = void 0
                }
                yield this.mTaskExtra.onTaskStatusChanged(e)
            })
        }

        onTaskDetailChanged(e) {
            this.setTaskBase(e), this.mTaskBase && this.mTaskBase.taskType === o.DownloadKernel.TaskType.Group && l.getTaskDetail(this.mTaskId).then(e => {
                e && e.files && e.files.forEach(e => {
                    this.setFile(e.subId, e)
                })
            }).catch()
        }

        onTaskDcdnStatusChanged(e, t) {
            e < 0 && this.mTaskBase && (this.mTaskBase.taskType === o.DownloadKernel.TaskType.Group || this.mTaskBase.taskType === o.DownloadKernel.TaskType.Bt) || (s.information("onTaskDcdnStatusChanged", "taskId", this.mTaskId, "subId", e, "dcdnStatus", t), this.setDcdnStatus(t), this.mTaskExtra.onTaskDcdnStatusChanged(e, t))
        }

        onBtSubFileDetailChanged(e, t) {
            if (this.mTaskDetail) for (let e of t) {
                let t = e.realIndex, n = l.createBtFileUrl(t, this.mTaskDetail.infoId), i = {
                    subId: t,
                    taskStatus: e.fileStatus,
                    filePath: "",
                    fileName: e.finalName,
                    gcid: e.gcid,
                    cid: e.cid,
                    url: n,
                    refUrl: "",
                    fileSize: e.fileSize,
                    downloadSize: e.downloadSize,
                    errCode: e.errorCode
                };
                this.setFile(t, i)
            }
        }

        onCidGcidRetrieved(e) {
            s.information("onCidGcidRetrieved", this.mTaskId, e), this.mTaskExtra.onCidGcidRetrieved(e)
        }

        onTaskCompleted() {
            s.information("onTaskCompleted", "taskId", this.mTaskId), this.remove()
        }

        onTaskRemoved() {
            s.information("onTaskRemoved", "taskId", this.mTaskId), this.remove()
        }

        init(e) {
            return i(this, void 0, void 0, function* () {
                this.onTaskDetailChanged(e);
                let t = yield l.getTaskStatus(this.mTaskId);
                yield this.onTaskStatusChanged(t)
            })
        }

        initTaskDetail() {
            return i(this, void 0, void 0, function* () {
                if (this.mTaskDetail = null, this.mTaskBase) {
                    let e = this.mTaskBase.taskType;
                    e !== o.DownloadKernel.TaskType.Bt && e !== o.DownloadKernel.TaskType.Group || (this.mTaskDetail = yield l.getTaskDetail(this.mTaskId))
                }
            })
        }

        setTaskBase(e) {
            this.mTaskBase = e, e && (e.taskType !== o.DownloadKernel.TaskType.P2sp && e.taskType !== o.DownloadKernel.TaskType.Emule || this.mIsGcidOk || e && e.gcid && "" !== e.gcid && e.cid && "" !== e.cid && (this.mIsGcidOk = !0, this.onCidGcidRetrieved(-1)))
        }

        getP2pFile() {
            return this.mTaskBase ? {
                subId: -1,
                taskStatus: this.mTaskBase.taskStatus,
                filePath: this.mTaskBase.savePath,
                fileName: this.mTaskBase.taskName,
                gcid: this.mTaskBase.gcid,
                cid: this.mTaskBase.cid,
                url: this.mTaskBase.url,
                refUrl: this.mTaskBase.refUrl,
                fileSize: this.mTaskBase.fileSize,
                downloadSize: this.mTaskBase.downloadSize,
                isNeedDownload: 1
            } : null
        }

        setFile(e, t) {
            if (!this.mTaskDetail) return;
            let n = this.getFile(e);
            this.mTaskDetail.files.set(e, t), n && n.taskStatus === t.taskStatus || this.mTaskExtra.onSubTaskStatusChanged(e, t.taskStatus), this.mIsSubGcidOk.get(e) || t.gcid && "" !== t.gcid && t.cid && "" !== t.cid && (this.mIsSubGcidOk.set(e, !0), this.onCidGcidRetrieved(e)), this.mTaskBase && this.mTaskBase.taskType === o.DownloadKernel.TaskType.Group && (n && n.dcdnStatus === t.dcdnStatus || this.onTaskDcdnStatusChanged(e, t.dcdnStatus))
        }

        isSubTaskDownloading(e) {
            if (!this.mTaskBase) return !1;
            let t = !1;
            switch (this.mTaskBase.taskType) {
                case o.DownloadKernel.TaskType.P2sp:
                case o.DownloadKernel.TaskType.Emule:
                    t = this.mTaskBase.taskStatus === o.DownloadKernel.TaskStatus.Started;
                    break;
                case o.DownloadKernel.TaskType.Bt:
                    if (this.mTaskDetail) {
                        let n = this.mTaskDetail.files.get(e);
                        n && (t = n.taskStatus === o.DownloadKernel.BtFileStatus.Started)
                    }
                    break;
                case o.DownloadKernel.TaskType.Group:
                    if (this.mTaskDetail) {
                        let n = this.mTaskDetail.files.get(e);
                        n && (t = n.taskStatus === o.DownloadKernel.TaskStatus.Started)
                    }
            }
            return t
        }

        getDcdnStatusPriority(e) {
            let t = -1;
            switch (e) {
                case void 0:
                    t = -1;
                    break;
                case o.DownloadKernel.DcdnStatusCode.Unkown:
                    t = 0;
                    break;
                case o.DownloadKernel.DcdnStatusCode.AuthorizingFailed:
                    t = 2;
                    break;
                case o.DownloadKernel.DcdnStatusCode.Success:
                    t = 3;
                    break;
                default:
                    t = 1
            }
            return t
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(115), o = n(782), r = n(79), s = n(8), l = n(788), u = n(792), d = n(210), c = n(730), h = n(556),
        f = n(558), p = n(245), g = n(62), k = n(557), m = n(22), T = n(209),
        v = n(1).default.getLogger("Thunder.VipDownload.task-extra"), y = r.UserHelperNS.getHelper(),
        S = T.ConfigHelperNS.getHelper(), w = d.TaskEventContainerNS.getEventContainer(),
        b = p.KuainiaoManagerNS.getManager();
    t.TaskExtra = class {
        constructor(e) {
            this.mTask = null, this.mOfflineTask = null, this.mAcclerateTasks = new Map, this.mIsCheckTry = !1, this.mKuaiNiaoInit = !1, this.mKuaiNiaoShow = !1, this.mKuaiNiaoTimer = null, this.mVipTaskInfo = null, this.mEnterType = void 0, this.mTaskId = e.getTaskId(), this.mTask = e
        }

        get vipTaskType() {
            let e = a.VipDownloadDefineNS.VipTaskType.Vip;
            return this.tryTask && (e = a.VipDownloadDefineNS.VipTaskType.Try), e
        }

        get vipTaskStatus() {
            let e = a.VipDownloadDefineNS.VipTaskStatus.Init;
            return this.vipTaskType === a.VipDownloadDefineNS.VipTaskType.Try ? this.tryTask && (e = this.tryTask.vipTaskStatus) : this.vipTask && (e = this.vipTask.vipTaskStatus), e
        }

        get vipTaskError() {
            let e = null;
            return this.vipTaskType === a.VipDownloadDefineNS.VipTaskType.Try ? this.tryTask && (e = this.tryTask.error) : this.vipTask && (e = this.vipTask.error), e
        }

        get careKuaiNiao() {
            if (this.mKuaiNiaoInit && void 0 !== this.mEnterType) {
                let e = this.getAcclerateTask(this.mEnterType);
                if (e) return e.enableKuaiNiao
            }
            return !1
        }

        getVipTaskInfo() {
            return this.mVipTaskInfo || (this.mVipTaskInfo = this.createVipTaskInfo()), this.mVipTaskInfo
        }

        setVipTaskStatus(e, t) {
            this.updateVipTaskInfo()
        }

        createVipTaskInfo() {
            v.information("createVipTaskInfo", this.mTaskId);
            let e = null, t = !1, n = this.careKuaiNiao;
            this.taskStatus !== s.DownloadKernel.TaskStatus.Started || n || this.mAcclerateTasks.forEach(e => {
                e.showSpeed && (t = !0)
            });
            let i = !1, o = this.getAcclerateTask(this.vipTaskType);
            o && (i = o.acclerated);
            let r = !1;
            this.vipTaskType === a.VipDownloadDefineNS.VipTaskType.Vip ? r = y.isSuperVip : this.tryTask && (r = this.tryTask.tryType === a.VipDownloadDefineNS.TryType.SuperVip);
            let l = !1;
            return r && !n && this.vipTaskStatus > a.VipDownloadDefineNS.VipTaskStatus.Init && this.vipTaskStatus < a.VipDownloadDefineNS.VipTaskStatus.Finished && this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.CommitFailed && this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed && (l = !0), e = {
                taskType: this.vipTaskType,
                isSuper: r,
                taskStatus: this.vipTaskStatus,
                isShowVipSpeed: t,
                isShowSuperSpeed: l,
                error: this.vipTaskError,
                isAcclerated: i,
                careKuaiNiao: n,
                showKuaiNiao: this.mKuaiNiaoShow,
                kuaiNiaoStatus: b.status
            }, this.mVipTaskInfo = e, e
        }

        updateVipTaskInfo() {
            let e = this.mVipTaskInfo, t = this.createVipTaskInfo(), n = !1;
            e && e.taskType === t.taskType && e.taskStatus === t.taskStatus || (n = !0), v.information("onVipTaskInfoChanged", "taskId", this.mTaskId, "taskInfo", t, "statusChange", n), w.onEvent(d.TaskEventNS.vipTaskInfoChanged, this.mTaskId, t), n && w.onEvent(d.TaskEventNS.taskAcclerateStatusChanged, this.mTaskId, t)
        }

        enterAcclerate(e) {
            v.information("enter", "type", e), this.mEnterType !== e && (this.mEnterType = e, this.mKuaiNiaoInit = !0, this.createAcclerateTask(e).enter(), this.startKuaiNiaoShow())
        }

        exitAcclerate(e) {
            let t = this.getAcclerateTask(e);
            t && (v.information("exit", "type", e), this.killKuaiNiaoTimer(), t.exit(), this.deleteAcclerateTask(e), this.updateVipTaskInfo()), this.mEnterType === e && (this.mEnterType = void 0)
        }

        autoAcclerate() {
            this.vipTaskStatus === a.VipDownloadDefineNS.VipTaskStatus.Init && this.enterAcclerate(a.VipDownloadDefineNS.VipTaskType.Vip)
        }

        showTry() {
            v.information("showTry"), h.TryTaskCacheNS.getCacheManager().setTaskId(this.mTaskId);
            let e = a.VipDownloadDefineNS.VipTaskType.Try;
            this.createAcclerateTask(e)
        }

        removeTry() {
            v.information("removeTry");
            let e = a.VipDownloadDefineNS.VipTaskType.Try;
            this.exitAcclerate(e)
        }

        remove() {
            this.mAcclerateTasks.forEach(e => {
                e.remove()
            }), this.offlineTask && this.offlineTask.remove()
        }

        onExpand() {
            this.activeTry().catch()
        }

        onUserAuthorityChanged(e, t) {
            return i(this, void 0, void 0, function* () {
                e ? !this.tryTask || this.userCanTry && this.tryTask.tryType !== a.VipDownloadDefineNS.TryType.PlatinumVip || this.exitAcclerate(a.VipDownloadDefineNS.VipTaskType.Try) : this.exitAcclerate(a.VipDownloadDefineNS.VipTaskType.Vip), yield this.checkAcclerate(), yield this.checkOffline(!0), t && this.updateVipTaskInfo()
            })
        }

        onKuaiNiaoStatusChanged(e) {
            e === f.KuaiNiaoDefineNS.KuaiNiaoStatus.Alive && (this.killKuaiNiaoTimer(), this.mKuaiNiaoInit = !0, this.mKuaiNiaoShow = !0, this.createKuaiNiaoTimer(3e3), this.updateVipTaskInfo())
        }

        onTaskStatusChanged(e) {
            return i(this, void 0, void 0, function* () {
                this.mAcclerateTasks.forEach(t => {
                    t.onTaskStatusChanged(e)
                }), yield this.checkAcclerate(), yield this.checkOffline()
            })
        }

        onSubTaskStatusChanged(e, t) {
            this.mAcclerateTasks.forEach(n => {
                n.onSubTaskStatusChanged(e, t)
            })
        }

        onTaskDcdnStatusChanged(e, t) {
            this.mAcclerateTasks.forEach(n => {
                n.onTaskDcdnStatusChanged(e, t)
            })
        }

        onCidGcidRetrieved(e) {
            setTimeout(() => i(this, void 0, void 0, function* () {
                yield this.activeTry()
            }), 1e3), this.mAcclerateTasks.forEach(t => {
                t.onCidGcidRetrieved(e)
            })
        }

        onTryFinishOpenVipClick() {
            this.tryTask && this.tryTask.setFinishClickDispearDelay()
        }

        get task() {
            return this.mTask
        }

        get taskStatus() {
            return this.mTask.getTaskStatus()
        }

        get vipTask() {
            return this.getAcclerateTask(a.VipDownloadDefineNS.VipTaskType.Vip)
        }

        getAcclerateTask(e) {
            return this.mAcclerateTasks.get(e)
        }

        createAcclerateTask(e) {
            let t = this.mAcclerateTasks.get(e);
            return t || (t = e === a.VipDownloadDefineNS.VipTaskType.Try ? new u.TryTask(this.task) : new l.VipTask(this.task), this.mAcclerateTasks.set(e, t), t.init()), t
        }

        deleteAcclerateTask(e) {
            this.mAcclerateTasks.delete(e)
        }

        checkAcclerate() {
            return i(this, void 0, void 0, function* () {
                y.isVip && this.taskStatus === s.DownloadKernel.TaskStatus.Started && this.autoAcclerate(), yield this.activeTry()
            })
        }

        get tryTask() {
            return this.getAcclerateTask(a.VipDownloadDefineNS.VipTaskType.Try)
        }

        get trySubId() {
            let e = 0, t = void 0, n = this.task.getDownloadingFiles();
            for (let i of n) i.gcid && "" !== i.gcid && i.cid && "" !== i.cid && i.fileSize && i.fileSize > e && (e = i.fileSize, t = i.subId);
            return t
        }

        get userCanTry() {
            return !y.isSuperVip && !y.hasFlux
        }

        get isTryMode() {
            return this.vipTaskType === a.VipDownloadDefineNS.VipTaskType.Try
        }

        get isTryInit() {
            return !!this.isTryMode && this.vipTaskStatus === a.VipDownloadDefineNS.VipTaskStatus.Init
        }

        activeTry() {
            return i(this, void 0, void 0, function* () {
                if (this.mIsCheckTry) v.information("is checking try!"); else {
                    this.mIsCheckTry = !0;
                    do {
                        v.information("checkActiveTry");
                        let e = g.PluginHelperNS.getHelper().currentTime, t = this.isTryMode, n = this.isTryInit;
                        const i = h.TryTaskCacheNS.getCacheManager().getTask(this.mTaskId);
                        n && i && i.createTime && i.expireTime && e - i.createTime > i.expireTime && (this.removeTry(), t = !1, n = !1);
                        let a = !1;
                        if (i && (a = this.canShowTry(i.type)), n && !a) {
                            v.information("task can not show try anymore!"), this.removeTry();
                            break
                        }
                        if (t) {
                            v.information("task already show try!");
                            break
                        }
                        if (i) {
                            i.trialKey && !i.commited && a ? (v.information("show try from cache"), this.showTry()) : v.information("this task had query!");
                            break
                        }
                        if (this.taskStatus !== s.DownloadKernel.TaskStatus.Started) {
                            v.information("this task is not started!");
                            break
                        }
                        if (!this.canQueryTry()) {
                            v.information("this task can not query try!");
                            break
                        }
                        let o = m.ConfigNS.getValue("VipDownload", "LastTryEnterTime", 0),
                            r = S.getValue("VipDownload", "TryInterval");
                        if (e - o < r) {
                            v.information("interval time less than ", r);
                            break
                        }
                        let l = yield k.TryTaskDataBaseNS.getTable().getUserData(this.mTaskId, -1);
                        if (l && l.tryDate) {
                            let e = (new Date).toDateString();
                            if (l.tryDate === e) {
                                v.information("this task had try today!");
                                break
                            }
                        }
                        let u = this.trySubId;
                        if (void 0 === u) {
                            v.information("subId invalid!");
                            break
                        }
                        yield this.queryTry(u)
                    } while (0);
                    this.mIsCheckTry = !1
                }
            })
        }

        queryTry(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.task.getTaskBase(), n = this.task.getFile(e);
                if (!t || !n) return null;
                let i = {btTitle: 2 === t.taskType ? t.taskName : void 0, file: n},
                    a = yield(new c.TryTaskHttpSession).query(i);
                a && (h.TryTaskCacheNS.getCacheManager().setQueryData(this.mTaskId, e, a), 0 === a.result && this.canShowTry(a.type) && (this.showTry(), this.task.select()))
            })
        }

        canQueryTry() {
            if (!this.userCanTry) return v.information("this user can not try!"), !1;
            let e = this.task.getTaskBase();
            if (!e) return v.information("task base not exist!"), !1;
            if (e.taskType === s.DownloadKernel.TaskType.Group) return v.information("this task is group task!"), !1;
            const t = h.TryTaskCacheNS.getCacheManager();
            if (t.chances <= 0) return v.information("no chances to try!", "chances:", t.chances), !1;
            let n = t.taskId;
            return !n || n === this.mTaskId || (v.information("another task trying!", "taskId:", n), !1)
        }

        canShowTry(e) {
            let t = this.task.getTaskBase();
            if (!t) return v.information("task base not exist!"), !1;
            if (!this.canQueryTry()) return !1;
            if (e !== a.VipDownloadDefineNS.TryType.SuperVip) {
                if (y.authority) return v.information("current user has superspeed authority!"), !1;
                if (this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.Init) return v.information("task already enter!"), !1
            }
            let n = 0, i = 0;
            e === a.VipDownloadDefineNS.TryType.SuperVip ? (n = S.getValue("VipDownload", "EnableSuperTryMinSize"), i = S.getValue("VipDownload", "EnableSuperTryMaxProgress")) : (n = S.getValue("VipDownload", "EnableTryMinSize"), i = S.getValue("VipDownload", "EnableTryMaxProgress"));
            let o = t.fileSize || 0;
            return o < n ? (v.information("fileSize less than minSize!"), !1) : !(100 * (t.downloadSize || 0) / o > i && (v.information("progress more than maxProgress!"), 1))
        }

        get offlineTask() {
            return this.mOfflineTask
        }

        checkOffline(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.mTask.getTaskStatus();
                y.offlineAuthority && t === s.DownloadKernel.TaskStatus.Started && (this.mOfflineTask || (this.mOfflineTask = new o.OfflineTask(this.mTask), e = !0), e && (yield this.mOfflineTask.loadData()), yield this.mOfflineTask.enter())
            })
        }

        startKuaiNiaoShow() {
            this.careKuaiNiao && (v.information("startKuaiNiaoShow"), this.createKuaiNiaoTimer(5e3))
        }

        createKuaiNiaoTimer(e) {
            this.mKuaiNiaoTimer || (v.information("createKuaiNiaoTimer"), this.mKuaiNiaoTimer = setTimeout(() => {
                v.information("onKuaiNiaoTimer"), this.mKuaiNiaoInit = !1, this.mKuaiNiaoShow = !1, this.mKuaiNiaoTimer = null, this.updateVipTaskInfo()
            }, e))
        }

        killKuaiNiaoTimer() {
            this.mKuaiNiaoTimer && (v.information("killKuaiNiaoTimer"), clearTimeout(this.mKuaiNiaoTimer), this.mKuaiNiaoInit = !1, this.mKuaiNiaoShow = !1, this.mKuaiNiaoTimer = null)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(8), o = n(783), r = n(785), s = n(151).DkHelperNS.getHelper(),
        l = n(1).default.getLogger("Thunder.VipDownload.offline-page");
    var u;
    !function (e) {
        e[e.Init = 0] = "Init", e[e.CommitWait = 1] = "CommitWait", e[e.Commiting = 2] = "Commiting", e[e.CommitFailed = 3] = "CommitFailed", e[e.CommitSuccess = 4] = "CommitSuccess"
    }(u = t.OfflineTaskStatus || (t.OfflineTaskStatus = {}));
    t.OfflineTask = class {
        constructor(e) {
            this.mOfflineTaskStatus = void 0, this.mCache = null, this.mTaskId = e.getTaskId(), this.mTask = e, this.offlineTaskStatus = u.Init, this.mCache = new r.OfflineTaskCacheNS.Task(this.mTaskId)
        }

        get taskId() {
            return this.mTaskId
        }

        get task() {
            return this.mTask
        }

        get offlineTaskStatus() {
            return this.mOfflineTaskStatus
        }

        set offlineTaskStatus(e) {
            (void 0 === this.mOfflineTaskStatus || e === u.Init || e > this.mOfflineTaskStatus) && (this.mOfflineTaskStatus = e)
        }

        enter() {
            return i(this, void 0, void 0, function* () {
                this.offlineTaskStatus === u.Init && (yield this.commit())
            })
        }

        exit() {
            this.clear(), this.offlineTaskStatus = u.Init
        }

        remove() {
            this.clear(!0)
        }

        loadData() {
            return i(this, void 0, void 0, function* () {
                yield this.mCache.load()
            })
        }

        clear(e) {
            this.mCache.clear(e)
        }

        commit() {
            return i(this, void 0, void 0, function* () {
                l.information("commit"), this.offlineTaskStatus = u.CommitWait;
                let e = this.task.getTaskBase();
                if (!e) return null;
                let t = [];
                if (e.taskType === a.DownloadKernel.TaskType.Bt) this.mCache.getItem(-1) || t.push(-1); else {
                    let e = this.task.getSelectFiles();
                    for (let n of e) this.mCache.getItem(n.subId) || t.push(n.subId)
                }
                if (l.information("subIds", t), t.length > 0) {
                    this.offlineTaskStatus = u.Commiting;
                    for (let e of t) yield this.commitOneTask(e)
                }
            })
        }

        commitOneTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = this.task.getTaskBase();
                if (!t) return l.information("taskBase not exits!"), null;
                let n = null;
                if (t.taskType === a.DownloadKernel.TaskType.Bt) {
                    let e = this.task.getTaskDetail();
                    if (!e) return l.information("taskDetail not exits!"), null;
                    let i = [], a = this.task.getSelectFiles();
                    for (let e of a) i.push(e.subId);
                    n = {
                        url: s.createBtTaskUrl(e.infoId),
                        filename: t.taskName,
                        gcid: "",
                        cid: "",
                        filesize: t.fileSize,
                        file_indexs: i,
                        refer_url: t.refUrl,
                        cookies: ""
                    }
                } else {
                    let t = this.task.getFile(e);
                    if (!t) return l.information("file not exits!"), null;
                    n = {
                        url: t.url,
                        filename: t.fileName,
                        gcid: t.gcid,
                        cid: t.cid,
                        filesize: t.fileSize,
                        file_indexs: [],
                        refer_url: t.refUrl,
                        cookies: ""
                    }
                }
                let i = {taskInfo: n}, r = yield(new o.OfflineTaskHttpSession).commitTask(i);
                this.onCommitTaskCallback(e, r)
            })
        }

        onCommitTaskCallback(e, t) {
            t && (0 === t.result ? this.offlineTaskStatus = u.CommitSuccess : this.offlineTaskStatus = u.CommitFailed, this.mCache.setItemData(e))
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(254), o = n(104), r = n(784), s = n(79), l = n(62), u = n(45),
        d = n(1).default.getLogger("Thunder.VipDownload.offline-page"), c = s.UserHelperNS.getHelper(),
        h = l.PluginHelperNS.getHelper();
    t.OfflineTaskHttpSession = class extends o.HttpSession {
        commitTask(e) {
            return i(this, void 0, void 0, function* () {
                let t = c.userId, n = yield c.getSessionId(), i = h.clientName, o = h.thunderVersionNumber,
                    s = h.currentTime, l = Math.random(), f = "+]^%?#@COLL`(^POST" + i + o + s + l,
                    p = "client_name=" + i + "&client_version=" + o + "&ts=" + s + "&r=" + l + "&key=" + (f = u.ToolsUtilitiesAWNS.genarateMd5(f));
                return d.information("key", f), this.host = "api.zone.lixian.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/tasks/" + t + "?" + p, this.auth = t + ":" + n + ":client:0", this.accept = a.HttpJsonCryptoNS.getAccept(), e.userId = t, this.body = yield r.OfflineTaskHttpPackageNS.createCommitTaskBuffer(e), yield this.postCommitTaskRequest(e)
            })
        }

        postCommitTaskRequest(e) {
            return new Promise(t => {
                this.post(n => {
                    let i = null;
                    c.userId === e.userId && 200 === n.statusCode && n.body && (i = r.OfflineTaskHttpPackageNS.praseCommitTaskBuffer(n.body)), t(i)
                }, e => {
                    d.information("error", e), t(null)
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1).default.getLogger("Thunder.VipDownload.offline-page");
    !function (e) {
        e.createCommitTaskBuffer = function (e) {
            return i(this, void 0, void 0, function* () {
                a.information("--\x3ecreateCommitTaskBuffer");
                let t = {task_info: e.taskInfo}, n = JSON.stringify(t);
                a.information("jsonStr", n);
                let i = Buffer.from(n);
                return a.information("<--createCommitTaskBuffer"), i
            })
        }, e.praseCommitTaskBuffer = function (e) {
            a.information("--\x3epraseCommitTaskBuffer");
            let t = null;
            if (e) {
                let n = e.toString();
                a.information("jsonStr", n);
                try {
                    t = JSON.parse(n)
                } catch (e) {
                    a.warning(e)
                }
            }
            return a.information("<--praseCommitTaskBuffer"), t
        }
    }(t.OfflineTaskHttpPackageNS || (t.OfflineTaskHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(727).OfflineTaskDataBaseNS.getTable();
    !function (e) {
        class t {
            constructor(e) {
                this.mSubId = e
            }

            get subId() {
                return this.mSubId
            }

            set itemData(e) {
                this.mData = e
            }

            get itemData() {
                return this.mData
            }
        }

        e.SubTask = t;
        e.Task = class {
            constructor(e) {
                this.mTaskId = void 0, this.mSubTasks = new Map, this.mTaskId = e
            }

            createItem(e) {
                let n = this.getItem(e);
                return n || (n = new t(e), this.mSubTasks.set(e, n)), n
            }

            deleteItem(e) {
                this.mSubTasks.delete(e)
            }

            getItem(e) {
                return this.mSubTasks.get(e)
            }

            setItemData(e, t) {
                this.createItem(e).itemData = t, this.save(e).catch()
            }

            load() {
                return i(this, void 0, void 0, function* () {
                    let e = yield a.getTaskIndexs(this.mTaskId);
                    for (let t of e) this.setItemData(t)
                })
            }

            save(e) {
                return i(this, void 0, void 0, function* () {
                    (yield a.isTaskExist(this.mTaskId, e)) || (yield a.setUserData(this.mTaskId, e))
                })
            }

            clear(e) {
                this.mSubTasks.clear(), e && a.removeTask(this.mTaskId, -2).catch()
            }
        }
    }(t.OfflineTaskCacheNS || (t.OfflineTaskCacheNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(26), a = n(1).default.getLogger("Thunder.VipDownload.aes-crypto");
    !function (e) {
        e.encryptString = function (e, t, n = "utf8", o = "hex") {
            let r = void 0;
            try {
                let s = i.createCipheriv("aes-128-ecb", t, "");
                r = s.update(e, n, o) + s.final(o)
            } catch (e) {
                a.error("encryptString", e)
            }
            return r
        }, e.decryptString = function (e, t, n = "hex", o = "utf8") {
            let r = void 0;
            try {
                let s = i.createDecipheriv("aes-128-ecb", t, "");
                r = s.update(e, n, o) + s.final(o)
            } catch (e) {
                a.error("decryptString", e)
            }
            return r
        }
    }(t.AesCryptoNS || (t.AesCryptoNS = {}))
}, function (e, t) {
    e.exports = require("querystring")
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(115), o = n(728), r = n(721), s = n(789), l = n(255), u = n(8), d = n(151), c = n(209), h = n(62),
        f = n(549), p = n(1).default.getLogger("Thunder.VipDownload.vip-task"), g = d.DkHelperNS.getHelper(),
        k = c.ConfigHelperNS.getHelper(), m = f.ErrorCodeHelperNS.getHelper();
    t.VipTask = class extends o.VipTaskBase {
        constructor() {
            super(...arguments), this.mTokenTimer = null, this.mCache = new s.VipTaskCacheNS.Task(this.taskId)
        }

        get vipTaskType() {
            return a.VipDownloadDefineNS.VipTaskType.Vip
        }

        get enableKuaiNiao() {
            return !1
        }

        get error() {
            return this.mCache.error
        }

        get showSpeed() {
            let e = !1;
            switch (this.vipTaskStatus) {
                case a.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                    e = !0;
                    break;
                case a.VipDownloadDefineNS.VipTaskStatus.CommitFailed:
                case a.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed:
                    this.error && this.error.isForbidResource && (e = !0)
            }
            return e
        }

        get acclerated() {
            return this.mCache.acclerated
        }

        init() {
            this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.Init
        }

        enter() {
            this.vipTaskStatus === a.VipDownloadDefineNS.VipTaskStatus.Init && (this.mCache.enter().catch(), this.task.getTaskStatus() === u.DownloadKernel.TaskStatus.Started ? this.commit() : this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped)
        }

        exit() {
            this.unAcclerate()
        }

        remove() {
            this.unAcclerate(!0)
        }

        onCidGcidRetrieved(e) {
            let t = this.task.getTaskBase();
            if (!t) return;
            let n = this.task.getTaskStatus(), i = this.vipTaskStatus;
            n === u.DownloadKernel.TaskStatus.Started && i !== a.VipDownloadDefineNS.VipTaskStatus.Init && (t.taskType === u.DownloadKernel.TaskType.Bt ? 0 === this.mCache.itemCount && this.commit([e]) : this.mCache.getItem(e) || this.commit([e]))
        }

        onTaskStatusChanged(e) {
            if (this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.Init) switch (e) {
                case u.DownloadKernel.TaskStatus.Started:
                    this.commit();
                    break;
                case u.DownloadKernel.TaskStatus.Stopped:
                    this.unAcclerate(), this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped
            }
        }

        onTaskDcdnStatusChanged(e, t) {
            let n = this.task.getTaskStatus(), i = this.vipTaskStatus;
            if (n === u.DownloadKernel.TaskStatus.Started && i >= a.VipDownloadDefineNS.VipTaskStatus.AcclerateWait) {
                if (t === u.DownloadKernel.DcdnStatusCode.AuthorizingFailed && i === a.VipDownloadDefineNS.VipTaskStatus.Acclerating) {
                    let t = null;
                    return t = e > 0 ? [e] : this.mCache.itemIds, void this.commit(t)
                }
                switch (t) {
                    case void 0:
                    case u.DownloadKernel.DcdnStatusCode.Unkown:
                        break;
                    case u.DownloadKernel.DcdnStatusCode.Success:
                        this.mCache.acclerated = !0, this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.Acclerating;
                        break;
                    case u.DownloadKernel.DcdnStatusCode.ResourceNotFound:
                        this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.SearchResource;
                        break;
                    default:
                        if (this.vipTaskStatus !== a.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed) {
                            let e = this.createDcdnError(t),
                                n = m.getMessage(f.ErrorCodeHelperNS.ErrorType.Dcdn, e.result);
                            n && (e.message = n), e.isForbidResource = e.result && e.result >= 5 && e.result <= 8, this.mCache.error = e, this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed
                        }
                }
            }
        }

        onSubTaskStatusChanged(e, t) {
            let n = this.task.getTaskBase();
            if (!n) return;
            let i = this.task.getTaskStatus(), o = this.vipTaskStatus;
            i === u.DownloadKernel.TaskStatus.Started && o !== a.VipDownloadDefineNS.VipTaskStatus.Init && (n.taskType === u.DownloadKernel.TaskType.Bt && t === u.DownloadKernel.BtFileStatus.Started ? 0 === this.mCache.itemCount && this.commit([e]) : n.taskType === u.DownloadKernel.TaskType.Group && t === u.DownloadKernel.TaskStatus.Started && (this.mCache.getItem(e) || this.commit([e])))
        }

        clear(e) {
            this.killTokenTimer(), this.mCache.clear(e)
        }

        commit(e) {
            p.information("commit"), this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.CommitWait;
            let t = this.task.getTaskBase();
            if (!t) return null;
            let n = this.task.getDownloadingFiles(e);
            p.information("downloadingFiles", n);
            let i = [];
            for (let e of n) if (e.gcid && "" !== e.gcid && e.cid && "" !== e.cid && (i.push(e), this.mCache.createItem(e.subId), t.taskType === u.DownloadKernel.TaskType.Bt)) break;
            if (i.length > 0) {
                let e = void 0, n = void 0;
                if (t.taskType === u.DownloadKernel.TaskType.Bt) {
                    let i = this.task.getTaskDetail();
                    if (!i) return;
                    e = t.taskName, n = i.infoId
                }
                let o = {taskType: t.taskType, files: i, btTitle: e, infoId: n};
                this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.Commiting, (new r.VipTaskHttpSession).queyToken(o).then(e => {
                    this.onTokenCallback(e)
                }).catch()
            }
        }

        onTokenCallback(e) {
            let t = this.vipTaskStatus, n = this.task.getTaskStatus();
            if (t !== a.VipDownloadDefineNS.VipTaskStatus.Init && n === u.DownloadKernel.TaskStatus.Started) {
                let t = [], n = void 0, i = null;
                for (let a of e) {
                    let e = a.subId;
                    0 === a.result ? (t.push(e), n = a.expire) : (i = a).errorStep = l.HttpDefineNS.ErrorStep.Token, this.mCache.setItemData(e, a)
                }
                if (t.length > 0) this.acclerate(t); else if (i) {
                    let e = m.getMessage(f.ErrorCodeHelperNS.ErrorType.Speed, i.result);
                    e && (i.message = e), this.mCache.error = i, this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.CommitFailed
                }
                this.createTokenTimer(n)
            }
        }

        createTokenTimer(e) {
            if (!this.mTokenTimer) {
                p.information("--\x3ecreateTokenTimer");
                let t = void 0, n = h.PluginHelperNS.getHelper().currentTime;
                if (e) {
                    let i = k.getValue("VipDownload", "TokenExpireAdvanceSecond");
                    t = e - n - i, p.information("expire", e, "current", n);
                    let a = k.getValue("VipDownload", "TokenExpireMinSecond");
                    t = Math.max(a, t), p.information("advance", i, "min", a)
                }
                p.information("timeout", t), t && (t *= 1e3, this.mTokenTimer = setTimeout(() => i(this, void 0, void 0, function* () {
                    p.information("onTokenTimer");
                    let e = this.mCache.itemIds;
                    this.commit(e), this.mTokenTimer = null
                }), t)), p.information("<--createTokenTimer")
            }
        }

        killTokenTimer() {
            this.mTokenTimer && (clearTimeout(this.mTokenTimer), this.mTokenTimer = null)
        }

        acclerate(e) {
            this.vipTaskStatus = a.VipDownloadDefineNS.VipTaskStatus.AcclerateWait;
            for (let t of e) {
                let e = this.mCache.getItem(t);
                if (e && e.itemData) {
                    let n = this.taskId, i = this.task.getTaskBase();
                    i && i.taskType === u.DownloadKernel.TaskType.Group && (n = t), e.itemData.token && (e.active ? g.updateDcdnWithVipCert(n, e.itemData.token) : (e.active = !0, g.enableDcdnWithVipCert(n, e.itemData.token)))
                }
            }
        }

        unAcclerate(e) {
            this.clear(e), this.vipTaskStatus >= a.VipDownloadDefineNS.VipTaskStatus.AcclerateWait && g.disableDcdnWithVipCert(this.taskId)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(729), o = n(1).default.getLogger("Thunder.VipDownload.vip-task"), r = a.VipTaskDataBaseNS.getTable();
    !function (e) {
        class t {
            constructor(e) {
                this.mSubId = e
            }

            get subId() {
                return this.mSubId
            }

            set active(e) {
                this.mActive = e
            }

            get active() {
                return this.mActive
            }

            set itemData(e) {
                this.mData = e
            }

            get itemData() {
                return this.mData
            }
        }

        e.SubTask = t;
        e.Task = class {
            constructor(e) {
                this.mTaskId = void 0, this.mSubTasks = new Map, this.mError = null, this.mAcclerated = !1, this.mTaskId = e
            }

            enter() {
                return i(this, void 0, void 0, function* () {
                    (yield r.isTaskExist(this.mTaskId, -1)) || r.setUserData(this.mTaskId, -1).catch()
                })
            }

            createItem(e) {
                if (!this.getItem(e)) {
                    let n = new t(e);
                    this.mSubTasks.set(e, n)
                }
            }

            deleteItem(e) {
                this.mSubTasks.delete(e)
            }

            getItem(e) {
                return this.mSubTasks.get(e)
            }

            setItemData(e, t) {
                let n = this.getItem(e);
                n && (n.itemData = t)
            }

            get itemIds() {
                let e = [];
                return this.mSubTasks.forEach(function (t, n) {
                    o.information("value", t, "key", n), e.push(n)
                }), e
            }

            get itemCount() {
                return this.mSubTasks.size
            }

            set error(e) {
                e && (this.mError = e)
            }

            get error() {
                return this.mError
            }

            set acclerated(e) {
                this.mAcclerated = e
            }

            get acclerated() {
                return this.mAcclerated
            }

            clear(e) {
                this.mSubTasks.clear(), this.error = null, e && r.removeTask(this.mTaskId, -2).catch()
            }
        }
    }(t.VipTaskCacheNS || (t.VipTaskCacheNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(104), o = n(9), r = n(1).default.getLogger("Thunder.VipDownload.file-download");
    !function (e) {
        e.downloadFile = function (e, t) {
            return i(this, void 0, void 0, function* () {
                let n = !1;
                r.information("downloadFile", "downloadUrl", e, "savePath", t);
                let s = yield function (e) {
                    return i(this, void 0, void 0, function* () {
                        let t = new Promise(t => {
                            let n = new a.HttpSession;
                            n.url = e, n.get(e => {
                                let n = null;
                                200 === e.statusCode && e.body && (n = e.body), t(n)
                            }, e => {
                                r.information("error", e), t(null)
                            })
                        });
                        return t
                    })
                }(e);
                return s && (n = yield o.FileSystemAWNS.writeFileAW(t, s)), n
            })
        }
    }(t.FileDownloadNS || (t.FileDownloadNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(9), o = n(1).default.getLogger("Thunder.VipDownload.config");
    t.Config = class {
        constructor() {
            this.configData = {}
        }

        init() {
            this.configData = {
                VipDownload: {
                    TokenExpireAdvanceSecond: 300,
                    TokenExpireMinSecond: 20,
                    EnableTryMinSize: 209715200,
                    EnableTryMaxProgress: 40,
                    TryInterval: 1800,
                    TryMaxProgress: 20,
                    TryMaxSize: 1073741824,
                    TryFailDispearDelay: 5,
                    TryFinishDispearDelay: 1800,
                    TryFinishClickDispearDelay: 180,
                    EnableSuperTryMinSize: 524288e3,
                    EnableSuperTryMaxProgress: 50,
                    SuperTryFinishDispearDelay: 5,
                    SceneChangeInterval: 10
                }, KuaiNiao: {KuaiNiaoPortalPort: 81, KuaiNiaoHeartBeatInterval: 300, KuaiNiaoHeartBeatLoseMaxCount: 2}
            }
        }

        getValue(e, t) {
            let n = void 0;
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let i = this.configData[e];
                if (!i) break;
                n = i[t]
            } while (0);
            return n
        }

        loadFile(e) {
            return i(this, void 0, void 0, function* () {
                let t = yield a.FileSystemAWNS.existsAW(e);
                if (t) {
                    t = !1;
                    let n = yield a.FileSystemAWNS.readFileAW(e);
                    if (n) {
                        let e = null;
                        try {
                            (e = JSON.parse(n.toString())) && (t = !0)
                        } catch (e) {
                            o.warning(e)
                        }
                        this.mergeConfigData(e)
                    }
                }
                return t
            })
        }

        printConfigData() {
            o.information("configData", this.configData)
        }

        mergeConfigData(e) {
            if (e) if (null === this.configData) this.configData = e; else for (let t in e) {
                let n = e[t];
                if (!n) break;
                for (let e in n) {
                    let i = n[e], a = this.configData[t];
                    if (a) a[e] = i; else {
                        let n = {};
                        n[e] = i, this.configData[t] = n
                    }
                }
            }
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(115), a = n(728), o = n(730), r = n(556), s = n(151), l = n(8), u = n(255), d = n(209), c = n(245),
        h = n(79), f = n(62), p = n(210), g = n(1).default.getLogger("Thunder.VipDownload.try-task"),
        k = s.DkHelperNS.getHelper(), m = r.TryTaskCacheNS.getCacheManager(), T = d.ConfigHelperNS.getHelper(),
        v = c.KuainiaoManagerNS.getManager(), y = h.UserHelperNS.getHelper();
    t.TryTask = class extends a.VipTaskBase {
        constructor() {
            super(...arguments), this.mTryTimer = null, this.mTryFinishTimer = null, this.mIsExit = !1, this.mIsFinish = !1, this.mRemainTime = void 0, this.mRemainSize = void 0, this.mStartSize = void 0, this.mTrySize = void 0
        }

        get vipTaskType() {
            return i.VipDownloadDefineNS.VipTaskType.Try
        }

        get tryType() {
            let e = i.VipDownloadDefineNS.TryType.PlatinumVip;
            return this.cache && (e = this.cache.type), e
        }

        get enableKuaiNiao() {
            return this.tryType === i.VipDownloadDefineNS.TryType.SuperVip
        }

        get error() {
            let e = null;
            return this.cache && (e = this.cache.error), e
        }

        get showSpeed() {
            let e = !1;
            switch (this.vipTaskStatus) {
                case i.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                    e = !0
            }
            return e
        }

        get acclerated() {
            return this.cache.acclerated
        }

        init() {
            this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Init
        }

        enter() {
            this.checkExitVip(), this.task.getTaskStatus() === l.DownloadKernel.TaskStatus.Started ? this.commit() : this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped, this.mTrySize = this.getTrySize(), g.information("mTrySize", this.mTrySize), this.mRemainSize = this.mTrySize, this.updateDetail(), this.kuaiNiaoAcclerate()
        }

        exit() {
            this.unAcclerate(), this.clear(), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Unkown
        }

        remove() {
            this.clear(), m.removeTask(this.taskId, !0)
        }

        setFinishClickDispearDelay() {
            if (this.tryType === i.VipDownloadDefineNS.TryType.PlatinumVip) {
                let e = T.getValue("VipDownload", "TryFinishClickDispearDelay");
                this.killTryFinishTimer(), this.createTryFinishTimer(e)
            }
        }

        onCidGcidRetrieved(e) {
        }

        onTaskStatusChanged(e) {
            g.information("onTaskStatusChanged", e);
            let t = this.vipTaskStatus;
            if (g.information("vipTaskStatus", t), t > i.VipDownloadDefineNS.VipTaskStatus.Init && t < i.VipDownloadDefineNS.VipTaskStatus.Finished) switch (e) {
                case l.DownloadKernel.TaskStatus.Started:
                    this.commit();
                    break;
                case l.DownloadKernel.TaskStatus.Stopped:
                    this.unAcclerate(), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.AcclerateStoped
            }
        }

        onTaskDcdnStatusChanged(e, t) {
            if (!this.cache) return;
            if (-1 !== e && e !== this.cache.subId) return;
            let n = this.task.getTaskStatus(), a = this.vipTaskStatus;
            if (!this.mIsExit && n === l.DownloadKernel.TaskStatus.Started && a >= i.VipDownloadDefineNS.VipTaskStatus.AcclerateWait && a < i.VipDownloadDefineNS.VipTaskStatus.Finished) {
                if (t === l.DownloadKernel.DcdnStatusCode.AuthorizingFailed && a === i.VipDownloadDefineNS.VipTaskStatus.Acclerating) return void this.commit();
                switch (t) {
                    case void 0:
                    case l.DownloadKernel.DcdnStatusCode.Unkown:
                        break;
                    case l.DownloadKernel.DcdnStatusCode.Success:
                        this.cache.acclerated = !0, this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Acclerating, this.createTryTimer();
                        break;
                    default:
                        if (this.vipTaskStatus !== i.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed) {
                            let e = this.createDcdnError(t);
                            this.cache && (this.cache.error = e), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed, this.failed()
                        }
                }
            }
        }

        onSubTaskStatusChanged(e, t) {
        }

        clear() {
            this.killTryTimer(), this.killTryFinishTimer(), this.mIsExit = !0, m.removeTaskId(this.taskId)
        }

        commit() {
            if (g.information("commit"), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Commiting, !this.cache) return;
            if (this.cache.trialVerify) return void this.queryToken();
            let e = this.task.getFile(this.cache.subId);
            if (!e) return;
            let t = {trialKey: this.cache.trialKey, file: e};
            (new o.TryTaskHttpSession).commit(t).then(e => {
                this.onCommitCallback(e)
            }).catch()
        }

        onCommitCallback(e) {
            if (g.information("onCommitCallback"), !this.mIsExit && e) if (m.setCommitData(this.taskId, e), 0 === e.result) this.task.getTaskStatus() === l.DownloadKernel.TaskStatus.Started && this.queryToken(); else {
                let t = e;
                t.errorStep = u.HttpDefineNS.ErrorStep.Commit, this.cache && (this.cache.error = t), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.CommitFailed, this.failed()
            }
        }

        queryToken() {
            if (g.information("queryToken"), !this.cache) return;
            let e = this.task.getTaskBase(), t = this.task.getFile(this.cache.subId);
            if (!e || !t) return;
            let n = void 0, i = void 0;
            if (e.taskType === l.DownloadKernel.TaskType.Bt) {
                let t = this.task.getTaskDetail();
                if (!t) return;
                n = e.taskName, i = t.infoId
            }
            let a = {verify: this.cache.trialVerify, file: t, taskType: e.taskType, btTitle: n, infohash: i};
            (new o.TryTaskHttpSession).queyToken(a).then(e => {
                this.onTokenCallback(e)
            }).catch()
        }

        onTokenCallback(e) {
            if (g.information("onTokenCallback"), !this.mIsExit && e) if (m.setTokenData(this.taskId, e), 0 === e.result) this.task.getTaskStatus() === l.DownloadKernel.TaskStatus.Started && this.acclerate(); else {
                let t = e;
                t.errorStep = u.HttpDefineNS.ErrorStep.Token, this.cache && (this.cache.error = t), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.CommitFailed, this.failed()
            }
        }

        acclerate() {
            this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.AcclerateWait, this.cache && (this.cache.active ? k.updateDcdnWithVipCert(this.taskId, this.cache.token) : (this.cache.active = !0, k.enableDcdnWithVipCert(this.taskId, this.cache.token)))
        }

        unAcclerate() {
            this.cache && (this.cache.active = !1);
            let e = this.vipTaskStatus;
            !this.mIsFinish && e >= i.VipDownloadDefineNS.VipTaskStatus.AcclerateWait && k.disableDcdnWithVipCert(this.taskId)
        }

        checkEnterVip() {
            if (this.tryType === i.VipDownloadDefineNS.TryType.SuperVip) {
                let e = this.task.getTaskStatus();
                y.isVip && e === l.DownloadKernel.TaskStatus.Started && this.task.getTaskExtra().enterAcclerate(i.VipDownloadDefineNS.VipTaskType.Vip)
            }
        }

        checkExitVip() {
            this.tryType === i.VipDownloadDefineNS.TryType.SuperVip && this.task.getTaskExtra().exitAcclerate(i.VipDownloadDefineNS.VipTaskType.Vip)
        }

        finish() {
            g.information("finish"), this.killTryTimer();
            let e = void 0;
            e = this.tryType === i.VipDownloadDefineNS.TryType.SuperVip ? T.getValue("VipDownload", "SuperTryFinishDispearDelay") : T.getValue("VipDownload", "TryFinishDispearDelay"), this.createTryFinishTimer(e), this.unAcclerate(), this.vipTaskStatus = i.VipDownloadDefineNS.VipTaskStatus.Finished, this.mIsFinish = !0, this.checkEnterVip()
        }

        failed() {
            g.information("failed"), this.createTryFailTimer(), this.unAcclerate(), this.mIsFinish = !0, this.checkEnterVip()
        }

        kuaiNiaoAcclerate() {
            this.enableKuaiNiao && v.triggerTry().catch()
        }

        get cache() {
            return m.getTask(this.taskId)
        }

        createTryTimer() {
            if (!this.mTryTimer) {
                if (g.information("createTryTimer"), !this.cache || void 0 === this.cache.maxTime) return void g.information("cache.maxTime not exist!");
                let e = this.task.getTaskBase();
                if (!e || void 0 === e.receiveSize) return void g.information("taskBase.receiveSize not exist!");
                this.mRemainTime = this.cache.maxTime, this.mStartSize = e.receiveSize, g.information("mStartSize", this.mStartSize), this.mTryTimer = setInterval(() => {
                    this.onTryTimer()
                }, 1e3)
            }
        }

        onTryTimer() {
            this.mRemainTime -= 1;
            let e = this.task.getTaskBase();
            if (e && e.receiveSize) {
                g.information("receiveSize", e.receiveSize);
                let t = e.receiveSize - this.mStartSize;
                this.mRemainSize = this.mTrySize - t
            }
            g.information("mRemainSize", this.mRemainSize), g.information("mRemainTime", this.mRemainTime), this.mRemainSize <= 0 && (this.mRemainSize = 0, this.mRemainTime = 0), this.updateDetail(), this.mRemainTime <= 0 && this.finish();
            let t = T.getValue("VipDownload", "TokenExpireAdvanceSecond"), n = f.PluginHelperNS.getHelper().currentTime;
            this.vipTaskStatus === i.VipDownloadDefineNS.VipTaskStatus.Acclerating && this.cache && this.cache.tokenExpire - t < n && this.commit()
        }

        killTryTimer() {
            this.mTryTimer && (g.information("killTryTimer"), clearInterval(this.mTryTimer), this.mTryTimer = void 0)
        }

        createTryFinishTimer(e) {
            this.mTryFinishTimer || (g.information("createTryFinishTimer"), this.mTryFinishTimer = setTimeout(() => {
                this.task.getTaskExtra().exitAcclerate(this.vipTaskType), this.killTryFinishTimer()
            }, 1e3 * e))
        }

        killTryFinishTimer() {
            this.mTryFinishTimer && (g.information("killTryFinishTimer"), clearTimeout(this.mTryFinishTimer), this.mTryFinishTimer = void 0)
        }

        createTryFailTimer() {
            let e = T.getValue("VipDownload", "TryFailDispearDelay");
            this.createTryFinishTimer(e)
        }

        getTrySize() {
            let e = 0, t = this.task.getTaskBase();
            if (!t || !t.fileSize) return e;
            if (!this.cache || void 0 === this.cache.subId) return e;
            const n = T.getValue("VipDownload", "TryMaxProgress"), i = T.getValue("VipDownload", "TryMaxSize");
            return e = Math.floor(t.fileSize * n / 100), e = Math.min(e, i)
        }

        updateDetail() {
            let e = this.mTrySize ? 1 - this.mRemainSize / this.mTrySize : 0,
                t = {remainSize: this.mRemainSize, progress: e};
            p.TaskEventContainerNS.getEventContainer().onEvent(p.TaskEventNS.taskTryDetailChanged, this.taskId, t)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(254), o = n(115), r = n(151), s = n(1).default.getLogger("Thunder.VipDownload.try-task"),
        l = r.DkHelperNS.getHelper();
    !function (e) {
        e.createQueryBuffer = function (e) {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3ecreateQueryBuffer");
                let t = {
                    peer_id: yield l.getTpPeerId(),
                    bt_title: e.btTitle,
                    url: e.file.url,
                    filename: e.file.fileName,
                    gcid: e.file.gcid,
                    cid: e.file.cid,
                    filesize: e.file.fileSize
                }, n = a.HttpJsonCryptoNS.getKey(e.userId, e.random), i = a.HttpJsonCryptoNS.encryptHttpBuffer(t, n);
                return s.information("<--createQueryBuffer"), i
            })
        }, e.praseQueryBuffer = function (e, t, n) {
            s.information("--\x3epraseQueryBuffer");
            let i = a.HttpJsonCryptoNS.getKey(e, t), r = a.HttpJsonCryptoNS.decryptHttpBuffer(n, i);
            if (!r) return null;
            let l = void 0;
            l = 1 === r.speed_type ? o.VipDownloadDefineNS.TryType.SuperVip : o.VipDownloadDefineNS.TryType.PlatinumVip;
            let u = {
                result: r.result,
                message: r.message,
                trialKey: r.trial_key,
                expireTime: r.trial_refresh_time,
                leftCount: r.trial_left_times,
                type: l
            };
            return s.information("<--praseQueryBuffer"), u
        }, e.createCommitBuffer = function (e) {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3ecreateCommitBuffer");
                let t = {
                    peer_id: yield l.getTpPeerId(),
                    url: e.file.url,
                    filename: e.file.fileName,
                    gcid: e.file.gcid,
                    cid: e.file.cid,
                    filesize: e.file.fileSize,
                    trial_key: e.trialKey
                }, n = a.HttpJsonCryptoNS.getKey(e.userId, e.random), i = a.HttpJsonCryptoNS.encryptHttpBuffer(t, n);
                return s.information("<--createCommitBuffer"), i
            })
        }, e.praseCommitBuffer = function (e, t, n) {
            s.information("--\x3epraseCommitBuffer");
            let i = a.HttpJsonCryptoNS.getKey(e, t), o = a.HttpJsonCryptoNS.decryptHttpBuffer(n, i);
            if (!o) return null;
            let r = {result: o.result, message: o.message, verify: o.trial_verify_info};
            return s.information("<--praseCommitBuffer"), r
        }, e.createTokenBuffer = function (e) {
            return i(this, void 0, void 0, function* () {
                s.information("--\x3ecreateTokenBuffer");
                let t = {
                        url: e.file.url,
                        filename: e.file.fileName,
                        gcid: e.file.gcid,
                        cid: e.file.cid,
                        filesize: e.file.fileSize,
                        refer_url: e.file.refUrl,
                        cookies: "",
                        file_index: 2 === e.taskType ? e.file.subId : void 0
                    }, n = {peer_id: yield l.getTpPeerId(), infohash: e.infohash, bt_title: e.btTitle, task_infos: [t]},
                    i = a.HttpJsonCryptoNS.getKey(e.userId, e.random), o = a.HttpJsonCryptoNS.encryptHttpBuffer(n, i);
                return s.information("<--createTokenBuffer"), o
            })
        }, e.praseTokenBuffer = function (e, t, n) {
            s.information("--\x3epraseTokenBuffer");
            let i = a.HttpJsonCryptoNS.getKey(e, t), o = a.HttpJsonCryptoNS.decryptHttpBuffer(n, i);
            if (!o) return null;
            if (0 !== o.result) return {result: o.result, message: o.message};
            let r = o.task_infos;
            if (!r) return null;
            let l = r[0];
            if (!l) return null;
            let u = {
                result: l.result,
                message: l.simple_msg,
                detailMessage: l.message,
                gcid: l.gcid,
                token: l.token,
                expire: l.expire,
                maxTime: o.speed_duration
            };
            return s.information("<--praseTokenBuffer"), u
        }
    }(t.TryTaskHttpPackageNS || (t.TryTaskHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    t.TaskCache = class {
        constructor() {
            this.mSelectId = void 0, this.mTrialKey = void 0, this.mTrialVerify = void 0, this.mExpireTime = void 0, this.mCreateTime = void 0, this.mToken = void 0, this.mTokenExpire = void 0, this.mMaxTime = void 0, this.mActive = !1, this.mError = null, this.mCommited = !1, this.mAcclerated = !1
        }

        get subId() {
            return this.mSelectId
        }

        set subId(e) {
            this.mSelectId = e
        }

        set type(e) {
            this.mType = e
        }

        get type() {
            return this.mType
        }

        set trialKey(e) {
            this.mTrialKey = e
        }

        get trialKey() {
            return this.mTrialKey
        }

        set expireTime(e) {
            this.mExpireTime = e
        }

        get expireTime() {
            return this.mExpireTime
        }

        set createTime(e) {
            this.mCreateTime = e
        }

        get createTime() {
            return this.mCreateTime
        }

        set trialVerify(e) {
            this.mTrialVerify = e
        }

        get trialVerify() {
            return this.mTrialVerify
        }

        set token(e) {
            this.mToken = e
        }

        get token() {
            return this.mToken
        }

        set tokenExpire(e) {
            this.mTokenExpire = e
        }

        get tokenExpire() {
            return this.mTokenExpire
        }

        set maxTime(e) {
            this.mMaxTime = e
        }

        get maxTime() {
            return this.mMaxTime
        }

        set commited(e) {
            this.mCommited = e
        }

        get commited() {
            return this.mCommited
        }

        set active(e) {
            this.mActive = e
        }

        get active() {
            return this.mActive
        }

        set acclerated(e) {
            this.mAcclerated = e
        }

        get acclerated() {
            return this.mAcclerated
        }

        set error(e) {
            e && (this.mError = e)
        }

        get error() {
            return this.mError
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(104), o = n(796), r = n(79), s = n(62), l = n(209), u = n(1).default.getLogger("Thunder.KuaiNiao"),
        d = s.PluginHelperNS.getHelper(), c = r.UserHelperNS.getHelper(), h = l.ConfigHelperNS.getHelper();

    class f extends a.HttpSession {
        queryPortal() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => i(this, void 0, void 0, function* () {
                    this.host = "api.portal.swjsq.vip.xunlei.com", this.retries = 1, this.port = h.getValue("KuaiNiao", "KuaiNiaoPortalPort"), this.path = "/v2/queryportal", this.timeout = 1e4;
                    let t = yield this.getPortalRequest();
                    t || (this.host = "api2.portal.swjsq.vip.xunlei.com", this.retries = 0, t = yield this.getPortalRequest()), e(t)
                }))
            })
        }

        queryBand(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.ip, this.port = Number(e.port).valueOf();
                    let a = yield c.getPeerId(), o = c.userId;
                    this.path = `/v2/bandwidth?sequence=${n}&peerid=${a}&userid=${o}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 15e3;
                    let r = void 0, s = yield this.getBandRequest();
                    if (s) switch (s.result) {
                        case 0:
                        case 520:
                            break;
                        case 711:
                            r = 1e4;
                            break;
                        default:
                            r = 3e3
                    } else r = 3e3;
                    r ? setTimeout(() => i(this, void 0, void 0, function* () {
                        s = yield this.getBandRequest(), t(s)
                    }), r) : t(s)
                }))
            })
        }

        speedUp(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.host.ip, this.port = Number(e.host.port).valueOf();
                    let a = yield c.getPeerId(), o = e.userId, r = e.sessionId;
                    this.path = `/v2/upgrade?sequence=${n}&peerid=${a}&userid=${o}&sessionid=${r}&user_type=${e.speedType}&dial_account=${e.dialAccount}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 15e3;
                    let s = void 0, l = yield this.getSpeedUpRequest();
                    if (l) switch (l.result) {
                        case 711:
                            s = 1e4
                    } else s = 3e3;
                    s ? setTimeout(() => i(this, void 0, void 0, function* () {
                        l = yield this.getSpeedUpRequest(), t(l)
                    }), s) : t(l)
                }))
            })
        }

        speedDown(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.host.ip, this.port = Number(e.host.port).valueOf();
                    let i = yield c.getPeerId(), a = e.userId, o = e.sessionId;
                    this.path = `/v2/recover?sequence=${n}&peerid=${i}&userid=${a}&sessionid=${o}&user_type=${e.speedType}&dial_account=${e.dialAccount}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 1e4;
                    let r = !0, s = yield this.getSpeedDownRequest();
                    if (s) switch (s.result) {
                        case 0:
                        case 520:
                        case 513:
                        case 518:
                        case 700:
                            r = !1
                    }
                    r && (s = yield this.getSpeedDownRequest()), t(s)
                }))
            })
        }

        heartBeat(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.host.ip, this.port = Number(e.host.port).valueOf();
                    let i = yield c.getPeerId(), a = c.userId, o = yield c.getSessionId();
                    this.path = `/v2/keepalive?sequence=${n}&peerid=${i}&userid=${a}&sessionid=${o}&dial_account=${e.dialAccount}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 1e4;
                    let r = yield this.getHeartBeatRequest();
                    t(r)
                }))
            })
        }

        queryTry(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => i(this, void 0, void 0, function* () {
                    let n = ++f.sequence;
                    this.host = e.host.ip, this.port = Number(e.host.port).valueOf();
                    let a = yield c.getPeerId(), o = c.userId, r = yield c.getSessionId();
                    this.path = `/v2/query_try_info?sequence=${n}&peerid=${a}&userid=${o}&sessionid=${r}&upspeed=0&dial_account=${e.dialAccount}&client_type=${this.clientType}&client_version=${this.clientVersion}&os=${this.osVersion}`, this.retries = 0, this.timeout = 1e4;
                    let s = void 0, l = yield this.getTryRequest();
                    if (l) switch (l.result) {
                        case 0:
                        case 508:
                        case 520:
                        case 715:
                        case 717:
                        case 718:
                            break;
                        default:
                            s = 3e3
                    } else s = 3e3;
                    s ? setTimeout(() => i(this, void 0, void 0, function* () {
                        l = yield this.getTryRequest(), t(l)
                    }), s) : t(l)
                }))
            })
        }

        getPortalRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.prasePortalBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getBandRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseBandBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getSpeedUpRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseSpeedUpBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getSpeedDownRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseSpeedDownBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getHeartBeatRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseHeartBeatBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        getTryRequest() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.KuainiaoHttpPackageNS.praseTryBuffer(t.body)), e(n)
                    }, t => {
                        u.information("error", t), e(null)
                    })
                })
            })
        }

        get clientType() {
            return "pc-xlxknplugin-" + d.thunderVersionString
        }

        get clientVersion() {
            return "xlxkn-" + d.thunderVersionString
        }

        get osVersion() {
            return "1.0"
        }
    }

    f.sequence = 0, t.KuainiaoHttpSession = f
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1).default.getLogger("Thunder.KuaiNiao");
    !function (e) {
        e.prasePortalBuffer = function (e) {
            i.information("--\x3eprasePortalBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                province: n.province,
                provinceName: n.province_name,
                sp: n.sp,
                spName: n.sp_name,
                serverIp: n.interface_ip,
                serverPort: n.interface_port
            };
            return i.information("<--prasePortalBuffer"), a
        }, e.praseBandBuffer = function (e) {
            i.information("--\x3epraseBandBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                province: n.province,
                provinceName: n.province_name,
                sp: n.sp,
                spName: n.sp_name,
                canUpgrade: n.can_upgrade,
                dialAccount: n.dial_account,
                bandWidth: n.bandwidth,
                maxBandWidth: n.max_bandwidth
            };
            return i.information("<--praseBandBuffer"), a
        }, e.praseSpeedUpBuffer = function (e) {
            i.information("--\x3epraseSpeedUpBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                province: n.province,
                provinceName: n.province_name,
                sp: n.sp,
                spName: n.sp_name,
                dialAccount: n.dial_account,
                bandWidth: n.bandwidth,
                timeStamp: n.timestamp
            };
            return i.information("<--praseSpeedUpBuffer"), a
        }, e.praseSpeedDownBuffer = function (e) {
            i.information("--\x3epraseSpeedDownBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                province: n.province,
                provinceName: n.province_name,
                sp: n.sp,
                spName: n.sp_name,
                dialAccount: n.dial_account,
                bandWidth: n.bandwidth,
                timeStamp: n.timestamp
            };
            return i.information("<--praseSpeedDownBuffer"), a
        }, e.praseHeartBeatBuffer = function (e) {
            i.information("--\x3epraseHeartBeatBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                timeStamp: n.timestamp,
                userId: n.userid,
                peerId: n.peerid,
                clientType: n.client_type,
                hasSpeedTime: n.has_speedup_time
            };
            return i.information("<--praseHeartBeatBuffer"), a
        }, e.praseTryBuffer = function (e) {
            i.information("--\x3epraseTryBuffer");
            let t = e.toString();
            i.information("jsonStr", t);
            let n = null;
            try {
                n = JSON.parse(t)
            } catch (e) {
                i.warning(e)
            }
            if (!n) return null;
            let a = {
                result: n.errno,
                message: n.message,
                timeStamp: n.timestamp,
                leftCount: n.number_of_try,
                duration: n.try_duration
            };
            return i.information("<--praseTryBuffer"), a
        }
    }(t.KuainiaoHttpPackageNS || (t.KuainiaoHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(62), a = n(1).default.getLogger("Thunder.VipDownload.ui-helper"), o = i.PluginHelperNS.getHelper();

    class r {
        init() {
        }

        showLoginDialog() {
        }

        openTab(e) {
            o.nativeCall && o.nativeCall.CallNativeFunction("openNewTab", e, e => {
                a.information("errorCode", e)
            })
        }
    }

    t.UIHelper = r, function (e) {
        const t = new r;
        e.getHelper = function () {
            return t
        }
    }(t.UIHelperNS || (t.UIHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(799), o = n(79), r = n(151), s = n(801), l = n(209), u = n(62), d = n(60),
        c = n(1).default.getLogger("Thunder.VipDownload.task-scene"), h = r.DkHelperNS.getHelper(),
        f = l.ConfigHelperNS.getHelper();
    var p;
    !function (e) {
        e.taskSceneChanged = "OnTaskSceneChanged"
    }(p = t.SceneEventNS || (t.SceneEventNS = {}));

    class g extends d.default {
        constructor() {
            super(), this.mSelectTaskId = void 0, this.mRefreshTime = void 0, this.mSession = null, this.mCacheManager = null, this.mSession = new a.SceneHttpSession, this.mCacheManager = s.SceneCacheNS.getCacheManager(), this.setMaxListeners(0)
        }

        init() {
            o.UserHelperNS.getHelper().attachListener(o.UserEventNS.authorityChanged, e => {
                c.information("authority", e), this.clear(), this.mSelectTaskId && this.activeTask(this.mSelectTaskId)
            }), setInterval(() => {
                this.refresh()
            }, 5e3), this.attachDkEvents()
        }

        getScene(e) {
            let t = this.mCacheManager.getTask(e);
            return t ? t.getItem() : null
        }

        onTaskExpand(e) {
            this.mSelectTaskId !== e && (this.mSelectTaskId = e, this.activeTask(e))
        }

        onTaskUnExpand(e) {
            this.mSelectTaskId === e && (this.mSelectTaskId = void 0, this.mRefreshTime = void 0)
        }

        onClickScene(e) {
            this.changeToNextScene(e)
        }

        attachDkEvents() {
            h.attachListener(r.DkEventNS.taskCompleted, e => {
                this.onTaskCompleted(e)
            }), h.attachListener(r.DkEventNS.taskRemoved, e => {
                this.onTaskRemoved(e)
            })
        }

        clear() {
            this.mSession.clear(), this.mCacheManager.clear()
        }

        refresh() {
            let e = f.getValue("VipDownload", "SceneChangeInterval"), t = this.mSelectTaskId, n = this.mRefreshTime,
                i = u.PluginHelperNS.getHelper().currentTime;
            t && n && i - n >= e && this.changeToNextScene(t)
        }

        activeTask(e) {
            this.mCacheManager.getTask(e) ? this.changeToNextScene(e) : this.mSession.queryTask(e, t => i(this, void 0, void 0, function* () {
                t && (yield this.mCacheManager.createTask(e, t), this.changeToNextScene(e))
            }))
        }

        changeToNextScene(e) {
            if (this.mSelectTaskId === e) {
                c.information("changeToNextScene", e);
                let t = this.mCacheManager.getTask(e);
                if (t) {
                    let n = t.getItem();
                    n && (this.fireEvent(p.taskSceneChanged, e, n), c.information("item.text", n.text)), t.next()
                }
                this.mRefreshTime = u.PluginHelperNS.getHelper().currentTime
            }
        }

        onTaskRemoved(e) {
            this.removeTask(e)
        }

        onTaskCompleted(e) {
            this.removeTask(e)
        }

        removeTask(e) {
            this.mCacheManager.deleteTask(e), this.mSession.removeTask(e), this.mSelectTaskId === e && (this.mSelectTaskId = void 0, this.mRefreshTime = void 0)
        }
    }

    t.SceneManager = g, function (e) {
        const t = new g;
        e.getSceneManager = function () {
            return t
        }
    }(t.TaskSceneManagerNS || (t.TaskSceneManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(104), o = n(800), r = n(79), s = n(1).default.getLogger("Thunder.VipDownload.task-scene");
    t.SceneHttpSession = class extends a.HttpSession {
        constructor() {
            super(), this.mMapDoneTaskids = new Map, this.mListWaitTasks = [], this.mIsQuerying = !1
        }

        clear() {
            this.mMapDoneTaskids.clear(), this.mListWaitTasks = []
        }

        removeTask(e) {
            this.mMapDoneTaskids.delete(e)
        }

        queryTask(e, t) {
            this.mMapDoneTaskids.get(e) ? s.information("taskId already query!") : (this.mMapDoneTaskids.set(e, e), this.mListWaitTasks.push({
                taskId: e,
                callback: t
            }), this.queryNext().catch())
        }

        queryNext() {
            return i(this, void 0, void 0, function* () {
                if (!this.mIsQuerying && this.mListWaitTasks.length > 0) {
                    let e = this.mListWaitTasks[0], t = e.taskId, n = e.callback;
                    this.mListWaitTasks.splice(0, 1);
                    let i = -1, a = {peerId: yield r.UserHelperNS.getHelper().getPeerId(), taskId: t, subId: i};
                    this.mIsQuerying = !0, n(yield this.query(a)), this.mIsQuerying = !1, this.queryNext().catch()
                }
            })
        }

        query(e) {
            return i(this, void 0, void 0, function* () {
                return new Promise(t => {
                    this.host = "scene.vip.xunlei.com", this.port = 8e3, this.retries = 1, this.timeout = 15e3, this.body = o.SceneHttpPackageNS.createSceneBuffer(e), this.post(e => {
                        let n = null;
                        200 === e.statusCode && e.body && e.body.length > 12 && (n = o.SceneHttpPackageNS.praseSceneBuffer(e.body)), t(n)
                    }, e => {
                        s.information("error", e), t(null)
                    })
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(206), a = n(207), o = n(62), r = n(79), s = n(1).default.getLogger("Thunder.VipDownload.task-scene");
    !function (e) {
        let t = 0;

        class n {
        }

        e.ItemData = n, e.createSceneBuffer = function (e) {
            s.information("--\x3ecreateSceneBuffer");
            let n = 0, l = Buffer.alloc(1024);
            n = l.writeUInt32LE(11, n), s.information("    protocolVersion:", 11), n = l.writeUInt32LE(++t, n), s.information("    sequence:", t), n = l.writeUInt32LE(0, n), s.information("    commandLegth:", 0);
            let u = o.PluginHelperNS.getHelper().thunderVersionNumber;
            n = l.writeUInt32LE(u, n), s.information("    thunderFlag:", u), n = l.writeUInt16LE(256, n), s.information("    compressFlag:", 256), n = l.writeUInt16LE(1, n), s.information("    commandType:", 1);
            let d = r.UserHelperNS.getHelper(), c = Number(d.userId).valueOf();
            n = a.BufferUtilitiesNS.writeUInt64LE(l, c, n), s.information("    userId:", c);
            let h = d.vipLevel;
            n = l.writeInt8(h, n), s.information("    vipLevel:", h);
            let f = d.userLevel;
            n = l.writeUInt32LE(f, n), s.information("    userLevel:", f);
            let p = e.peerId;
            return n = a.BufferUtilitiesNS.writeString(l, p, n, "gbk"), s.information("    peerId:", p), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    taskUrl:", ""), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    referUrl:", ""), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    gcid:", ""), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    cid:", ""), n = a.BufferUtilitiesNS.writeUInt64LE(l, 0, n), s.information("    fileSize:", 0), n = a.BufferUtilitiesNS.writeString(l, "", n, "gbk"), s.information("    taskName:", ""), n = l.writeUInt32LE(0, n), s.information("    netStatus:", 0), n = a.BufferUtilitiesNS.writeUInt64LE(l, 0, n), s.information("    taskSpeed:", 0), n = a.BufferUtilitiesNS.writeUInt64LE(l, 0, n), s.information("    totalSpeed:", 0), n = a.BufferUtilitiesNS.writeUInt64LE(l, 0, n), s.information("    speedLimit:", 0), n = l.writeUInt32LE(0, n), s.information("    downloadingCount:", 0), n = l.writeUInt32LE(0, n), s.information("    resourceCount:", 0), n = l.writeUInt32LE(0, n), s.information("    downloadMode:", 0), n = l.writeUInt32LE(2, n), s.information("    queryType:", 2), n = l.writeUInt32LE(0, n), s.information("    ipProvince:", 0), n = l.writeUInt32LE(0, n), s.information("    ipCity:", 0), n = l.writeUInt32LE(0, n), s.information("    ipIsp:", 0), n = l.writeUInt32LE(0, n), s.information("    privilege:", 0), n = l.writeUInt32LE(0, n), s.information("    subNum:", 0), l = l.slice(0, n), l = i.ShubCryptoNS.encryptHttpBuffer(l), s.information("<--createSceneBuffer"), l
        }, e.praseSceneBuffer = function (e) {
            s.information("--\x3epraseSceneBuffer");
            let t = null;
            try {
                e = i.ShubCryptoNS.decryptHttpBuffer(e);
                let o = 0, r = e.readUInt32LE(o);
                s.information("    protocolVersion:", r), o += 4;
                let l = e.readUInt32LE(o);
                s.information("    sequence:", l), o += 4;
                let u = e.readUInt32LE(o);
                s.information("    commandLegth:", u), o += 4;
                let d = e.readUInt32LE(o);
                s.information("    thunderVersion:", d), o += 4;
                let c = e.readUInt16LE(o);
                s.information("    compressFlag:", c), o += 2;
                let h = e.readUInt16LE(o);
                s.information("    commandType:", h), o += 2;
                let f = e.readUInt32LE(o);
                s.information("    result:", f), o += 4;
                let p = a.BufferUtilitiesNS.readString(e, o, "gbk"), g = p[1];
                s.information("    key:", g), o = p[0];
                let k = e.readUInt32LE(o);
                s.information("    queryAgain:", k), o += 4;
                let m = e.readUInt32LE(o);
                s.information("    tryListNum:", m), o += 4;
                for (let t = 0; t < m; t++) {
                    s.information("");
                    let n = e.readUInt32LE(o);
                    s.information("      index", t, "size:", n), o += 4, o += n
                }
                let T = [], v = e.readUInt32LE(o);
                s.information("    sceneListNum:", v), o += 4;
                for (let t = 0; t < v; t++) {
                    s.information("");
                    let i = e.readUInt32LE(o);
                    s.information("      index", t, "size:", i), o += 4;
                    let r = new n, l = o;
                    r.id = e.readUInt32LE(l), s.information("      id:", r.id), l += 4, r.type = e.readUInt32LE(l), s.information("      type:", r.type), l += 4;
                    let u = a.BufferUtilitiesNS.readString(e, l, "gbk");
                    r.name = u[1], s.information("      name:", r.name), l = u[0], r.status = e.readInt32LE(l), s.information("      status:", r.status), l += 4;
                    let d = e.readUInt32LE(l);
                    s.information("      scoped:", d), l += 4, r.priority = e.readUInt32LE(l), s.information("      priority:", r.priority), l += 4;
                    let c = (u = a.BufferUtilitiesNS.readString(e, l, "gbk"))[1];
                    s.information("      clickStr:", c), l = u[0], u = a.BufferUtilitiesNS.readString(e, l, "gbk"), r.lineStr = u[1], s.information("      lineStr:", r.lineStr), l = u[0];
                    let h = (u = a.BufferUtilitiesNS.readString(e, l, "gbk"))[1];
                    s.information("      tipsStr:", h), l = u[0];
                    let f = e.readUInt32LE(l);
                    s.information("      indate:", f), l += 4;
                    let p = (u = a.BufferUtilitiesNS.readString(e, l, "gbk"))[1];
                    s.information("      matchStr:", p), l = u[0];
                    let g = (u = a.BufferUtilitiesNS.readString(e, l, "gbk"))[1];
                    s.information("      showStr:", g), l = u[0], T.push(r), o += i
                }
                t = {itemDatas: T}
            } catch (e) {
                s.error("praseSceneBuffer", e)
            }
            return s.information("<--praseSceneBuffer"), t
        }
    }(t.SceneHttpPackageNS || (t.SceneHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(802);

    class o {
        constructor() {
            this.mTasks = new Map
        }

        createTask(e, t) {
            return i(this, void 0, void 0, function* () {
                let n = this.getTask(e);
                return n || (yield(n = new a.TaskCache).setData(t), this.mTasks.set(e, n)), n
            })
        }

        deleteTask(e) {
            this.mTasks.delete(e)
        }

        getTask(e) {
            return this.mTasks.get(e)
        }

        clear() {
            this.mTasks.clear()
        }
    }

    t.SceneCacheManager = o, function (e) {
        const t = new o;
        e.getCacheManager = function () {
            return t
        }
    }(t.SceneCacheNS || (t.SceneCacheNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(731), o = n(7).promisify, r = n(1).default.getLogger("Thunder.VipDownload.task-scene");
    t.TaskCache = class {
        constructor() {
            this.mItems = [], this.mCursor = 0
        }

        next() {
            this.mCursor += 1
        }

        getItem() {
            let e = this.mItems.length;
            if (e > 0) {
                let t = this.mCursor % e;
                return this.mItems[t]
            }
            return null
        }

        setData(e) {
            return i(this, void 0, void 0, function* () {
                let t = yield this.parseData(e);
                this.mItems = t
            })
        }

        parseData(e) {
            return i(this, void 0, void 0, function* () {
                let t = [];
                for (let n of e.itemDatas) if (-1 === n.status) {
                    let e = {explicitArray: !1}, i = yield o(a.parseString)(n.lineStr, e);
                    if (!i || !i.scene || !i.scene.element) {
                        r.information("scene elements is null");
                        continue
                    }
                    let s = null, l = i.scene.element;
                    if (l instanceof Array ? s = l : l instanceof Object && (s = [l]), !s) {
                        r.information("scene elements is null");
                        continue
                    }
                    let u = {id: n.id, priority: n.priority}, d = void 0, c = void 0;
                    for (let e of s) e.text && "" !== e.text && (d = e.text, e.code && "" !== e.code && (c = this.parseUrl(e.code)));
                    d && "" !== d && (u.text = d, u.textlink = c, t.push(u))
                }
                return t
            })
        }

        parseUrl(e) {
            let t = void 0, n = e.indexOf('GenerateJumpKey("');
            if (n < 0 || n >= e.length) return t;
            n += 17;
            let i = e.indexOf('")', n);
            return i <= n || i >= e.length ? t : t = e.substring(n, i)
        }
    }
}, function (e, t, n) {
    (function () {
        "use strict";
        var e, i, a, o, r, s = {}.hasOwnProperty;
        e = n(804), i = n(559).defaults, o = function (e) {
            return "string" == typeof e && (e.indexOf("&") >= 0 || e.indexOf(">") >= 0 || e.indexOf("<") >= 0)
        }, r = function (e) {
            return "<![CDATA[" + a(e) + "]]>"
        }, a = function (e) {
            return e.replace("]]>", "]]]]><![CDATA[>")
        }, t.Builder = function () {
            function t(e) {
                var t, n, a;
                for (t in this.options = {}, n = i[.2]) s.call(n, t) && (a = n[t], this.options[t] = a);
                for (t in e) s.call(e, t) && (a = e[t], this.options[t] = a)
            }

            return t.prototype.buildObject = function (t) {
                var n, a, l, u, d, c;
                return n = this.options.attrkey, a = this.options.charkey, 1 === Object.keys(t).length && this.options.rootName === i[.2].rootName ? t = t[d = Object.keys(t)[0]] : d = this.options.rootName, c = this, l = function (e, t) {
                    var i, u, d, h, f, p;
                    if ("object" != typeof t) c.options.cdata && o(t) ? e.raw(r(t)) : e.txt(t); else if (Array.isArray(t)) {
                        for (h in t) if (s.call(t, h)) for (f in u = t[h]) d = u[f], e = l(e.ele(f), d).up()
                    } else for (f in t) if (s.call(t, f)) if (u = t[f], f === n) {
                        if ("object" == typeof u) for (i in u) p = u[i], e = e.att(i, p)
                    } else if (f === a) e = c.options.cdata && o(u) ? e.raw(r(u)) : e.txt(u); else if (Array.isArray(u)) for (h in u) s.call(u, h) && (e = "string" == typeof(d = u[h]) ? c.options.cdata && o(d) ? e.ele(f).raw(r(d)).up() : e.ele(f, d).up() : l(e.ele(f), d).up()); else "object" == typeof u ? e = l(e.ele(f), u).up() : "string" == typeof u && c.options.cdata && o(u) ? e = e.ele(f).raw(r(u)).up() : (null == u && (u = ""), e = e.ele(f, u.toString()).up());
                    return e
                }, u = e.create(d, this.options.xmldec, this.options.doctype, {
                    headless: this.options.headless,
                    allowSurrogateChars: this.options.allowSurrogateChars
                }), l(u, t).end(this.options.renderOpts)
            }, t
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l;
        l = n(202), r = l.assign, s = l.isFunction, t = n(805), i = n(806), o = n(560), a = n(807), e.exports.create = function (e, n, i, a) {
            var o, s;
            if (null == e) throw new Error("Root element needs a name");
            return a = r({}, n, i, a), s = (o = new t(a)).element(e), a.headless || (o.declaration(a), null == a.pubID && null == a.sysID || o.doctype(a)), s
        }, e.exports.begin = function (e, n, a) {
            var o;
            return s(e) && (n = (o = [e, n])[0], a = o[1], e = {}), n ? new i(e, n, a) : new t(e)
        }, e.exports.stringWriter = function (e) {
            return new o(e)
        }, e.exports.streamWriter = function (e, t) {
            return new a(e, t)
        }
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r = {}.hasOwnProperty;
        o = n(202).isPlainObject, t = n(106), a = n(733), i = n(560), e.exports = function (e) {
            function n(e) {
                n.__super__.constructor.call(this, null), e || (e = {}), e.writer || (e.writer = new i), this.options = e, this.stringify = new a(e), this.isDocument = !0
            }

            return function (e, t) {
                for (var n in t) r.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, t), n.prototype.end = function (e) {
                var t;
                return e ? o(e) && (t = e, e = this.options.writer.set(t)) : e = this.options.writer, e.document(this)
            }, n.prototype.toString = function (e) {
                return this.options.writer.set(e).document(this)
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l, u, d, c, h, f, p, g, k, m, T, v, y, S = {}.hasOwnProperty;
        y = n(202), T = y.isObject, m = y.isFunction, v = y.isPlainObject, c = n(282), i = n(283), a = n(284), f = n(291), k = n(292), h = n(293), u = n(285), d = n(286), o = n(287), s = n(288), r = n(289), l = n(290), t = n(732), g = n(733), p = n(560), e.exports = function () {
            function e(e, t, n) {
                var i;
                e || (e = {}), e.writer ? v(e.writer) && (i = e.writer, e.writer = new p(i)) : e.writer = new p(e), this.options = e, this.writer = e.writer, this.stringify = new g(e), this.onDataCallback = t || function () {
                }, this.onEndCallback = n || function () {
                }, this.currentNode = null, this.currentLevel = -1, this.openTags = {}, this.documentStarted = !1, this.documentCompleted = !1, this.root = null
            }

            return e.prototype.node = function (e, t, n) {
                var i;
                if (null == e) throw new Error("Missing node name");
                if (this.root && -1 === this.currentLevel) throw new Error("Document can only have one root node");
                return this.openCurrent(), e = e.valueOf(), null == t && (t = {}), t = t.valueOf(), T(t) || (n = (i = [t, n])[0], t = i[1]), this.currentNode = new c(this, e, t), this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, null != n && this.text(n), this
            }, e.prototype.element = function (e, t, n) {
                return this.currentNode && this.currentNode instanceof d ? this.dtdElement.apply(this, arguments) : this.node(e, t, n)
            }, e.prototype.attribute = function (e, n) {
                var i, a;
                if (!this.currentNode || this.currentNode.children) throw new Error("att() can only be used immediately after an ele() call in callback mode");
                if (null != e && (e = e.valueOf()), T(e)) for (i in e) S.call(e, i) && (a = e[i], this.attribute(i, a)); else m(n) && (n = n.apply()), this.options.skipNullAttributes && null == n || (this.currentNode.attributes[e] = new t(this, e, n));
                return this
            }, e.prototype.text = function (e) {
                var t;
                return this.openCurrent(), t = new k(this, e), this.onData(this.writer.text(t, this.currentLevel + 1)), this
            }, e.prototype.cdata = function (e) {
                var t;
                return this.openCurrent(), t = new i(this, e), this.onData(this.writer.cdata(t, this.currentLevel + 1)), this
            }, e.prototype.comment = function (e) {
                var t;
                return this.openCurrent(), t = new a(this, e), this.onData(this.writer.comment(t, this.currentLevel + 1)), this
            }, e.prototype.raw = function (e) {
                var t;
                return this.openCurrent(), t = new f(this, e), this.onData(this.writer.raw(t, this.currentLevel + 1)), this
            }, e.prototype.instruction = function (e, t) {
                var n, i, a, o, r;
                if (this.openCurrent(), null != e && (e = e.valueOf()), null != t && (t = t.valueOf()), Array.isArray(e)) for (n = 0, o = e.length; n < o; n++) i = e[n], this.instruction(i); else if (T(e)) for (i in e) S.call(e, i) && (a = e[i], this.instruction(i, a)); else m(t) && (t = t.apply()), r = new h(this, e, t), this.onData(this.writer.processingInstruction(r, this.currentLevel + 1));
                return this
            }, e.prototype.declaration = function (e, t, n) {
                var i;
                if (this.openCurrent(), this.documentStarted) throw new Error("declaration() must be the first node");
                return i = new u(this, e, t, n), this.onData(this.writer.declaration(i, this.currentLevel + 1)), this
            }, e.prototype.doctype = function (e, t, n) {
                if (this.openCurrent(), null == e) throw new Error("Missing root node name");
                if (this.root) throw new Error("dtd() must come before the root node");
                return this.currentNode = new d(this, t, n), this.currentNode.rootNodeName = e, this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, this
            }, e.prototype.dtdElement = function (e, t) {
                var n;
                return this.openCurrent(), n = new r(this, e, t), this.onData(this.writer.dtdElement(n, this.currentLevel + 1)), this
            }, e.prototype.attList = function (e, t, n, i, a) {
                var r;
                return this.openCurrent(), r = new o(this, e, t, n, i, a), this.onData(this.writer.dtdAttList(r, this.currentLevel + 1)), this
            }, e.prototype.entity = function (e, t) {
                var n;
                return this.openCurrent(), n = new s(this, !1, e, t), this.onData(this.writer.dtdEntity(n, this.currentLevel + 1)), this
            }, e.prototype.pEntity = function (e, t) {
                var n;
                return this.openCurrent(), n = new s(this, !0, e, t), this.onData(this.writer.dtdEntity(n, this.currentLevel + 1)), this
            }, e.prototype.notation = function (e, t) {
                var n;
                return this.openCurrent(), n = new l(this, e, t), this.onData(this.writer.dtdNotation(n, this.currentLevel + 1)), this
            }, e.prototype.up = function () {
                if (this.currentLevel < 0) throw new Error("The document node has no parent");
                return this.currentNode ? (this.currentNode.children ? this.closeNode(this.currentNode) : this.openNode(this.currentNode), this.currentNode = null) : this.closeNode(this.openTags[this.currentLevel]), delete this.openTags[this.currentLevel], this.currentLevel--, this
            }, e.prototype.end = function () {
                for (; this.currentLevel >= 0;) this.up();
                return this.onEnd()
            }, e.prototype.openCurrent = function () {
                if (this.currentNode) return this.currentNode.children = !0, this.openNode(this.currentNode)
            }, e.prototype.openNode = function (e) {
                if (!e.isOpen) return !this.root && 0 === this.currentLevel && e instanceof c && (this.root = e), this.onData(this.writer.openNode(e, this.currentLevel)), e.isOpen = !0
            }, e.prototype.closeNode = function (e) {
                if (!e.isClosed) return this.onData(this.writer.closeNode(e, this.currentLevel)), e.isClosed = !0
            }, e.prototype.onData = function (e) {
                return this.documentStarted = !0, this.onDataCallback(e)
            }, e.prototype.onEnd = function () {
                return this.documentCompleted = !0, this.onEndCallback()
            }, e.prototype.ele = function () {
                return this.element.apply(this, arguments)
            }, e.prototype.nod = function (e, t, n) {
                return this.node(e, t, n)
            }, e.prototype.txt = function (e) {
                return this.text(e)
            }, e.prototype.dat = function (e) {
                return this.cdata(e)
            }, e.prototype.com = function (e) {
                return this.comment(e)
            }, e.prototype.ins = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.dec = function (e, t, n) {
                return this.declaration(e, t, n)
            }, e.prototype.dtd = function (e, t, n) {
                return this.doctype(e, t, n)
            }, e.prototype.e = function (e, t, n) {
                return this.element(e, t, n)
            }, e.prototype.n = function (e, t, n) {
                return this.node(e, t, n)
            }, e.prototype.t = function (e) {
                return this.text(e)
            }, e.prototype.d = function (e) {
                return this.cdata(e)
            }, e.prototype.c = function (e) {
                return this.comment(e)
            }, e.prototype.r = function (e) {
                return this.raw(e)
            }, e.prototype.i = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.att = function () {
                return this.currentNode && this.currentNode instanceof d ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments)
            }, e.prototype.a = function () {
                return this.currentNode && this.currentNode instanceof d ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments)
            }, e.prototype.ent = function (e, t) {
                return this.entity(e, t)
            }, e.prototype.pent = function (e, t) {
                return this.pEntity(e, t)
            }, e.prototype.not = function (e, t) {
                return this.notation(e, t)
            }, e
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        var t, i, a, o, r, s, l, u, d, c, h, f, p, g = {}.hasOwnProperty;
        l = n(285), u = n(286), t = n(283), i = n(284), d = n(282), h = n(291), f = n(292), c = n(293), a = n(287), o = n(289), r = n(288), s = n(290), p = n(734), e.exports = function (e) {
            function n(e, t) {
                n.__super__.constructor.call(this, t), this.stream = e
            }

            return function (e, t) {
                for (var n in t) g.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(n, p), n.prototype.document = function (e) {
                var t, n, a, o, r, s, d, h;
                for (n = 0, o = (s = e.children).length; n < o; n++) (t = s[n]).isLastRootNode = !1;
                for (e.children[e.children.length - 1].isLastRootNode = !0, h = [], a = 0, r = (d = e.children).length; a < r; a++) switch (t = d[a], !1) {
                    case!(t instanceof l):
                        h.push(this.declaration(t));
                        break;
                    case!(t instanceof u):
                        h.push(this.docType(t));
                        break;
                    case!(t instanceof i):
                        h.push(this.comment(t));
                        break;
                    case!(t instanceof c):
                        h.push(this.processingInstruction(t));
                        break;
                    default:
                        h.push(this.element(t))
                }
                return h
            }, n.prototype.attribute = function (e) {
                return this.stream.write(" " + e.name + '="' + e.value + '"')
            }, n.prototype.cdata = function (e, t) {
                return this.stream.write(this.space(t) + "<![CDATA[" + e.text + "]]>" + this.endline(e))
            }, n.prototype.comment = function (e, t) {
                return this.stream.write(this.space(t) + "\x3c!-- " + e.text + " --\x3e" + this.endline(e))
            }, n.prototype.declaration = function (e, t) {
                return this.stream.write(this.space(t)), this.stream.write('<?xml version="' + e.version + '"'), null != e.encoding && this.stream.write(' encoding="' + e.encoding + '"'), null != e.standalone && this.stream.write(' standalone="' + e.standalone + '"'), this.stream.write(this.spacebeforeslash + "?>"), this.stream.write(this.endline(e))
            }, n.prototype.docType = function (e, n) {
                var l, u, d, h;
                if (n || (n = 0), this.stream.write(this.space(n)), this.stream.write("<!DOCTYPE " + e.root().name), e.pubID && e.sysID ? this.stream.write(' PUBLIC "' + e.pubID + '" "' + e.sysID + '"') : e.sysID && this.stream.write(' SYSTEM "' + e.sysID + '"'), e.children.length > 0) {
                    for (this.stream.write(" ["), this.stream.write(this.endline(e)), u = 0, d = (h = e.children).length; u < d; u++) switch (l = h[u], !1) {
                        case!(l instanceof a):
                            this.dtdAttList(l, n + 1);
                            break;
                        case!(l instanceof o):
                            this.dtdElement(l, n + 1);
                            break;
                        case!(l instanceof r):
                            this.dtdEntity(l, n + 1);
                            break;
                        case!(l instanceof s):
                            this.dtdNotation(l, n + 1);
                            break;
                        case!(l instanceof t):
                            this.cdata(l, n + 1);
                            break;
                        case!(l instanceof i):
                            this.comment(l, n + 1);
                            break;
                        case!(l instanceof c):
                            this.processingInstruction(l, n + 1);
                            break;
                        default:
                            throw new Error("Unknown DTD node type: " + l.constructor.name)
                    }
                    this.stream.write("]")
                }
                return this.stream.write(this.spacebeforeslash + ">"), this.stream.write(this.endline(e))
            }, n.prototype.element = function (e, n) {
                var a, o, r, s, l, u, p, k;
                for (l in n || (n = 0), k = this.space(n), this.stream.write(k + "<" + e.name), u = e.attributes) g.call(u, l) && (a = u[l], this.attribute(a));
                if (0 === e.children.length || e.children.every(function (e) {
                    return "" === e.value
                })) this.allowEmpty ? this.stream.write("></" + e.name + ">") : this.stream.write(this.spacebeforeslash + "/>"); else if (this.pretty && 1 === e.children.length && null != e.children[0].value) this.stream.write(">"), this.stream.write(e.children[0].value), this.stream.write("</" + e.name + ">"); else {
                    for (this.stream.write(">" + this.newline), r = 0, s = (p = e.children).length; r < s; r++) switch (o = p[r], !1) {
                        case!(o instanceof t):
                            this.cdata(o, n + 1);
                            break;
                        case!(o instanceof i):
                            this.comment(o, n + 1);
                            break;
                        case!(o instanceof d):
                            this.element(o, n + 1);
                            break;
                        case!(o instanceof h):
                            this.raw(o, n + 1);
                            break;
                        case!(o instanceof f):
                            this.text(o, n + 1);
                            break;
                        case!(o instanceof c):
                            this.processingInstruction(o, n + 1);
                            break;
                        default:
                            throw new Error("Unknown XML node type: " + o.constructor.name)
                    }
                    this.stream.write(k + "</" + e.name + ">")
                }
                return this.stream.write(this.endline(e))
            }, n.prototype.processingInstruction = function (e, t) {
                return this.stream.write(this.space(t) + "<?" + e.target), e.value && this.stream.write(" " + e.value), this.stream.write(this.spacebeforeslash + "?>" + this.endline(e))
            }, n.prototype.raw = function (e, t) {
                return this.stream.write(this.space(t) + e.value + this.endline(e))
            }, n.prototype.text = function (e, t) {
                return this.stream.write(this.space(t) + e.value + this.endline(e))
            }, n.prototype.dtdAttList = function (e, t) {
                return this.stream.write(this.space(t) + "<!ATTLIST " + e.elementName + " " + e.attributeName + " " + e.attributeType), "#DEFAULT" !== e.defaultValueType && this.stream.write(" " + e.defaultValueType), e.defaultValue && this.stream.write(' "' + e.defaultValue + '"'), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, n.prototype.dtdElement = function (e, t) {
                return this.stream.write(this.space(t) + "<!ELEMENT " + e.name + " " + e.value), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, n.prototype.dtdEntity = function (e, t) {
                return this.stream.write(this.space(t) + "<!ENTITY"), e.pe && this.stream.write(" %"), this.stream.write(" " + e.name), e.value ? this.stream.write(' "' + e.value + '"') : (e.pubID && e.sysID ? this.stream.write(' PUBLIC "' + e.pubID + '" "' + e.sysID + '"') : e.sysID && this.stream.write(' SYSTEM "' + e.sysID + '"'), e.nData && this.stream.write(" NDATA " + e.nData)), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, n.prototype.dtdNotation = function (e, t) {
                return this.stream.write(this.space(t) + "<!NOTATION " + e.name), e.pubID && e.sysID ? this.stream.write(' PUBLIC "' + e.pubID + '" "' + e.sysID + '"') : e.pubID ? this.stream.write(' PUBLIC "' + e.pubID + '"') : e.sysID && this.stream.write(' SYSTEM "' + e.sysID + '"'), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, n.prototype.endline = function (e) {
                return e.isLastRootNode ? "" : this.newline
            }, n
        }()
    }).call(this)
}, function (e, t, n) {
    (function () {
        "use strict";
        var e, i, a, o, r, s, l, u, d = function (e, t) {
            return function () {
                return e.apply(t, arguments)
            }
        }, c = {}.hasOwnProperty;
        l = n(809), a = n(35), e = n(811), s = n(735), u = n(812).setImmediate, i = n(559).defaults, o = function (e) {
            return "object" == typeof e && null != e && 0 === Object.keys(e).length
        }, r = function (e, t, n) {
            var i, a;
            for (i = 0, a = e.length; i < a; i++) t = (0, e[i])(t, n);
            return t
        }, t.Parser = function (n) {
            function h(e) {
                var n, a, o;
                if (this.parseString = d(this.parseString, this), this.reset = d(this.reset, this), this.assignOrPush = d(this.assignOrPush, this), this.processAsync = d(this.processAsync, this), !(this instanceof t.Parser)) return new t.Parser(e);
                for (n in this.options = {}, a = i[.2]) c.call(a, n) && (o = a[n], this.options[n] = o);
                for (n in e) c.call(e, n) && (o = e[n], this.options[n] = o);
                this.options.xmlns && (this.options.xmlnskey = this.options.attrkey + "ns"), this.options.normalizeTags && (this.options.tagNameProcessors || (this.options.tagNameProcessors = []), this.options.tagNameProcessors.unshift(s.normalize)), this.reset()
            }

            return function (e, t) {
                for (var n in t) c.call(t, n) && (e[n] = t[n]);

                function i() {
                    this.constructor = e
                }

                i.prototype = t.prototype, e.prototype = new i, e.__super__ = t.prototype
            }(h, a.EventEmitter), h.prototype.processAsync = function () {
                var e, t;
                try {
                    return this.remaining.length <= this.options.chunkSize ? (e = this.remaining, this.remaining = "", this.saxParser = this.saxParser.write(e), this.saxParser.close()) : (e = this.remaining.substr(0, this.options.chunkSize), this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length), this.saxParser = this.saxParser.write(e), u(this.processAsync))
                } catch (e) {
                    if (t = e, !this.saxParser.errThrown) return this.saxParser.errThrown = !0, this.emit(t)
                }
            }, h.prototype.assignOrPush = function (e, t, n) {
                return t in e ? (e[t] instanceof Array || (e[t] = [e[t]]), e[t].push(n)) : this.options.explicitArray ? e[t] = [n] : e[t] = n
            }, h.prototype.reset = function () {
                var e, t, n, i, a;
                return this.removeAllListeners(), this.saxParser = l.parser(this.options.strict, {
                    trim: !1,
                    normalize: !1,
                    xmlns: this.options.xmlns
                }), this.saxParser.errThrown = !1, this.saxParser.onerror = (a = this, function (e) {
                    if (a.saxParser.resume(), !a.saxParser.errThrown) return a.saxParser.errThrown = !0, a.emit("error", e)
                }), this.saxParser.onend = function (e) {
                    return function () {
                        if (!e.saxParser.ended) return e.saxParser.ended = !0, e.emit("end", e.resultObject)
                    }
                }(this), this.saxParser.ended = !1, this.EXPLICIT_CHARKEY = this.options.explicitCharkey, this.resultObject = null, i = [], e = this.options.attrkey, t = this.options.charkey, this.saxParser.onopentag = function (n) {
                    return function (a) {
                        var o, s, l, u, d;
                        if ((l = {})[t] = "", !n.options.ignoreAttrs) for (o in d = a.attributes) c.call(d, o) && (e in l || n.options.mergeAttrs || (l[e] = {}), s = n.options.attrValueProcessors ? r(n.options.attrValueProcessors, a.attributes[o], o) : a.attributes[o], u = n.options.attrNameProcessors ? r(n.options.attrNameProcessors, o) : o, n.options.mergeAttrs ? n.assignOrPush(l, u, s) : l[e][u] = s);
                        return l["#name"] = n.options.tagNameProcessors ? r(n.options.tagNameProcessors, a.name) : a.name, n.options.xmlns && (l[n.options.xmlnskey] = {
                            uri: a.uri,
                            local: a.local
                        }), i.push(l)
                    }
                }(this), this.saxParser.onclosetag = function (e) {
                    return function () {
                        var n, a, s, l, u, d, h, f, p, g;
                        if (d = i.pop(), u = d["#name"], e.options.explicitChildren && e.options.preserveChildrenOrder || delete d["#name"], !0 === d.cdata && (n = d.cdata, delete d.cdata), p = i[i.length - 1], d[t].match(/^\s*$/) && !n ? (a = d[t], delete d[t]) : (e.options.trim && (d[t] = d[t].trim()), e.options.normalize && (d[t] = d[t].replace(/\s{2,}/g, " ").trim()), d[t] = e.options.valueProcessors ? r(e.options.valueProcessors, d[t], u) : d[t], 1 === Object.keys(d).length && t in d && !e.EXPLICIT_CHARKEY && (d = d[t])), o(d) && (d = "" !== e.options.emptyTag ? e.options.emptyTag : a), null != e.options.validator && (g = "/" + function () {
                            var e, t, n;
                            for (n = [], e = 0, t = i.length; e < t; e++) l = i[e], n.push(l["#name"]);
                            return n
                        }().concat(u).join("/"), function () {
                            var t;
                            try {
                                d = e.options.validator(g, p && p[u], d)
                            } catch (n) {
                                return t = n, e.emit("error", t)
                            }
                        }()), e.options.explicitChildren && !e.options.mergeAttrs && "object" == typeof d) if (e.options.preserveChildrenOrder) {
                            if (p) {
                                for (s in p[e.options.childkey] = p[e.options.childkey] || [], h = {}, d) c.call(d, s) && (h[s] = d[s]);
                                p[e.options.childkey].push(h), delete d["#name"], 1 === Object.keys(d).length && t in d && !e.EXPLICIT_CHARKEY && (d = d[t])
                            }
                        } else l = {}, e.options.attrkey in d && (l[e.options.attrkey] = d[e.options.attrkey], delete d[e.options.attrkey]), !e.options.charsAsChildren && e.options.charkey in d && (l[e.options.charkey] = d[e.options.charkey], delete d[e.options.charkey]), Object.getOwnPropertyNames(d).length > 0 && (l[e.options.childkey] = d), d = l;
                        return i.length > 0 ? e.assignOrPush(p, u, d) : (e.options.explicitRoot && (f = d, (d = {})[u] = f), e.resultObject = d, e.saxParser.ended = !0, e.emit("end", e.resultObject))
                    }
                }(this), n = function (e) {
                    return function (n) {
                        var a, o;
                        if (o = i[i.length - 1]) return o[t] += n, e.options.explicitChildren && e.options.preserveChildrenOrder && e.options.charsAsChildren && (e.options.includeWhiteChars || "" !== n.replace(/\\n/g, "").trim()) && (o[e.options.childkey] = o[e.options.childkey] || [], (a = {"#name": "__text__"})[t] = n, e.options.normalize && (a[t] = a[t].replace(/\s{2,}/g, " ").trim()), o[e.options.childkey].push(a)), o
                    }
                }(this), this.saxParser.ontext = n, this.saxParser.oncdata = function (e) {
                    var t;
                    if (t = n(e)) return t.cdata = !0
                }
            }, h.prototype.parseString = function (t, n) {
                var i;
                null != n && "function" == typeof n && (this.on("end", function (e) {
                    return this.reset(), n(null, e)
                }), this.on("error", function (e) {
                    return this.reset(), n(e)
                }));
                try {
                    return "" === (t = t.toString()).trim() ? (this.emit("end", null), !0) : (t = e.stripBOM(t), this.options.async ? (this.remaining = t, u(this.processAsync), this.saxParser) : this.saxParser.write(t).close())
                } catch (e) {
                    if (i = e, !this.saxParser.errThrown && !this.saxParser.ended) return this.emit("error", i), this.saxParser.errThrown = !0;
                    if (this.saxParser.ended) throw i
                }
            }, h
        }(), t.parseString = function (e, n, i) {
            var a, o;
            return null != i ? ("function" == typeof i && (a = i), "object" == typeof n && (o = n)) : ("function" == typeof n && (a = n), o = {}), new t.Parser(o).parseString(e, a)
        }
    }).call(this)
}, function (e, t, n) {
    !function (e) {
        e.parser = function (e, t) {
            return new a(e, t)
        }, e.SAXParser = a, e.SAXStream = r, e.createStream = function (e, t) {
            return new r(e, t)
        }, e.MAX_BUFFER_LENGTH = 65536;
        var t,
            i = ["comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script"];

        function a(t, n) {
            if (!(this instanceof a)) return new a(t, n);
            !function (e) {
                for (var t = 0, n = i.length; t < n; t++) e[i[t]] = ""
            }(this), this.q = this.c = "", this.bufferCheckPosition = e.MAX_BUFFER_LENGTH, this.opt = n || {}, this.opt.lowercase = this.opt.lowercase || this.opt.lowercasetags, this.looseCase = this.opt.lowercase ? "toLowerCase" : "toUpperCase", this.tags = [], this.closed = this.closedRoot = this.sawRoot = !1, this.tag = this.error = null, this.strict = !!t, this.noscript = !(!t && !this.opt.noscript), this.state = C.BEGIN, this.strictEntities = this.opt.strictEntities, this.ENTITIES = this.strictEntities ? Object.create(e.XML_ENTITIES) : Object.create(e.ENTITIES), this.attribList = [], this.opt.xmlns && (this.ns = Object.create(c)), this.trackPosition = !1 !== this.opt.position, this.trackPosition && (this.position = this.line = this.column = 0), D(this, "onready")
        }

        e.EVENTS = ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "opentagstart", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"], Object.create || (Object.create = function (e) {
            function t() {
            }

            return t.prototype = e, new t
        }), Object.keys || (Object.keys = function (e) {
            var t = [];
            for (var n in e) e.hasOwnProperty(n) && t.push(n);
            return t
        }), a.prototype = {
            end: function () {
                E(this)
            }, write: function (t) {
                if (this.error) throw this.error;
                if (this.closed) return A(this, "Cannot write after close. Assign an onready handler.");
                if (null === t) return E(this);
                "object" == typeof t && (t = t.toString());
                var n = 0, a = "";
                for (; a = V(t, n++), this.c = a, a;) switch (this.trackPosition && (this.position++, "\n" === a ? (this.line++, this.column = 0) : this.column++), this.state) {
                    case C.BEGIN:
                        if (this.state = C.BEGIN_WHITESPACE, "\ufeff" === a) continue;
                        K(this, a);
                        continue;
                    case C.BEGIN_WHITESPACE:
                        K(this, a);
                        continue;
                    case C.TEXT:
                        if (this.sawRoot && !this.closedRoot) {
                            for (var o = n - 1; a && "<" !== a && "&" !== a;) (a = V(t, n++)) && this.trackPosition && (this.position++, "\n" === a ? (this.line++, this.column = 0) : this.column++);
                            this.textNode += t.substring(o, n - 1)
                        }
                        "<" !== a || this.sawRoot && this.closedRoot && !this.strict ? (k(a) || this.sawRoot && !this.closedRoot || M(this, "Text data outside of root node."), "&" === a ? this.state = C.TEXT_ENTITY : this.textNode += a) : (this.state = C.OPEN_WAKA, this.startTagPosition = this.position);
                        continue;
                    case C.SCRIPT:
                        "<" === a ? this.state = C.SCRIPT_ENDING : this.script += a;
                        continue;
                    case C.SCRIPT_ENDING:
                        "/" === a ? this.state = C.CLOSE_TAG : (this.script += "<" + a, this.state = C.SCRIPT);
                        continue;
                    case C.OPEN_WAKA:
                        if ("!" === a) this.state = C.SGML_DECL, this.sgmlDecl = ""; else if (k(a)) ; else if (v(h, a)) this.state = C.OPEN_TAG, this.tagName = a; else if ("/" === a) this.state = C.CLOSE_TAG, this.tagName = ""; else if ("?" === a) this.state = C.PROC_INST, this.procInstName = this.procInstBody = ""; else {
                            if (M(this, "Unencoded <"), this.startTagPosition + 1 < this.position) {
                                var r = this.position - this.startTagPosition;
                                a = new Array(r).join(" ") + a
                            }
                            this.textNode += "<" + a, this.state = C.TEXT
                        }
                        continue;
                    case C.SGML_DECL:
                        (this.sgmlDecl + a).toUpperCase() === s ? (I(this, "onopencdata"), this.state = C.CDATA, this.sgmlDecl = "", this.cdata = "") : this.sgmlDecl + a === "--" ? (this.state = C.COMMENT, this.comment = "", this.sgmlDecl = "") : (this.sgmlDecl + a).toUpperCase() === l ? (this.state = C.DOCTYPE, (this.doctype || this.sawRoot) && M(this, "Inappropriately located doctype declaration"), this.doctype = "", this.sgmlDecl = "") : ">" === a ? (I(this, "onsgmldeclaration", this.sgmlDecl), this.sgmlDecl = "", this.state = C.TEXT) : m(a) ? (this.state = C.SGML_DECL_QUOTED, this.sgmlDecl += a) : this.sgmlDecl += a;
                        continue;
                    case C.SGML_DECL_QUOTED:
                        a === this.q && (this.state = C.SGML_DECL, this.q = ""), this.sgmlDecl += a;
                        continue;
                    case C.DOCTYPE:
                        ">" === a ? (this.state = C.TEXT, I(this, "ondoctype", this.doctype), this.doctype = !0) : (this.doctype += a, "[" === a ? this.state = C.DOCTYPE_DTD : m(a) && (this.state = C.DOCTYPE_QUOTED, this.q = a));
                        continue;
                    case C.DOCTYPE_QUOTED:
                        this.doctype += a, a === this.q && (this.q = "", this.state = C.DOCTYPE);
                        continue;
                    case C.DOCTYPE_DTD:
                        this.doctype += a, "]" === a ? this.state = C.DOCTYPE : m(a) && (this.state = C.DOCTYPE_DTD_QUOTED, this.q = a);
                        continue;
                    case C.DOCTYPE_DTD_QUOTED:
                        this.doctype += a, a === this.q && (this.state = C.DOCTYPE_DTD, this.q = "");
                        continue;
                    case C.COMMENT:
                        "-" === a ? this.state = C.COMMENT_ENDING : this.comment += a;
                        continue;
                    case C.COMMENT_ENDING:
                        "-" === a ? (this.state = C.COMMENT_ENDED, this.comment = x(this.opt, this.comment), this.comment && I(this, "oncomment", this.comment), this.comment = "") : (this.comment += "-" + a, this.state = C.COMMENT);
                        continue;
                    case C.COMMENT_ENDED:
                        ">" !== a ? (M(this, "Malformed comment"), this.comment += "--" + a, this.state = C.COMMENT) : this.state = C.TEXT;
                        continue;
                    case C.CDATA:
                        "]" === a ? this.state = C.CDATA_ENDING : this.cdata += a;
                        continue;
                    case C.CDATA_ENDING:
                        "]" === a ? this.state = C.CDATA_ENDING_2 : (this.cdata += "]" + a, this.state = C.CDATA);
                        continue;
                    case C.CDATA_ENDING_2:
                        ">" === a ? (this.cdata && I(this, "oncdata", this.cdata), I(this, "onclosecdata"), this.cdata = "", this.state = C.TEXT) : "]" === a ? this.cdata += "]" : (this.cdata += "]]" + a, this.state = C.CDATA);
                        continue;
                    case C.PROC_INST:
                        "?" === a ? this.state = C.PROC_INST_ENDING : k(a) ? this.state = C.PROC_INST_BODY : this.procInstName += a;
                        continue;
                    case C.PROC_INST_BODY:
                        if (!this.procInstBody && k(a)) continue;
                        "?" === a ? this.state = C.PROC_INST_ENDING : this.procInstBody += a;
                        continue;
                    case C.PROC_INST_ENDING:
                        ">" === a ? (I(this, "onprocessinginstruction", {
                            name: this.procInstName,
                            body: this.procInstBody
                        }), this.procInstName = this.procInstBody = "", this.state = C.TEXT) : (this.procInstBody += "?" + a, this.state = C.PROC_INST_BODY);
                        continue;
                    case C.OPEN_TAG:
                        v(f, a) ? this.tagName += a : (P(this), ">" === a ? U(this) : "/" === a ? this.state = C.OPEN_TAG_SLASH : (k(a) || M(this, "Invalid character in tag name"), this.state = C.ATTRIB));
                        continue;
                    case C.OPEN_TAG_SLASH:
                        ">" === a ? (U(this, !0), L(this)) : (M(this, "Forward-slash in opening tag not followed by >"), this.state = C.ATTRIB);
                        continue;
                    case C.ATTRIB:
                        if (k(a)) continue;
                        ">" === a ? U(this) : "/" === a ? this.state = C.OPEN_TAG_SLASH : v(h, a) ? (this.attribName = a, this.attribValue = "", this.state = C.ATTRIB_NAME) : M(this, "Invalid attribute name");
                        continue;
                    case C.ATTRIB_NAME:
                        "=" === a ? this.state = C.ATTRIB_VALUE : ">" === a ? (M(this, "Attribute without value"), this.attribValue = this.attribName, O(this), U(this)) : k(a) ? this.state = C.ATTRIB_NAME_SAW_WHITE : v(f, a) ? this.attribName += a : M(this, "Invalid attribute name");
                        continue;
                    case C.ATTRIB_NAME_SAW_WHITE:
                        if ("=" === a) this.state = C.ATTRIB_VALUE; else {
                            if (k(a)) continue;
                            M(this, "Attribute without value"), this.tag.attributes[this.attribName] = "", this.attribValue = "", I(this, "onattribute", {
                                name: this.attribName,
                                value: ""
                            }), this.attribName = "", ">" === a ? U(this) : v(h, a) ? (this.attribName = a, this.state = C.ATTRIB_NAME) : (M(this, "Invalid attribute name"), this.state = C.ATTRIB)
                        }
                        continue;
                    case C.ATTRIB_VALUE:
                        if (k(a)) continue;
                        m(a) ? (this.q = a, this.state = C.ATTRIB_VALUE_QUOTED) : (M(this, "Unquoted attribute value"), this.state = C.ATTRIB_VALUE_UNQUOTED, this.attribValue = a);
                        continue;
                    case C.ATTRIB_VALUE_QUOTED:
                        if (a !== this.q) {
                            "&" === a ? this.state = C.ATTRIB_VALUE_ENTITY_Q : this.attribValue += a;
                            continue
                        }
                        O(this), this.q = "", this.state = C.ATTRIB_VALUE_CLOSED;
                        continue;
                    case C.ATTRIB_VALUE_CLOSED:
                        k(a) ? this.state = C.ATTRIB : ">" === a ? U(this) : "/" === a ? this.state = C.OPEN_TAG_SLASH : v(h, a) ? (M(this, "No whitespace between attributes"), this.attribName = a, this.attribValue = "", this.state = C.ATTRIB_NAME) : M(this, "Invalid attribute name");
                        continue;
                    case C.ATTRIB_VALUE_UNQUOTED:
                        if (!T(a)) {
                            "&" === a ? this.state = C.ATTRIB_VALUE_ENTITY_U : this.attribValue += a;
                            continue
                        }
                        O(this), ">" === a ? U(this) : this.state = C.ATTRIB;
                        continue;
                    case C.CLOSE_TAG:
                        if (this.tagName) ">" === a ? L(this) : v(f, a) ? this.tagName += a : this.script ? (this.script += "</" + this.tagName, this.tagName = "", this.state = C.SCRIPT) : (k(a) || M(this, "Invalid tagname in closing tag"), this.state = C.CLOSE_TAG_SAW_WHITE); else {
                            if (k(a)) continue;
                            y(h, a) ? this.script ? (this.script += "</" + a, this.state = C.SCRIPT) : M(this, "Invalid tagname in closing tag.") : this.tagName = a
                        }
                        continue;
                    case C.CLOSE_TAG_SAW_WHITE:
                        if (k(a)) continue;
                        ">" === a ? L(this) : M(this, "Invalid characters in closing tag");
                        continue;
                    case C.TEXT_ENTITY:
                    case C.ATTRIB_VALUE_ENTITY_Q:
                    case C.ATTRIB_VALUE_ENTITY_U:
                        var u, d;
                        switch (this.state) {
                            case C.TEXT_ENTITY:
                                u = C.TEXT, d = "textNode";
                                break;
                            case C.ATTRIB_VALUE_ENTITY_Q:
                                u = C.ATTRIB_VALUE_QUOTED, d = "attribValue";
                                break;
                            case C.ATTRIB_VALUE_ENTITY_U:
                                u = C.ATTRIB_VALUE_UNQUOTED, d = "attribValue"
                        }
                        ";" === a ? (this[d] += B(this), this.entity = "", this.state = u) : v(this.entity.length ? g : p, a) ? this.entity += a : (M(this, "Invalid character in entity name"), this[d] += "&" + this.entity + a, this.entity = "", this.state = u);
                        continue;
                    default:
                        throw new Error(this, "Unknown state: " + this.state)
                }
                this.position >= this.bufferCheckPosition && function (t) {
                    for (var n = Math.max(e.MAX_BUFFER_LENGTH, 10), a = 0, o = 0, r = i.length; o < r; o++) {
                        var s = t[i[o]].length;
                        if (s > n) switch (i[o]) {
                            case"textNode":
                                _(t);
                                break;
                            case"cdata":
                                I(t, "oncdata", t.cdata), t.cdata = "";
                                break;
                            case"script":
                                I(t, "onscript", t.script), t.script = "";
                                break;
                            default:
                                A(t, "Max buffer length exceeded: " + i[o])
                        }
                        a = Math.max(a, s)
                    }
                    var l = e.MAX_BUFFER_LENGTH - a;
                    t.bufferCheckPosition = l + t.position
                }(this);
                return this
            }
            /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */, resume: function () {
                return this.error = null, this
            }, close: function () {
                return this.write(null)
            }, flush: function () {
                var e;
                _(e = this), "" !== e.cdata && (I(e, "oncdata", e.cdata), e.cdata = ""), "" !== e.script && (I(e, "onscript", e.script), e.script = "")
            }
        };
        try {
            t = n(113).Stream
        } catch (e) {
            t = function () {
            }
        }
        var o = e.EVENTS.filter(function (e) {
            return "error" !== e && "end" !== e
        });

        function r(e, n) {
            if (!(this instanceof r)) return new r(e, n);
            t.apply(this), this._parser = new a(e, n), this.writable = !0, this.readable = !0;
            var i = this;
            this._parser.onend = function () {
                i.emit("end")
            }, this._parser.onerror = function (e) {
                i.emit("error", e), i._parser.error = null
            }, this._decoder = null, o.forEach(function (e) {
                Object.defineProperty(i, "on" + e, {
                    get: function () {
                        return i._parser["on" + e]
                    }, set: function (t) {
                        if (!t) return i.removeAllListeners(e), i._parser["on" + e] = t, t;
                        i.on(e, t)
                    }, enumerable: !0, configurable: !1
                })
            })
        }

        r.prototype = Object.create(t.prototype, {constructor: {value: r}}), r.prototype.write = function (e) {
            if ("function" == typeof Buffer && "function" == typeof Buffer.isBuffer && Buffer.isBuffer(e)) {
                if (!this._decoder) {
                    var t = n(810).StringDecoder;
                    this._decoder = new t("utf8")
                }
                e = this._decoder.write(e)
            }
            return this._parser.write(e.toString()), this.emit("data", e), !0
        }, r.prototype.end = function (e) {
            return e && e.length && this.write(e), this._parser.end(), !0
        }, r.prototype.on = function (e, n) {
            var i = this;
            return i._parser["on" + e] || -1 === o.indexOf(e) || (i._parser["on" + e] = function () {
                var t = 1 === arguments.length ? [arguments[0]] : Array.apply(null, arguments);
                t.splice(0, 0, e), i.emit.apply(i, t)
            }), t.prototype.on.call(i, e, n)
        };
        var s = "[CDATA[", l = "DOCTYPE", u = "http://www.w3.org/XML/1998/namespace",
            d = "http://www.w3.org/2000/xmlns/", c = {xml: u, xmlns: d},
            h = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
            f = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,
            p = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
            g = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;

        function k(e) {
            return " " === e || "\n" === e || "\r" === e || "\t" === e
        }

        function m(e) {
            return '"' === e || "'" === e
        }

        function T(e) {
            return ">" === e || k(e)
        }

        function v(e, t) {
            return e.test(t)
        }

        function y(e, t) {
            return !v(e, t)
        }

        var S, w, b, C = 0;
        for (var N in e.STATE = {
            BEGIN: C++,
            BEGIN_WHITESPACE: C++,
            TEXT: C++,
            TEXT_ENTITY: C++,
            OPEN_WAKA: C++,
            SGML_DECL: C++,
            SGML_DECL_QUOTED: C++,
            DOCTYPE: C++,
            DOCTYPE_QUOTED: C++,
            DOCTYPE_DTD: C++,
            DOCTYPE_DTD_QUOTED: C++,
            COMMENT_STARTING: C++,
            COMMENT: C++,
            COMMENT_ENDING: C++,
            COMMENT_ENDED: C++,
            CDATA: C++,
            CDATA_ENDING: C++,
            CDATA_ENDING_2: C++,
            PROC_INST: C++,
            PROC_INST_BODY: C++,
            PROC_INST_ENDING: C++,
            OPEN_TAG: C++,
            OPEN_TAG_SLASH: C++,
            ATTRIB: C++,
            ATTRIB_NAME: C++,
            ATTRIB_NAME_SAW_WHITE: C++,
            ATTRIB_VALUE: C++,
            ATTRIB_VALUE_QUOTED: C++,
            ATTRIB_VALUE_CLOSED: C++,
            ATTRIB_VALUE_UNQUOTED: C++,
            ATTRIB_VALUE_ENTITY_Q: C++,
            ATTRIB_VALUE_ENTITY_U: C++,
            CLOSE_TAG: C++,
            CLOSE_TAG_SAW_WHITE: C++,
            SCRIPT: C++,
            SCRIPT_ENDING: C++
        }, e.XML_ENTITIES = {amp: "&", gt: ">", lt: "<", quot: '"', apos: "'"}, e.ENTITIES = {
            amp: "&",
            gt: ">",
            lt: "<",
            quot: '"',
            apos: "'",
            AElig: 198,
            Aacute: 193,
            Acirc: 194,
            Agrave: 192,
            Aring: 197,
            Atilde: 195,
            Auml: 196,
            Ccedil: 199,
            ETH: 208,
            Eacute: 201,
            Ecirc: 202,
            Egrave: 200,
            Euml: 203,
            Iacute: 205,
            Icirc: 206,
            Igrave: 204,
            Iuml: 207,
            Ntilde: 209,
            Oacute: 211,
            Ocirc: 212,
            Ograve: 210,
            Oslash: 216,
            Otilde: 213,
            Ouml: 214,
            THORN: 222,
            Uacute: 218,
            Ucirc: 219,
            Ugrave: 217,
            Uuml: 220,
            Yacute: 221,
            aacute: 225,
            acirc: 226,
            aelig: 230,
            agrave: 224,
            aring: 229,
            atilde: 227,
            auml: 228,
            ccedil: 231,
            eacute: 233,
            ecirc: 234,
            egrave: 232,
            eth: 240,
            euml: 235,
            iacute: 237,
            icirc: 238,
            igrave: 236,
            iuml: 239,
            ntilde: 241,
            oacute: 243,
            ocirc: 244,
            ograve: 242,
            oslash: 248,
            otilde: 245,
            ouml: 246,
            szlig: 223,
            thorn: 254,
            uacute: 250,
            ucirc: 251,
            ugrave: 249,
            uuml: 252,
            yacute: 253,
            yuml: 255,
            copy: 169,
            reg: 174,
            nbsp: 160,
            iexcl: 161,
            cent: 162,
            pound: 163,
            curren: 164,
            yen: 165,
            brvbar: 166,
            sect: 167,
            uml: 168,
            ordf: 170,
            laquo: 171,
            not: 172,
            shy: 173,
            macr: 175,
            deg: 176,
            plusmn: 177,
            sup1: 185,
            sup2: 178,
            sup3: 179,
            acute: 180,
            micro: 181,
            para: 182,
            middot: 183,
            cedil: 184,
            ordm: 186,
            raquo: 187,
            frac14: 188,
            frac12: 189,
            frac34: 190,
            iquest: 191,
            times: 215,
            divide: 247,
            OElig: 338,
            oelig: 339,
            Scaron: 352,
            scaron: 353,
            Yuml: 376,
            fnof: 402,
            circ: 710,
            tilde: 732,
            Alpha: 913,
            Beta: 914,
            Gamma: 915,
            Delta: 916,
            Epsilon: 917,
            Zeta: 918,
            Eta: 919,
            Theta: 920,
            Iota: 921,
            Kappa: 922,
            Lambda: 923,
            Mu: 924,
            Nu: 925,
            Xi: 926,
            Omicron: 927,
            Pi: 928,
            Rho: 929,
            Sigma: 931,
            Tau: 932,
            Upsilon: 933,
            Phi: 934,
            Chi: 935,
            Psi: 936,
            Omega: 937,
            alpha: 945,
            beta: 946,
            gamma: 947,
            delta: 948,
            epsilon: 949,
            zeta: 950,
            eta: 951,
            theta: 952,
            iota: 953,
            kappa: 954,
            lambda: 955,
            mu: 956,
            nu: 957,
            xi: 958,
            omicron: 959,
            pi: 960,
            rho: 961,
            sigmaf: 962,
            sigma: 963,
            tau: 964,
            upsilon: 965,
            phi: 966,
            chi: 967,
            psi: 968,
            omega: 969,
            thetasym: 977,
            upsih: 978,
            piv: 982,
            ensp: 8194,
            emsp: 8195,
            thinsp: 8201,
            zwnj: 8204,
            zwj: 8205,
            lrm: 8206,
            rlm: 8207,
            ndash: 8211,
            mdash: 8212,
            lsquo: 8216,
            rsquo: 8217,
            sbquo: 8218,
            ldquo: 8220,
            rdquo: 8221,
            bdquo: 8222,
            dagger: 8224,
            Dagger: 8225,
            bull: 8226,
            hellip: 8230,
            permil: 8240,
            prime: 8242,
            Prime: 8243,
            lsaquo: 8249,
            rsaquo: 8250,
            oline: 8254,
            frasl: 8260,
            euro: 8364,
            image: 8465,
            weierp: 8472,
            real: 8476,
            trade: 8482,
            alefsym: 8501,
            larr: 8592,
            uarr: 8593,
            rarr: 8594,
            darr: 8595,
            harr: 8596,
            crarr: 8629,
            lArr: 8656,
            uArr: 8657,
            rArr: 8658,
            dArr: 8659,
            hArr: 8660,
            forall: 8704,
            part: 8706,
            exist: 8707,
            empty: 8709,
            nabla: 8711,
            isin: 8712,
            notin: 8713,
            ni: 8715,
            prod: 8719,
            sum: 8721,
            minus: 8722,
            lowast: 8727,
            radic: 8730,
            prop: 8733,
            infin: 8734,
            ang: 8736,
            and: 8743,
            or: 8744,
            cap: 8745,
            cup: 8746,
            int: 8747,
            there4: 8756,
            sim: 8764,
            cong: 8773,
            asymp: 8776,
            ne: 8800,
            equiv: 8801,
            le: 8804,
            ge: 8805,
            sub: 8834,
            sup: 8835,
            nsub: 8836,
            sube: 8838,
            supe: 8839,
            oplus: 8853,
            otimes: 8855,
            perp: 8869,
            sdot: 8901,
            lceil: 8968,
            rceil: 8969,
            lfloor: 8970,
            rfloor: 8971,
            lang: 9001,
            rang: 9002,
            loz: 9674,
            spades: 9824,
            clubs: 9827,
            hearts: 9829,
            diams: 9830
        }, Object.keys(e.ENTITIES).forEach(function (t) {
            var n = e.ENTITIES[t], i = "number" == typeof n ? String.fromCharCode(n) : n;
            e.ENTITIES[t] = i
        }), e.STATE) e.STATE[e.STATE[N]] = N;

        function D(e, t, n) {
            e[t] && e[t](n)
        }

        function I(e, t, n) {
            e.textNode && _(e), D(e, t, n)
        }

        function _(e) {
            e.textNode = x(e.opt, e.textNode), e.textNode && D(e, "ontext", e.textNode), e.textNode = ""
        }

        function x(e, t) {
            return e.trim && (t = t.trim()), e.normalize && (t = t.replace(/\s+/g, " ")), t
        }

        function A(e, t) {
            return _(e), e.trackPosition && (t += "\nLine: " + e.line + "\nColumn: " + e.column + "\nChar: " + e.c), t = new Error(t), e.error = t, D(e, "onerror", t), e
        }

        function E(e) {
            return e.sawRoot && !e.closedRoot && M(e, "Unclosed root tag"), e.state !== C.BEGIN && e.state !== C.BEGIN_WHITESPACE && e.state !== C.TEXT && A(e, "Unexpected end"), _(e), e.c = "", e.closed = !0, D(e, "onend"), a.call(e, e.strict, e.opt), e
        }

        function M(e, t) {
            if ("object" != typeof e || !(e instanceof a)) throw new Error("bad call to strictFail");
            e.strict && A(e, t)
        }

        function P(e) {
            e.strict || (e.tagName = e.tagName[e.looseCase]());
            var t = e.tags[e.tags.length - 1] || e, n = e.tag = {name: e.tagName, attributes: {}};
            e.opt.xmlns && (n.ns = t.ns), e.attribList.length = 0, I(e, "onopentagstart", n)
        }

        function F(e, t) {
            var n = e.indexOf(":") < 0 ? ["", e] : e.split(":"), i = n[0], a = n[1];
            return t && "xmlns" === e && (i = "xmlns", a = ""), {prefix: i, local: a}
        }

        function O(e) {
            if (e.strict || (e.attribName = e.attribName[e.looseCase]()), -1 !== e.attribList.indexOf(e.attribName) || e.tag.attributes.hasOwnProperty(e.attribName)) e.attribName = e.attribValue = ""; else {
                if (e.opt.xmlns) {
                    var t = F(e.attribName, !0), n = t.prefix, i = t.local;
                    if ("xmlns" === n) if ("xml" === i && e.attribValue !== u) M(e, "xml: prefix must be bound to " + u + "\nActual: " + e.attribValue); else if ("xmlns" === i && e.attribValue !== d) M(e, "xmlns: prefix must be bound to " + d + "\nActual: " + e.attribValue); else {
                        var a = e.tag, o = e.tags[e.tags.length - 1] || e;
                        a.ns === o.ns && (a.ns = Object.create(o.ns)), a.ns[i] = e.attribValue
                    }
                    e.attribList.push([e.attribName, e.attribValue])
                } else e.tag.attributes[e.attribName] = e.attribValue, I(e, "onattribute", {
                    name: e.attribName,
                    value: e.attribValue
                });
                e.attribName = e.attribValue = ""
            }
        }

        function U(e, t) {
            if (e.opt.xmlns) {
                var n = e.tag, i = F(e.tagName);
                n.prefix = i.prefix, n.local = i.local, n.uri = n.ns[i.prefix] || "", n.prefix && !n.uri && (M(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), n.uri = i.prefix);
                var a = e.tags[e.tags.length - 1] || e;
                n.ns && a.ns !== n.ns && Object.keys(n.ns).forEach(function (t) {
                    I(e, "onopennamespace", {prefix: t, uri: n.ns[t]})
                });
                for (var o = 0, r = e.attribList.length; o < r; o++) {
                    var s = e.attribList[o], l = s[0], u = s[1], d = F(l, !0), c = d.prefix, h = d.local,
                        f = "" === c ? "" : n.ns[c] || "", p = {name: l, value: u, prefix: c, local: h, uri: f};
                    c && "xmlns" !== c && !f && (M(e, "Unbound namespace prefix: " + JSON.stringify(c)), p.uri = c), e.tag.attributes[l] = p, I(e, "onattribute", p)
                }
                e.attribList.length = 0
            }
            e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), I(e, "onopentag", e.tag), t || (e.noscript || "script" !== e.tagName.toLowerCase() ? e.state = C.TEXT : e.state = C.SCRIPT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0
        }

        function L(e) {
            if (!e.tagName) return M(e, "Weird empty close tag."), e.textNode += "</>", void(e.state = C.TEXT);
            if (e.script) {
                if ("script" !== e.tagName) return e.script += "</" + e.tagName + ">", e.tagName = "", void(e.state = C.SCRIPT);
                I(e, "onscript", e.script), e.script = ""
            }
            var t = e.tags.length, n = e.tagName;
            e.strict || (n = n[e.looseCase]());
            for (var i = n; t--;) {
                if (e.tags[t].name === i) break;
                M(e, "Unexpected close tag")
            }
            if (t < 0) return M(e, "Unmatched closing tag: " + e.tagName), e.textNode += "</" + e.tagName + ">", void(e.state = C.TEXT);
            e.tagName = n;
            for (var a = e.tags.length; a-- > t;) {
                var o = e.tag = e.tags.pop();
                e.tagName = e.tag.name, I(e, "onclosetag", e.tagName);
                var r = {};
                for (var s in o.ns) r[s] = o.ns[s];
                var l = e.tags[e.tags.length - 1] || e;
                e.opt.xmlns && o.ns !== l.ns && Object.keys(o.ns).forEach(function (t) {
                    var n = o.ns[t];
                    I(e, "onclosenamespace", {prefix: t, uri: n})
                })
            }
            0 === t && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = "", e.attribList.length = 0, e.state = C.TEXT
        }

        function B(e) {
            var t, n = e.entity, i = n.toLowerCase(), a = "";
            return e.ENTITIES[n] ? e.ENTITIES[n] : e.ENTITIES[i] ? e.ENTITIES[i] : ("#" === (n = i).charAt(0) && ("x" === n.charAt(1) ? (n = n.slice(2), a = (t = parseInt(n, 16)).toString(16)) : (n = n.slice(1), a = (t = parseInt(n, 10)).toString(10))), n = n.replace(/^0+/, ""), isNaN(t) || a.toLowerCase() !== n ? (M(e, "Invalid character entity"), "&" + e.entity + ";") : String.fromCodePoint(t))
        }

        function K(e, t) {
            "<" === t ? (e.state = C.OPEN_WAKA, e.startTagPosition = e.position) : k(t) || (M(e, "Non-whitespace before first tag."), e.textNode = t, e.state = C.TEXT)
        }

        function V(e, t) {
            var n = "";
            return t < e.length && (n = e.charAt(t)), n
        }

        C = e.STATE, String.fromCodePoint || (S = String.fromCharCode, w = Math.floor, b = function () {
            var e, t, n = [], i = -1, a = arguments.length;
            if (!a) return "";
            for (var o = ""; ++i < a;) {
                var r = Number(arguments[i]);
                if (!isFinite(r) || r < 0 || r > 1114111 || w(r) !== r) throw RangeError("Invalid code point: " + r);
                r <= 65535 ? n.push(r) : (e = 55296 + ((r -= 65536) >> 10), t = r % 1024 + 56320, n.push(e, t)), (i + 1 === a || n.length > 16384) && (o += S.apply(null, n), n.length = 0)
            }
            return o
        }, Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
            value: b,
            configurable: !0,
            writable: !0
        }) : String.fromCodePoint = b)
    }(t)
}, function (e, t) {
    e.exports = require("string_decoder")
}, function (e, t) {
    (function () {
        "use strict";
        t.stripBOM = function (e) {
            return "\ufeff" === e[0] ? e.substring(1) : e
        }
    }).call(this)
}, function (e, t) {
    e.exports = require("timers")
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(15), o = n(6), r = n(115), s = n(210), l = n(246), u = n(62), d = n(1), c = n(257),
        h = d.default.getLogger("Thunder.VipDownload.speedcurve-skin");
    let f = void 0, p = null;
    s.TaskEventContainerNS.getEventContainer().attachListener(s.TaskEventNS.taskAcclerateStatusChanged, function (e, t) {
        return i(this, void 0, void 0, function* () {
            do {
                if (t.taskType !== r.VipDownloadDefineNS.VipTaskType.Try) break;
                switch (t.taskStatus) {
                    case r.VipDownloadDefineNS.VipTaskStatus.Acclerating:
                        if (f) {
                            h.information("enableChangeSkin already true");
                            break
                        }
                        h.information("onTaskAcclerateStatusChanged", "taskStatus", t.taskStatus);
                        let e = yield a.default("GetSpeedCurveSkinInfo");
                        if (h.information("skinInfo", e), e && e.type !== l.SpeedCurveSkinHelperNS.SkinType.Default) break;
                        let n = (yield c.default.getSkins()) || [];
                        if (n.length > 0) {
                            let e = u.PluginHelperNS.getHelper().currentTime, t = e % n.length;
                            f = !0, (p = n[t]).is_vip_try = !0, h.information("curSkinInfo", p), yield a.default("SetSpeedCurveSkinInfo", p, !1, !0)
                        }
                        break;
                    case r.VipDownloadDefineNS.VipTaskStatus.Unkown:
                    case r.VipDownloadDefineNS.VipTaskStatus.CommitFailed:
                    case r.VipDownloadDefineNS.VipTaskStatus.AcclerateFailed:
                    case r.VipDownloadDefineNS.VipTaskStatus.Finished:
                        if (p && (p.is_vip_try = !1, p = null), !f) break;
                        h.information("onTaskAcclerateStatusChanged", "taskStatus", t.taskStatus), f = !1, yield a.default("SetSpeedCurveSkinInfo", l.SpeedCurveSkinHelperNS.defaultSkinInfo, !1, !0)
                }
            } while (0)
        })
    }), o.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSpeedCurveSkin", function (e, t = !1, n = !1) {
        return i(this, void 0, void 0, function* () {
            t && f && (f = !1)
        })
    })
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(8), o = n(67), r = n(31), s = n(37), l = n(93), u = n(114), d = n(253), c = n(22), h = n(65),
        f = n(6), p = n(565), g = n(5);
    !function (e) {
        e.dk = a.DownloadKernel, e.dkManager = o.DownloadKernelManager, e.taskManager = r.DownloadKernelTaskManager.getTaskManager(), e.eventManager = s.DownloadKernelEventManager.getEventManager(), e.categoryManager = l.DownloadKernelCategoryManager.getCategoryManager(), e.categoryViewManager = u.DownloadKernelCategoryViewManager.getCategoryViewManager(), e.taskUtilities = d.TaskUtilitiesAWNS, e.config = c.ConfigNS, e.logHelper = h.LoginHelperNS, e.thunderHelper = g.default(i.join(__rootDir, "../bin/ThunderHelper.node")), e.nativeCallModule = f.NativeCallModule, e.messageChannel = p.MessageChannelNS, e.thunderMsgChannel = g.default(i.join(__rootDir, "../bin/ThunderMsgChannel.node"))
    }(t.DownloadKernelTestNS || (t.DownloadKernelTestNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(2), o = n(5).default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        r = i.default.getLogger("HistoryDataNS");
    let s = a.resolve(__profilesDir, "mainWndData.ini"), l = 1020, u = 650;
    !function (e) {
        e.getMainWndSizeHistoryData = function () {
            let e = null;
            r.information(s);
            let t = o.readINI(s, "MainFrame", "ExitState"), n = o.readINI(s, "MainFrame", "MainWndLastWidth"),
                i = o.readINI(s, "MainFrame", "MainWndLastHeight");
            if (r.information(t, n, i), "" !== n && "" !== i) {
                let a = Number(n), o = Number(i);
                (a < l || o < u) && (a = l, o = u), (e = {}).width = a, e.height = o, e.exitState = t
            }
            return null === e && ((e = {}).exitState = "normal", e.width = l, e.height = u), e
        }, e.setExitType = function (e) {
            o.writeINI(s, "MainFrame", "ExitType", e)
        }, e.getExitType = function () {
            return o.readINI(s, "MainFrame", "ExitType")
        }
    }(t.HistoryDataNS || (t.HistoryDataNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(8), o = n(37), r = n(31), s = n(93), l = n(6),
        u = r.DownloadKernelTaskManager.getTaskManager(), d = o.DownloadKernelEventManager.getEventManager(),
        c = s.DownloadKernelCategoryManager.getCategoryManager(), h = i.default.getLogger("Community.TaskManager");
    !function (e) {
        class t {
            constructor() {
                this.insertToCategoryViewEventId = void 0, this.detailChangedEventId = void 0, this.taskStatusChangedEventId = void 0, this.taskInfoMap = new Map, this.userLoginEventId = void 0, this.userLogoutEventId = void 0
            }

            init() {
                h.information("init"), this.insertToCategoryViewEventId = d.attachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.InsertToCategoryView && this.onInsertToCategoryView(e[1], e[2], e[3])
                }), this.detailChangedEventId = d.attachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.DetailChanged && this.onDetailChanged(e[1], e[2])
                }), this.taskStatusChangedEventId = d.attachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.StatusChanged && this.onTaskStatusChanged(e[1])
                }), this.userLoginEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", this.onUserLogin.bind(this)), this.userLogoutEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", this.onUserLogout.bind(this))
            }

            uninit() {
                void 0 !== this.insertToCategoryViewEventId && (this.insertToCategoryViewEventId = void 0, d.detachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId)), void 0 !== this.detailChangedEventId && (this.detailChangedEventId = void 0, d.detachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, this.detailChangedEventId)), void 0 !== this.taskStatusChangedEventId && (this.taskStatusChangedEventId = void 0, d.detachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventId)), void 0 !== this.userLoginEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", this.userLoginEventId), this.userLoginEventId = void 0), void 0 !== this.userLogoutEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogout", this.userLogoutEventId), this.userLogoutEventId = void 0), this.taskInfoMap.clear()
            }

            getTaskNameByTaskUniqueID(e) {
                if (!e || "" === e) return "";
                let t = this.taskInfoMap.get(e);
                if (t) {
                    if (-1 === t.categoryId) return t.taskName;
                    {
                        let e = c.getCurrentPrivateCategory();
                        if (e && e.getId() === t.categoryId) return t.taskName
                    }
                }
                return ""
            }

            getTaskAverageSpeedByTaskUniqueID(e) {
                if (!e || "" === e) return 0;
                let t = 0, n = this.taskInfoMap.get(e);
                if (n) if (-1 !== n.categoryId) {
                    let e = c.getCurrentPrivateCategory();
                    e && e.getId() === n.categoryId && (t = this.getTaskAverageSpeed(n.taskId))
                } else t = this.getTaskAverageSpeed(n.taskId);
                return t
            }

            getTaskInfoByTaskUniqueID(e) {
                return e && "" !== e ? this.taskInfoMap.get(e) : null
            }

            onUserLogin(e) {
                h.information("onUserLogin userId:", e);
                let t = c.getPrivateCategoryFromUserId(e);
                if (t) {
                    let e = t.getCategoryViews();
                    for (let t = 0; t < e.length; ++t) {
                        let n = [];
                        e[t].getTasks().forEach(e => {
                            n.push(e)
                        }), this.updateTaskInfo(n)
                    }
                }
            }

            onUserLogout() {
                h.information("onUserLogout");
                let e = new Map;
                this.taskInfoMap.forEach((t, n) => {
                    -1 !== t.categoryId && e.set(n, t)
                }), e.forEach((e, t) => {
                    -1 !== e.categoryId && this.taskInfoMap.delete(t)
                })
            }

            onInsertToCategoryView(e, t, n) {
                do {
                    if (!n) break;
                    h.information("onInsertToCategoryView number of taskList:", n.length), this.updateTaskInfo(n)
                } while (0)
            }

            onDetailChanged(e, t) {
                do {
                    if (!e || !t) break;
                    h.information("onDetailChanged number of taskList:", e.length, ", detailChangedFlags:", t);
                    for (let n = 0; n < e.length; ++n) {
                        let i = e[n];
                        i && ((t & a.DownloadKernel.TaskDetailChangedFlags.TaskName || t & a.DownloadKernel.TaskDetailChangedFlags.Gcid) && this.updateTaskInfo([i]))
                    }
                } while (0)
            }

            onTaskStatusChanged(e) {
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t];
                    if (n && n.getTaskStatus() === a.DownloadKernel.TaskStatus.DestroyPending) {
                        let e = this.getTaskUniqueIDByTask(n);
                        e && "" !== e && (h.information("onTaskStatusChanged delete taskInfoMap uniqueId:", e), this.taskInfoMap.delete(e))
                    }
                }
            }

            updateTaskInfo(e) {
                let t = c.getCurrentPrivateCategory();
                for (let n = 0; n < e.length; ++n) {
                    let i = e[n];
                    if (!i) continue;
                    let o = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.CategoryId);
                    if (-1 !== o && (!t || t.getId() !== o)) continue;
                    let r = this.getTaskUniqueIDByTask(i);
                    if (r && "" !== r) {
                        let e = this.getTaskNameByTask(i), t = i.getTaskBaseInfo().taskId,
                            n = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.CategoryViewId);
                        h.information("updateTaskInfo uniqueId:", r, ", taskId:", t, ", taskName:", e, ", categoryId:", o, ", categoryViewId:", n);
                        let s = {taskId: t, taskName: e, categoryId: o, categoryViewId: n};
                        this.taskInfoMap.set(r, s)
                    }
                }
            }

            getTaskAverageSpeed(e) {
                let t = u.getTaskFromTaskId(e);
                if (!t) return 0;
                let n = t.getTaskAttribute(a.DownloadKernel.TaskAttribute.DownloadingPeriod),
                    i = t.getTaskAttribute(a.DownloadKernel.TaskAttribute.DownloadSize);
                0 === n && (n = 0);
                let o = Math.round(i / n);
                return h.information("getTaskAverageSpeed taskId:", e, ", taskAverageSpeed:", o, ", taskAverageSpeedFormat:", this.formatSize(o)), o
            }

            formatSize(e, t = 2) {
                if (!e || e < 0) return "0.0B";
                let n = 0, i = e;
                for (; i > 1024 && !(n >= 5);) i /= 1024, n += 1;
                let a = Math.pow(10, t);
                return Math.round(i * a) / a + ["B", "KB", "MB", "GB", "TB", "PB"][n]
            }

            getTaskNameByTask(e) {
                let t = e.getTaskName();
                if (!t || "" === t) {
                    if (e.getTaskBaseInfo().taskType === a.DownloadKernel.TaskType.Bt) {
                        t = e.getExtraObject().getDisplayName()
                    }
                }
                return t
            }

            getTaskUniqueIDByTask(e) {
                let t = "";
                if (!e) return t;
                switch (e.getType()) {
                    case a.DownloadKernel.TaskType.Bt:
                        let n = e.getExtraObject().getInfoId();
                        h.information("getTaskUniqueIDByTask bt task infoId:", n), t = n;
                        break;
                    case a.DownloadKernel.TaskType.P2sp:
                    case a.DownloadKernel.TaskType.Emule:
                        let i = e.getTaskAttribute(a.DownloadKernel.TaskAttribute.Gcid);
                        h.information("getTaskUniqueIDByTask p2sp or emule task gcid: ", i), t = i
                }
                return t
            }
        }

        e.TaskManager = t;
        const n = new t;
        e.getTaskManager = function () {
            return n
        }
    }(t.CommunityTaskManagerNS || (t.CommunityTaskManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = "\n", a = "\r\n", o = /^\s*\[(.+?)\]\s*$/, r = /^\s*([^#].*?)\s*=\s*(.*?)\s*$/;
    !function (e) {
        e.stringify = function (e) {
            let t = "";
            for (let n in e) {
                let i = e[n];
                if (!i) break;
                t += "[" + n + "]" + a;
                for (let e in i) {
                    let n = i[e];
                    if (void 0 === n || null === n) break;
                    t += e + "=" + n + a
                }
            }
            return t + i
        }, e.parse = function (e) {
            let t, n = {}, i = e.split(/\r\n|\r|\n/), a = {};
            for (let e = 0; e < i.length; ++e) {
                let s = i[e];
                (t = s.match(o)) ? n[t[1]] = a = n[t[1]] || {} : a && (t = s.match(r)) && (a[t[1]] = t[2])
            }
            return n
        }
    }(t.IniNS || (t.IniNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t = "";
        e.getRecommends = function () {
            return t
        }, e.setRecommends = function (e) {
            t = e
        }
    }(t.SearchConfigNS || (t.SearchConfigNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(83), o = n(7), r = n(66), s = n(21), l = n(726), u = n(65),
        d = i.default.getLogger("NativeFunction.Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "NativeFireEvent",
                        nativeFunc: this.fireEvent
                    }, {
                        functionName: "CreateLoginWnd",
                        nativeFunc: this.createLoginWnd
                    }, {functionName: "CloseLoginWnd", nativeFunc: this.closeLoginWnd}, {
                        functionName: "UpdateLoginWnd",
                        nativeFunc: this.updateLoginWnd
                    }, {functionName: "SaveLoginData", nativeFunc: this.saveLoginData}, {
                        functionName: "LoadLoginData",
                        nativeFunc: this.loadLoginData
                    }, {functionName: "GetUserID", nativeFunc: this.getUserID}, {
                        functionName: "GetSessionID",
                        nativeFunc: this.getSessionID
                    }, {functionName: "ShowLoginDlg", nativeFunc: this.showLoginDlg}, {
                        functionName: "GetLoginInfo",
                        nativeFunc: this.getLoginInfo
                    }, {functionName: "GetUserInfo", nativeFunc: this.getUserInfo}, {
                        functionName: "GetAllUserInfo",
                        nativeFunc: this.getAllUserInfo
                    }, {functionName: "IsLogined", nativeFunc: this.isLogined}, {
                        functionName: "Logout",
                        nativeFunc: this.logout
                    }, {
                        functionName: "GetLoginDeviceID",
                        nativeFunc: this.getLoginDeviceID
                    }, {
                        functionName: "RetryLogIn",
                        nativeFunc: this.retryLogIn
                    }, {
                        functionName: "ShowModifierUserInfoWnd",
                        nativeFunc: this.showModifierUserInfoWnd
                    }, {
                        functionName: "GetUserHeaderByUserID",
                        nativeFunc: this.getUserHeaderByUserID
                    }, {
                        functionName: "IsAlreadySign",
                        nativeFunc: this.isAlreadySign
                    }, {functionName: "IsHaveSignQuestion", nativeFunc: this.isHaveSignQuestion}];
                    a.setDefaultNativeFunctionMap(e)
                }
            }

            fireEvent(e, t, n, i) {
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                let a = i[0];
                d.information("fireEvent eventName:", a), i.splice(0, 1), r.NativeCallHostModule.nativeCallHost.fireNativeEvent(a, ...i), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            getUserID(e, t, n, i) {
                d.information("getUserID:", i), u.LoginHelperNS.loginHelper.getUserInfo("userid", function (i) {
                    d.information("getUserID:userid = ", i), null !== i && void 0 !== i && "" !== i || (i = "0"), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                })
            }

            getSessionID(e, t, n, i) {
                d.information("getSessionID:", i), u.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (i) {
                    d.information("getSessionID:sessionid = ", i), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                })
            }

            showLoginDlg(e, t, n, i) {
                d.information(i);
                let a = "", r = !0;
                o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || (a = i[0]), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[1]) || (r = i[1]), u.LoginHelperNS.loginHelper.showLoginDlg(a, r), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            getLoginInfo(e, t, n, i) {
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) u.LoginHelperNS.loginHelper.getUserInfo(function (i) {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }); else {
                    let a = i[0];
                    u.LoginHelperNS.loginHelper.getUserInfo(a, function (i) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                    })
                }
            }

            getUserInfo(e, t, n, i) {
                d.information(i), (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) && e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                let a = 0;
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) a = 0; else {
                    let e = i[0];
                    a = null === e || void 0 === e || "" === e ? 0 : Number(e)
                }
                u.LoginHelperNS.loginHelper.getUserInfoEx(a, function (i) {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                })
            }

            getAllUserInfo(e, t, n, i) {
                if (d.information(i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) u.LoginHelperNS.loginHelper.getAllUserInfo(function (i) {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }); else {
                    let a = i[0];
                    u.LoginHelperNS.loginHelper.getAllUserInfo(a, function (i) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                    })
                }
            }

            isLogined(e, t, n, i) {
                d.information(i), (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) && e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError), u.LoginHelperNS.loginHelper.isLogined(function (i) {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                })
            }

            logout(e, t, n, i) {
                d.information(i), u.LoginHelperNS.loginHelper.logout(), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            saveLoginData(e, t, n, i) {
                do {
                    if (d.information("saveLoginData", e, t, n), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1]) || o.isNullOrUndefined(i[2])) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], l = i[2];
                    u.LoginHelperNS.loginSDKHelper.saveData(a, r, l).then(i => {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                    }).catch(() => {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.CallFailed)
                    })
                } while (0)
            }

            loadLoginData(e, t, n, i) {
                let a = null;
                do {
                    if (d.information("loadLoginData", e, t, n), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let r = i[0], l = i[1];
                    a = "memory" === r && "initconfig" === l ? u.LoginHelperNS.loginSDKHelper.getInitData() : u.LoginHelperNS.loginSDKHelper.loadData(r, l), d.information("loadLoginData:data = ", a), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            createLoginWnd(e, t, n, i) {
                do {
                    if (d.information("createLoginWnd", e, t, n), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n) || o.isNullOrUndefined(i)) {
                        d.information("createLoginWnd 失败");
                        break
                    }
                    if (o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        d.information("createLoginWnd 失败 参数错误"), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], r = i[1], l = "", c = null, h = null;
                    o.isNullOrUndefined(i[2]) || (l = i[2]), o.isNullOrUndefined(i[3]) || (c = i[3]), o.isNullOrUndefined(i[4]) || (h = i[4]), u.LoginHelperNS.loginUIHelper.createLoginWnd(a, r, l, c, h), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
                } while (0)
            }

            closeLoginWnd(e, t, n, i) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n) || o.isNullOrUndefined(i)) break;
                    if (o.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    u.LoginHelperNS.loginUIHelper.closeLoginWnd(a)
                } while (0)
            }

            updateLoginWnd(e, t, n, i) {
                d.information("updateLoginWnd", e, t, n);
                let a = !1, r = null, l = null, c = null, h = null;
                o.isNullOrUndefined(i[0]) || (a = i[0]), o.isNullOrUndefined(i[1]) || (r = i[1]), o.isNullOrUndefined(i[2]) || (l = i[2]), o.isNullOrUndefined(i[3]) || (c = i[3]), o.isNullOrUndefined(i[4]) || (h = i[4]), u.LoginHelperNS.loginUIHelper.updateLoginWnd(a, r, l, c, h), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            getLoginDeviceID(e, t, n, i) {
                d.information("getDeviceID", e, t, n), u.LoginHelperNS.loginSDKHelper.getDeviceID().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.CallFailed, i)
                })
            }

            retryLogIn(e, t, n, i) {
                d.information("retryLogIn"), u.LoginHelperNS.loginHelper.logIn("retryLogIn"), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            showModifierUserInfoWnd(e, t, n, i) {
                d.information("showModifierUserInfoWnd", e, t, n);
                let a = "";
                a = o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) ? "" : i[0], u.LoginHelperNS.loginUIHelper.createModifierUserInfoWnd(a), e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
            }

            getUserHeaderByUserID(e, t, n, i) {
                if (d.information("getUserHeaderByUserID", e, t, n), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                let a = u.LoginHelperNS.loginHelper.getUserHeader(i[0]);
                e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, a)
            }

            isAlreadySign(e, t, n, i) {
                d.information("isAlreadySign", e, t, n), l.CommonSignFunctionNs.isAlreadySign().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }

            isHaveSignQuestion(e, t, n, i) {
                d.information("isHaveSignQuestion", e, t, n), l.CommonSignFunctionNs.isHaveSignQuestion().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.LoginNaviteFunctionNS || (t.LoginNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(8), o = n(67), r = n(31), s = n(37), l = n(114), u = n(83), d = n(21), c = n(66), h = n(92),
        f = n(23), p = n(201), g = n(9), k = n(256), m = n(547), T = n(138),
        v = i.default.getLogger("DKNativeFunction"), y = r.DownloadKernelTaskManager.getTaskManager(),
        S = s.DownloadKernelEventManager.getEventManager(),
        w = l.DownloadKernelCategoryViewManager.getCategoryViewManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, S.attachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.onTaskDetailChanged(...e)
                }), S.attachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.onTaskStatusChanged(...e)
                }), S.attachTaskEvent(a.DownloadKernel.TaskEventType.DcdnStatusChanged, (...e) => {
                    this.onTaskDcdnStatusChanged(...e)
                }), S.attachTaskEvent(a.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), S.attachTaskEvent(a.DownloadKernel.TaskEventType.BtSubFileForbidden, (...e) => {
                    this.onBtSubFileForbidden(...e)
                }), S.attachTaskEvent(a.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, (...e) => {
                    this.onBtSubFileDcdnStatusChanged(...e)
                }), S.attachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    this.onTaskInserted(...e)
                }), S.attachTaskEvent(a.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    this.onTaskRemoved(...e)
                }), o.DownloadKernelManager.attachListener(f.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                    this.onGlobalDownloadSpeedChanged(...e)
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "GetTaskChannelInfo",
                        nativeFunc: this.getTaskChannelInfo
                    }, {
                        functionName: "GetTaskBaseInfo",
                        nativeFunc: this.getTaskBaseInfo
                    }, {
                        functionName: "GetTaskAttribute",
                        nativeFunc: this.getTaskAttribute
                    }, {functionName: "GetTaskStatus", nativeFunc: this.getTaskStatus}, {
                        functionName: "FindTask",
                        nativeFunc: this.findTask
                    }, {functionName: "IsTaskExist", nativeFunc: this.isTaskExist}, {
                        functionName: "IsSupportPlay",
                        nativeFunc: this.isSupportPlay
                    }, {
                        functionName: "GetTaskDownloadSpeed",
                        nativeFunc: this.getTaskDownloadSpeed
                    }, {
                        functionName: "EnableDcdnWithVipCert",
                        nativeFunc: this.enableDcdnWithVipCert
                    }, {
                        functionName: "UpdateDcdnWithVipCert",
                        nativeFunc: this.updateDcdnWithVipCert
                    }, {
                        functionName: "DisableDcdnWithVipCert",
                        nativeFunc: this.disableDcdnWithVipCert
                    }, {functionName: "GetTpPeerId", nativeFunc: this.getPeerId}, {
                        functionName: "ExecSqlite",
                        nativeFunc: this.execSqlite
                    }, {
                        functionName: "QuerySqlite",
                        nativeFunc: this.querySqlite
                    }, {
                        functionName: "GetCategoryViewTaskList",
                        nativeFunc: this.getCategoryViewTaskList
                    }, {
                        functionName: "GetCategoryViewTaskListForSuspensionWnd",
                        nativeFunc: this.getCategoryViewTaskListForSuspensionWnd
                    }, {
                        functionName: "IsLoadStorageTaskFinish",
                        nativeFunc: this.isLoadStorageTaskFinish
                    }, {
                        functionName: "IsSupportInstall",
                        nativeFunc: this.isSupportInstall
                    }, {
                        functionName: "GetDownloadProgress",
                        nativeFunc: this.getDownloadProgress
                    }, {functionName: "IsSingleBtTask", nativeFunc: this.isSingleBtTask}];
                    u.setDefaultNativeFunctionMap(e)
                }
            }

            getTaskChannelInfo(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = y.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.getTaskChannelInfo(), a = JSON.stringify(i);
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskAttribute(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], r = y.getTaskFromTaskId(a);
                    if (r) {
                        let i = r.getTaskAttribute(o), a = JSON.stringify(i);
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskBaseInfo(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = y.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.getTaskBaseInfo(), a = JSON.stringify(i);
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskDownloadSpeed(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = y.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.getDownloadSpeed();
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskStatus(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = y.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.getTaskStatus();
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            findTask(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = {keyType: i[0], keyValue: i[1], keyFilter: a.DownloadKernel.KeyFilter.All};
                    y.batchFindTaskAsync([o]).then(i => {
                        if (i && i.length > 0) {
                            let o = i[0].getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                            e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !0, o)
                        } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1, 0)
                    }).catch()
                } while (0)
            }

            isTaskExist(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0];
                    y.getTaskFromTaskId(a) ? e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !0) : e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            isSupportPlay(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = y.getTaskFromTaskId(a);
                    if (o) {
                        let i = o.isSupportPlay();
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            enableDcdnWithVipCert(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = y.getTaskFromTaskId(a);
                    o ? (o.enableDcdnWithVipCert(i[1]), e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            updateDcdnWithVipCert(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = y.getTaskFromTaskId(a);
                    o ? (o.updateDcdnWithVipCert(i[1]), e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            disableDcdnWithVipCert(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = y.getTaskFromTaskId(a);
                    o ? (o.disableDcdnWithVipCert(), e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getPeerId(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    v.verbose(i), o.DownloadKernelManager.getPeerId().then(i => {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    }).catch()
                } while (0)
            }

            execSqlite(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    h.ThunderKernel.execSqlite(i[0], i => {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    })
                } while (0)
            }

            querySqlite(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    h.ThunderKernel.querySqlite(i[0], i => {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    })
                } while (0)
            }

            getCategoryViewTaskList(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = w.getCategoryViewFromId(i[0]);
                    if (a) {
                        let i = [], o = a.getTasks();
                        if (o) for (let e of o) {
                            let t = e[0];
                            i.push(t)
                        }
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getCategoryViewTaskListForSuspensionWnd(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = w.getCategoryViewFromId(i[0]);
                    if (a) {
                        let i = a.getTasks(), o = "", r = [];
                        if (i) {
                            for (let [, e]of i) {
                                let t = e.getTaskBaseInfo();
                                r.push(t)
                            }
                            o = JSON.stringify(r)
                        }
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, o)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            isLoadStorageTaskFinish(e, t, n) {
                do {
                    if (!e || !t || !n) break;
                    o.DownloadKernelManager.attachListener(f.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            onTaskDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.DetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], n = e[2], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let o = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId), r = n.getTaskBaseInfo();
                        i[o] = r
                    }
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskDetailChanged", JSON.stringify(i), n)
                } while (0)
            }

            onTaskStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], n = {};
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let o = i.getTaskStatus();
                        n[i.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId)] = o
                    }
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskStatusChanged", JSON.stringify(n))
                } while (0)
            }

            onTaskDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.DcdnStatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], n = {};
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let o = i.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId),
                            r = i.getTaskChannelInfo().dcdnStatus;
                        n[o] = r
                    }
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskDcdnStatusChanged", JSON.stringify(n))
                } while (0)
            }

            onBtSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], n = e[2];
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileDetailChanged", t, JSON.stringify(n))
                } while (0)
            }

            onBtSubFileForbidden(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.BtSubFileForbidden) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], n = e[2];
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileForbidden", t, n)
                } while (0)
            }

            onBtSubFileDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged) break;
                    if (!e[1] || null === e[2] || void 0 === e[2] || null === e[3] || void 0 === e[3] || null === e[4] || void 0 === e[4]) break;
                    let t = e[1], n = e[2], i = e[3], o = e[4];
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileDcdnStatusChanged", t, n, i, o)
                } while (0)
            }

            onTaskInserted(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], n = e[2], i = e[3], o = [];
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e].getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                        o.push(t)
                    }
                    let r = JSON.stringify(o);
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskInserted", t, n, r)
                } while (0)
            }

            onTaskRemoved(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== a.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], n = e[2], i = e[3], o = [];
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e].getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                        o.push(t)
                    }
                    let r = JSON.stringify(o);
                    c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskRemoved", t, n, r)
                } while (0)
            }

            onGlobalDownloadSpeedChanged(...e) {
                let t = o.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1),
                    n = o.DownloadKernelManager.getTotalTaskVipSpeed(!1, !1);
                c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnGlobalDownloadSpeedChanged", t, n)
            }

            isSupportInstall(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0]) {
                        e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = i[0], r = y.getTaskFromTaskId(o);
                    if (r.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskType) === a.DownloadKernel.TaskType.Group) {
                        let i = r.getExtraObject(),
                            a = i.getUserData(k.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                        if (void 0 !== a && null !== a && "" !== a && "0" !== a) {
                            let r = p.TaskCtrlOperatorNS.getSavePathByFileName(o, a);
                            g.FileSystemAWNS.existsAW(r).then(a => {
                                if (a) {
                                    let a = i.getUserData(k.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams");
                                    e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !0, r, a)
                                } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                            }).catch()
                        } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                    } else e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            getDownloadProgress(e, t, n, i) {
                let a = m.DownloadProgressNS.getDownloadProgressPercent();
                e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, a)
            }

            isSingleBtTask(e, t, n, i) {
                let a = i[0], o = y.getTaskFromTaskId(a);
                T.SingleBtTaskNS.isSingleBtTask(o).then(i => {
                    e.callNativeFunctionCallback(t, n, d.NativeFunctionErrorCode.Success, i)
                }).catch()
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.DKNaviteFunctionNS || (t.DKNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(23), o = n(83), r = n(21), s = n(66), l = n(22), u = n(150), d = n(258),
        c = i.default.getLogger("ConfigNaviteFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigValueChanged, (e, t, n, i) => {
                    s.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnConfigValueChanaged", e, t, n, i)
                }), l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    s.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnConfigInitFinished")
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "Save", nativeFunc: this.save}, {
                        functionName: "GetValue",
                        nativeFunc: this.getValue
                    }, {functionName: "SetValue", nativeFunc: this.setValue}, {
                        functionName: "SaveConfig",
                        nativeFunc: this.save
                    }, {functionName: "GetConfigValue", nativeFunc: this.getValue}, {
                        functionName: "SetConfigValue",
                        nativeFunc: this.setValue
                    }, {
                        functionName: "IsConfigInitFinish",
                        nativeFunc: this.isConfigInitFinish
                    }, {
                        functionName: "GetConfigModules",
                        nativeFunc: this.getConfigModules
                    }, {
                        functionName: "IsConfigBrowserInitFinish",
                        nativeFunc: this.isConfigBrowserInitFinish
                    }, {functionName: "GetInstallBrowserInfo", nativeFunc: this.getInstallBrowserInfo}];
                    o.setDefaultNativeFunctionMap(e)
                }
            }

            save(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    c.verbose(i), l.ConfigNS.save().then(() => {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                    }).catch()
                } while (0)
            }

            getValue(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], s = i[2], u = l.ConfigNS.getValue(a, o, s);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, u)
                } while (0)
            }

            setValue(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (!i || !i[0] || !i[1]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = i[1], s = i[2];
                    l.ConfigNS.setValue(a, o, s), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isConfigInitFinish(e, t, n) {
                do {
                    if (!e || !t || !n) break;
                    l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            getConfigModules(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    let a = "", o = "";
                    null !== i && void 0 !== i && (null !== i[0] && void 0 !== i[0] && "" !== i[0] && (a = i[0]), null !== i[1] && void 0 !== i[1] && "" !== i[1] && (o = i[1]));
                    let s = u.default.getConfigInfo(a, o);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, s)
                } while (0)
            }

            isConfigBrowserInitFinish(e, t, n) {
                do {
                    if (!e || !t || !n) break;
                    d.SettingConfigHelperNS.configBrowserHelper.attachListener(a.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            getInstallBrowserInfo(e, t, n, i) {
                do {
                    if (!e || !t || !n) break;
                    if (null === i || void 0 === i || i.length <= 0 || void 0 === i[0] || null === i[0] || "" === i[0]) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], o = d.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName(a);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, o)
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.ConfigNaviteFunctionNS || (t.ConfigNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(83), a = n(7), o = n(552), r = n(551), s = n(21);
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "InstallXmp", nativeFunc: this.installXmp}, {
                        functionName: "OpenXmp",
                        nativeFunc: this.openXmp
                    }, {
                        functionName: "GetXmpCoreVersion",
                        nativeFunc: this.getXmpCoreVersion
                    }, {functionName: "GetXmpBuildNum", nativeFunc: this.getXmpBuildNum}, {
                        functionName: "GetXmpPath",
                        nativeFunc: this.getXmpPath
                    }, {functionName: "GetXmpReg", nativeFunc: this.getXmpReg}, {
                        functionName: "GetXmpUserDataPath",
                        nativeFunc: this.getXmpUserDataPath
                    }];
                    i.setDefaultNativeFunctionMap(e)
                }
            }

            installXmp(e, t, n, i) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n) || o.default.installXmp().then(() => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success)
                }).catch()
            }

            openXmp(e, t, n, i) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n)) break;
                    let r = "";
                    a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || (r = i[0]), o.default.openXmp(r).then(i => {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                    }).catch()
                } while (0)
            }

            getXmpCoreVersion(e, t, n, i) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n) || o.default.getXmpCoreVersion().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }

            getXmpBuildNum(e, t, n, i) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n) || o.default.getXmpBuildNum().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }

            getXmpPath(e, t, n, i) {
                if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n)) return;
                let o = r.DownloadAndPlayNS.getXmpPath();
                e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, o)
            }

            getXmpReg(e, t, n, i) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n)) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0])) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = i[0];
                    if (a.isNullOrUndefined(o) || "" === o) {
                        e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let l = r.DownloadAndPlayNS.getXmpReg(o);
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            getXmpUserDataPath(e, t, n, i) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(n) || o.default.getXmpUserDataPath().then(i => {
                    e.callNativeFunctionCallback(t, n, s.NativeFunctionErrorCode.Success, i)
                }).catch()
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.DownloadAndPlayNaviteFunctionNS || (t.DownloadAndPlayNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(83), r = n(21), s = n(10), l = n(824), u = n(825), d = n(66), c = n(3), h = n(36), f = n(15),
        p = n(150), g = n(2), k = n(5), m = a.default.getLogger("SkinNaviteFunction"),
        T = k.default(g.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.default.on("changeSkin", this.onChangeSkin), u.default.on("changeSkin", this.onChangeSpeedCurveSkin)
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "GetSkinInfo", nativeFunc: this.getSkinInfo}, {
                        functionName: "SetSkinInfo",
                        nativeFunc: this.setSkinInfo
                    }, {
                        functionName: "GetSpeedCurveSkinInfo",
                        nativeFunc: this.getSpeedCurveSkinInfo
                    }, {
                        functionName: "SetSpeedCurveSkinInfo",
                        nativeFunc: this.setSpeedCurveSkinInfo
                    }, {
                        functionName: "ClickSpeedCurveIcon",
                        nativeFunc: this.clickSpeedCurveIcon
                    }, {functionName: "ShowIndividuation", nativeFunc: this.showIndividuation}];
                    o.setDefaultNativeFunctionMap(e)
                }
            }

            getSkinInfo(e, t, n) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                    let i = l.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(i)) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    m.information(i), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                } while (0)
            }

            setSkinInfo(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield l.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (i) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSkin(e, t) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    m.information(e), d.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSkin", e, t), c.ipcRenderer.send("OnChangeSkin", e)
                } while (0)
            }

            getSpeedCurveSkinInfo(e, t, n) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                    let i = u.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(i)) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    m.information(i), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                } while (0)
            }

            setSpeedCurveSkinInfo(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield u.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (i) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            clickSpeedCurveIcon(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                        try {
                            yield f.default("ShowIndividuation", {activeKey: "skin", skinActiveKey: "speedcurve"})
                        } catch (i) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSpeedCurveSkin(e, t, n) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    m.information("onChangeSpeedCurveSkin", e), d.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSpeedCurveSkin", e, t, n)
                } while (0)
            }

            showIndividuation(e, t, n, a) {
                return i(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(n)) break;
                        if (s.ThunderUtil.isUndef(a)) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let i;
                        try {
                            i = yield h.MessageBox.custom("Individuation", Object.assign({
                                singleton: !0,
                                version: T.getFileVersion(g.join(__rootDir, "../../Thunder.exe")),
                                dynamicSkinVersion: p.default.getConfigInfo("dynamicSkinVersion")
                            }, a[0] || {}), {modal: !1, webPreferences: {webSecurity: !1}})
                        } catch (i) {
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.SkinNaviteFunctionNS || (t.SkinNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(35), o = n(1), r = n(38), s = n(10), l = n(568), u = n(9), d = o.default.getLogger("Thunder.Skin");
    t.default = new class extends a.EventEmitter {
        constructor() {
            super(), this.skinInfo = r.SkinHelperNS.defaultSkinInfo, this.cacheURL = `${__profilesDir}/skin-info.json`, this.init().catch(e => {
                d.warning(e)
            })
        }

        init() {
            return i(this, void 0, void 0, function* () {
                do {
                    let e;
                    try {
                        e = JSON.parse((yield u.FileSystemAWNS.readFileAW(this.cacheURL)).toString())
                    } catch (e) {
                        d.warning("解析皮肤信息失败")
                    }
                    if (s.ThunderUtil.isUndef(e)) break;
                    yield this.setSkinInfo(e)
                } while (0)
            })
        }

        getSkinInfo() {
            return this.skinInfo
        }

        setSkinInfo(e, t = !1, n = !1) {
            return i(this, void 0, void 0, function* () {
                if (s.ThunderUtil.isDef(e)) {
                    this.skinInfo = e, this.skinInfo.colors = l.SkinConfigNS.colorList.find(e => e.id === this.skinInfo.colorID).colors, this.emit("changeSkin", this.skinInfo, t);
                    let i = Object.assign({}, this.skinInfo);
                    delete i.colors;
                    try {
                        !n && (yield u.FileSystemAWNS.writeFileAW(this.cacheURL, JSON.stringify(i)))
                    } catch (e) {
                        d.warning("保存皮肤信息失败")
                    }
                }
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(35), o = n(1), r = n(246), s = n(10), l = n(9), u = n(257),
        d = o.default.getLogger("Thunder.speedcurve-skin.skin-manager"), c = r.SpeedCurveSkinHelperNS.cacheDir;
    t.default = new class extends a.EventEmitter {
        constructor() {
            super(), this.skinInfo = r.SpeedCurveSkinHelperNS.defaultSkinInfo, this.cacheURL = `${c}/skin-info.json`, this.init().catch(e => {
                d.warning(e)
            })
        }

        init() {
            return i(this, void 0, void 0, function* () {
                do {
                    let e;
                    yield l.FileSystemAWNS.mkdirAW(c);
                    try {
                        e = JSON.parse((yield l.FileSystemAWNS.readFileAW(this.cacheURL)).toString())
                    } catch (e) {
                        d.warning("解析皮肤信息失败")
                    }
                    if (s.ThunderUtil.isUndef(e)) break;
                    let t = JSON.parse(localStorage.getItem("speedcurveSkins"));
                    if (null === t && (t = (yield u.default.getSkins()) || []), e = t.find(t => t.id === e.id), s.ThunderUtil.isUndef(e)) break;
                    yield this.setSkinInfo(e)
                } while (0)
            })
        }

        getSkinInfo() {
            return this.skinInfo
        }

        setSkinInfo(e, t = !1, n = !1) {
            return i(this, void 0, void 0, function* () {
                if (s.ThunderUtil.isDef(e)) {
                    this.skinInfo = e, this.emit("changeSkin", this.skinInfo, t, n);
                    try {
                        if (!n) {
                            let t = {id: e.id, type: e.type};
                            d.information("保存皮肤", JSON.stringify(t)), yield l.FileSystemAWNS.writeFileAW(this.cacheURL, JSON.stringify(t))
                        }
                    } catch (e) {
                        d.warning("保存皮肤信息失败")
                    }
                }
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(9), r = n(22), s = n(23), l = n(85), u = n(8), d = n(67), c = n(37), h = n(569), f = n(3),
        p = n(1), g = n(259), k = n(295), m = n(256), T = n(139), v = n(153), y = n(149), S = n(13), w = n(155),
        b = n(157), C = n(79), N = n(65), D = k.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        I = c.DownloadKernelEventManager.getEventManager(), _ = p.default.getLogger("notification-render"),
        x = v.ToastNotifyManagerNS.getToastNotifyManger(), A = C.UserHelperNS.getHelper(),
        E = g.MsgQueueNS.MsgPriority.Download;
    const M = new class {
        init() {
            this.attachConfigInitFinished(), this.attachTaskStatusChanged(), this.attachTaskCreated()
        }

        attachConfigInitFinished() {
            r.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished()
            })
        }

        onConfigInitFinished() {
            this.attachLoadStorageTaskFinish()
        }

        attachLoadStorageTaskFinish() {
            d.DownloadKernelManager.attachListener(s.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                this.autoStartUnfinishTask(), setTimeout(() => {
                    this.autoDeleteNonExistTasks().catch()
                }, 1e4)
            })
        }

        autoDeleteNonExistTasks() {
            return i(this, void 0, void 0, function* () {
                if (r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoDeleteNotExistFile", !1)) {
                    let e = yield l.TaskOperatorNs.removeNonExistingTask();
                    if (e > 0) {
                        let t = "已自动删除" + e + "个文件不存在的任务";
                        _.information(t), x.showNotify(v.ToastNotifyManagerNS.notifyIdAutoDeleteNonExistTasks, y.ToastNotifyItemType.GreenNotify, t, 3e3)
                    }
                }
            })
        }

        autoStartUnfinishTask() {
            let e = r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_MaxRunningTaskCount", 5);
            T.DownloadDispatchNS.setStartTaskCount(e), r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoStartUnFinishedTask", !1) && l.TaskOperatorNs.startAll()
        }

        getBrowserFromProductInfo(e) {
            let t = "";
            do {
                if (void 0 === e || null === e || "" === e) break;
                let n = /^(xl_thunder_pc)\|([\d\.]+)\|(\d+)\|(.*)$/.exec(e);
                if (null === n) break;
                if (null === n[4] || void 0 === n[4]) break;
                t = n[4]
            } while (0);
            return t
        }

        convertSourceToStat(e) {
            let t = e;
            do {
                if ("leftup" === e || "rightup" === e || "BHO_left" === e || "BHO_right" === e) {
                    t = "BHO";
                    break
                }
                if ("wfp" === e) {
                    t = "XLWFP";
                    break
                }
                if ("redown" === e) {
                    t = "re_download";
                    break
                }
                if ("newwindow" === e) {
                    t = "newwindow_url";
                    break
                }
                if ("bt_file" === e) {
                    t = "Torrent";
                    break
                }
            } while (0);
            return t
        }

        statCoreEvent(e, t, n) {
            return i(this, void 0, void 0, function* () {
                do {
                    if (null === e) break;
                    if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                    let i = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Origin);
                    i = this.convertSourceToStat(i);
                    let o = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.ProductInfo),
                        r = this.getBrowserFromProductInfo(o), s = e.getId();
                    const l = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize);
                    let c = `broswer=${r},taskid=${s}`, h = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType),
                        f = "";
                    if (h === u.DownloadKernel.TaskType.P2sp) f = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl), c = `${c},task_type=p2sp,download_info=${encodeURIComponent(f)}`; else if (h === u.DownloadKernel.TaskType.Bt) {
                        let t = e.getExtraObject().getInfoId();
                        c = `${c},task_type=bt,download_info=${t}`, f = t
                    } else h === u.DownloadKernel.TaskType.Emule ? (f = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl), c = `${c},task_type=emule,download_info=${encodeURIComponent(f)}`) : h === u.DownloadKernel.TaskType.Group ? c = `${c},task_type=group,download_info=` : h === u.DownloadKernel.TaskType.Magnet && (f = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl), c = `${c},task_type=magnet,download_info=${encodeURIComponent(f)}`);
                    let p = yield b.isVestUrl(f, "vestURL"), g = yield b.isVestUrl(f, "commonUrl");
                    p ? i = "xl_password_vest" : g && (i = "xl_password_common");
                    let k = 0;
                    A.isLogin && A.isVip && (k = A.isSuperVip ? 7 : A.isPlatinumVip ? 3 : 2), c = `${c},source=${i},is_login=${A.isLogin ? 1 : 0},is_vip=${A.isVip ? 1 : 0},vip_type=${k}`;
                    let m = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), T = encodeURIComponent(m),
                        v = a.extname(m);
                    "" !== (v = void 0 === v ? "" : v) && (v = v.substring(1)), w.ParseUrlFileNameNS.isUsualFileExtName(v) || (v = ""), c = `${c},filename=${T},filesize=${l},filesuffix=${v},libversion=${d.DownloadKernelManager.getDownloadSdkVersion()}`, void 0 !== n && (c = `${c},${n}`);
                    let y = "core_event";
                    _.information("trackEvent", y, t, c), S.XLStatNS.trackEvent(y, t, "", 0, 0, 0, 0, c)
                } while (0)
            })
        }

        statJsSdkEvent(e, t, n) {
            do {
                if (null === e) break;
                if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                if (e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskType) !== u.DownloadKernel.TaskType.Group) break;
                if ("ThunderUnion" !== e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Origin)) break;
                let i = e.getId();
                const a = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize);
                let o = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName), r = encodeURIComponent(o),
                    s = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid), l = e.getExtraObject();
                if (null === l || void 0 === l) break;
                let d = `taskid=${i},filesize=${a},filename=${r},gcid=${s},filenum=${l.getSubTaskCount()}`;
                if ("js_grouptask_download_success" === t && null !== a && void 0 !== a && a >= 1048576) {
                    let t = 0, n = 0, i = 0, a = 0, o = e.getTaskChannelInfo();
                    if (null !== o && void 0 !== o) {
                        void 0 !== o.originSize && (t = this.getSizeFormat(o.originSize)), null !== o.p2sSize && void 0 !== o.p2sSize && (n = this.getSizeFormat(o.p2sSize)), null !== o.p2pSize && void 0 !== o.p2pSize && (i = this.getSizeFormat(o.p2pSize));
                        let e = 0;
                        null !== o.offlineSize && void 0 !== o.offlineSize && (e = o.offlineSize), null !== o.dcdnSize && void 0 !== o.dcdnSize && (e += o.dcdnSize), d = `${d},ysdzh=${t},jxjs=${n},P2P=${i},hyjs=${a = this.getSizeFormat(e)}`
                    }
                }
                void 0 !== n && (d = `${d},${n}`);
                let c = "core_operate";
                _.information("trackEvent", c, t, d), S.XLStatNS.trackEvent(c, t, "", 0, 0, 0, 0, d)
            } while (0)
        }

        getSizeFormat(e) {
            let t = 0;
            do {
                if (void 0 === e || null === e || e <= 0) break;
                t = Number((e / 1048576).toFixed(2))
            } while (0);
            return t
        }

        attachTaskCreated() {
            I.attachTaskEvent(u.DownloadKernel.TaskEventType.TaskCreated, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== u.DownloadKernel.TaskEventType.TaskCreated) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e of t) this.statCoreEvent(e, "createtask").catch(), this.statJsSdkEvent(e, "js_grouptask_create")
                } while (0)
            })
        }

        attachTaskStatusChanged() {
            I.attachTaskEvent(u.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== u.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let i = n.getTaskStatus();
                        if (n.getTaskAttribute(u.DownloadKernel.TaskAttribute.GroupTaskId) > 0) {
                            i === u.DownloadKernel.TaskStatus.Succeeded && this.checkOpenOnFinish(n).catch();
                            continue
                        }
                        let a = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background);
                        if (i === u.DownloadKernel.TaskStatus.Succeeded) {
                            let e = `task_stop_type=success,errorcode=0,gcid=${n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid)}`;
                            this.statCoreEvent(n, "download_task_result", e).catch();
                            let t = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.CreateTime);
                            e = `downloadtime=${(n.getTaskAttribute(u.DownloadKernel.TaskAttribute.CompletionTime) - t) / 1e3}`, this.statJsSdkEvent(n, "js_grouptask_download_success", e), a || this.onTaskFinished(n)
                        } else if (i === u.DownloadKernel.TaskStatus.Failed) {
                            let e = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.Gcid),
                                t = n.getTaskAttribute(u.DownloadKernel.TaskAttribute.ErrorCode),
                                i = `task_stop_type=fail,errorcode=${t},gcid=${e}`;
                            this.statCoreEvent(n, "download_task_result", i).catch(), i = `errorcode=${t}`, this.statJsSdkEvent(n, "js_grouptask_download_fail", i), a || this.onTaskFailed(n)
                        }
                    }
                } while (0)
            })
        }

        getTaskUrl(e) {
            let t = "", n = e.getType();
            return n === u.DownloadKernel.TaskType.Bt ? t = e.getExtraObject().getSeedFilePath() : n !== u.DownloadKernel.TaskType.Emule && n !== u.DownloadKernel.TaskType.P2sp || (t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskUrl)), t
        }

        getDownloadFileReportedData(e) {
            let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize),
                n = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.Cid), i = this.getTaskUrl(e), a = 0, o = 0,
                r = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadSize),
                s = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.DownloadingPeriod),
                l = e.getTaskChannelInfo().originSize;
            _.information("getDownloadFileReportedData fileSize=", t, ";cid=", n, ";url=", i, ";recvValidSize=", r, ";period=", s, ";originalsize=", l), null !== t && void 0 !== t && null !== s && void 0 !== s && null !== l && void 0 !== l && 0 !== l && null !== r && void 0 !== r && 0 !== r ? o = Math.floor((t / l - t / r) * s) : a = 1;
            let d = JSON.stringify({
                type: "dlfile_report",
                data: {dlFileSize: t, cid: n, url: i, deadLinks: a, saveTime: o}
            });
            return _.information("getDownloadFileReportedData data=", d), d
        }

        onTaskFinished(e) {
            let t = r.ConfigNS.getValue("BossKey", "BossKeyState", !1);
            const n = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_Finish", !0),
                i = f.remote.getGlobal("mainRendererWindow"), a = i.isMinimized(), o = i.isVisible(),
                s = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName),
                d = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize), c = e.getTaskBaseInfo(),
                p = c.taskType === u.DownloadKernel.TaskType.Group, g = e.getIsPrivate(),
                k = null !== f.remote.BrowserWindow.getFocusedWindow();
            if (N.LoginHelperNS.loginHelper.channel(this.getDownloadFileReportedData(e)), t || this.playTaskFinishedSound().catch(), this.openFinishedTask(e).catch(), p) {
                let t = e.getExtraObject().getUserData(m.TaskUserDataGUID.guidDownloadCompleteInstall, "isImmediatelyInstall");
                null !== t && void 0 !== t && "1" === t && l.TaskOperatorNs.executeInstallFile(e).catch()
            }
            if (!t && n && (a || !o || !k) && s && !g) {
                if (p && d < 10485760) return;
                _.information("DownloadComplete", D), D.enQueue({
                    callback: function () {
                        _.information("trackEvent", "download_leftpanel", "dl_finished_tips_show", "panel_type=mypc"), S.XLStatNS.trackEvent("download_leftpanel", "dl_finished_tips_show", "", 0, 0, 0, 0, "panel_type=mypc"), h.Notification.notify({
                            type: "DownloadComplete",
                            data: {taskBase: c},
                            width: 400,
                            height: 205
                        })
                    }, name: "download", priority: E
                }), h.Notification.getCurrentWindow() ? D.getCurrentProperty() < E && h.Notification.close() : D.deQueue()
            }
        }

        onTaskFailed(e) {
            let t = r.ConfigNS.getValue("BossKey", "BossKeyState", !1);
            const n = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_FailSuggest", !0),
                i = f.remote.getGlobal("mainRendererWindow"), a = i.isMinimized(), o = i.isVisible(),
                s = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName),
                l = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.FileSize), d = e.getTaskBaseInfo(),
                c = d.taskType === u.DownloadKernel.TaskType.Group, p = e.getIsPrivate(),
                g = null !== f.remote.BrowserWindow.getFocusedWindow();
            if (!t && n && (a || !o || !g) && s && !p) {
                if (c && l < 10485760) return;
                D.enQueue({
                    callback: function () {
                        _.information("trackEvent", "download_leftpanel", "dl_fail_tips_show", "panel_type=mypc"), S.XLStatNS.trackEvent("download_leftpanel", "dl_fail_tips_show", "", 0, 0, 0, 0, "panel_type=mypc"), h.Notification.notify({
                            type: "DownloadFail",
                            data: {taskBase: d},
                            width: 400,
                            height: 180
                        })
                    }, name: "download", priority: E
                }), h.Notification.getCurrentWindow() ? D.getCurrentProperty() < E && h.Notification.close() : D.deQueue()
            }
        }

        playTaskFinishedSound() {
            return i(this, void 0, void 0, function* () {
                if (r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_PlayWaveWhileFinish", !0)) {
                    let e = a.join(__rootDir, "../../download-complete.wav"),
                        t = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_WavePath", e);
                    (yield o.FileSystemAWNS.existsAW(t)) ? yield new Audio(t).play() : (yield o.FileSystemAWNS.existsAW(e)) && (yield new Audio(e).play())
                }
            })
        }

        checkOpenOnFinish(e) {
            return i(this, void 0, void 0, function* () {
                let t = e.getTaskAttribute(u.DownloadKernel.TaskAttribute.TaskName);
                if (".torrent" === a.extname(t)) {
                    if (r.ConfigNS.getValue("BtGenericSettings", "AutoBTNewTask", !1)) {
                        let t = e.getTaskBaseInfo();
                        yield l.TaskOperatorNs.openTaskItem(t)
                    }
                } else if (1 === e.getTaskAttribute(u.DownloadKernel.TaskAttribute.OpenOnComplete)) {
                    let t = e.getTaskBaseInfo();
                    yield l.TaskOperatorNs.openTaskItem(t)
                }
            })
        }

        openFinishedTask(e) {
            return i(this, void 0, void 0, function* () {
                if (r.ConfigNS.getValue("TaskDefaultSettings", "OpenFile", !1)) {
                    let t = e.getTaskBaseInfo();
                    yield l.TaskOperatorNs.openTaskItem(t)
                } else this.checkOpenOnFinish(e).catch()
            })
        }
    };
    !function (e) {
        e.init = function () {
            M.init()
        }
    }(t.TaskHelperNS || (t.TaskHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(16), o = n(2), r = n(5), s = n(1), l = n(13), u = n(23), d = n(22), c = n(567), h = n(67), f = n(737),
        p = n(294), g = n(85), k = n(139), m = n(153), T = n(149), v = n(258), y = n(738), S = n(3), w = n(14),
        b = s.default.getLogger("ConfigHandler"), C = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        N = m.ToastNotifyManagerNS.getToastNotifyManger();
    const D = new class {
        init() {
            this.attachConfigInitFinished(), d.ConfigNS.attachListener(u.NodeEventMesssageNS.eventConfigValueChanged, (e, t, n, i) => {
                switch (e) {
                    case"ConfigNormalSession":
                        this.onConfigNormalSessionChanged(t, n, i);
                        break;
                    case"TaskDefaultSettings":
                        this.onTaskDefaultSettingsChanged(t, n, i);
                        break;
                    case"ConfigNet":
                        this.onConfigNetChanged(t, n, i);
                        break;
                    case"ConfigMsg":
                        this.onConfigMsgChanged(t, n, i);
                        break;
                    case"Monitor":
                        this.onMonitorChanged(t, n, i);
                        break;
                    case"Proxy":
                        this.onProxyChanged(t, n, i);
                        break;
                    case"BtGenericSettings":
                        this.onBtGenericSettingsChanged(t, n, i);
                        break;
                    case"ConfigNoLimitDownload":
                        this.onConfigNoLimitDownloadChanged(t, n, i);
                        break;
                    case"Others":
                        this.onOthersChanged(t, n, i);
                        break;
                    case"IdleDownload":
                        this.onIdleDownloadChanged(t, n, i);
                        break;
                    case"EMuleGenericSettings":
                        this.onEMuleGenericSettingsChanged(t, n, i);
                        break;
                    case"MagnetGenericSettings":
                        this.onMagnetGenericSettingsChanged(t, n, i);
                        break;
                    case"BossKey":
                        this.onBossKeyChanged(t, n, i);
                        break;
                    case"DiskCache":
                        this.onDiskCacheChanged(t, n, i);
                        break;
                    case"Motitor":
                        this.onMotitorChanged(t, n, i)
                }
            }), c.BHOConfigNS.attachListener(u.NodeEventMesssageNS.eventBHOConfigValueChanged, (e, t, n, i) => {
                switch (e) {
                    case"Monitor":
                        this.onBHOConfigMonitorSessionChanged(t, n, i)
                }
            })
        }

        attachConfigInitFinished() {
            d.ConfigNS.attachListener(u.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished()
            })
        }

        onConfigInitFinished() {
            let e = d.ConfigNS.getValue("DiskCache", "DiskCacheSelect", 256);
            h.DownloadKernelManager.setCacheSize(e);
            let t = d.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_MaxRunningTaskCount", 5);
            if (k.DownloadDispatchNS.setStartTaskCount(t), d.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAdd", !1)) {
                let e = d.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAddRate", 100);
                e = Number(e), !isNaN(e) && e > 0 && k.DownloadDispatchNS.setAutoAddTask(!0, e)
            }
            h.DownloadKernelManager.attachListener(u.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                if (d.ConfigNS.getValue("ConfigNoLimitDownload", "OpenNoLimitDownload", !1)) {
                    let e = d.ConfigNS.getValue("ConfigNoLimitDownload", "NoLimitDownloadFileSize", 30);
                    setTimeout(() => {
                        k.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(e))
                    }, 0)
                }
            });
            let n = d.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoRun", !0),
                i = C.readRegString("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder");
            n && "" === i ? d.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", 0) : n || "" === i || d.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", 1);
            let a = d.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1");
            if (this.handleDownloadMode(void 0, a), d.ConfigNS.getValue("ConfigNet", "ConfigNet_IdleDownload", !1) && y.ScheduleTaskNS.startFreeDownLoad(), d.ConfigNS.getValue("BtGenericSettings", "AssocTorrent", !0) && f.FileAssociationNS.checkAndRegisterTorrentFile(), 0 === d.ConfigNS.getValue("GenericSettings", "CheckCpu", 0)) {
                d.ConfigNS.setValue("GenericSettings", "CheckCpu", 1);
                let e = C.getCpuProcessors();
                C.getCpuFrequency(t => {
                    let n = "0";
                    n = 1 === e ? "0" : 2 === e || 3 === e ? t < 3500 ? "0" : "1" : 4 === e && t < 3e3 ? "0" : "1", d.ConfigNS.setValue("GenericSettings", "AnimationLevel", n);
                    let i = "cpu_processors=" + e.toString();
                    i += ",cpu_frequency=", i += t.toString(), l.XLStatNS.trackEvent("xdas_client_pro", "cpu_info", "", 0, 0, 0, 0, i)
                })
            }
        }

        onConfigNormalSessionChanged(e, t, n) {
            switch (e) {
                case"ConfigNormal_AutoRun":
                    this.handleAutoRun(t, n);
                    break;
                case"ConfigNormal_AutoStartUnFinishedTask":
                    break;
                case"ConfigNormal_MaxRunningTaskCount":
                    this.handleSetMaxRunningTaskCount(t, n);
                    break;
                case"TaskCountTotalSpeed":
                case"ConfigNormal_AutoSlowTask2Tail":
                    break;
                case"ConfigNormal_AutoDeleteNotExistFile":
                    this.handleAutoDeleteNonExistTasks(t, n).catch()
            }
        }

        onTaskDefaultSettingsChanged(e, t, n) {
            switch (e) {
                case"DefaultPath":
                case"UseLastCatalog":
                case"Win7Libraries":
                case"NewTaskStartMode":
                case"OpenFile":
                case"OpenSilenceDownload":
                    break;
                case"AwayModeEnabled":
                    this.handleAwayMode(t, n);
                    break;
                case"NewTaskDlgWithoutMainWnd":
                    this.handleNewTaskDlgWithoutMainWnd(t, n);
                    break;
                case"OrignHostThreads":
                    this.handleSetThreadCount(t, n)
            }
        }

        onConfigNetChanged(e, t, n) {
            switch (e) {
                case"ConfigNet_Type":
                    this.handleDownloadMode(t, n);
                    break;
                case"ConfigNet_Custom_DownloadSpeedChk":
                    (n = n) ? k.DownloadDispatchNS.setAutoAddTaskAvailable(!1) : k.DownloadDispatchNS.setAutoAddTaskAvailable(!0);
                    break;
                case"ConfigNet_Custom_MaxDownloadSpeed":
                case"ConfigNet_Custom_MaxUploadSpeed":
                case"ConfigNet_Custom_Time_Switch":
                case"ConfigNet_Custom_Time_Begin_Hour":
                case"ConfigNet_Custom_Time_Begin_Minute":
                case"ConfigNet_Custom_Time_End_Hour":
                case"ConfigNet_Custom_Time_End_Minute":
                    b.information("onConfigNetChanged DownloadMode handleCustomDownloadMode"), p.DownloadModeNS.handleCustomDownloadMode();
                    break;
                case"ConfigNet_OpenMirrorImageIncreaseSpeed":
                    this.handleOpenMirrorImageIncreaseSpeed(t, n);
                    break;
                case"ConfigNet_OpenXunleiP2PIncreaseSpeed":
                    this.handleOpenXunleiP2PIncreaseSpeed(t, n);
                    break;
                case"ConfigNet_IdleDownload":
                    this.handleSetFreedown(t, n)
            }
        }

        onConfigMsgChanged(e, t, n) {
            switch (e) {
                case"ConfigMsg_Finish":
                    break;
                case"ConfigMsg_PlayWaveWhileFinish":
                    this.handlePlayWaveWhileFinish(t, n)
            }
        }

        onMonitorChanged(e, t, n) {
            switch (e) {
                case"MonitorClipBoard":
                    this.handleMonitorClipBoard(t, n)
            }
        }

        handleSetFreedown(e, t) {
            b.verbose("handleSetMaxRunningTaskCount preValue:", e, "; newValue:", t), t && N.showNotify(m.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, T.ToastNotifyItemType.GreenNotify, "已开启空闲下载", 3e3)
        }

        onMotitorChanged(e, t, n) {
            b.information("onMotitorChanged:", e, t, n);
            do {
                if ("MotitorAll" === e) break;
                let t = v.SettingConfigHelperNS.configBrowserHelper.getWriteIniConfigShowBrowsers();
                c.BHOConfigNS.setValue("Monitor", "ConfigBrowsers", t), v.SettingConfigHelperNS.configBrowserHelper.savaMotiorBrowserToConfig()
            } while (0)
        }

        onProxyChanged(e, t, n) {
            switch (e) {
                case"UseProxy":
                    this.handleUseProxy(t, n)
            }
        }

        onBtGenericSettingsChanged(e, t, n) {
            switch (e) {
                case"AutoBTNewTask":
                case"AssocTorrent":
                    break;
                case"ConfigBt_SetPortType":
                    this.handleSetPortType(t, n)
            }
        }

        onConfigNoLimitDownloadChanged(e, t, n) {
            switch (e) {
                case"TaskCountAutoAdd":
                    this.handleAutoAddTask(t, n);
                    break;
                case"TaskCountAutoAddRate":
                    d.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAdd", !1) && t !== n && k.DownloadDispatchNS.setAutoAddTask(!0, Number(n));
                    break;
                case"OpenNoLimitDownload":
                    this.handleOpenNoLimitDownload(t, n);
                    break;
                case"NoLimitDownloadFileSize":
                    d.ConfigNS.getValue("ConfigNoLimitDownload", "OpenNoLimitDownload", !1) && t !== n && k.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(n))
            }
        }

        onOthersChanged(e, t, n) {
            switch (e) {
                case"AntiDisturb":
                    this.handleAntiDisturb(t, n)
            }
        }

        onIdleDownloadChanged(e, t, n) {
            switch (e) {
                case"isOpen":
                    this.handleOpenIdleDownload(t, n)
            }
        }

        onEMuleGenericSettingsChanged(e, t, n) {
            switch (e) {
                case"EMuleWatchLink":
                    this.handleWatchEmuleLink(t, n)
            }
        }

        onMagnetGenericSettingsChanged(e, t, n) {
            switch (e) {
                case"MagnetWatchLink":
                    this.handleWatchMagnetLink(t, n)
            }
        }

        onBossKeyChanged(e, t, n) {
            switch (e) {
                case"BossKeySwitch":
                    this.handleBossKeySwitch(t, n)
            }
        }

        onDiskCacheChanged(e, t, n) {
            switch (e) {
                case"DiskCacheSelect":
                    this.handleDiskCacheSelect(t, n)
            }
        }

        handleAutoRun(e, t) {
            if (b.verbose("handleAutoRun preValue:", e, "; newValue:", t), t) {
                let e = o.join(__rootDir, "../../Thunder.exe") + " -silent -StartType:AutoRun";
                C.writeRegValue("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder", e, 1)
            } else C.deleteRegValue("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder")
        }

        handleSetMaxRunningTaskCount(e, t) {
            b.verbose("handleSetMaxRunningTaskCount preValue:", e, "; newValue:", t), t && k.DownloadDispatchNS.setStartTaskCount(t)
        }

        handleAutoDeleteNonExistTasks(e, t) {
            return i(this, void 0, void 0, function* () {
                if (t) {
                    let e = yield g.TaskOperatorNs.removeNonExistingTask();
                    if (e > 0) {
                        let t = "已自动删除" + e + "个文件不存在的任务";
                        b.information(t), N.showNotify(m.ToastNotifyManagerNS.notifyIdAutoDeleteNonExistTasks, T.ToastNotifyItemType.GreenNotify, t, 3e3)
                    }
                }
            })
        }

        handleSetThreadCount(e, t) {
            b.verbose("handleSetThreadCount preValue:", e, "; newValue:", t)
        }

        handleDownloadMode(e, t) {
            b.verbose("handleDownloadMode preValue:", e, "; newValue:", t), "1" === String(t) ? (b.information("handleDownloadMode DownloadMode setFullDownloadMode"), p.DownloadModeNS.setFullDownloadMode(), k.DownloadDispatchNS.setAutoAddTaskAvailable(!0)) : "0" === String(t) && (d.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", !0) ? k.DownloadDispatchNS.setAutoAddTaskAvailable(!1) : k.DownloadDispatchNS.setAutoAddTaskAvailable(!0), b.information("handleDownloadMode DownloadMode handleCustomDownloadMode"), p.DownloadModeNS.handleCustomDownloadMode())
        }

        handleOpenMirrorImageIncreaseSpeed(e, t) {
            b.verbose("handleOpenMirrorImageIncreaseSpeed preValue:", e, "; newValue:", t), h.DownloadKernelManager.enableCommonP2sChannel(t)
        }

        handleOpenXunleiP2PIncreaseSpeed(e, t) {
            b.verbose("handleOpenXunleiP2PIncreaseSpeed preValue:", e, "; newValue:", t), h.DownloadKernelManager.enableCommonP2pChannel(t)
        }

        handleMonitorClipBoard(e, t) {
            b.verbose("handleMonitorClipBoard preValue:", e, "; newValue:", t)
        }

        handleUseProxy(e, t) {
            b.verbose("handleUseProxy preValue:", e, "; newValue:", t)
        }

        handlePlayWaveWhileFinish(e, t) {
            b.verbose("handlePlayWaveWhileFinish preValue:", e, "; newValue:", t)
        }

        handleSetPortType(e, t) {
            b.verbose("handleSetPortType preValue:", e, "; newValue:", t)
        }

        handleOpenNoLimitDownload(e, t) {
            b.verbose("handleOpenNoLimitDownload preValue:", e, "; newValue:", t);
            do {
                if (e === t) break;
                if (t) {
                    let e = d.ConfigNS.getValue("ConfigNoLimitDownload", "NoLimitDownloadFileSize", 30);
                    k.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(e))
                } else k.DownloadDispatchNS.setFreeFromScheduleOpen(!1)
            } while (0)
        }

        handleAutoAddTask(e, t) {
            do {
                if (e === t) break;
                if (t) {
                    let e = d.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAddRate", 100);
                    k.DownloadDispatchNS.setAutoAddTask(!0, Number(e))
                } else k.DownloadDispatchNS.setAutoAddTask(!1)
            } while (0)
        }

        handleAntiDisturb(e, t) {
            b.verbose("handleAntiDisturb preValue:", e, "; newValue:", t)
        }

        handleOpenIdleDownload(e, t) {
            b.verbose("handleOpenIdleDownload preValue:", e, "; newValue:", t)
        }

        handleWatchEmuleLink(e, t) {
            b.verbose("handleWatchEmuleLink preValue:", e, "; newValue:", t)
        }

        handleWatchMagnetLink(e, t) {
            b.verbose("handleWatchMagnetLink preValue:", e, "; newValue:", t)
        }

        handleBossKeySwitch(e, t) {
            b.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t)
        }

        handleDiskCacheSelect(e, t) {
            b.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t), h.DownloadKernelManager.setCacheSize(t)
        }

        onBHOConfigMonitorSessionChanged(e, t, n) {
            switch (c.BHOConfigNS.saveSync(), e) {
                case"ConfigBrowsers":
                case"FilterSitesForUI":
                    this.handleBHOConfigMonitorBrowserChanged(t, n)
            }
        }

        handleBHOConfigMonitorBrowserChanged(e, t) {
            C.notifyBrowserConfigChanged(), b.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t)
        }

        handleNewTaskDlgWithoutMainWnd(e, t) {
            e !== t && d.ConfigNS.saveSync()
        }

        setAwayMode(e) {
            let t = o.join(__rootDir, "../../ThunderCmd.exe");
            S.ipcRenderer.send(w.ThunderChannelList.channelRMExecute, "AwayMode", "runas", t, e, "", "SW_HIDE"), S.ipcRenderer.once(w.ThunderChannelList.channelMRExecuteResult, function (t, n, i) {
                if ("AwayMode" === n) if (i > 32) {
                    let t = !0;
                    "-CloseLeaveMode" === e && (t = !1), d.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", t)
                } else {
                    let t = !1;
                    "-CloseLeaveMode" === e && (t = !0), d.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", t)
                }
            })
        }

        handleAwayMode(e, t) {
            let n = t, i = a.release(), o = i.indexOf(".", 0), r = i.substring(0, o);
            if (null !== r && void 0 !== r && Number(r) >= 6) {
                let e = C.queryRegValue("HKEY_LOCAL_MACHINE", "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", "AwayModeEnabled");
                b.information("设置离开模式:", n, e), n ? 1 !== e ? this.setAwayMode("-OpenLeaveMode") : d.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", !0) : 1 === e ? this.setAwayMode("-CloseLeaveMode") : d.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", !1)
            }
        }
    };
    !function (e) {
        e.init = function () {
            D.init()
        }
    }(t.ConfigHandlerNS || (t.ConfigHandlerNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(35), a = n(2), o = n(5);
    let r = null, s = null, l = null;
    s = o.default(a.join(__rootDir, "../bin/ThunderHelper.node"));

    class u extends i.EventEmitter {
        constructor() {
            super(...arguments), this.keyboard = null
        }

        setKeyboard(e) {
            this.keyboard = e
        }

        ref() {
            this.keyboard && this.keyboard.ref()
        }

        unref() {
            this.keyboard && this.keyboard.unref()
        }

        destroy() {
            this.keyboard && (this.keyboard.destroy(), this.keyboard = null, r = null, l = null)
        }
    }

    t.WinKeyboardEvent = u, t.keyboardUse = function (e) {
        if (r) return;
        r = s.registerWinKeyboardObj(), l = new u;
        let t = new r(t => {
            e(t)
        });
        l.setKeyboard(t)
    }, t.keyboardDestroy = function () {
        l && l.destroy()
    }
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(679), a = n(300);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(615), n(616), n(919), n(617), n(920), n(618), n(921), n(922), n(923), n(924), n(925);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\app.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(669), a = n(302);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(870);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(678), a = n(304);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\login-area.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(22), o = n(60), r = n(833), s = n(1).default.getLogger("login-prompt"), l = n(6);
    let u = new r.DataHelper;
    var d;
    !function (e) {
        e.promptDataGet = "OnpromptDataGet"
    }(d = t.LoginPromptManagerEventNS || (t.LoginPromptManagerEventNS = {}));

    class c extends o.default {
        constructor() {
            super(...arguments), this.dataList = null
        }

        init() {
            return i(this, void 0, void 0, function* () {
                s.information("init---\x3e"), this.setMaxListeners(1), this.fireEvent(d.promptDataGet, !0), s.information("1 fire prompt data get event"), (yield u.init()) && u.httpLoadDataInfo((e, t) => {
                    e && (this.dataList = t, s.information("datalist len", this.dataList.length), this.fireEvent(d.promptDataGet, !0), s.information("2 fire prompt data get event"), this.run())
                }), s.information("<---init")
            })
        }

        getPromptData() {
            return this.curShowData ? this.curShowData : null
        }

        run() {
            s.information("run---\x3e"), this.clearConfig(), this.startAttach(), this.startRun(), s.information("<---run")
        }

        getShowData(e) {
            for (let t = 0; t < this.dataList.length; t++) {
                const n = this.dataList[t];
                if (!e.includes(String(n.id))) return n
            }
            return null
        }

        updateData() {
            s.information("updateData---\x3e");
            let e = a.ConfigNS.getValue("XLLoginPrompt", "id", "");
            this.curShowData = this.getShowData(e), this.curShowData || (this.clearConfig(), this.curShowData = this.getShowData("")), s.information("cur show data", this.curShowData), e = "" === (e = a.ConfigNS.getValue("XLLoginPrompt", "id", "")) ? String(this.curShowData.id) : e + "," + this.curShowData.id, s.information("showids", e), a.ConfigNS.setValue("XLLoginPrompt", "id", e), this.fireEvent(d.promptDataGet, !0), s.information("3 fire prompt data get event"), s.information("<---updateData")
        }

        hideLoginPromptPanel() {
            s.information("hideLoginPromptPanel---\x3e")
        }

        startAttach() {
            s.information("startAttach---\x3e"), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => i(this, void 0, void 0, function* () {
                this.startRun()
            })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.startRun()
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("OnMainWindowVisibleChange", e => {
                s.information("OnMainWindowVisibleChange returnValue", e), e && this.startRun()
            }), this.startRun(), s.information("<---startAttach")
        }

        startRun() {
            s.information("startRun---\x3e"), l.NativeCallModule.nativeCall.CallNativeFunction("IsLogined", (e, t) => {
                0 === e ? (s.information("logined", t), l.NativeCallModule.nativeCall.CallNativeFunction("IsMainWndShow", e => {
                    s.information("IsMainWndShow returnValue", e), this.updateData()
                })) : this.hideLoginPromptPanel()
            }), s.information("<---startRun")
        }

        clearConfig() {
            s.information("clearConfig---\x3e"), a.ConfigNS.setValue("XLLoginPrompt", "id", ""), s.information("<---clearConfig")
        }
    }

    t.LoginPromptManager = c, function (e) {
        let t = new c;
        e.getManager = function () {
            return t
        }, e.init = function () {
            t.init().then().catch()
        }, e.getPromptData = function () {
            return t.getPromptData()
        }
    }(t.LoginPromptManagerNS || (t.LoginPromptManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(104), o = n(1).default.getLogger("login-prompt"), r = n(2), s = n(9), l = n(200);
    t.DataHelper = class extends a.HttpSession {
        constructor() {
            super(...arguments), this.dataList = []
        }

        init() {
            return i(this, void 0, void 0, function* () {
                let e = yield s.FileSystemAWNS.mkdirsAW(this.adDataDir);
                return e || o.information("初始化路径目录失败"), e
            })
        }

        httpLoadDataInfo(e) {
            o.information("httpLoadDataInfo---\x3e"), this.host = "admin.static.xl9.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/json/login_icon.json", o.information("uri:" + this.path), o.information("host:" + this.host), this.get(t => {
                if (200 === t.statusCode && t.body) {
                    let n = this.parseResponse(t.body);
                    this.downLoadResource(n, e).then().catch()
                }
            }, e => {
                o.information("error", e)
            }), o.information("<---httpLoadDataInfo")
        }

        downLoadResource(e, t) {
            return i(this, void 0, void 0, function* () {
                if (o.information("downLoadResource---\x3e"), e && e.length > 0) {
                    for (let t = 0; t < e.length; t++) {
                        const n = e[t];
                        o.information("element", t, n);
                        let i = n.img.substring(n.img.lastIndexOf("/") + 1), a = this.adDataDir + "/" + i;
                        o.information("imageLocalPath", a);
                        let r = yield l.AxiosNS.downloadFileAW(n.img, a);
                        if (o.information("ret", r), r) {
                            if (!(yield s.FileSystemAWNS.existsAW(a))) continue;
                            if (0 === (yield s.FileSystemAWNS.lstatAW(a)).size) continue;
                            let e = "png", t = i.substring(i.lastIndexOf(".") + 1, i.length);
                            o.information("fileExt", t), "gif" === t && (e = "gif");
                            let r = {id: n.id, title: n.title, image: n.img, url: n.url, imgLocalPath: a, iconType: e};
                            this.dataList.push(r)
                        }
                    }
                    o.information("<---downLoadResource"), this.dataList.length > 0 ? t(!0, this.dataList) : t(!1, null)
                }
            })
        }

        parseResponse(e) {
            if (!e) return null;
            let t = e.toString(), n = JSON.parse(t);
            return o.information("jsonstr", t), o.information("resObj", n), n || null
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(65), o = n(835), r = n(60), s = n(6), l = n(838), u = n(1).default.getLogger("vip-renewicon.manager");
    var d;
    !function (e) {
        e.userTypeChanged = "OnuserTypeChanged"
    }(d = t.UserEventNS || (t.UserEventNS = {}));

    class c extends r.default {
        constructor() {
            super(...arguments), this.cashHover = !1, this.hasCash = !1, this.isQueryCashBack = !1, this.isQueryTagsBack = !1, this.expiredRange = 7, this.userType = 0, this.vipData = null, this.aidfromMap = new Map, this.urlMap = new Map
        }

        get $hasCash() {
            return this.hasCash
        }

        init() {
            super.setMaxListeners(1), this.aidfromMap.set(1, "xfbtn_grow0_kt"), this.aidfromMap.set(2, "xfbtn_grow1_kt"), this.aidfromMap.set(3, "xfbtn_pt_xf"), this.aidfromMap.set(4, "xfbtn_bj_xf"), this.aidfromMap.set(5, "xfbtn_cj_xf"), this.urlMap.set("url_1", "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_ggong_pay_top&aidfrom=xfbtn_grow0_kt"), this.urlMap.set("url_2", "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_ggong_pay_top&aidfrom=xfbtn_grow1_kt"), this.urlMap.set("url_3", "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_ggong_pay_top&aidfrom=xfbtn_pt_xf"), this.urlMap.set("url_4", "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_ggong_pay_top&aidfrom=xfbtn_bj_xf"), this.urlMap.set("url_5", "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_ggong_pay_top&aidfrom=xfbtn_cj_xf")
        }

        calculateExpireDate() {
            let e, t, n;
            e = this.vipData.expireDate.substring(0, 4), t = this.vipData.expireDate.substring(4, 6), n = this.vipData.expireDate.substring(6, 8);
            let i = new Date(e + "-" + t + "-" + n + " 00:00:00").getTime() / 1e3, a = new Date, o = a.getFullYear(),
                r = a.getMonth(), s = a.getDate(),
                l = (a = new Date(o + "-" + (r < 10 ? "0" + (r + 1) : r + 1) + "-" + (s < 10 ? "0" + s : s) + " 00:00:00")).getTime() / 1e3;
            return Math.ceil((i - l) / 86400)
        }

        checkUserType(e) {
            return i(this, void 0, void 0, function* () {
                if (u.information("checkUserType---\x3e"), u.information("vipData", e), yield this.querySettingInfo(), this.vipData = e, 1 === this.vipData.isVip) {
                    let e = this.calculateExpireDate();
                    u.information("leftdays", e), e <= this.expiredRange && (5 === this.vipData.vasType ? this.userType = 5 : 3 === this.vipData.vasType ? this.userType = 4 : 2 === this.vipData.vasType && (this.userType = 3))
                } else this.userType = 2;
                u.information("expirerange", this.expiredRange), u.information("userType", this.userType), u.information("cashHover", this.cashHover), yield this.queryCashInfo(), yield this.queryUserTagInfo()
            })
        }

        onLogout() {
            this.cashHover = !1, this.expiredRange = 7, this.vipData = null, this.userType = 0, this.hasCash = !1, this.isQueryCashBack = !1, this.isQueryTagsBack = !1, this.fireEvent(d.userTypeChanged, this.userType)
        }

        openNewTab() {
            u.information("openNewTab---\x3e");
            let e = "url_" + this.userType, t = this.urlMap.get(e);
            s.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t)
        }

        onIconClick() {
            u.information("onIconClick---\x3e"), this.openNewTab();
            let e = new Map;
            e.set("show_type", this.userType), e.set("isvip", this.vipData.isVip), e.set("vas_type", this.vipData.vasType), e.set("referfrom", "v_pc_xlx_ggong_pay_top"), e.set("aidfrom", this.aidfromMap.get(this.userType));
            let t = {attribute1: "xufei_botton_click", extData: e};
            l.StatUtilitiesNS.trackEvent("clienttop", t), u.information("<----onIconClick")
        }

        onIconShow() {
            u.information("onIconShow---\x3e");
            let e = new Map;
            e.set("show_type", this.userType), e.set("isvip", this.vipData.isVip), e.set("vas_type", this.vipData.vasType);
            let t = {attribute1: "xufei_botton_show", extData: e};
            l.StatUtilitiesNS.trackEvent("clienttop", t), u.information("<----onIconShow")
        }

        querySettingInfo() {
            return i(this, void 0, void 0, function* () {
                u.information("querySettingInfo");
                let e = new o.UserHttpSession;
                this.mSetting = yield e.querySettingInfo(), u.information("this.mSetting :", this.mSetting), this.mSetting && (1 === this.mSetting.cash_hover && (this.cashHover = !0), this.hasCash && !this.cashHover && (this.hasCash = !1), this.mSetting.expired_day > 0 && (this.expiredRange = this.mSetting.expired_day), this.mSetting.url_1 && this.urlMap.set("url_1", this.mSetting.url_1), this.mSetting.url_2 && this.urlMap.set("url_2", this.mSetting.url_2), this.mSetting.url_3 && this.urlMap.set("url_3", this.mSetting.url_3), this.mSetting.url_4 && this.urlMap.set("url_4", this.mSetting.url_4), this.mSetting.url_5 && this.urlMap.set("url_5", this.mSetting.url_5), u.information("<---querySettingInfo"))
            })
        }

        queryUserTagInfo() {
            return i(this, void 0, void 0, function* () {
                u.information("queryUserTagInfo---\x3e");
                let e = new o.UserHttpSession, t = yield this.getUserID(), n = yield this.getSessionID();
                u.information("userId", t), u.information("sessionId", n), this.isQueryTagsBack = !1;
                let i = yield e.queryUserTags(t, n);
                u.information("response :", i), i && i.code && 1 === i.code && (i.isSign > 0 && 1 === this.vipData.isVip ? this.userType = 0 : 0 === this.vipData.isVip && 0 === i.payTimesRangeForDL ? this.userType = 1 : 0 === i.payTimesRangeForDL && this.userType > 2 && (this.userType = 0)), this.isQueryTagsBack = !0, u.information("usertype", this.userType), this.isQueryCashBack && this.fireEvent(d.userTypeChanged, this.userType), u.information("<---queryUserTagInfo")
            })
        }

        queryCashInfo() {
            return i(this, void 0, void 0, function* () {
                u.information("queryCashInfo---\x3e");
                let e = new o.UserHttpSession, t = yield this.getUserID(), n = yield this.getSessionID();
                u.information("userId", t), u.information("sessionId", n), this.isQueryCashBack = !1;
                let i = yield e.queryCashInfo(t, n);
                u.information("response", i), u.information("this.cashHover", this.cashHover), i && 0 === i.result && i.totalnum > 0 && this.cashHover ? this.hasCash = !0 : this.hasCash = !1, this.isQueryCashBack = !0, u.information("this.hasCash :", this.hasCash), this.isQueryTagsBack && this.fireEvent(d.userTypeChanged, this.userType), u.information("<---queryCashInfo")
            })
        }

        getUserID() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    a.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                        u.information("getUserID:userid = ", t), e(t)
                    })
                })
            })
        }

        getSessionID() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    a.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (t) {
                        u.information("getSessionID:sessionid = ", t), e(t)
                    })
                })
            })
        }
    }

    t.VipRenewIconManager = c, function (e) {
        const t = new c;
        t.init(), e.getIconManager = function () {
            return t
        }
    }(t.VipRenewIconManagerNS || (t.VipRenewIconManagerNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(836), o = n(837), r = n(1).default.getLogger("vip-renewicon.http-session");
    t.UserHttpSession = class extends a.HttpSession {
        querySettingInfo() {
            return i(this, void 0, void 0, function* () {
                return r.information("querySettingInfo----\x3e"), this.host = "images.client.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/mini/xlx/tips_300x310/ssi_html/xdsxfbtnconf.js", r.information("uri:", this.path), r.information("host:", this.host), new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.UserHttpPackageNS.praseSettingBuffer(t.body)), e(n)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }

        queryCashInfo(e, t) {
            return i(this, void 0, void 0, function* () {
                return r.information("queryCashInfo"), this.host = "dynamic.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/cashv2/userCashCount?userid=" + e + "&sessionid=" + t, r.information("host:", this.host), r.information("uri:", this.path), new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.UserHttpPackageNS.praseCashBuffer(t.body)), e(n)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }

        queryUserTags(e, t) {
            return i(this, void 0, void 0, function* () {
                return r.information("queryUserTags--\x3e"), this.host = "soa.vip.xunlei.com", this.retries = 2, this.timeout = 2e4, this.path = "/xlvip.common.mooseapi/querytags?userid=" + e + "&sessionid=" + t + "&tags=isSign,payTimesRangeForDL", r.information("uri:", this.path), r.information("host:", this.host), new Promise(e => {
                    this.get(t => {
                        let n = null;
                        200 === t.statusCode && t.body && (n = o.UserHttpPackageNS.praseTagBuffer(t.body)), e(n)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(52);
    t.HttpSession = class {
        constructor() {
            this.mRetries = 0, this.mHost = void 0, this.mPort = 80, this.mPath = void 0, this.mAuth = void 0, this.mAccept = void 0, this.mBody = null, this.mUrl = void 0, this.mTimeout = void 0, this.mCurRetries = 0
        }

        set host(e) {
            this.mHost = e
        }

        get host() {
            return this.mHost
        }

        set port(e) {
            this.mPort = e
        }

        get port() {
            return this.mPort
        }

        set path(e) {
            this.mPath = e
        }

        get path() {
            return this.mPath
        }

        set url(e) {
            this.mUrl = e
        }

        get url() {
            return this.mUrl
        }

        set auth(e) {
            this.mAuth = e
        }

        get auth() {
            return this.mAuth
        }

        set accept(e) {
            this.mAccept = e
        }

        get accept() {
            return this.mAccept
        }

        set body(e) {
            this.mBody = e
        }

        get body() {
            return this.mBody
        }

        set retries(e) {
            this.mRetries = e
        }

        get retries() {
            return this.mRetries
        }

        set timeout(e) {
            this.mTimeout = e
        }

        get timeout() {
            return this.mTimeout
        }

        get(e, t) {
            let n = {hostname: this.host, port: this.port, path: this.path || "/", method: "GET"};
            this.getImpl(n, e, n => {
                this.mCurRetries < this.retries ? (this.mCurRetries++, this.get(e, t)) : t(n)
            })
        }

        getImpl(e, t, n) {
            i.get(e, e => {
                let n = null;
                e.on("data", e => {
                    n = n ? Buffer.concat([n, e]) : e
                }), e.on("end", () => {
                    t({statusCode: e.statusCode, headers: e.headers, body: n})
                })
            }).on("error", e => {
                n(e)
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1).default.getLogger("vip-renewicon.http-package");
    !function (e) {
        e.praseSettingBuffer = function (e) {
            i.information("--\x3epraseSettingBuffer");
            let t = null;
            if (e) {
                let n = e.toString();
                if (n) {
                    i.information("jsonStr :", n);
                    try {
                        let e = JSON.parse(n);
                        i.information("resobj", e);
                        let a = null;
                        e[1] && e[1].url && (a = e[1].url);
                        let o = null;
                        e[2] && e[2].url && (o = e[2].url);
                        let r = null;
                        e[3] && e[3].url && (r = e[3].url);
                        let s = null;
                        e[4] && e[4].url && (s = e[4].url);
                        let l = null;
                        e[5] && e[5].url && (l = e[5].url), t = {
                            cash_hover: Number(e.cash_hover),
                            expired_day: Number(e.expired_day),
                            url_1: a,
                            url_2: o,
                            url_3: r,
                            url_4: s,
                            url_5: l
                        }
                    } catch (e) {
                        i.information("parser json error")
                    }
                }
            }
            return i.information("<--praseSettingBuffer"), t
        }, e.praseCashBuffer = function (e) {
            i.information("--\x3epraseCashBuffer");
            let t = null;
            if (e) {
                let n = e.toString();
                if (n) {
                    i.information("jsonStr :", n);
                    try {
                        let e = JSON.parse(n);
                        t = {
                            result: Number(e.result),
                            msg: e.msg,
                            totalnum: Number(e.data.total_num),
                            expirenum: Number(e.data.expire_num)
                        }
                    } catch (e) {
                        i.information("parser json error")
                    }
                }
            }
            return i.information("<--praseCashBuffer"), t
        }, e.praseTagBuffer = function (e) {
            i.information("--\x3epraseTagBuffer");
            let t = null;
            if (e) {
                let n = e.toString();
                if (n) {
                    i.information("jsonStr :", n);
                    try {
                        let e = JSON.parse(n);
                        t = {
                            code: Number(e.code),
                            msg: e.message,
                            isSign: e.result ? Number(e.result.isSign) : 0,
                            payTimesRangeForDL: e.result ? Number(e.result.payTimesRangeForDL) : 0
                        }
                    } catch (e) {
                        i.information("parser json error")
                    }
                }
            }
            return i.information("<--praseTagBuffer"), t
        }
    }(t.UserHttpPackageNS || (t.UserHttpPackageNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(6), a = n(1).default.getLogger("vip-renewicon.stat-utilities");
    !function (e) {
        e.trackEvent = function (e, t) {
            if (i.NativeCallModule.nativeCall) {
                let n = (t = t || {}).attribute1 || "", o = t.attribute2 || "", r = function (e) {
                    let t = "";
                    return e.forEach((e, n) => {
                        "" !== t && (t += ","), t = t + n + "=" + e
                    }), t
                }(t.extData || new Map);
                r = encodeURIComponent(r), a.information("key : ", e), a.information("attribute1 : ", n), a.information("attribute2 ：", o), a.information("extData ： ", r), i.NativeCallModule.nativeCall.CallNativeFunction("TrackEvent", e, n, o, 0, 0, 0, 0, r, (e, t) => {
                    a.information("trackEvent", "errorCode", e, "returnValue", t)
                })
            }
        }
    }(t.StatUtilitiesNS || (t.StatUtilitiesNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(306);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\address-bar-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(685), a = n(308);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\address-bar.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(35), a = n(10), {isDef: o, throttle: r, setStyle: s} = a.ThunderUtil;
    t.default = class extends i.EventEmitter {
        constructor(e) {
            super(), this.options = [...e]
        }

        position() {
            let e, t, n = this.currentElement.getBoundingClientRect(),
                i = this.currentReference.getBoundingClientRect(),
                a = o(this.currentGuideOptions.position) ? this.currentGuideOptions.position : "center";
            ["center", "top", "bottom"].includes(a) ? e = i.left + (i.width - n.width) / 2 : "left" === a ? e = i.left : "right" === a && (e = i.right - n.width), ["center", "left", "right"].includes(a) ? t = i.top + i.height / 2 - n.height : "top" === a ? t = i.top - n.height / 2 : "bottom" === a && (t = i.bottom - n.height / 2), o(this.currentGuideOptions.offset) && (e += this.currentGuideOptions.offset[0], t += this.currentGuideOptions.offset[1]), this.currentElement.style.left = `${e}px`, this.currentElement.style.top = `${t}px`
        }

        next() {
            if (this.currentGuideOptions = this.options.shift(), o(this.currentGuideOptions)) {
                document.body.insertAdjacentHTML("beforeend", '<div class="xlx-new"><i></i></div>'), this.currentElement = document.body.lastElementChild, this.currentReference = document.querySelector(this.currentGuideOptions.selector);
                let e = r(() => {
                    this.position()
                }, 16);
                o(this.currentGuideOptions.style) && s(this.currentElement, this.currentGuideOptions.style), this.position(), this.emit("show", this.currentGuideOptions.name), window.addEventListener("resize", e), this.currentReference.addEventListener("focus", () => {
                    this.currentElement.style.display = "none", this.emit("done", this.currentGuideOptions.name), window.removeEventListener("resize", e)
                }, {once: !0}), this.currentReference.addEventListener("blur", () => {
                    this.next()
                }, {once: !0})
            }
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(2), r = a.default.getLogger("Thunder.renderer.contextmenu"), s = n(7), l = n(6), u = n(140),
        d = n(27), c = n(9), h = n(3), f = n(82), p = n(103), g = n(8), k = n(17),
        m = n(5).default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        T = ".asf;.avi;.exe;.iso;.mp3;.mp4;.mkv;.mpeg;.mpg;.mpga;.ra;.rar;||.rm;.rmvb;.tar;.wma;.wmp;.wmv;.mov;.zip;.3gp;.chm;.mdf",
        v = ["http://", "https://", "ftp://"], y = ["thunder://", "thunders://", "ed2k://", "magnet:"];

    function S(e) {
        let t = !1;
        if (e) for (let n = 0; n < v.length; ++n) {
            let i = v[n];
            if (0 === e.indexOf(i)) {
                t = !0;
                break
            }
        }
        return t
    }

    function w(e) {
        let t = !1;
        if (e) for (let n = 0; n < y.length; ++n) {
            let i = y[n];
            if (0 === e.indexOf(i)) {
                t = !0;
                break
            }
        }
        return t
    }

    function b(e) {
        let t = [], n = e;
        if (f.Common.isThunderPrivateUrl(n) && (n = f.Common.parseThunderPrivateUrl(n)), function (e) {
            let t = !1;
            do {
                if (!e) break;
                if (S(e)) {
                    let n = o.extname(e);
                    if (!n) break;
                    T.indexOf(n) > -1 && (t = !0)
                } else w(e) && (t = !0)
            } while (0);
            return t
        }(n)) {
            let i = k.ThunderHelper.getTaskTypeFromUrl(n);
            if (i === g.DownloadKernel.TaskType.P2sp || i === g.DownloadKernel.TaskType.Emule) t.push(e); else if (i === g.DownloadKernel.TaskType.Magnet || i === g.DownloadKernel.TaskType.Bt) return p.ThunderNewTask.createBtTaskWindow({
                url: e,
                type: "url"
            }, {browser: "xlbrowser.exe"}), !0
        }
        return t.length > 0 && (p.ThunderNewTask.createPreNewTaskWindow(t), !0)
    }

    function C(e, t) {
        return i(this, void 0, void 0, function* () {
            let n = null, i = !1;
            try {
                n = yield d.default.get(e)
            } catch (e) {
            }
            return null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (i = yield c.FileSystemAWNS.writeFileAW(t, n.data)), i
        })
    }

    function N(e) {
        do {
            if (s.isNullOrUndefined(e)) break;
            let t = e;
            !1 === D(e) && (t = "https://www.baidu.com/s?wd=" + e), l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", t)
        } while (0)
    }

    function D(e) {
        let t = !1;
        do {
            let n = e.trim();
            if (s.isNullOrUndefined(n)) break;
            if (t = /([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/.test(n)) {
                t = 1 === m.isPingHostValid(n)
            }
        } while (0);
        return t
    }

    function I(e, t) {
        r.information("commandOpenUrl", e), b(e.link_url) ? r.information(e.link_url) : N(e.link_url)
    }

    function _(e, t) {
        if (r.information(e), b(e.link_url)) return;
        let n = h.remote.getCurrentWindow(), i = h.remote.dialog.showSaveDialog(n, {
            defaultPath: "新建网页.html",
            filters: [{name: "网页 HTML（*.html）", extensions: ["html"]}]
        });
        void 0 !== i && "" !== i && (".html" !== o.extname(i).toLowerCase() && (i += ".html"), setTimeout(() => {
            C(e.link_url, i).catch()
        }, 0))
    }

    t.contextMenuPage = [{
        label: "返回", commandFunc: function (e, t) {
            r.information("goBack"), t.goBack()
        }
    }, {
        label: "前进", commandFunc: function (e, t) {
            r.information(e), t.goForward()
        }
    }, {
        label: "重新加载", commandFunc: function (e, t) {
            r.information(e), t.refresh(!1)
        }
    }, {
        label: "另存为", commandFunc: function (e, t) {
            r.information(e);
            let n = h.remote.getCurrentWindow(), i = h.remote.dialog.showSaveDialog(n, {
                defaultPath: "新建网页.html",
                filters: [{name: "网页 HTML（*.html）", extensions: ["html"]}]
            });
            if (void 0 === i || "" === i) return;
            ".html" !== o.extname(i).toLowerCase() && (i += ".html");
            setTimeout(() => {
                C(e.page_url, i).catch()
            }, 0)
        }
    }, {
        label: "查看网页源代码", commandFunc: function (e, t) {
            r.information(e), l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", "view-source:" + e.page_url)
        }
    }], t.contextMenuDownloadableLink = [{label: "在新标签页打开链接", commandFunc: I}, {
        label: "链接另存为",
        commandFunc: _
    }, {
        label: "复制链接地址", commandFunc: function (e, t) {
            r.information(e), m.copyTextToClipBoard(e.link_url)
        }
    }], t.contextMenuMedia = [{
        label: "在新标签页中打开图片", commandFunc: function (e, t) {
            r.information("commandOpenUrl", e), N(e.source_url)
        }
    }, {
        label: "图片另存为", commandFunc: function (e, t) {
            r.information(e);
            let n = o.basename(e.source_url), a = o.extname(n);
            "" === n && (n = function () {
                let e = "";
                for (let t = 1; t <= 32; t++) {
                    let n = Math.floor(16 * Math.random()).toString(16);
                    e += n, 8 !== t && 12 !== t && 16 !== t && 20 !== t || (e += "-")
                }
                return e
            }() + a);
            let s = void 0;
            s = "" !== a ? {
                defaultPath: n,
                filters: [{name: "图片（*" + a + "）", extensions: [a]}, {name: "所有文件", extensions: ["*"]}]
            } : {defaultPath: n, filters: [{name: "所有文件", extensions: ["*"]}]};
            let l = h.remote.getCurrentWindow(), u = h.remote.dialog.showSaveDialog(l, s);
            if (void 0 === u || "" === u) return;
            setTimeout(() => {
                (function (e, t) {
                    return i(this, void 0, void 0, function* () {
                        let n = null, i = !1;
                        try {
                            n = yield d.default.get(e, {responseType: "arraybuffer"})
                        } catch (e) {
                        }
                        return null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (i = yield c.FileSystemAWNS.writeFileAW(t, n.data)), i
                    })
                })(e.source_url, u).catch()
            }, 0)
        }
    }, {
        label: "复制图片", commandFunc: function (e, t) {
            r.information(e), setTimeout(() => {
                (function (e) {
                    return i(this, void 0, void 0, function* () {
                        let t = null, i = !1;
                        try {
                            t = yield d.default.get(e, {responseType: "arraybuffer"})
                        } catch (e) {
                            return !1
                        }
                        if (null !== t && void 0 !== t.status && 200 === t.status && null !== t.data) {
                            let e = "data:" + t.headers["content-type"] + ";base64," + new Buffer(t.data).toString("base64"),
                                a = n(3).nativeImage.createFromDataURL(e);
                            h.clipboard.clear(), h.clipboard.writeImage(a), i = !0
                        }
                        return i
                    })
                })(e.source_url).catch()
            }, 0)
        }
    }, {
        label: "复制图片地址", commandFunc: function (e, t) {
            r.information(e), m.copyTextToClipBoard(e.source_url)
        }
    }], t.contextMenuSelection = [{
        label: "复制", commandFunc: function (e, t) {
            r.information(e), t.editCopy()
        }
    }, {
        label: "用百度搜索", commandFunc: function (e, t) {
            r.information(e);
            let n = "https://www.baidu.com/s?wd=" + e.selection_text;
            l.NativeCallModule.nativeCall.CallNativeFunction("openNewTab", n)
        }
    }], t.contextMenuEditable = [{
        label: "撤销", commandFunc: function (e, t) {
            r.information(e), t.editUndo()
        }
    }, {
        label: "剪切", commandFunc: function (e, t) {
            r.information(e), t.editCut()
        }
    }, {
        label: "复制", commandFunc: function (e, t) {
            r.information(e), t.editCopy()
        }
    }, {
        label: "粘贴", commandFunc: function (e, t) {
            r.information(e), t.editPaste()
        }
    }, {
        label: "删除", commandFunc: function (e, t) {
            r.information(e), t.editDelete()
        }
    }, {
        label: "全选", commandFunc: function (e, t) {
            r.information(e), t.editSelectAll()
        }
    }], t.contextMenuLink = [{label: "在新标签页打开链接", commandFunc: I}, {label: "链接另存为", commandFunc: _}, {
        label: "复制链接地址",
        commandFunc: function (e, t) {
            r.information(e), m.copyTextToClipBoard(e.link_url), b(e.link_url) && r.information(e.link_url)
        }
    }], t.registerContextMenu = function (e) {
        e.getTabType() === u.TabType.Chromium && e.getBrowser().registerContextMenu({
            page: t.contextMenuPage,
            selection: t.contextMenuSelection,
            edit: t.contextMenuEditable,
            link: t.contextMenuLink,
            media: t.contextMenuMedia,
            downloadLink: t.contextMenuDownloadableLink
        })
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(22), a = n(844), o = n(32), r = n(1).default.getLogger("setting-conf"), s = {
        SET_CONFIG_DATA(e, t) {
            e.formData = t
        }, SET_CONF_SCHEMA(e, t) {
            e.confSchema = t
        }, ADD_SCHEMA_ITEM(e, t) {
            if (r.information("ADD_SCHEMA_ITEM", t), void 0 !== t.position[0] && void 0 !== t.position[1]) {
                let n = 0;
                n = t.direction < 0 ? e.confSchema[t.position[0]].children[t.position[1]].children.length + t.direction + 1 : t.direction, e.confSchema[t.position[0]].children[t.position[1]].children.splice(n, 0, t.schemaItem), o.default.set(e.confSchema[t.position[0]].children[t.position[1]].children, "children", e.confSchema[t.position[0]].children[t.position[1]].children)
            }
        }, ADD_FORMDATA_ITEM(e, t) {
            let n = `${t.section}-${t.key}`;
            void 0 === e.formData[n] && o.default.set(e.formData, n, t)
        }, ADD_SELECT_ITEM(e, t) {
            let n = e.formData[t.target];
            r.information("targetItem", n), n.selectItems.includes(t.from) || (n.selectItems.push(t.from), o.default.set(e.formData[t.target], "selectItems", n.selectItems))
        }, SET_CONFIG_VALUE(e, t) {
            if (void 0 !== e.formData[t.name].optionToValue) {
                let n = t.value;
                i.ConfigNS.setValue(t.section, `${t.key}`, e.formData[t.name].optionToValue[n]), "" !== t.userId && i.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, e.formData[t.name].optionToValue[n])
            } else if (e.formData[t.name].type && "number" === e.formData[t.name].type) {
                let e = Number(t.value);
                i.ConfigNS.setValue(t.section, `${t.key}`, e), "" !== t.userId && i.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, e)
            } else i.ConfigNS.setValue(t.section, `${t.key}`, t.value), "" !== t.userId && i.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, t.value);
            void 0 !== e.formData[t.name].immediatelySave && i.ConfigNS.saveSync(), function (e, t) {
                let n = e.formData[t.name];
                void 0 !== n.selectItems && n.selectItems.map(n => {
                    let a = t.value;
                    e.formData[n].type && "number" === e.formData[n].type && (a = Number(t.value)), i.ConfigNS.setValue(e.formData[n].section, e.formData[n].key, a)
                });
                if (void 0 !== n.selectAllName) {
                    let n = e.formData[t.name].selectAllName, a = e.formData[n];
                    if (t.value) {
                        let t = !0;
                        a.selectItems.map(n => {
                            t = i.ConfigNS.getValue(e.formData[n].section, e.formData[n].key, !1) && t
                        }), t && i.ConfigNS.setValue(a.section, a.key, !0)
                    } else {
                        let e = i.ConfigNS.getValue(a.section, a.key, "");
                        e && i.ConfigNS.setValue(a.section, a.key, !1)
                    }
                }
            }(e, t)
        }, SET_FOMR_DATA(e, t) {
            let n = `${t.section}-${t.key}`;
            if (void 0 === e.formData[n]) return;
            let i = t.value;
            if (void 0 !== e.formData[n] && void 0 !== e.formData[n].optionToValue) {
                let a = e.formData[n];
                for (let e in a.optionToValue) if (a.optionToValue[e] === t.value) {
                    i = e;
                    break
                }
            } else void 0 !== e.formData[`${t.section}-${t.key}`] && (i = t.value);
            e.formData[`${t.section}-${t.key}`].value = i
        }
    }, l = {
        initSettingData({commit: e}) {
            a.SettingInit.setBaseConf();
            let t = a.SettingInit.getConfSchema(), n = a.SettingInit.getConfFormData();
            e("SET_CONF_SCHEMA", t), e("SET_CONFIG_DATA", n)
        }
    };
    t.default = {state: {confSchema: [], formData: {}}, mutations: s, actions: l}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(22), a = n(2), o = n(20), r = n(3), s = a.join(__rootDir, "../../download-complete.wav");
    !function (e) {
        e.conf = {
            sechema: [{
                name: "基本设置",
                children: [{
                    name: "启动",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "ConfigNormalSession-ConfigNormal_AutoRun",
                        type: "confCheckbox",
                        label: "开机启动迅雷",
                        classes: ""
                    }, {
                        name: "Others-AntiDisturb",
                        type: "confCheckbox",
                        label: "开启免打扰模式",
                        classes: "",
                        extEles: [{
                            type: "confTip",
                            classes: "td-icon-info",
                            text: "免打扰模式下，当您运行全屏程序时，迅雷将\n自动帮您取消提示消息弹出，避免打扰您的其\n它体验。",
                            value: ""
                        }]
                    }, {
                        name: "ConfigNormalSession-ConfigNormal_AutoStartUnFinishedTask",
                        type: "confCheckbox",
                        label: "启动迅雷后自动开始未完成任务"
                    }]
                }, {
                    name: "下载目录",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "TaskDefaultSettings-DefaultPath",
                        type: "confSelect",
                        label: "",
                        classes: "",
                        optionByName: "PathAndCategory-historyDownloadPaths",
                        selectType: "file",
                        slotOption: "openDirectory",
                        editable: !0,
                        hasDeleteOption: !0,
                        deleteOptionText: "清除历史下载目录",
                        maxOptionLen: 5,
                        rules: [function (e, t, n) {
                            let i = [], a = t.match(/(^[a-zA-Z]):[\\\/].*?/);
                            !/^[a-zA-Z]:[\\\/].*?/.test(t) || /[\*\"<>《》\?:：、？“”\|]/i.test(t.slice(3)) ? i.push(new Error("下载目录名称不能包含下列任何字符：:|* ?“<>")) : null !== a && null !== a && o.existsSync(`${a[0]}`) ? t.length > 256 && i.push(new Error("您输入的下载目录路径长度超过系统限制，请控制在256个字符以内")) : i.push(new Error("该磁盘分区不存在, 请重新选择")), n(i)
                        }]
                    }, {
                        name: "TaskDefaultSettings-UseLastCatalog",
                        type: "confCheckbox",
                        label: "自动修改为上次使用的目录",
                        linkItem: {
                            section: "PathAndCategory",
                            key: "LastUsedPath",
                            name: "TaskDefaultSettings-DefaultPath"
                        }
                    }]
                }]
            }, {
                name: "下载接管设置",
                children: [{
                    name: "接管设置",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "",
                        type: "confText",
                        text: "接管对象",
                        value: "xlx-setting-content__text"
                    }, {
                        name: "Monitor-MonitorClipBoard",
                        type: "confCheckbox",
                        label: "接管剪切板"
                    }, {name: "Motitor-MotitorAll", type: "confCheckbox", label: "接管所有浏览器"}]
                }, {
                    name: "BT关联",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "BtGenericSettings-AutoBTNewTask",
                        type: "confCheckbox",
                        label: "下载种子文件后自动打开新建面板"
                    }, {name: "BtGenericSettings-AssocTorrent", type: "confCheckbox", label: "启动时关联BT种子文件(.torrent文件)"}]
                }]
            }, {
                name: "下载设置",
                children: [{
                    name: "下载管理",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "TaskDefaultSettings-OpenSilenceDownload",
                        type: "confCheckbox",
                        label: "一键下载",
                        extEles: [{
                            type: "confTip",
                            text: '"一键下载" 生效时,点击下载链接将直接建立下载任务,不会弹出新建任务面板',
                            classes: "td-icon-info"
                        }]
                    }, {
                        name: "TaskDefaultSettings-NewTaskStartMode",
                        type: "confSelect",
                        label: "默认下载方式",
                        classes: "xlx-select-size-4",
                        option: ["立即下载", "手动下载"]
                    }, {
                        name: "ConfigNormalSession-ConfigNormal_MaxRunningTaskCount",
                        type: "confSelect",
                        label: "同时下载的最大任务数",
                        classes: "xlx-select-size-1",
                        option: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50"]
                    }, {
                        name: "ConfigNoLimitDownload-TaskCountAutoAdd",
                        type: "confCheckboxInput",
                        label: "全局下载速度低于",
                        extEles: [{
                            type: "confInput",
                            name: "ConfigNoLimitDownload-TaskCountAutoAddRate",
                            label: " ",
                            toolTipsContent: "输入速度值必须大于0",
                            rules: [["rule, value, callback", "let errors = [];\n                        let speed = 100;\n                        if (value.trim() !== '') {\n                          speed = Number(value);\n                          if (isNaN(speed) || speed <= 0) {\n                            errors.push(new Error('输入速度值必须大于0'));\n                          }\n                          callback(errors);\n                        }"]],
                            outClasses: "xlx-select-size-1"
                        }, {
                            type: "confText",
                            classes: "xlx-select-size-2",
                            text: " KB/s自动增加同时下载任务数",
                            style: "padding-right: 3px"
                        }, {
                            type: "confTip",
                            text: "当您使用迅雷进行排队下载时，开启本选项能够尽量\n充分利用您的网络带宽进行下载。本选项合理的设定\n值应为您的网络带宽最大下载速度的80%。假设您最\n大下载速度曾达到1000KB/s，则此项合理的设定值\n应为800KB/s。",
                            classes: "td-icon-info"
                        }]
                    }, {
                        name: "ConfigNoLimitDownload-OpenNoLimitDownload",
                        type: "confCheckboxSelect",
                        label: "优先下载小于",
                        extEles: [{
                            type: "confSelect",
                            classes: "xlx-select-size-1",
                            name: "ConfigNoLimitDownload-NoLimitDownloadFileSize",
                            option: ["5", "10", "20", "30", "50", "100"],
                            style: "padding-left: 3px"
                        }, {
                            type: "confText",
                            classes: "textCenter flexLay",
                            text: "MB的任务",
                            style: "padding-left: 5px"
                        }],
                        classes: "flexLay"
                    }, {
                        name: "TaskDefaultSettings-OrignHostThreads",
                        type: "confSelect",
                        label: "原始地址线程数",
                        classes: "xlx-select-size-1",
                        option: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
                    }, {
                        name: "TaskDefaultSettings-OpenFile",
                        type: "confCheckbox",
                        label: "下载完成后自动打开"
                    }, {
                        name: "ConfigNormalSession-ConfigNormal_AutoDeleteNotExistFile",
                        type: "confCheckbox",
                        label: "自动删除“文件不存在”的任务"
                    }]
                }, {
                    name: "下载模式",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "ConfigNet-ConfigNet_Type",
                        type: "confRadio",
                        label: "全速下载",
                        extEles: [{
                            type: "confTip",
                            text: "p2sp下载完的文件会通过p2p的方式上传分享，\n帮助其它网友加速下载，绝不会涉及任何用户隐\n私。下载和分享是通过智能带宽控制的技术，不\n会影响您的上网体验，请放心使用。",
                            classes: "td-icon-info"
                        }, {
                            type: "confBtn",
                            text: "修改配置",
                            classes: "td-button--small",
                            outerClass: "inline",
                            boxType: "speedConfBox"
                        }],
                        extActiveValue: "0",
                        labels: ["全速下载", "限速下载"],
                        option: ["1", "0"]
                    }, {type: "confSpeedText", classes: "xlx-setting-content__config"}]
                }]
            }, {
                name: "消息及提醒",
                children: [{
                    name: "提醒",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "ConfigMsg-ConfigMsg_Finish",
                        type: "confCheckbox",
                        label: "下载完成后右下角弹窗提示"
                    }, {
                        name: "ConfigMsg-ConfigMsg_PlayWaveWhileFinish",
                        type: "confCheckbox",
                        label: "下载完成后播放提示音"
                    }, {
                        type: "confSelect",
                        name: "ConfigMsg-ConfigMsg_WavePath",
                        classes: "noPullDown",
                        selectType: "file",
                        slotOption: "openFile",
                        outerClass: "td-checkbox",
                        editable: !0
                    }, {
                        name: "ConfigMsg-ConfigMsg_FailSuggest",
                        type: "confCheckbox",
                        label: "下载失败时右下角弹窗提示"
                    }, {
                        name: "",
                        type: "confText",
                        text: "消息通知设置",
                        isReleventUser: !0,
                        value: "xlx-setting-content__text"
                    }, {
                        name: "UserCommunitySet-radio_id_",
                        isReleventUser: !0,
                        type: "confRadio",
                        label: "接收所有人的消息通知",
                        option: ["1", "3"],
                        labels: ["接收所有人的消息通知", "不接收消息通知"],
                        ulClasses: "xlx-setting-content__horizontal"
                    }]
                }]
            }, {
                name: "高级设置",
                children: [{
                    name: "快捷设置",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "TaskDefaultSettings-AwayModeEnabled",
                        type: "confCheckbox",
                        label: '启用"离开模式"',
                        extEles: [{
                            type: "confTip",
                            text: "启用“离开模式”后，在电脑处于“睡眠”状态时，\n迅雷仍然能帮您继续下载资源",
                            classes: "td-icon-info"
                        }]
                    }, {
                        name: "BossKey-BossKeySwitch",
                        type: "confCheckboxInput",
                        label: "启用老板键",
                        extEles: [{
                            type: "confInput",
                            name: "BossKey-BossKeyName",
                            label: " ",
                            toolTipsContent: "注册老板键失败,请选择功能键 + 字母键/数字键",
                            rules: [["rule, value, callback", "let errors = [];\n                        value = String(value);\n                        if (value.indexOf('+') === -1 ) {\n                          errors.push(new Error('注册老板键失败,请选择功能键 + 字母键/数字键'));\n                        }\n                        callback(errors);"]],
                            outClasses: "xlx-select-size-4",
                            ShortcutKey: !0,
                            style: "padding-right: 3px"
                        }, {type: "confTip", text: "如果老板来了，按老板键，迅雷将自动隐身", classes: "td-icon-info"}]
                    }, {
                        name: "TaskDefaultSettings-NewTaskDlgWithoutMainWnd",
                        type: "confCheckbox",
                        label: "新建任务时显示主界面"
                    }]
                }, {
                    name: "悬浮窗",
                    classes: "xlx-setting-content__horizontal",
                    children: [{
                        name: "ConfigFloatPanel-FloatPanelValue",
                        type: "confRadio",
                        label: "显示悬浮窗",
                        option: ["0", "1", "2"],
                        labels: ["显示悬浮窗", "下载时显示悬浮窗", "隐藏悬浮窗"],
                        ulClasses: "xlx-setting-content__horizontal"
                    }]
                }, {
                    name: "动画效果",
                    children: [{
                        name: "GenericSettings-AnimationLevel",
                        type: "confRadio",
                        label: "开启全部动效",
                        ulClasses: "xlx-setting-content__vertical",
                        tip: "适用于CPU性能较低的电脑",
                        tipClass: "xlx-setting-content__tips tip-text",
                        option: ["1", "0"],
                        labels: ["开启全部动效", "关闭部分动效"]
                    }]
                }, {
                    name: "下载磁盘缓存",
                    children: [{
                        name: "DiskCache-DiskCacheSelect",
                        type: "confRadio",
                        label: "256",
                        ulClasses: "xlx-setting-content__horizontal",
                        tip: "磁盘缓存越大，下载速度越快，占用资源越多",
                        tipClass: "xlx-setting-content__tips tip-text",
                        option: ["128", "256", "512"],
                        labels: ["128M", "256M", "512M"]
                    }]
                }, {
                    name: "下载加速",
                    classes: "xlx-setting-content__vertical",
                    children: [{
                        name: "ConfigNet-ConfigNet_OpenMirrorImageIncreaseSpeed",
                        type: "confCheckbox",
                        label: "开启镜像服务器加速",
                        tip: "全网数据挖掘，自动匹配与原始资源相同的镜像供用户下载",
                        tipClass: "xlx-setting-content__tips tip-text"
                    }, {
                        name: "ConfigNet-ConfigNet_OpenXunleiP2PIncreaseSpeed",
                        type: "confCheckbox",
                        label: "开启迅雷P2P加速",
                        tip: "利用P2P技术进行用户间加速，该通道产生的上传流量会慢慢提升通道的健康度，从而提升通道加速效果",
                        tipClass: "xlx-setting-content__tips tip-text"
                    }]
                }, {
                    name: "播放组件",
                    children: [{
                        name: "DownloadAndPlay-LanuchMediaPlayer",
                        type: "confRadio",
                        label: "使用迅雷播放组件播放",
                        option: ["0", "1"],
                        labels: ["使用迅雷播放组件播放", "使用迅雷影音播放"],
                        ulClasses: "xlx-setting-content__vertical"
                    }]
                }]
            }],
            formData: {
                "ConfigNormalSession-ConfigNormal_AutoRun": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoRun",
                    value: !0
                },
                "Others-AntiDisturb": {section: "Others", key: "AntiDisturb", value: !0},
                "ConfigNormalSession-ConfigNormal_AutoStartUnFinishedTask": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoStartUnFinishedTask",
                    value: !1
                },
                "TaskDefaultSettings-DefaultPath": {section: "TaskDefaultSettings", key: "DefaultPath", value: ""},
                "TaskDefaultSettings-UseLastCatalog": {
                    section: "TaskDefaultSettings",
                    key: "UseLastCatalog",
                    value: !0
                },
                "DiskCache-DiskCacheSelect": {section: "DiskCache", key: "DiskCacheSelect", value: "256"},
                "TaskDefaultSettings-NewTaskStartMode": {
                    section: "TaskDefaultSettings",
                    key: "NewTaskStartMode",
                    value: "立即下载",
                    optionToValue: {"立即下载": 1, "手动下载": 0}
                },
                "ConfigNormalSession-ConfigNormal_MaxRunningTaskCount": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_MaxRunningTaskCount",
                    value: "5"
                },
                "ConfigNormalSession-ConfigNormal_AutoDeleteNotExistFile": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoDeleteNotExistFile",
                    value: !1
                },
                "TaskDefaultSettings-OpenFile": {section: "TaskDefaultSettings", key: "OpenFile", value: !1},
                "ConfigNet-ConfigNet_Type": {section: "ConfigNet", key: "ConfigNet_Type", value: "1"},
                "ConfigMsg-ConfigMsg_Finish": {section: "ConfigMsg", key: "ConfigMsg_Finish", value: !0},
                "ConfigMsg-ConfigMsg_PlayWaveWhileFinish": {
                    section: "ConfigMsg",
                    key: "ConfigMsg_PlayWaveWhileFinish",
                    value: !0
                },
                "ConfigMsg-ConfigMsg_WavePath": {section: "ConfigMsg", key: "ConfigMsg_WavePath", value: s},
                "ConfigMsg-ConfigMsg_FailSuggest": {section: "ConfigMsg", key: "ConfigMsg_FailSuggest", value: !0},
                "Monitor-MonitorClipBoard": {section: "Monitor", key: "MonitorClipBoard", value: !0},
                "Monitor-ShortcutMonitor": {section: "Monitor", key: "ShortcutMonitor", value: !0},
                "Monitor-WatchTraditionLink": {section: "Monitor", key: "WatchTraditionLink", value: !0},
                "Monitor-ConfigWatch_Bt": {section: "Monitor", key: "ConfigWatch_Bt", value: !0},
                "EMuleGenericSettings-EMuleWatchLink": {
                    section: "EMuleGenericSettings",
                    key: "EMuleWatchLink",
                    value: !0
                },
                "MagnetGenericSettings-MagnetWatchLink": {
                    section: "MagnetGenericSettings",
                    key: "MagnetWatchLink",
                    value: !0
                },
                "BtGenericSettings-AutoBTNewTask": {section: "BtGenericSettings", key: "AutoBTNewTask", value: !0},
                "BtGenericSettings-AssocTorrent": {section: "BtGenericSettings", key: "AssocTorrent", value: !0},
                "TaskDefaultSettings-OpenSilenceDownload": {
                    section: "TaskDefaultSettings",
                    key: "OpenSilenceDownload",
                    type: "number",
                    value: 0
                },
                "TaskDefaultSettings-AwayModeEnabled": {
                    section: "TaskDefaultSettings",
                    key: "AwayModeEnabled",
                    value: !1
                },
                "BossKey-BossKeySwitch": {section: "BossKey", key: "BossKeySwitch", value: !1},
                "BossKey-BossKeyName": {section: "BossKey", key: "BossKeyName", value: "Alt+D"},
                "TaskDefaultSettings-NewTaskDlgWithoutMainWnd": {
                    section: "TaskDefaultSettings",
                    key: "NewTaskDlgWithoutMainWnd",
                    value: !0
                },
                "ConfigFloatPanel-FloatPanelValue": {
                    section: "ConfigFloatPanel",
                    key: "FloatPanelValue",
                    value: "0",
                    immediatelySave: !0
                },
                "TaskDefaultSettings-OrignHostThreads": {
                    section: "TaskDefaultSettings",
                    key: "OrignHostThreads",
                    value: "5"
                },
                "ConfigNoLimitDownload-TaskCountAutoAdd": {
                    section: "ConfigNoLimitDownload",
                    key: "TaskCountAutoAdd",
                    value: !1
                },
                "ConfigNoLimitDownload-TaskCountAutoAddRate": {
                    section: "ConfigNoLimitDownload",
                    key: "TaskCountAutoAddRate",
                    value: "100"
                },
                "ConfigNormalSession-ConfigNormal_AutoSlowTask2Tail": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoSlowTask2Tail",
                    value: !0
                },
                "ConfigNoLimitDownload-OpenNoLimitDownload": {
                    section: "ConfigNoLimitDownload",
                    key: "OpenNoLimitDownload",
                    value: !1
                },
                "ConfigNoLimitDownload-NoLimitDownloadFileSize": {
                    section: "ConfigNoLimitDownload",
                    key: "NoLimitDownloadFileSize",
                    value: "30"
                },
                "ConfigNet-ConfigNet_OpenMirrorImageIncreaseSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_OpenMirrorImageIncreaseSpeed",
                    value: !0
                },
                "ConfigNet-ConfigNet_OpenXunleiP2PIncreaseSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_OpenXunleiP2PIncreaseSpeed",
                    value: !0
                },
                "ConfigNet-ConfigNet_Custom_DownloadSpeedChk": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_DownloadSpeedChk",
                    value: !0,
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_UploadSpeedChk": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_UploadSpeedChk",
                    value: !0,
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_MaxDownloadSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_MaxDownloadSpeed",
                    value: "1024",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_MaxUploadSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_MaxUploadSpeed",
                    value: "1024",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_Switch": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_Switch",
                    value: !1,
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_Begin_Hour": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_Begin_Hour",
                    value: "0",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_Begin_Minute": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_Begin_Minute",
                    value: "0",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_End_Hour": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_End_Hour",
                    value: "23",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_End_Minute": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_End_Minute",
                    value: "59",
                    immediatelySave: !0
                },
                "BtGenericSettings-ConfigBt_SetPortType": {
                    section: "BtGenericSettings",
                    key: "ConfigBt_SetPortType",
                    value: "0"
                },
                "BtGenericSettings-ConfigBt_Manul_TcpPort": {
                    section: "BtGenericSettings",
                    key: "ConfigBt_Manul_TcpPort",
                    value: "15000"
                },
                "Monitor-FilterSitesForUI": {
                    section: "Monitor",
                    key: "FilterSitesForUI",
                    value: "\n*.mail.live.com\n*.mail.yahoo.com\n*.mail.qq.com\n*.mail.sohu.com\n*.mail.google.com\n*.sinamail.sina.com.cn\n*.mail.sina.com.cn\n*.mail.163.com\n*.mail.10086.cn\n*.www.126.com\n*.passport.alipay.com\n*.login.live.com\n*.mail.sogou.com\n*.web.mail.tom.com\n*.www.2980.com\n*.mail.21cn.com\n*.www.188.com\n*.yeah.net\n*.mail.wo.com.cn\n*.263.net\n*.ecitic.com\n*.pos.baidu.com"
                },
                "Monitor-ExtendNames": {
                    section: "Monitor",
                    key: "ExtendNames",
                    value: ".asf;.avi;.exe;.iso;.mp3;.mpeg;.mpg;.mpga;.ra;.rar;.rm;.rmvb;.tar;.wma;.wmp;.wmv;.mov;.zip;.3gp;.chm;.mdf;.torrent;.jar;.msi;.arj;.bin;.dll;.psd;.hqx;.sit;.lzh;.gz;.tgz;.xlsx;.xls;.doc;.docx;.ppt;.pptx;.flv;.swf;.mkv;.tp;.ts;.flac;.ape;.wav;.aac;.txt;.dat;.7z;.ttf;.bat;.xv;.xvx;.pdf;.mp4;.apk;.ipa;.epub;.mobi;.deb;.sisx;.cab;.pxl;.xlb;"
                },
                "UserCommunitySet-radio_id_": {
                    section: "UserCommunitySet",
                    key: "radio_id_",
                    value: "1",
                    isReleventUser: !0,
                    immediatelySave: !0
                },
                "GenericSettings-AnimationLevel": {section: "GenericSettings", key: "AnimationLevel", value: "1"},
                "Motitor-MotitorAll": {
                    section: "Motitor",
                    key: "MotitorAll",
                    value: 1,
                    type: "number",
                    selectItems: ["Motitor-MotitorIE浏览器"]
                },
                "Bookmark-ShowBookmarkBar": {section: "Bookmark", key: "ShowBookmarkBar", value: 1},
                "PathAndCategory-historyDownloadPaths": {
                    section: "PathAndCategory",
                    key: "historyDownloadPaths",
                    value: []
                },
                "DownloadAndPlay-LanuchMediaPlayer": {
                    section: "DownloadAndPlay",
                    key: "LanuchMediaPlayer",
                    value: "0",
                    immediatelySave: !0
                }
            }
        }, e.setBaseConf = function () {
            let t = Object.values(e.conf.formData);
            for (let n = 0; n < t.length; n++) {
                let a = "";
                if (void 0 !== t[n].optionToValue) {
                    let e = i.ConfigNS.getValue(t[n].section, t[n].key, t[n].optionToValue[t[n].value]);
                    for (let i in t[n].optionToValue) if (t[n].optionToValue[i] === e) {
                        a = i;
                        break
                    }
                } else a = i.ConfigNS.getValue(t[n].section, t[n].key, t[n].value);
                e.conf.formData[`${t[n].section}-${t[n].key}`].value = a
            }
        }, e.initConf = function () {
            return i.ConfigNS.init(a.join(__profilesDir, "config.json"))
        }, e.getConfSchema = function () {
            if (null === r.remote.getGlobal("suspensionWindow")) for (let t in e.conf.sechema) {
                let n = e.conf.sechema[t];
                if (null !== n && "高级设置" === n.name) {
                    n.children = n.children.filter(e => "悬浮窗" !== e.name);
                    break
                }
            }
            return e.conf.sechema
        }, e.getConfFormData = function () {
            return e.conf.formData
        }
    }(t.SettingInit || (t.SettingInit = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(4), a = n(1), o = n(8), r = n(37), s = n(114), l = n(93), u = n(846), d = n(61), c = n(548),
        h = a.default.getLogger("DownloadStore"), f = r.DownloadKernelEventManager.getEventManager(),
        p = s.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        g = l.DownloadKernelCategoryManager.getCategoryManager(), k = {
            currentCategoryId: -1,
            currentCategoryViewId: o.DownloadKernel.CategroyViewID.Downloading,
            taskList: [{
                categoryId: -1,
                id: o.DownloadKernel.CategroyViewID.Downloading,
                tasksMap: {},
                selected: [],
                taskIds: []
            }, {
                categoryId: -1,
                id: o.DownloadKernel.CategroyViewID.Completed,
                tasksMap: {},
                selected: [],
                taskIds: []
            }, {categoryId: -1, id: o.DownloadKernel.CategroyViewID.Recycle, tasksMap: {}, selected: [], taskIds: []}],
            taskListPrivate: [{
                id: o.DownloadKernel.CategroyViewID.Downloading,
                tasksMap: {},
                selected: [],
                taskIds: []
            }, {id: o.DownloadKernel.CategroyViewID.Completed, tasksMap: {}, selected: [], taskIds: []}]
        }, m = {
            INIT_CATEGORY_TASKLIST(e) {
                h.information("INIT_CATEGORY_TASKLIST state.currentCategoryId:", e.currentCategoryId);
                let t = e.taskList;
                -1 !== e.currentCategoryId && (t = e.taskListPrivate);
                for (let n = 0; n < t.length; n++) {
                    let i = t[n], a = null;
                    if (!(a = -1 === e.currentCategoryId ? p.getCategoryViewFromId(i.id) : g.getCategoryView(e.currentCategoryId, i.id))) {
                        i.tasksMap = null, i.selected = [], i.taskIds = [], i.tasksMap = {};
                        continue
                    }
                    let o = a.getTasks();
                    t[n].tasksMap = null, t[n].tasksMap = {}, t[n].selected = [], t[n].categoryId = e.currentCategoryId;
                    let r = {};
                    for (let [e, t]of o) r[e] = t.getTaskBaseInfo();
                    let s = [...Object.values(r)];
                    s.sort(c.SortNS.getSortFuncByConfig(i.id, i.categoryId)), t[n].tasksMap = Object.assign({}, r), t[n].taskIds = s.map(e => e.taskId)
                }
                h.information("INIT_CATEGORY_TASKLIST end")
            }, SORT_CATEGORY_HISTORY(e) {
                let t = e.taskList;
                -1 !== e.currentCategoryId && (t = e.taskListPrivate);
                for (let e = 0; e < t.length; e++) {
                    let n = [...Object.values(t[e].tasksMap)];
                    n.sort(c.SortNS.getSortFuncByConfig(t[e].id, t[e].categoryId)), t[e].taskIds = n.map(e => e.taskId)
                }
            }, SORT_CATEGORY_BY_FUNCTION(e, t) {
                do {
                    if (t.index < 0 || t.index > 2) break;
                    if ("function" != typeof t.compareFn) break;
                    if (-1 === t.categoryId) {
                        let n = [...Object.values(e.taskList[t.index].tasksMap)];
                        n.sort(t.compareFn), e.taskList[t.index].taskIds = n.map(e => e.taskId)
                    } else {
                        let n = [...Object.values(e.taskListPrivate[t.index].tasksMap)];
                        n.sort(t.compareFn), e.taskListPrivate[t.index].taskIds = n.map(e => e.taskId)
                    }
                } while (0)
            }, UPDATE_CATEGORYVIEW(e, t) {
                e.currentCategoryViewId !== t && (e.currentCategoryViewId = t)
            }, INSERT_TO_CATEGORY_VIEW(e, t) {
                h.information("insert INSERT_TO_CATEGORY_VIEW in ");
                let n = e.taskList;
                -1 !== t.categoryId && (n = e.taskListPrivate);
                for (let e = 0; e < n.length; e++) if (n[e].id === t.id) {
                    if (n[e].categoryId !== t.categoryId) break;
                    let i = [], a = {};
                    for (let e of t.tasks) a[e.taskId] = Object.assign({}, e), i.push(e.taskId);
                    n[e].tasksMap = Object.assign({}, n[e].tasksMap, a), i.length > 0 && n[e].taskIds.splice(0, 0, ...i);
                    break
                }
                h.information("insert INSERT_TO_CATEGORY_VIEW end ")
            }, REMOVE_FROM_CATEGORY_VIEW(e, t) {
                let n = e.taskList;
                -1 !== t.categoryId && (n = e.taskListPrivate);
                for (let e = 0; e < n.length; e++) if (n[e].id === t.categoryViewId) {
                    if (n[e].categoryId !== t.categoryId) break;
                    let i = Object.assign({}, n[e].tasksMap), a = Object.assign([], n[e].taskIds),
                        o = Object.assign([], n[e].selected);
                    for (let e of t.tasks) {
                        let t = e.taskId;
                        delete i[t];
                        let n = a.indexOf(t);
                        -1 !== n && a.splice(n, 1);
                        let r = o.indexOf(t);
                        -1 !== r && o.splice(r, 1)
                    }
                    n[e].tasksMap = i, n[e].taskIds = a, n[e].selected = o;
                    break
                }
            }, UPDATE_TASK_INFO(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    for (let n of t) {
                        let t = 0;
                        e.taskList[t].tasksMap.hasOwnProperty(String(n.taskId)) ? i.Vue.set(e.taskList[t].tasksMap, String(n.taskId), Object.assign({}, n)) : e.taskListPrivate[t].tasksMap.hasOwnProperty(String(n.taskId)) ? i.Vue.set(e.taskListPrivate[t].tasksMap, String(n.taskId), Object.assign({}, n)) : (t = 1, e.taskList[t].tasksMap.hasOwnProperty(String(n.taskId)) ? (h.information("update task info not find in downloading", n), i.Vue.set(e.taskList[t].tasksMap, String(n.taskId), Object.assign({}, n))) : e.taskListPrivate[t].tasksMap.hasOwnProperty(String(n.taskId)) && i.Vue.set(e.taskListPrivate[t].tasksMap, String(n.taskId), Object.assign({}, n)))
                    }
                } while (0)
            }, UPDATE_TASK_READED(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = 1;
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskList[n].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskListPrivate[n].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_RENAME(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = 1;
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskList[n].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskListPrivate[n].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_MOVED(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = 0;
                    t[0].taskStatus !== o.DownloadKernel.TaskStatus.Succeeded && t[0].taskStatus !== o.DownloadKernel.TaskStatus.Seeding || (n = 1);
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskList[n].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[n].tasksMap.hasOwnProperty(String(a.taskId)) && i.Vue.set(e.taskListPrivate[n].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_STATUS(e, t) {
                h.information("update status in", t.length, t[0].taskStatus, t[0].taskId);
                let n = {}, i = void 0;
                for (let a of t) void 0 === i && (i = !e.taskList[0].tasksMap.hasOwnProperty(String(a.taskId))), n[a.taskId] = a;
                h.information("update status "), i ? e.taskListPrivate[0].tasksMap = Object.assign({}, e.taskListPrivate[0].tasksMap, n) : e.taskList[0].tasksMap = Object.assign({}, e.taskList[0].tasksMap, n), h.information("update status end")
            }, UPDATE_DOWNLOADING_SELECTED_TASKS(e, t) {
                -1 === e.currentCategoryId ? e.taskList[0].selected = [...t] : e.taskListPrivate[0].selected = [...t]
            }, UPDATE_COMPLETED_SELECTED_TASKS(e, t) {
                -1 === e.currentCategoryId ? e.taskList[1].selected = [...t] : e.taskListPrivate[1].selected = [...t]
            }, UPDATE_RECYCLE_SELECTED_TASKS(e, t) {
                -1 === e.currentCategoryId && (e.taskList[2].selected = [...t])
            }, MOVE_TO_TOP(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = e.taskList[0].taskIds;
                    -1 !== e.currentCategoryId && (n = e.taskListPrivate[0].taskIds);
                    let i = [];
                    for (let e of t) {
                        let t = n.indexOf(e);
                        -1 !== t && i.push(t)
                    }
                    i.sort((e, t) => e - t);
                    let a = [];
                    for (let e = i.length - 1; e >= 0; e--) a.unshift(n.splice(i[e], 1)[0]);
                    n.splice(0, 0, ...a)
                } while (0)
            }, MOVE_TO_BOTTOM(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let n = e.taskList[0].taskIds;
                    -1 !== e.currentCategoryId && (n = e.taskListPrivate[0].taskIds);
                    let i = [];
                    for (let e of t) {
                        let t = n.indexOf(e);
                        -1 !== t && i.push(t)
                    }
                    i.sort((e, t) => e - t);
                    let a = [];
                    for (let e = i.length - 1; e >= 0; e--) a.unshift(n.splice(i[e], 1)[0]);
                    n.splice(n.length, 0, ...a)
                } while (0)
            }, UPDATE_CATEGORY(e, t) {
                if (e.currentCategoryId !== t) {
                    if (e.currentCategoryId = t, -1 !== t) for (let n = 0; n < e.taskListPrivate.length; n++) e.taskListPrivate[n].categoryId = t, e.taskListPrivate[n].tasksMap = null, e.taskListPrivate[n].tasksMap = {}, e.taskListPrivate[n].taskIds = [], e.taskListPrivate[n].selected = [];
                    d.default.setCurrentCategoryId(t)
                }
            }, UPDATE_DOWNLOADING_TASKLIST(e, t) {
                if (t.length > 0) {
                    let n = 0, i = e.taskList[n];
                    -1 !== e.currentCategoryId && (i = e.taskListPrivate[n]), i.taskIds.splice(0, t.length, ...t)
                }
            }, UPDATE_COMPLETED_TASKLIST(e, t) {
                if (t.length > 0) {
                    let n = 1, i = e.taskList[n];
                    -1 !== e.currentCategoryId && (i = e.taskListPrivate[n]), i.taskIds.splice(0, t.length, ...t)
                }
            }, UPDATE_RECYCLE_TASKLIST(e, t) {
                t.length > 0 && -1 === e.currentCategoryId && e.taskList[2].taskIds.splice(0, t.length, ...t)
            }
        }, T = {
            attachTaskEvent({commit: e}) {
                f.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.DetailChanged) break;
                        if (!t[1]) break;
                        let n = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_INFO", n)
                    } while (0)
                }), f.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskUserRead, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskUserRead) break;
                        if (!t[1]) break;
                        let n = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_READED", n)
                    } while (0)
                }), f.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskRenamed, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskRenamed) break;
                        if (!t[1]) break;
                        let n = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_RENAME", n)
                    } while (0)
                }), f.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskMovedEnd, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskMovedEnd) break;
                        if (!t[1]) break;
                        let n = t[1], i = [];
                        for (let e of n) null !== e && i.push(e.getTaskBaseInfo());
                        i.length > 0 && e("UPDATE_TASK_MOVED", i)
                    } while (0)
                }), f.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd) break;
                        if (!t[1]) break;
                        let n = t[1], i = [];
                        for (let e of n) null !== e && i.push(e.getTaskBaseInfo());
                        i.length > 0 && e("UPDATE_TASK_MOVED", i)
                    } while (0)
                }), f.attachTaskEvent(o.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                        if (void 0 === t[1] || !t[2] || !t[3]) break;
                        let n = t[1], i = t[2], a = t[3].map(e => e.getTaskBaseInfo());
                        e("REMOVE_FROM_CATEGORY_VIEW", {categoryId: n, categoryViewId: i, tasks: a})
                    } while (0)
                })
            }
        }, v = {
            toolbarButtons: e => {
                let t = [];
                return -1 === e.currentCategoryId ? e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? t = u.DownloadToolbar.downloadingButtons : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? t = u.DownloadToolbar.completedButtons : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && (t = u.DownloadToolbar.recycleButtons) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? t = u.DownloadToolbar.privateDownloadingButtons : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed && (t = u.DownloadToolbar.privateCompletedButtons), t
            }, currentCategoryTaskCount: e => {
                let t = 0;
                return e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 === e.currentCategoryId ? t = e.taskList[0].taskIds.length : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0].taskIds.length) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 === e.currentCategoryId ? t = e.taskList[1].taskIds.length : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[1].taskIds.length) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (t = e.taskList[2].taskIds.length), t
            }, currentSelectdTaskInfos: e => {
                let t = [], n = null, i = [];
                if (e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 !== e.currentCategoryId ? e.currentCategoryId === e.taskListPrivate[0].categoryId && (n = e.taskListPrivate[0].tasksMap, i = e.taskListPrivate[0].selected) : (n = e.taskList[0].tasksMap, i = e.taskList[0].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 !== e.currentCategoryId ? e.currentCategoryId === e.taskListPrivate[1].categoryId && (n = e.taskListPrivate[1].tasksMap, i = e.taskListPrivate[1].selected) : (n = e.taskList[1].tasksMap, i = e.taskList[1].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (n = e.taskList[2].tasksMap, i = e.taskList[2].selected), null !== n) for (let e of i) void 0 !== n[e] && null !== n[e] ? t.push(n[e]) : h.information("selected taskbase undefined", e);
                return t
            }, downloadingSelectedIndexs: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[0].selected : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0].selected), t
            }, completedSelectedTaskIndexs: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[1].selected : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1].selected), t
            }, recycleSelectedTaskIndexs: e => {
                let t = [];
                return -1 === e.currentCategoryId && (t = e.taskList[2].selected), t
            }, downloadingTaskList: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[0].taskIds : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0].taskIds), t
            }, completedTaskList: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[1].taskIds : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1].taskIds), t
            }, recycleTaskList: e => {
                let t = [];
                return -1 === e.currentCategoryId && (t = e.taskList[2].taskIds), t
            }, downloadingOrder: e => {
                return e.taskList[0].taskIds
            }, downloadingTaskBaseList: e => {
                let t = [], n = {};
                return -1 !== e.currentCategoryId ? e.currentCategoryId === e.taskListPrivate[0].categoryId && (n = e.taskListPrivate[0].tasksMap) : n = e.taskList[0].tasksMap, t = [...Object.values(n)]
            }, completedTaskBaseList: e => {
                let t = [], n = {};
                return -1 !== e.currentCategoryId ? e.currentCategoryId === e.taskListPrivate[1].categoryId && (n = e.taskListPrivate[1].tasksMap) : n = e.taskList[1].tasksMap, t = [...Object.values(n)]
            }, recycleTaskBaseList: e => {
                let t = [], n = {};
                return -1 === e.currentCategoryId && (n = e.taskList[2].tasksMap), t = [...Object.values(n)]
            }
        };
    t.default = {state: k, mutations: m, actions: T, getters: v}
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(8), r = n(103), s = n(154), l = n(31), u = n(85), d = n(201), c = n(114), h = n(13),
        f = n(261), p = n(138), g = c.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        k = a.default.getLogger("DownloadToolbar"), m = l.DownloadKernelTaskManager.getTaskManager();
    let T = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_newtask_click"), h.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=dltab_menu"), r.ThunderNewTask.createPreNewTaskWindow(null)
    }, v = () => "", y = (e, t, n, i) => {
        let a = "";
        return i && (a = "is-disabled"), a
    }, S = (e, t) => {
        k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        n === o.DownloadKernel.CategroyViewID.Downloading ? u.TaskOperatorNs.startTasks(i) : k.error("toolbar start tasks but not in downloading category")
    }, w = (e, t, n, i) => {
        let a = "is-disabled";
        return !i && s.TaskStatusHelper.canStartSelectedTask(t, n) && (a = ""), a
    }, b = (e, t) => {
        k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        n === o.DownloadKernel.CategroyViewID.Downloading ? u.TaskOperatorNs.pauseTasks(i, o.DownloadKernel.TaskStopReason.ToolbarButton) : k.error("toolbar pause tasks but not in downloading category")
    }, C = (e, t, n, i) => {
        let a = "is-disabled";
        return !i && s.TaskStatusHelper.canStopSelectedTask(t, n) && (a = ""), a
    }, N = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let n = t.currentSelectdTaskInfos, i = !1;
        e.shiftKey && (i = !0), i ? u.TaskOperatorNs.destroyTasks(n) : u.TaskOperatorNs.deleteTasks(n)
    }, D = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let n = t.currentSelectdTaskInfos;
        u.TaskOperatorNs.destroyTasks(n)
    }, I = (e, t, n, i) => {
        let a = "is-disabled";
        return !i && s.TaskStatusHelper.canDeleteSelectedTask(t, n) && (a = ""), a
    }, _ = (e, t) => i(this, void 0, void 0, function* () {
        k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        do {
            if (n === o.DownloadKernel.CategroyViewID.Downloading) break;
            if (1 !== i.length) break;
            let e = i[0].taskType;
            if (e === o.DownloadKernel.TaskType.Bt) {
                let e = m.getTaskFromTaskId(i[0].taskId);
                (yield p.SingleBtTaskNS.isSingleBtTask(e)) ? yield u.TaskOperatorNs.openTaskItem(i[0]) : yield u.TaskOperatorNs.openTaskFolder(i[0], !0)
            } else if (e === o.DownloadKernel.TaskType.Group) if (n === o.DownloadKernel.CategroyViewID.Completed) {
                let e = m.getTaskFromTaskId(i[0].taskId);
                (yield u.TaskOperatorNs.executeInstallFile(e)) || (yield u.TaskOperatorNs.openTaskFolder(i[0], !0))
            } else yield u.TaskOperatorNs.openTaskFolder(i[0], !0); else {
                let e = "";
                n === o.DownloadKernel.CategroyViewID.Completed ? e = "finished" : n === o.DownloadKernel.CategroyViewID.Recycle && (e = "dustbin"), yield u.TaskOperatorNs.openTaskItem(i[0], void 0, void 0, e)
            }
            n === o.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(i, 1)
        } while (0)
    }), x = (e, t) => i(this, void 0, void 0, function* () {
        k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        do {
            if (n === o.DownloadKernel.CategroyViewID.Downloading) break;
            if (1 !== i.length) break;
            yield u.TaskOperatorNs.openTaskFolder(i[0]), n === o.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(i, 1)
        } while (0)
    }), A = (e, t, n, a) => i(this, void 0, void 0, function* () {
        let e = "is-disabled";
        do {
            if (a || t !== o.DownloadKernel.CategroyViewID.Completed) break;
            if (1 === n.length) {
                if (!(yield d.TaskCtrlOperatorNS.canOpenSelectedTaskFile(n[0]))) break;
                e = ""
            }
        } while (0);
        return e
    }), E = (e, t, n, a) => i(this, void 0, void 0, function* () {
        let e = "is-disabled";
        do {
            if (a || t !== o.DownloadKernel.CategroyViewID.Completed) break;
            if (1 === n.length) {
                if (!(yield d.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(n[0]))) break;
                e = ""
            }
        } while (0);
        return e
    }), M = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_undo_click"), k.verbose(e);
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        n === o.DownloadKernel.CategroyViewID.Recycle && u.TaskOperatorNs.recoverTask(i)
    }, P = (e, t) => {
        k.verbose(e), h.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let n = t.currentCategoryViewId, i = t.currentSelectdTaskInfos;
        n === o.DownloadKernel.CategroyViewID.Recycle && u.TaskOperatorNs.destroyTasks(i)
    }, F = (e, t, n, i) => {
        k.verbose(t);
        let a = "is-disabled";
        return !i && n.length > 0 && (a = ""), a
    }, O = () => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_clear_click"), u.TaskOperatorNs.clearRecycle()
    }, U = (e, t, n, i) => {
        let a = g.getCategoryViewFromId(o.DownloadKernel.CategroyViewID.Recycle).getTasks().size, r = "is-disabled";
        return !i && a > 0 && (r = ""), r
    }, L = (e, t, n, i) => {
        let a = "";
        return i && (a = "is-disabled"), a
    }, B = (e, t) => i(this, void 0, void 0, function* () {
        const {VipDownloadPlugin: t} = yield Promise.resolve().then(() => n(53));
        let i = encodeURIComponent("referfrom=v_pc_xlx_ggong_taskbar_vip");
        h.XLStatNS.trackEvent("download_leftpanel", "top_vipicon_click", "", 0, 0, 0, 0, i), k.verbose(e), t.clickToolbarVipBtn()
    }), K = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_more_click"), k.information("open more"), k.verbose(e), f.downloadContextMenu.setContextInfo(t, t.currentCategoryId), f.downloadContextMenu.popMenu(f.DownloadMenuType.ToolbarMore).catch()
    }, V = (e, t) => {
        h.XLStatNS.trackEvent("download_leftpanel", "top_private_setting_click"), f.downloadContextMenu.setContextInfo(t, t.currentCategoryId), f.downloadContextMenu.popMenu(f.DownloadMenuType.PrivateSpaceHome).catch()
    };
    !function (e) {
        e.downloadingButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: y
        }, {id: "xlx-icon-nav-down", title: "下载", onClick: S, filterClass: w}, {
            id: "xlx-icon-nav-pause",
            title: "暂停",
            onClick: b,
            filterClass: C
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: N, filterClass: I}, {
            id: "xlx-icon-nav-more",
            title: "更多",
            onClick: K,
            filterClass: y
        }], e.completedButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: y
        }, {id: "xlx-icon-nav-file", title: "打开文件", onClick: _, filterClass: A}, {
            id: "xlx-icon-nav-folder",
            title: "打开文件夹",
            onClick: x,
            filterClass: E
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: N, filterClass: I}, {
            id: "xlx-icon-nav-more",
            title: "更多",
            onClick: K,
            filterClass: y
        }], e.recycleButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: y
        }, {id: "xlx-icon-nav-restore", title: "还原", onClick: M, filterClass: F}, {
            id: "xlx-icon-nav-clear",
            title: "彻底删除",
            onClick: P,
            filterClass: F
        }, {id: "xlx-icon-nav-rubbish", title: "清空垃圾箱", onClick: O, filterClass: U}, {
            id: "xlx-icon-nav-more",
            title: "更多",
            onClick: K,
            filterClass: y
        }], e.privateDownloadingButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: y
        }, {id: "xlx-icon-nav-down", title: "下载", onClick: S, filterClass: w}, {
            id: "xlx-icon-nav-pause",
            title: "暂停",
            onClick: b,
            filterClass: C
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: D, filterClass: I}, {
            id: "xlx-icon-nav-home",
            title: "私人空间设置",
            onClick: V,
            filterClass: L
        }], e.privateCompletedButtons = [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: y
        }, {id: "xlx-icon-nav-file", title: "打开文件", onClick: _, filterClass: A}, {
            id: "xlx-icon-nav-folder",
            title: "打开文件夹",
            onClick: x,
            filterClass: E
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: D, filterClass: I}, {
			id: "xlx-icon-nav-home", title: "私人空间设置", onClick: V, filterClass: L}]
    }(t.DownloadToolbar || (t.DownloadToolbar = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.contextMenuDownloadImportUncomplete = "context_menu_download_import_uncompleted", e.contextMenuDownloadFolder = "context_menu_download_folder", e.contextMenuGroupAccelerate = "context_menu_group_accelerate", e.contxtMenuSubtitleSearch = "context_menu_subtitle_search", e.contextMenuDownloadStart = "context_menu_download_start", e.contextMenuDownloadPause = "context_menu_download_pause", e.contextMenuDownloadStartAll = "context_menu_download_start_all", e.contextMenuDownloadPauseAll = "context_menu_download_pause_all", e.contextMenuDownloadDelete = "context_menu_download_delete", e.contextMenuDownloadDestroy = "context_menu_download_destroy", e.contextMenuDownloadMoveFilePrivateSpace = "context_menu_download_move_file_private_space", e.contextMenuDownloadMoveFileOutPrivateSpace = "context_menu_download_move_file_out_private_space", e.contextMenuDownloadMoveFileOther = "context_menu_download_move_file_other", e.contextMenuDownloadMoveFileLastest = "context_menu_download_move_file_lastest", e.contextMenuDownloadMoveTop = "context_menu_download_move_top", e.contextMenuDownloadMoveBottom = "context_menu_download_move_bottom", e.contextMenuDownloadMerge = "context_menu_download_merge", e.contextMenuDownloadVipAcc = "context_menu_download_vip_acc", e.contextMenuDownloadCopyLink = "context_menu_download_copy_link", e.contextMenuDownloadTorrentSaveAs = "context_menu_download_torrent_save_as", e.contextMenuDownloadCopyMagnet = "context_menu_download_copy_magnet", e.contextMenuDownloadFile = "context_menu_download_file", e.contextMenuDownloadRename = "context_menu_download_rename", e.contextMenuDownloadCopyFileLastest = "context_menu_download_copy_file_lastest", e.contextMenuDownloadCopyFileOther = "context_menu_download_copy_file_other", e.contextMenuDownloadRedownload = "context_menu_download_redownload", e.contextMenuDownloadRecover = "context_menu_download_recover", e.contextMenuDownloadClear = "context_menu_download_clear", e.contextMenuDownloadSelectAll = "context_menu_download_select_all", e.contextMenuDownloadDeleteNonexisting = "context_menu_download_delete_non_existing", e.contextMenuDownloadAsReadedAll = "context_menu_download_as_readed_all", e.contextMenuToolbarMoreOpenSearch = "context_menu_toolbar_more_opensearch", e.contextMenuToolbarMoreDestroy = "context_menu_toolbar_more_destroy", e.contextMenuToolbarMoreConfig = "context_menu_toolbar_more_config", e.contextMenuToolbarMoreSortByDefault = "context_menu_toolbar_more_sort_default", e.contextMenuToolbarMoreSortByTime = "context_menu_toolbar_more_sort_time", e.contextMenuToolbarMoreSortByType = "context_menu_toolbar_more_sort_type", e.contextMenuToolbarMoreSortByName = "context_menu_toolbar_more_sort_name", e.contextMenuToolbarMoreSortBySize = "context_menu_toolbar_more_sort_size", e.contextMenuToolbarMoreSortByStatus = "context_menu_toolbar_more_sort_status", e.contextMenuToolbarMoreSortByProgress = "context_menu_toolbar_more_sort_progress", e.contextMenuTabChangeCategoryMyComputer = "context_menu_tab_change_category_mycomputer", e.contextMenuTabChangeCategoryPrivateSpace = "context_menu_tab_change_category_privatespace", e.contextMenuToolbarPrivateSpaceSelectAll = "context_menu_toolbar_privatespace_select_all", e.contextMenuToolbarPrivateSpaceDownloadSetting = "context_menu_toolbar_privatespace_download_setting", e.contextMenuToolbarPrivateSpaceTaskManager = "context_menu_toolbar_privatespace_download_task_manager", e.contextMenuOpenTaskPosition = "context_menu_search_openfile_position"
    }(t.ContextMenuIdsNS || (t.ContextMenuIdsNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        ON_MOUNTED(e, t) {
            e.homePageUrl = t
        }
    };
    t.default = {state: {homePageUrl: ""}, mutations: i, actions: {}}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(850), o = i.default.getLogger("CommunityStore"), r = [6, 8, 10], s = [7, 9, 11];
    o.verbose("enter");
    const l = {
        SET_UNREAD_NUMS(e, t) {
            e.unreadNums = Object.assign({}, e.unreadNums, t)
        }, SET_SHOW_MESSAGE_BUTTON(e, t) {
            e.showMessageButton = t
        }, SET_UNREAD_MESSAGES(e, t) {
            e.messages = t
        }, SET_UNREAD_STARS(e, t) {
            e.stars = t
        }, SET_CHAT_MSGS(e, t) {
            o.information("SET_CHAT_MSGS", Object.assign({}, e.chatMsgs)), e.chatMsgs = e.chatMsgs.concat(t)
        }, RESET_CHATS_NUM(e) {
            e.chatMsgs = []
        }, SET_USERS_INFO(e, t) {
            e.chatUsersInfo[t.uid || "0"] = t, o.information(" state.chatUsersInfo", e.chatUsersInfo), e.chatUserId = t.uid || 0
        }, SET_CHATS_NUM(e, t) {
            e.unreadNums.chat = t
        }, SET_MINE_ID(e, t) {
            e.mineId = t
        }
    }, u = {
        getUnreadNums: ({commit: e, state: t, rootState: n}, i) => (o.information("getUnreadNums"), a.getUnreadMsgNum(i).then(n => {
            n.error || "ok" !== n.data.result || (o.information("获取未读数消息", n), e("SET_UNREAD_NUMS", {
                star: n.data.aggregation,
                comment: n.data.comment,
                chat: t.unreadNums.chat
            }))
        }).catch(e => {
            o.information("getUnreadNums error")
        })),
        getUnreadNoticeNum: ({commit: e, state: t, rootState: n}, i) => (o.information("getUnreadNoticeNum"), a.getUnreadNoticeNum(i).then(t => {
            o.information("获取未读系统通知数", t), t.error || "ok" !== t.data.result || e("SET_UNREAD_NUMS", {notice: t.data.count})
        }).catch(e => {
            o.information("getUnreadNoticeNum error")
        })),
        getUnreadMessages: ({commit: e, state: t, rootState: n}, i) => a.getUnreadMsgs(i, 0).then(t => {
            o.information("获取未读消息内容，评论/回复", t);
            let n = [];
            if (!t.error && "ok" === t.data.result) {
                let i = 0;
                for (let e = 0; e < t.data.messages.length; e++) !t.data.messages[e].have_read && r.includes(t.data.messages[e].type) && (n[i] = {
                    msgType: t.data.messages[e].type,
                    userId: t.data.messages[e].initiator,
                    userName: t.data.messages[e].initiator_name,
                    userAvatar: t.data.messages[e].initiator_portrait,
                    messageContent: t.data.messages[e].reply,
                    msgid: t.data.messages[e].msgid,
                    res: t.data.messages[e].cinecism,
                    createTime: t.data.messages[e].insert_time
                }, i++);
                o.information("messages--", n), n.length > 0 && e("SET_UNREAD_MESSAGES", n)
            }
        }).catch(e => {
            o.information("getUnreadMessages error")
        }),
        getUnreadStars: ({commit: e, state: t, rootState: n}, i) => a.getStarsMsg(i, 0).then(t => {
            o.information("获取点赞的消息内容", t);
            let n = [];
            if (!t.error && "ok" === t.data.result) {
                let i = 0;
                for (let e = 0; e < t.data.messages.length; e++) !t.data.messages[e].have_read && s.includes(t.data.messages[e].type) && (n[i] = {
                    msgType: t.data.messages[e].type,
                    userId: t.data.messages[e].initiator,
                    userName: t.data.messages[e].initiator_name,
                    userAvatar: t.data.messages[e].initiator_portrait,
                    messageContent: t.data.messages[e].original,
                    res: t.data.messages[e].cinecism,
                    msgid: t.data.messages[e].msgid,
                    createTime: t.data.messages[e].insert_time
                }, i++);
                o.information("messages--", n), n.length > 0 && e("SET_UNREAD_STARS", n)
            }
        }).catch(e => {
            o.information("getUnreadStars error")
        }),
        getUserInfo: ({commit: e, state: t, rootState: n}, i) => (o.information("getUserInfo", i), void 0 !== t.chatUsersInfo[i] ? (o.information("用户信息已存在"), Promise.resolve({data: {result: "ok"}})) : a.getUserInfo(i).then(t => (o.information("getUserInfo....", t), t.error || "ok" !== t.data.result || (o.information("getUserInfo....", t.data.user_info), e("SET_USERS_INFO", t.data.user_info)), t)).catch(e => {
            o.information("getUserInfo error")
        })),
        getUserSessionList: ({commit: e, state: t, rootState: n}, i) => a.getUserSessionList(i).then(n => {
            if (o.information("获取用户会话列表", n), !n.error && "ok" === n.data.result) {
                let i = 0, a = [];
                for (let e = 0; e < n.data.sessions.length; e++) o.information("mineId--", t.mineId), n.data.sessions[e].user_id === t.mineId || a.includes(n.data.sessions[e].record.sender) || (i += n.data.sessions[e].unread, a.push(n.data.sessions[e].record.sender));
                i > 0 && e("SET_CHATS_NUM", i), o.information("私信未读数 chatNum", i)
            }
        }).catch(e => {
            o.information("getUserSessionList error")
        })
    }, d = {
        totalUnread(e, t, n) {
            let {star: i, comment: a, notice: o, chat: r} = e.unreadNums;
            return i + a + o + r
        }, UnreadMsgsLen: (e, t, n) => e.messages.length + e.stars.length + e.chatMsgs.length
    };
    t.default = {
        state: {
            unreadNums: {star: 0, comment: 0, notice: 0, chat: 0},
            showMessageButton: !0,
            messages: [],
            stars: [],
            chatUserId: 0,
            chatMsgs: [],
            chatUsersInfo: {},
            mineId: 0
        }, mutations: l, actions: u, getters: d
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(84);
    t.getUnreadMsgNum = function (e) {
        return i.fetchSlRes({url: "/msgcenter/unread_info_v3", data: {userid: e, "Chat-Version": 4}})
    }, t.getUnreadNoticeNum = function (e) {
        return i.fetchSlRes({url: "/msgcenter/pc/unread_count", data: {user_id: e, "Chat-Version": 4}})
    }, t.getUnreadMsgs = function (e, t, n, a) {
        return i.fetchSlRes({
            url: "/msgcenter/query_comment_v3",
            data: {userid: e, "Chat-Version": 4, reset_read_status: t, cursor: n, size: a}
        })
    }, t.getStarsMsg = function (e, t, n, a) {
        return i.fetchSlRes({
            url: "/msgcenter/query_star_v3",
            data: {userid: e, "Chat-Version": 4, reset_read_status: t, cursor: n, size: a}
        })
    }, t.getUserInfo = function (e) {
        return i.fetchSlRes({url: "/user_info/pc_info", data: {uid: e}})
    }, t.getUserSessionList = function (e, t = 60) {
        return i.fetchSlRes({url: "/chitchat/sessions", data: {uid: e, limit: t}})
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        SHOW_PRIVATE_SPACE_OPEN_PAGE(e, t) {
            e.showPrivateSpaceOpenPage = t
        }
    };
    t.default = {state: {showPrivateSpaceOpenPage: !1}, mutations: i, actions: {}, getters: {}}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = {
        SHOW_UPGRADE_TASK(e, t) {
            e.showUpgradeTask !== t && (e.showUpgradeTask = t)
        }
    };
    t.default = {state: {showUpgradeTask: !1}, mutations: i, actions: {}, getters: {}}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(20), a = n(2), o = n(22), r = n(4), s = n(1).default.getLogger("book-marks-store"), l = n(107),
        u = a.join(__profilesDir, "XLBrowserApp", "bookmarks"), d = 1, c = {
            ADD_BOOK_MARKS_ITEM(e, t) {
                e.bookMarks = Object.assign({}, e.bookMarks, t);
                let n = JSON.stringify(e.bookMarks);
                o.ConfigNS.setValue("book-marks-section", "book-marks-key", n)
            }, REMOVE_BOOK_MARKS_ITEM(e, t) {
                if (s.information("REMOVE_BOOK_MARKS_ITEM", t), void 0 !== e.bookMarks[t]) {
                    s.information("delete state.bookMarks", e.bookMarks), r.Vue.delete(e.bookMarks, t);
                    let n = JSON.stringify(e.bookMarks);
                    o.ConfigNS.setValue("book-marks-section", "book-marks-key", n)
                }
            }, SET_BOOK_MARKS_STATE(e, t) {
                e.bookMarks = t
            }, UPDATE_BOOK_MARKS_ICONURL(e, t) {
                for (let n in e.bookMarks) {
                    let i = e.bookMarks[n];
                    if (i.url === t.url) {
                        i.iconUrl = t.iconUrl;
                        let n = JSON.stringify(e.bookMarks);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", n)
                    }
                }
            }
        }, h = {
            initBookMarks: ({commit: e, state: t, rootState: n}) => new Promise((e, t) => {
                let n = o.ConfigNS.getValue("book-marks-section", "book-marks-key", "/");
                if ("/" !== n) try {
                    let i = JSON.parse(n);
                    e(i)
                } catch (e) {
                    t(new Error("JSON parse book marks error"))
                } else i.readFile(`${u}`, "utf8", (n, i) => {
                    if (n) s.information("读取书签文件出错,书签路径..", u), t(new Error("read book marks file error")); else try {
                        let t = function (e) {
                            if (void 0 === l(e, "roots", "bookmarkbar", "itemlist")) return {};
                            let t = l(e, "roots", "bookmarkbar", "itemlist");
                            s.information("bookMarkItemList", t);
                            let n = {};
                            for (let e = 0; e < t.length; e++) l(t[e], "bmType") === d && void 0 === n[l(t[e], "url")] ? n[l(t[e], "url")] = {
                                url: l(t[e], "url"),
                                name: l(t[e], "name"),
                                iconUrl: l(t[e], "iconUrl") || ""
                            } : f(t[e], n);
                            return n
                        }(JSON.parse(i)), n = JSON.stringify(t);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", n), e(t)
                    } catch (e) {
                        s.information("book marks data parse error")
                    }
                })
            }).then(t => {
                e("SET_BOOK_MARKS_STATE", t)
            }).catch(e => {
                s.information("初始化书签数据失败")
            })
        };

    function f(e, t) {
        let n = l(e, "itemlist");
        for (let e = 0; e < n.length; e++) l(n[e], "bmType") === d && void 0 === t[l(t[e], "url")] ? t[l(n[e], "url")] = {
            url: l(n[e], "url"),
            name: l(n[e], "name")
        } : f(n[e], t)
    }

    t.default = {state: {bookMarks: {}}, mutations: c, actions: h}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(855), a = n(4), o = n(1).default.getLogger("groupStore"), r = {
        ADD_NET_GROUP(e, t) {
            a.Vue.set(e.all, t.domain, t)
        }
    }, s = {
        getNetGroup: ({commit: e, state: t, rootState: n}, a) => i.findbydomain(a.domain).then(t => {
            if (!t.error && "ok" === t.data.result && 1 === t.data.response.group_exist) {
                let n = {
                    domain: a.domain,
                    id: t.data.response.group_summary.id,
                    name: t.data.response.group_summary.name,
                    membersNum: t.data.response.group_summary.members_num,
                    icon: t.data.response.group_summary.icon
                };
                e("ADD_NET_GROUP", n)
            }
        }).catch(e => {
            o.information("getNetGroup error", e)
        })
    };
    t.default = {state: {all: {}}, mutations: r, actions: s}
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(84);
    t.findbydomain = function (e) {
        return i.fetchSlRes({url: "/xlppc.group.api/group/findbydomain", data: {domain: e}})
    }
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(310);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\system-buttons-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(686), a = n(312);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(860);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\system-buttons.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(314);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\message-button-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(697), a = n(316);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\message-button.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1072);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(318);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\tabs-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(682), a = n(320);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(864);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\tabs.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(10), o = n(8), r = n(23), s = n(154), l = n(547), u = n(31), d = n(67), c = n(37),
        h = i.default.getLogger("tabs-cue"), f = u.DownloadKernelTaskManager.getTaskManager(),
        p = c.DownloadKernelEventManager.getEventManager();
    const g = new class {
        constructor() {
            this.enable = !1
        }

        enableTrack(e) {
            h.information("enableTrack", e), this.enable = e
        }

        getCurTasksStatus(e) {
            let t = l.DownloadProgressNS.getDownloadDetails(), n = !1, i = "";
            if (1 === t.downloadingTaskIds.length) {
                let e = t.downloadingTaskIds[0], i = f.getTaskFromTaskId(e);
                void 0 !== s.TaskStatusHelper.getTaskStartStatusPrompt(i.getTaskBaseInfo()) && (n = !0)
            }
            if (n) ; else if (t.progress >= 0) {
                let e = d.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1);
                i = a.ThunderUtil.formatSize(e, 1) + "/s"
            }
            h.information(n, t.progress, i), e(n, t.progress, i)
        }

        track(e, t, n, i) {
            d.DownloadKernelManager.attachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                do {
                    if (!this.enable) {
                        h.information("in downloading tab not cue", this.enable);
                        break
                    }
                    this.getCurTasksStatus(t)
                } while (0)
            }), p.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!this.enable) break;
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let a = t[e];
                        if (!a) continue;
                        if (a.getTaskAttribute(o.DownloadKernel.TaskAttribute.GroupTaskId) > 0) continue;
                        if (a.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) continue;
                        if (-1 !== a.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId)) continue;
                        let r = a.getTaskStatus();
                        r === o.DownloadKernel.TaskStatus.Succeeded ? n() : r === o.DownloadKernel.TaskStatus.Failed && (h.information("cue task fail"), i())
                    }
                } while (0)
            }), p.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskCreated, (...t) => {
                do {
                    if (!this.enable) break;
                    if (!t) break;
                    if (t[0] !== o.DownloadKernel.TaskEventType.TaskCreated) break;
                    let n = t[1];
                    if (!n) break;
                    if (n[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) break;
                    if (-1 !== n[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId)) {
                        h.information("private does not cue");
                        break
                    }
                    h.information("cue task new", n.length), e(n.length)
                } while (0)
            })
        }
    };
    !function (e) {
        e.enableTrack = function (e) {
            g.enableTrack(e)
        }, e.getCurTasksStatus = function (e) {
            g.getCurTasksStatus(e)
        }, e.track = function (e, t, n, i) {
            g.track(e, t, n, i)
        }
    }(t.DownloadingTabCueNS || (t.DownloadingTabCueNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = n(1074);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(322);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\message-tips-containner.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(683), a = n(324);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\message-tips.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(326);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-top\\book-marks-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(688), a = n(328);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\book-marks.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(689), a = n(330);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-top\\book-marks-item.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1076);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(332);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\index-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(677), a = n(334);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(680), a = n(336);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(338);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\index-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(695), a = n(340);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(342);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(707), a = n(344);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(346);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-button-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(709), a = n(348);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-button.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(350);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-vip-button-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(710), a = n(352);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\tool-bar\\tool-bar-vip-button.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(6), o = n(13), r = n(27), s = n(2), l = n(9), u = n(200),
        d = n(1).default.getLogger("DownloadPanel.ToolBarVipButton");

    class c {
        constructor() {
            this.mPeerId = void 0, this.mUserId = "0", this.mSessionId = void 0, this.mIsLogin = !1, this.mIsVip = !1, this.mVipLevel = 0, this.mVasType = 0, this.mVipData = null
        }

        get vasType() {
            return this.mVasType
        }

        get vipLevel() {
            return this.mVipLevel
        }

        get userId() {
            return this.mUserId
        }

        get isLogin() {
            return this.mIsLogin
        }

        get isVip() {
            return this.mIsVip
        }

        get isPlatinumVip() {
            return this.isVip && this.mVasType > 2
        }

        get isSuperVip() {
            return this.isVip && 5 === this.mVasType
        }

        get vipData() {
            return this.mVipData
        }

        getSessionId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mSessionId ? e(this.mSessionId) : a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetSessionID", (t, n) => {
                        0 === t && (this.mSessionId = n), e(this.mSessionId || "0")
                    }) : e(this.mSessionId || "0")
                })
            })
        }

        getPeerId() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mPeerId ? e(this.mPeerId) : a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetPeerID", (t, n) => {
                        0 === t && n && "" !== n && (this.mPeerId = n), e(this.mPeerId || "")
                    }) : e(this.mPeerId || "")
                })
            })
        }

        getUserinfo() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    let t = null;
                    a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetAllUserInfo", (n, i) => {
                        0 === n && (t = i), e(t)
                    }) : e(t)
                })
            })
        }

        parseUserInfo() {
            return i(this, void 0, void 0, function* () {
                let e = yield this.getUserinfo();
                if (e) if (this.mIsLogin = !0, this.mUserId = e.userID || "0", e.vipList && e.vipList[0]) {
                    if (e.vipList[0].isVip) {
                        let t = Number(e.vipList[0].isVip).valueOf();
                        this.mIsVip = t > 0
                    } else this.mIsVip = !1;
                    e.vipList[0].vipLevel && (this.mVipLevel = Number(e.vipList[0].vipLevel).valueOf()), e.vipList[0].vasType && (this.mVasType = Number(e.vipList[0].vasType).valueOf()), this.mVipData = e.vipList[0]
                } else this.mIsVip = !1
            })
        }

        onLogin() {
            return i(this, void 0, void 0, function* () {
                this.clear(), yield this.parseUserInfo()
            })
        }

        onLogout() {
            this.clear()
        }

        clear() {
            this.mUserId = "0", this.mSessionId = void 0, this.mIsVip = !1, this.mIsLogin = !1, this.mVasType = 0, this.mVipLevel = 0
        }
    }

    t.UserHelper = c;
    t.VipIconMgr = class {
        constructor(e) {
            this.mVueObj = null, this.mVipIconData = null, this.mModel = "b", this.mUserHelper = null, this.mUsedDLVipCache = null, this.mUpdateType = "", this.mIsFirstLoad = !0, this.mVueObj = e, this.mUserHelper = new c
        }

        init() {
            return i(this, void 0, void 0, function* () {
                try {
                    r.default.defaults.adapter = n(28), r.default.get("http://act.vip.xunlei.com/vip/2018/ssi/vipiconData.js", {timeout: 1e4}).then(e => i(this, void 0, void 0, function* () {
                        if (a.NativeCallModule.nativeCall && null !== e && 200 === e.status && null !== e.data && "string" == typeof e.data.atestuids) {
                            this.mVipIconData = e.data.btpl;
                            let t = yield this.mUserHelper.getPeerId();
                            d.information(`init: peerid=${t},ipData.data.atestuids=${e.data.atestuids}`), "" !== t && 16 === t.length && -1 !== e.data.atestuids.toLowerCase().indexOf(t.toLowerCase()[11]) && (this.mVipIconData = e.data.atpl, this.mModel = "a"), this.attachUserEvents(), this.updateUI().catch()
                        } else this.sendStat("download_leftpanel", "top_vipicon_show")
                    })).catch(e => {
                        d.warning(e)
                    })
                } catch (e) {
                    d.information(e)
                }
            })
        }

        sendStat(e, t, n = "") {
            let i = 0;
            this.mUserHelper.isLogin && (i = 5 === this.mUserHelper.vasType ? 5 : this.mUserHelper.vasType > 2 ? 3 : 2);
            let a = "";
            "newuser" === this.mUpdateType ? a = "new" : "inner15" === this.mUpdateType ? a = "expire_1_15" : "out15" === this.mUpdateType && (a = "expire_15+");
            let r = `is_red=${this.mVueObj.hasRedPoint ? 1 : 0},is_login=${this.mUserHelper.isLogin ? 1 : 0},is_vip=${this.mUserHelper.isVip ? 1 : 0},user_type=${a},vip_type=${i},test_type=${this.mModel}`;
            "" !== n && (r = `${r},${n}`), d.information(`sendStat: event=${e}, attr1=${t}, statExtData=${r}`), o.XLStatNS.trackEvent(e, t, "", 0, 0, 0, 0, r)
        }

        updateUIDefault() {
            this.mVueObj.cfgType = "", this.mVueObj.hasRedPoint = !1, this.mVueObj.clickUrl = "https://vip.xunlei.com/index.html?referfrom=v_pc_xlx_ggong_taskbar_vip", this.mVueObj.vipIcon = "", this.mVueObj.hoverTitle = ""
        }

        updateUI() {
            return i(this, void 0, void 0, function* () {
                if (yield this.isLogin()) if (yield this.mUserHelper.onLogin(), this.mUserHelper.isVip) {
                    let e = "vip", t = "LastLink_PlatinumVip_" + String(this.mUserHelper.userId);
                    this.mUserHelper.isSuperVip && (e = "super", t = "LastLink_SuperVip_" + String(this.mUserHelper.userId)), this.updateUIPrivate(e, t)
                } else {
                    null === this.mUsedDLVipCache && (this.mUsedDLVipCache = {});
                    let e = () => {
                        if (0 === this.mUsedDLVipCache[this.mUserHelper.userId] || 2 === this.mUsedDLVipCache[this.mUserHelper.userId]) this.updateUIPrivate("newuser", "LastLink_Newuser_" + String(this.mUserHelper.userId)); else {
                            let e = "inner15", t = "LastLink_Inner15_" + String(this.mUserHelper.userId);
                            15 < this.calculateExpireDate() && (e = "out15", t = "LastLink_Out15_" + String(this.mUserHelper.userId)), this.updateUIPrivate(e, t)
                        }
                    };
                    if (void 0 === this.mUsedDLVipCache[this.mUserHelper.userId]) try {
                        let t = yield this.mUserHelper.getSessionId();
                        this.queryUsedToBeDLVip(this.mUserHelper.userId, t).then(t => {
                            null !== t && 200 === t.status && null !== t.data && 1 === t.data.code && null !== t.data.result && void 0 !== t.data.result.usedToBeDLVip ? (this.mUsedDLVipCache[this.mUserHelper.userId] = Number(t.data.result.usedToBeDLVip).valueOf(), e()) : this.updateUIDefault()
                        }).catch(e => {
                            d.warning(e), this.updateUIDefault()
                        })
                    } catch (e) {
                        d.information(e), this.updateUIDefault()
                    } else e()
                } else this.mIsFirstLoad ? (this.mIsFirstLoad = !1, setTimeout(() => i(this, void 0, void 0, function* () {
                    (yield this.isLogin()) || this.updateUIPrivate("visitor", "LastLink_UnLogin")
                }), 3e3)) : this.updateUIPrivate("visitor", "LastLink_UnLogin")
            })
        }

        calculateExpireDate() {
            if (!this.mUserHelper.vipData || !this.mUserHelper.vipData.expireDate) return 0;
            let e, t, n;
            e = this.mUserHelper.vipData.expireDate.substring(0, 4), t = this.mUserHelper.vipData.expireDate.substring(4, 6), n = this.mUserHelper.vipData.expireDate.substring(6, 8);
            let i = new Date(e + "-" + t + "-" + n + " 00:00:00").getTime() / 1e3, a = new Date(Date.now()),
                o = a.getFullYear(), r = a.getMonth(), s = a.getDate(),
                l = (a = new Date(o + "-" + (r < 10 ? "0" + (r + 1) : r + 1) + "-" + (s < 10 ? "0" + s : s) + " 00:00:00")).getTime() / 1e3;
            return Math.ceil((l - i) / 86400)
        }

        updateUIPrivate(e, t) {
            d.information(`updateUIPrivate: updateType=${e}, cfgType=${t}`), this.mUpdateType = e;
            let n = Date.now(), o = n;
            this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].online && (o = new Date(this.mVipIconData[e].online).getTime());
            let r = n;
            this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].offline && (r = new Date(this.mVipIconData[e].offline).getTime()), d.information("updateUIPrivate, curDate=" + String(n) + ", onlineDate=" + String(o) + ", offlineDate=" + String(r)), o >= n || n >= r || a.NativeCallModule.nativeCall.CallNativeFunction("GetValue", "ToolBarButtonVipIcon", t, "", (n, a) => i(this, void 0, void 0, function* () {
                let i = "";
                0 === n && (i = a);
                let o = this.mVueObj.clickUrl;
                this.mVipIconData && this.mVipIconData[e] && "string" == typeof this.mVipIconData[e].link && "" !== this.mVipIconData[e].link && (o = this.mVipIconData[e].link.trim());
                let r = "";
                r = "newuser" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_vip_new" : "inner15" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_vip_expire_1_15" : "out15" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_vip_expire_15+" : "super" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_vip_vip" : "vip" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_vip_vip" : "v_pc_xlx_ggong_taskbar_vip_nolog", r += "_", r += this.mModel, -1 === o.toLowerCase().indexOf("referfrom") && (o = -1 === o.indexOf("?") ? `${o}?referfrom=${r}` : `${o}&referfrom=${r}`), this.mVueObj.clickUrl = o, this.mVueObj.cfgType = t, this.mVueObj.hasRedPoint = i !== o;
                let c = "";
                this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].xdsicon && (c = this.mVipIconData[e].xdsicon);
                let h = s.resolve(__profilesDir, "VipDownload/vipicon");
                if ((yield l.FileSystemAWNS.mkdirsAW(h)) && "" !== c) {
                    let e = s.basename(c), t = s.join(h, e), n = c, i = String(1e6 * Math.random()).valueOf();
                    n.indexOf("?") >= 0 ? n += "&rd=" + i : n += "?rd=" + i, u.AxiosNS.downloadFileAW(n, t).then(n => {
                        d.information("下载图片：result = ", n, ";fileName = ", e), this.mVueObj.vipIcon = n ? "file://" + t : ""
                    }).catch(e => {
                        d.warning(e), this.mVueObj.vipIcon = ""
                    })
                } else this.mVueObj.vipIcon = "";
                let f = "";
                this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].hover && (f = this.mVipIconData[e].hover), "" !== f && (this.mVueObj.hoverTitle = f), this.sendStat("download_leftpanel", "top_vipicon_show")
            }))
        }

        queryUsedToBeDLVip(e, t) {
            return i(this, void 0, void 0, function* () {
                let i = `http://soa.vip.xunlei.com/xlvip.common.mooseapi/querytags?userid=${e}&sessionid=${t}&tags=usedToBeDLVip&platform=xlx`;
                return r.default.defaults.adapter = n(28), r.default.get(i, {timeout: 1e4})
            })
        }

        isLogin() {
            return i(this, void 0, void 0, function* () {
                return new Promise(e => {
                    let t = null;
                    a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("IsLogined", (n, i) => {
                        0 === n && (t = i), e(t)
                    }) : e(t)
                })
            })
        }

        attachUserEvents() {
            a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => i(this, void 0, void 0, function* () {
                this.updateUI().catch()
            })), a.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.mUserHelper.onLogout(), this.updateUI().catch()
            }), a.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => i(this, void 0, void 0, function* () {
                yield this.onUserInfoChange(e, t)
            })), a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginStatusChange", (e, t) => {
                this.onLoginStatusChange(t)
            })
        }

        onUserInfoChange(e, t) {
            return i(this, void 0, void 0, function* () {
                d.information("vipicon --\x3eonUserInfoChange"), "vipinfo" === e && this.updateUI().catch(), d.information("<--onUserInfoChange")
            })
        }

        onLoginStatusChange(e) {
            d.information("vipicon --\x3eonLoginStatusChange", "newStatus", e), "offline" === e && (this.mUserHelper.onLogout(), this.updateUI().catch()), d.information("<--onLoginStatusChange")
        }
    }
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(354);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\status-bar-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(706), a = n(356);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\status-bar.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(22), a = n(67), o = n(247);
    !function (e) {
        let t = 0, n = 0, r = "", s = 0, l = 0;

        function u() {
            let e = new Date;
            return e.getFullYear() + "." + (e.getMonth() + 1) + "." + e.getDate()
        }

        function d() {
            let e = !0;
            return u() === r && (e = !1), e
        }

        function c() {
            return i.ConfigNS.getValue("FlowMonitor", "DownloadSize", 0)
        }

        function h() {
            return i.ConfigNS.getValue("FlowMonitor", "UploadSize", 0)
        }

        function f(e, t) {
            i.ConfigNS.setValue("FlowMonitor", "DownloadSize", e), i.ConfigNS.setValue("FlowMonitor", "UploadSize", t), i.ConfigNS.setValue("FlowMonitor", "Date", u())
        }

        e.isDateChange = d, e.getDownloadSizeFromFile = c, e.getUploadSizeFromFile = h, e.setFlowData = f, e.startMonitor = function () {
            t = c(), n = h(), r = i.ConfigNS.getValue("FlowMonitor", "Date", ""), d() && (t = 0, n = 0, f(0, 0)), s = t, l = n, o.quitPromises.add(function () {
                return new Promise(e => {
                    f(s, l), i.ConfigNS.save().catch(), e(!0)
                })
            })
        }, e.getTodayDownloadSize = function () {
            let e = a.DownloadKernelManager.getTotalDownloadSize();
            return s = t + e
        }, e.getTodayUploadSize = function () {
            let e = a.DownloadKernelManager.getTotalUploadSize();
            return l = n + e
        }, e.getCurrentDownloadSpeed = function () {
            return a.DownloadKernelManager.getTotalTaskDownloadSpeed(!1)
        }, e.getCurrentVipSpeed = function () {
            return a.DownloadKernelManager.getTotalTaskVipSpeed(!1)
        }
    }(t.FlowMonitorNS || (t.FlowMonitorNS = {}))
}, function (e) {
    e.exports = {urls: [{url: "www.iqiyi.com"}, {url: "v.qq.com"}, {url: "www.youku.com"}, {url: "www.bilibili.com"}, {url: "www.pptv.com"}, {url: "www.youtube.com"}, {url: "tv.sohu.com"}, {url: "v.ifeng.com/film"}, {url: "www.mgtv.com"}, {url: "www.56.com"}, {url: "www.cctv.com"}, {url: "www.pps.tv"}, {url: "tv.sohu.com"}, {url: "www.tvb.com"}, {url: "www.wasu.cn"}, {url: "www.baomihua.com"}, {url: "www.1905.com"}, {url: "v.163.com"}, {url: "www.v1.cn"}, {url: "www.6.cn"}, {url: "www.tvbs.com.tw"}, {url: "www.tangdou.com"}, {url: "www.pipi.cn"}, {url: "www.360kan.com"}, {url: "www.le.com"}, {url: "v.baidu.com"}, {url: "www.tudou.com"}, {url: "www.douyu.com"}, {url: "www.huya.com"}, {url: "www.panda.tv"}, {url: "www.longzhu.com"}, {url: "www.zhanqi.tv"}, {url: "www.yy.com"}, {url: "www.huajiao.com"}]}
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(358);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\upgrade-task-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(702), a = n(360);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\upgrade-task.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(8), r = n(31), s = n(93), l = n(253), u = n(22), d = n(7),
        c = a.default.getLogger("PrivateSpace.Upgrade"), h = r.DownloadKernelTaskManager.getTaskManager(),
        f = s.DownloadKernelCategoryManager.getCategoryManager();

    class p {
        insertTaskToNewPrivateSpace(e, t, n) {
            return i(this, void 0, void 0, function* () {
                let i = !1, a = yield l.TaskUtilitiesAWNS.batchFindTaskAW([n]);
                return (!a || a.length <= 0) && (c.information("insertTaskToNewPrivateSpace taskId:", t.getId(), ", findInfo:", n), i = h.moveCategoryTask(t.getId(), e.getId())), i
            })
        }

        getOldPrivateSpaceTaskList() {
            let e = [], t = f.getCategorys();
            for (let [, n]of t) {
                let t = n.getName(), i = n.getUserName();
                if ("Private" === t && "0" === i) {
                    let t = n.getCategoryViews();
                    for (let n = 0; n < t.length; n++) {
                        let i = t[n].getTasks();
                        for (let [, t]of i) e.push(t)
                    }
                }
            }
            return e
        }

        insertTaskListToNewPrivateSpace(e) {
            return i(this, void 0, void 0, function* () {
                let t = !1, n = this.getOldPrivateSpaceTaskList();
                for (let i = 0; i < n.length; i++) {
                    let a = n[i], r = a.getType();
                    if (c.information("addTaskListToNewPrivateSpace taskType:", r), r === o.DownloadKernel.TaskType.P2sp) {
                        let n = a.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskUrl),
                            i = {taskType: o.DownloadKernel.TaskType.P2sp, value: n};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, i)
                    } else if (r === o.DownloadKernel.TaskType.Bt) {
                        let n = a.getExtraObject().getInfoId(), i = {taskType: o.DownloadKernel.TaskType.Bt, value: n};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, i)
                    } else if (r === o.DownloadKernel.TaskType.Emule) {
                        let n = a.getExtraObject().getFileHash(),
                            i = {taskType: o.DownloadKernel.TaskType.Emule, value: n};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, i)
                    }
                }
                return t
            })
        }

        upgradePrivateSpace(e) {
            let t = !1, n = u.ConfigNS.getValue("TaskUpgrading", "UpgradedUsers", "");
            if (d.isString(n) || (n = ""), -1 === n.indexOf(e + ", ")) {
                let i = f.getPrivateCategoryFromUserId(e);
                i && (this.insertTaskListToNewPrivateSpace(i).catch(), n += e + ", ", u.ConfigNS.setValue("TaskUpgrading", "UpgradedUsers", n), t = !0)
            }
            return t
        }
    }

    t.PrivateSpaceUpgrade = p, function (e) {
        const t = new p;
        e.getUpgrade = function () {
            return t
        }
    }(t.PrivateSpaceUpgradeNS || (t.PrivateSpaceUpgradeNS = {}))
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(700), a = n(362);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\toast-notify\\toast-notify.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(698), a = n(364);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\ad-platform\\ad-platform.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(366);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-list-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(705), a = n(368);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-list.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(372);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\downloading-item-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(711), a = n(374);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\downloading-item.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(715), a = n(376);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\item-vip-expand\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(716), a = n(378);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\item-vip-expand\\item-vip-status.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(717), a = n(380);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\item-vip-expand\\item-try-status.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(714), a = n(382);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\item-vip-expand\\item-vip-speed.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(384);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\completed-item-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(713), a = n(386);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\completed-item.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(388);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\recycle-item-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(712), a = n(390);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\task-items\\recycle-item.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1097);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(392);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\private-space-open-page-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(703), a = n(394);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\private-space-open-page.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(396);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-search-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(704), a = n(398);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\download-panel\\download-list-search.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(400);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\home-page\\index-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(696), a = n(402);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(911);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, "f12073ec", null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\home-tab-view\\home-page\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1099);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(404);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\browser-view-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(692), a = n(406);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(914);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\browser-view.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1101);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(408);
    for (var a in i) "default" !== a && function (e) {
        n.d(t, e, function () {
            return i[e]
        })
    }(a);
    var o = n(0), r = Object(o.a)(i.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-bottom\\setting-center-view\\index-container.vue", t.default = r.exports
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(691), a = n(410);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    n(917);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-bottom\\setting-center-view\\index.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1108);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    n.r(t);
    var i = n(636), a = n(412);
    for (var o in a) "default" !== o && function (e) {
        n.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = n(0), s = Object(r.a)(a.default, i.a, i.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-background.vue", t.default = s.exports
}, function (e, t, n) {
    "use strict";
    var i = n(1117);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1124);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1128);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1130);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1133);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1137);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    var i = n(1139);
    n.n(i).a
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(2), a = n(29), o = n(1), r = n(5), s = n(82), l = n(8), u = n(22), d = n(103), c = n(564), h = n(17),
        f = n(157), p = n(68), g = r.default(i.join(__rootDir, "../bin/ThunderHelper.node"));

    class k {
        static getInstance() {
            return null === k.instance && (k.instance = new k), k.instance
        }
    }

    k.instance = null, function (e) {
        const t = ".asf;.avi;.exe;.iso;.mp3;.mpeg;.mpg;.mpga;.ra;.rar;.rm;.rmvb;.tar;.wma;.wmp;.wmv;.mov;.zip;.3gp;.chm;.mdf;.torrent;.jar;.msi;.arj;.bin;.dll;.psd;.hqx;.sit;.lzh;.gz;.tgz;.xlsx;.xls;.doc;.docx;.ppt;.pptx;.flv;.swf;.mkv;.tp;.ts;.flac;.ape;.wav;.aac;.txt;.dat;.7z;.ttf;.bat;.xv;.xvx;.pdf;.mp4;.apk;.ipa;.epub;.mobi;.deb;.sisx;.cab;.pxl;.dmg;",
            n = ["http://", "https://", "ftp://"], r = ["thunder://", "thunders://", "ed2k://", "magnet:"],
            m = o.default.getLogger("ClipBoardNS");

        function T(e) {
            let t = e;
            for (; !(t.length < 1) && 0 === t.indexOf(" ");) t = t.substring(1, t.length);
            return t
        }

        function v(e) {
            let t = !1;
            if (e) for (let i = 0; i < n.length; ++i) {
                let a = n[i];
                if (0 === e.indexOf(a)) {
                    t = !0;
                    break
                }
            }
            return t
        }

        function y(e) {
            let t = !1;
            if (e) for (let n = 0; n < r.length; ++n) {
                let i = r[n];
                if (0 === e.indexOf(i)) {
                    t = !0;
                    break
                }
            }
            return t
        }

        function S(e) {
            let n = !1;
            do {
                if (!e) break;
                if (v(e = T(e))) {
                    let o = a.parse(e);
                    if (null === o) break;
                    let r = i.extname(o.pathname);
                    if (!r) break;
                    t.indexOf(r) > -1 && (n = !0)
                } else y(e) && (n = !0)
            } while (0);
            return n
        }

        function w(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e || "" === e) break;
                let n = "thunderx://";
                if (void 0 === (e = e.trim()) || null === e || "" === e) break;
                0 === e.indexOf(n, 0) && (t = !0)
            } while (0);
            return t
        }

        function b(e) {
            let t = "", n = (e = e.trim()).substring("thunderx://".length), i = n.lastIndexOf("}");
            return i > 0 && (t = n.substring(0, i + 1)), t
        }

        function C(e, t) {
            let n = [], i = u.ConfigNS.getValue("Monitor", "MonitorClipBoard", !0);
            do {
                if (!i) {
                    m.information("notwatch");
                    break
                }
                let a = t.join("");
                if (m.information("textList", t), p.URLHelperNS.isBirdKey(a) && (m.information("isbirdkey"), f.openBirdKeyDecodeDialog(a, {from: "clipboard"})), m.information("attachClipBoardCallback type:", e, t), null !== t && void 0 !== t && t.length > 0) {
                    let e = t.join("");
                    if (w(e)) {
                        let t = b(e);
                        d.ThunderNewTask.createThunderxTask(t).catch();
                        break
                    }
                }
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e], a = i;
                    if (s.Common.isThunderPrivateUrl(i) && (i = s.Common.parseThunderPrivateUrl(i)), S(i)) {
                        let e = h.ThunderHelper.getTaskTypeFromUrl(i);
                        e === l.DownloadKernel.TaskType.P2sp || e === l.DownloadKernel.TaskType.Emule ? n.includes(a, 0) || n.push(a) : e !== l.DownloadKernel.TaskType.Magnet && e !== l.DownloadKernel.TaskType.Bt || (c.default.bringMainWindowToTop(), d.ThunderNewTask.createBtTaskWindow({
                            url: a,
                            type: "url"
                        }, {source: "clipboard"}))
                    }
                }
            } while (0);
            n.length > 0 && d.ThunderNewTask.createPreNewTaskWindow(n, "clipboard")
        }

        e.init = function () {
            g.initClipBoard(), setTimeout(() => {
                g.attachClipBoard(C)
            }, 5e3)
        }, e.getOperInfoInstance = function () {
            return k.getInstance()
        }
    }(t.ClipBoardNS || (t.ClipBoardNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(1), o = n(3), r = n(2), s = n(9), l = n(10), u = n(5), d = n(23), c = n(22),
        h = a.default.getLogger("MainRendererHelper"), f = u.default(r.join(__rootDir, "../bin/ThunderHelper.node"));
    const p = new class {
        constructor() {
            this.mainWndDataIniPath = r.resolve(__profilesDir, "mainWndData.ini"), this.preBossKeyName = "", this.defaultMainWndWidth = 1020, this.defaultMainWndHeight = 650
        }

        saveMainWndData() {
            let e = o.remote.getCurrentWindow(), t = e.getSize(), n = "normal";
            e.isMaximized() && (n = "max");
            let i = this.defaultMainWndWidth, a = this.defaultMainWndHeight;
            t && (i = t[0], a = t[1]), f.writeINI(this.mainWndDataIniPath, "MainFrame", "ExitState", n), f.writeINI(this.mainWndDataIniPath, "MainFrame", "MainWndLastWidth", i.toString()), f.writeINI(this.mainWndDataIniPath, "MainFrame", "MainWndLastHeight", a.toString()), h.information("saveMainWndData:", this.mainWndDataIniPath, i, a, n)
        }

        initMainRendererHelper() {
            c.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onRegisterBossKey(), this.onInitDefaultPath().catch()
            })
        }

        onInitDefaultPath() {
            return i(this, void 0, void 0, function* () {
                let e = c.ConfigNS.getValue("TaskDefaultSettings", "InitPath", "");
                if ("" === e) {
                    let t = l.ThunderUtil.getMaxFreeDriver();
                    null !== t && "" !== t && (e = t + ":\\迅雷下载")
                }
                "" !== e && c.ConfigNS.setValue("TaskDefaultSettings", "InitPath", e);
                let t = c.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "");
                "" !== t && (yield s.FileSystemAWNS.mkdirsAW(t)) || "" !== e && (yield s.FileSystemAWNS.mkdirsAW(e), c.ConfigNS.setValue("TaskDefaultSettings", "DefaultPath", e))
            })
        }

        onRegisterBossKey() {
            c.ConfigNS.setValue("BossKey", "BossKeyState", !1), this.registerBossKey(), c.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigValueChanged, (e, t, n, i) => {
                "BossKey" === e && this.registerBossKey()
            })
        }

        registerBossKey() {
            if ("" !== this.preBossKeyName && o.remote.globalShortcut.unregister(this.preBossKeyName), c.ConfigNS.getValue("BossKey", "BossKeySwitch", !1)) {
                let e = c.ConfigNS.getValue("BossKey", "BossKeyName", "");
                null !== e && void 0 !== e && "" !== e && (o.remote.globalShortcut.register(e, () => {
                    o.ipcRenderer.send("closeMainWindow", "BossKey")
                }), this.preBossKeyName = e)
            }
        }
    };
    t.default = p
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(83), o = n(7), r = n(21), s = n(565), l = n(6),
        u = i.default.getLogger("MessageChannel.NativeFunction"), d = a.TabEventManagerNS.getEventEmitter();
    !function (e) {
        const t = new class {
            constructor() {
                this.isInit = !1, this.nextListenerCookie = 0, this.listenerMap = new Map
            }

            init() {
                if (!this.isInit) {
                    this.isInit = !0;
                    let e = [{
                        functionName: "MessageChannelRegisterService",
                        nativeFunc: this.registerService.bind(this)
                    }, {
                        functionName: "MessageChannelUnregisterService",
                        nativeFunc: this.unregisterService.bind(this)
                    }, {
                        functionName: "MessageChannelJoinGroup",
                        nativeFunc: this.joinGroup.bind(this)
                    }, {
                        functionName: "MessageChannelLeaveGroup",
                        nativeFunc: this.leaveGroup.bind(this)
                    }, {
                        functionName: "MessageChannelGetLongConnectState",
                        nativeFunc: this.getLongConnectState.bind(this)
                    }, {
                        functionName: "MessageChannelGetUserState",
                        nativeFunc: this.getUserState.bind(this)
                    }, {
                        functionName: "MessageChannelAttachEvent",
                        nativeFunc: this.attachEvent.bind(this)
                    }, {functionName: "MessageChannelDetachEvent", nativeFunc: this.detachEvent.bind(this)}];
                    a.setDefaultNativeFunctionMap(e), d.on(a.TabEventManagerNS.EventType.RemoveTab, this.onTabRemove.bind(this)), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventUserLogin, () => {
                        this.fireUserLogin()
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventUserLoginFailed, () => {
                        this.fireUserLoginFailed()
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventUserLogout, () => {
                        this.fireUserLogout()
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventUserLogoutFailed, () => {
                        this.fireUserLogoutFailed()
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventServiceCallbackId, (e, t) => {
                        this.fireServiceCallbackEvent(e, t)
                    }), s.MessageChannelNS.attachListener(s.MessageChannelNS.eventGroupServiceCallbackId, (e, t) => {
                        this.fireGroupServiceCallbackEvent(e, t)
                    })
                }
            }

            onTabRemove(e) {
                this.listenerMap.forEach(t => {
                    let n = [];
                    for (let [i, a]of t) a.tab === e.tabInfo.tab && n.push(i);
                    n.forEach(e => {
                        if (t.size > 0) {
                            let n = t.get(e);
                            if (!n) return;
                            if (t.delete(e), n.eventType === s.MessageChannelNS.eventServiceCallbackId) {
                                let e = 0;
                                for (let [, i]of t) if (i.serviceType === n.serviceType) {
                                    ++e;
                                    break
                                }
                                if (0 === e) {
                                    let e = s.MessageChannelNS.unregisterService(n.serviceType);
                                    u.information("unregisterService serviceType: ", n.serviceType, ", success: ", e)
                                }
                            } else if (n.eventType === s.MessageChannelNS.eventGroupServiceCallbackId) {
                                let e = 0;
                                for (let [, i]of t) if (i.groupId === n.groupId) {
                                    ++e;
                                    break
                                }
                                if (0 === e) {
                                    let e = s.MessageChannelNS.leaveGroup(n.groupId);
                                    u.information("leaveGroup groupId: ", n.groupId, ", success: ", e)
                                }
                            }
                        }
                    })
                })
            }

            registerService(e, t, n, i) {
                if (u.information("registerService args:", i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0];
                if (o.isNullOrUndefined(i[1])) {
                    let i = s.MessageChannelNS.registerService(a);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                } else if (o.isNumber(i[1])) {
                    let o = i[1], l = this.listenerMap.get(s.MessageChannelNS.eventServiceCallbackId);
                    l || (l = new Map, this.listenerMap.set(s.MessageChannelNS.eventServiceCallbackId, l));
                    let d = 0;
                    for (let [, e]of l) if (e.serviceType === a) {
                        ++d;
                        break
                    }
                    if (0 === d && !s.MessageChannelNS.registerService(a)) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !1);
                    let c = {};
                    c.tab = e, c.nativeCallId = t, c.eventType = s.MessageChannelNS.eventServiceCallbackId, c.serviceType = a, c.callBackId = o;
                    let h = this.nextListenerCookie;
                    u.information("registerService callBackId:", c.callBackId, ", cookie:", h), l.set(h, c), ++this.nextListenerCookie, e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0, h)
                } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
            }

            unregisterService(e, t, n, i) {
                if (u.information("unregisterService args:", i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0];
                if (o.isNullOrUndefined(i[1])) {
                    let i = s.MessageChannelNS.unregisterService(a);
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                } else if (o.isNumber(i[1])) {
                    let o = i[1], l = this.listenerMap.get(s.MessageChannelNS.eventServiceCallbackId);
                    if (l) {
                        l.delete(o);
                        let i = 0;
                        if (0 === l.size) this.listenerMap.delete(s.MessageChannelNS.eventServiceCallbackId); else for (let [, e]of l) if (e.serviceType === a) {
                            ++i;
                            break
                        }
                        if (u.information("unregisterService cookie: ", o, ", serviceType: ", a, ", serviceRefCount: ", i), 0 === i) {
                            let i = s.MessageChannelNS.unregisterService(a);
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                        } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0)
                    } else {
                        u.warning("serviceType already unregister! cookie: ", o);
                        let i = s.MessageChannelNS.unregisterService(a);
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                    }
                } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
            }

            joinGroup(e, t, n, i) {
                if (u.information("joinGroup args:", i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError); else if (o.isNumber(i[1])) {
                    let a = i[0], o = i[1], l = this.listenerMap.get(s.MessageChannelNS.eventGroupServiceCallbackId);
                    l || (l = new Map, this.listenerMap.set(s.MessageChannelNS.eventGroupServiceCallbackId, l));
                    let d = 0;
                    for (let [, e]of l) if (e.groupId === a) {
                        ++d;
                        break
                    }
                    if (0 === d && !s.MessageChannelNS.joinGroup(a)) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !1);
                    let c = {};
                    c.tab = e, c.nativeCallId = t, c.eventType = s.MessageChannelNS.eventGroupServiceCallbackId, c.groupId = a, c.callBackId = o;
                    let h = this.nextListenerCookie;
                    u.information("joinGroup callBackId:", c.callBackId, ", cookie:", h), l.set(h, c), ++this.nextListenerCookie, e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0, h)
                } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
            }

            leaveGroup(e, t, n, i) {
                if (u.information("leaveGroup args:", i), o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError); else if (o.isNullOrUndefined(i[1])) {
                    let a = i[0], o = this.listenerMap.get(s.MessageChannelNS.eventGroupServiceCallbackId), l = !1;
                    if (o && o.size > 0) {
                        let e = [];
                        for (let [t, n]of o) n.groupId === a && e.push(t);
                        e.length > 0 && (e.forEach(e => {
                            o.delete(e)
                        }), l = s.MessageChannelNS.leaveGroup(a))
                    }
                    e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, l)
                } else if (o.isNumber(i[1])) {
                    let a = i[0], o = i[1], l = this.listenerMap.get(s.MessageChannelNS.eventGroupServiceCallbackId);
                    if (l) {
                        l.delete(o);
                        let i = 0;
                        if (0 === l.size) this.listenerMap.delete(s.MessageChannelNS.eventGroupServiceCallbackId); else for (let [, e]of l) if (e.groupId === a) {
                            ++i;
                            break
                        }
                        if (u.information("leaveGroup cookie: ", o, ", groupId: ", a, ", serviceRefCount: ", i), 0 === i) {
                            let i = s.MessageChannelNS.leaveGroup(a);
                            e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                        } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, !0)
                    } else {
                        u.warning("groupServiceCallback already unregister! cookie: ", o);
                        let i = s.MessageChannelNS.leaveGroup(a);
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, i)
                    }
                } else e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError)
            }

            getLongConnectState(e, t, n, i) {
                if (u.information("getLongConnectState"), o.isNullOrUndefined(i)) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = s.MessageChannelNS.getLongConnectState();
                u.information("longConnectState:", a), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, a)
            }

            getUserState(e, t, n, i) {
                if (u.information("getUserState"), o.isNullOrUndefined(i)) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = s.MessageChannelNS.getUserState();
                u.information("userState:", a), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, a)
            }

            attachEvent(e, t, n, i) {
                if (u.information("attachEvent enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) return void u.information("attachEvent bad external args");
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0], l = {};
                if (l.tab = e, l.nativeCallId = t, l.eventType = a, a === s.MessageChannelNS.eventServiceCallbackId) {
                    if (o.isNullOrUndefined(i[2])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                    let a = i[1], s = i[2];
                    l.serviceType = a, l.callBackId = s
                } else if (a === s.MessageChannelNS.eventGroupServiceCallbackId) {
                    if (o.isNullOrUndefined(i[2])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                    let a = i[1], s = i[2];
                    l.groupId = a, l.callBackId = s
                } else {
                    let n = i[1];
                    l.callBackId = n, a === s.MessageChannelNS.eventUserLogin && s.MessageChannelNS.getUserState() === s.MessageChannelNS.UserState.Login && (u.information("attach eventUserLogin, current userState is already MessageChannelNS.UserState.Login, direct callback this time."), e.callNativeFunctionCallback(t, n))
                }
                let d = this.nextListenerCookie;
                u.information("attachEvent eventType:", a, ", callBackId:", l.callBackId, ", cookie:", d);
                let c = this.listenerMap.get(a);
                c || (c = new Map, this.listenerMap.set(a, c)), c.set(d, l), ++this.nextListenerCookie, e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success, d)
            }

            detachEvent(e, t, n, i) {
                if (u.information("detachEvent enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) return void u.information("detachEvent bad external args");
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0];
                u.information("detachEvent cookie:", a), this.listenerMap.forEach(e => {
                    e.delete(a)
                }), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
            }

            fireUserLogin() {
                let e = this.listenerMap.get(s.MessageChannelNS.eventUserLogin);
                e && e.forEach((e, t) => {
                    e.eventType === s.MessageChannelNS.eventUserLogin && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventUserLogin)
            }

            fireUserLoginFailed() {
                let e = this.listenerMap.get(s.MessageChannelNS.eventUserLoginFailed);
                e && e.forEach((e, t) => {
                    e.eventType === s.MessageChannelNS.eventUserLoginFailed && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventUserLoginFailed)
            }

            fireUserLogout() {
                let e = this.listenerMap.get(s.MessageChannelNS.eventUserLogout);
                e && e.forEach((e, t) => {
                    e.eventType === s.MessageChannelNS.eventUserLogout && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventUserLogout)
            }

            fireUserLogoutFailed() {
                let e = this.listenerMap.get(s.MessageChannelNS.eventUserLogoutFailed);
                e && e.forEach((e, t) => {
                    e.eventType === s.MessageChannelNS.eventUserLogoutFailed && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventUserLogoutFailed)
            }

            fireServiceCallbackEvent(e, t) {
                let n = JSON.stringify(t), i = this.listenerMap.get(s.MessageChannelNS.eventServiceCallbackId);
                i && i.forEach((t, i) => {
                    t.eventType === s.MessageChannelNS.eventServiceCallbackId && t.serviceType === e && t.tab.callNativeFunctionCallback(t.nativeCallId, t.callBackId, e, n)
                }), l.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", s.MessageChannelNS.eventServiceCallbackId, e, n)
            }

            fireGroupServiceCallbackEvent(e, t) {
                let n = JSON.stringify(t), i = this.listenerMap.get(s.MessageChannelNS.eventGroupServiceCallbackId);
                i && i.forEach((t, i) => {
                    t.eventType === s.MessageChannelNS.eventGroupServiceCallbackId && t.groupId === e && t.tab.callNativeFunctionCallback(t.nativeCallId, t.callBackId, e, n)
                })
            }
        };
        e.init = function () {
            t.init()
        }
    }(t.MessageChannelNaviteFunctionNS || (t.MessageChannelNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(83), o = n(7), r = n(21), s = n(745), l = n(930);
    !function (e) {
        e.adNaviteFunction = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "SetSceneStatus",
                        nativeFunc: this.setSceneStatus
                    }, {functionName: "ShowAdTips", nativeFunc: this.showTips}];
                    a.setDefaultNativeFunctionMap(e)
                }
            }

            setSceneStatus(e, t, n, i) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], l = i[1];
                    s.adPlatform.setSceneStatus(a, l), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showTips(e, t, n, i) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], s = i[1];
                    l.adTipsManager.showFunctionalTips(s, a), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }
        }, e.init = function () {
            e.adNaviteFunction.registerNativeFunction(), setTimeout(() => i(this, void 0, void 0, function* () {
                yield s.adPlatform.initAw()
            }), 5e3), setTimeout(() => i(this, void 0, void 0, function* () {
                yield l.adTipsManager.initAw()
            }), 12e4)
        }
    }(t.AdManageNS || (t.AdManageNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(619), o = n(931), r = n(932), s = n(14), l = n(3);
    t.adTipsManager = new class {
        constructor() {
            this.marketTips = new o.AdMarketTips, this.functionalTips = new r.AdFunctionalTips
        }

        initAw() {
            return i(this, void 0, void 0, function* () {
                l.remote.ipcMain.on(s.ThunderChannelList.channelMRAdTipsClick, (e, t, n) => i(this, void 0, void 0, function* () {
                    n && n.orderType && (n.orderType === a.OrderType.Market ? yield this.marketTips.onClickAw(t, n) : n.orderType === a.OrderType.Functional && (yield this.functionalTips.onClickAw(t, n)))
                })), yield this.marketTips.initAw(), setTimeout(() => i(this, void 0, void 0, function* () {
                    yield this.functionalTips.initAw()
                }), 3e4)
            })
        }

        showFunctionalTips(e, t) {
            this.functionalTips.showTip(e, t)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(262), o = n(22), r = n(259), s = n(619), l = n(6), u = n(15), d = n(1);
    t.AdMarketTips = class extends s.AdTips {
        constructor() {
            super(), this.isVip = !1, this.lastShowTime = 0, this.orderType = s.OrderType.Market, this.tipsPriority = r.MsgQueueNS.MsgPriority.AdvertisementMarket, this.positionId = 1305, this.logger = d.default.getLogger("AdMarketTips")
        }

        initAw() {
            const e = e => super[e];
            return i(this, void 0, void 0, function* () {
                return l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => i(this, void 0, void 0, function* () {
                    yield this.updateUserInfoAw()
                })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => i(this, void 0, void 0, function* () {
                    this.isVip = !1, (new Date).getTime() - this.lastShowTime > 108e5 && this.timerCookie && (this.killTimer(), yield this.fetchOrdersAw())
                })), yield this.updateUserInfoAw(), e("initAw").call(this)
            })
        }

        showTip() {
            do {
                if (null === this.curSelectOrder || void 0 === this.curSelectOrder) {
                    this.logger.information("showTip:curSelectOrder 有问题");
                    break
                }
                let e = this.curSelectOrder.materials;
                if (e.length <= 0) {
                    this.logger.information("showTip:materials 有问题");
                    break
                }
                let t = e[0].materialId;
                super.showTip(t)
            } while (0)
        }

        fetchOrdersAw() {
            const e = e => super[e];
            return i(this, void 0, void 0, function* () {
                let t = null;
                return this.isVip || (this.shownOrderIds = yield this.getShownOrderIdAw(), t = e("fetchOrdersAw").call(this)), this.createTimer(), t
            })
        }

        handleEventAW(e, t) {
            const n = e => super[e];
            return i(this, void 0, void 0, function* () {
                switch (yield n("handleEventAW").call(this, e, t), e) {
                    case"ad_load":
                        let i = yield this.downloadResourcesAW();
                        this.logger.information("downloadResourcesAW result", i), i && (this.isVip ? yield this.handleEventAW("ad_noshow", "vip") : this.showTip());
                        break;
                    case"ad_show":
                        this.lastShowTime = (new Date).getTime(), this.saveShownOrders()
                }
            })
        }

        updateUserInfoAw() {
            return i(this, void 0, void 0, function* () {
                try {
                    let e = JSON.parse(yield u.default("GetUserInfo", 2)).isVip;
                    this.isVip = e > 0, this.isVip && this.clearAllTips()
                } catch (e) {
                    this.logger.warning(e)
                }
            })
        }

        getShownOrderIdAw() {
            return i(this, void 0, void 0, function* () {
                let e = "";
                return yield a.AdHelperNS.onConfigInitAw(), o.ConfigNS.getValue("AdMarketTips", "TheDate", "") === a.AdHelperNS.getCurDate() && "" !== (e = o.ConfigNS.getValue("AdMarketTips", "shownOrders", "")) && "," === e.slice(e.length - 1) && (e = e.slice(0, e.length - 1)), e
            })
        }

        saveShownOrders() {
            let e = o.ConfigNS.getValue("AdMarketTips", "TheDate", ""), t = a.AdHelperNS.getCurDate(), n = "";
            e === t ? "" !== (n = o.ConfigNS.getValue("AdMarketTips", "shownOrders", "")) && "," === n.slice(n.length - 1) && (n = n.slice(0, n.length - 1)) : o.ConfigNS.setValue("AdMarketTips", "TheDate", t), n = "" !== n ? `${n},${this.curShowOrder.orderId}` : `${this.curShowOrder.orderId}`, o.ConfigNS.setValue("AdMarketTips", "shownOrders", n)
        }
    }
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(2), o = n(262), r = n(45), s = n(9), l = n(259), u = n(619), d = n(200), c = n(1);
    t.AdFunctionalTips = class extends u.AdTips {
        constructor() {
            super(), this.readyScenesMap = new Map, this.orderType = u.OrderType.Functional, this.tipsPriority = l.MsgQueueNS.MsgPriority.AdvertisementFunctional, this.positionId = 1306, this.logger = c.default.getLogger("AdFunctionalTips")
        }

        showTip(e, t) {
            this.logger.information("sceneName", t);
            do {
                let n = this.readyScenesMap.get(t);
                if (!n) {
                    this.logger.information("showTip:sceneName 有问题");
                    break
                }
                this.curSelectScene = n, super.showTip(e)
            } while (0)
        }

        fetchOrdersAw() {
            const e = e => super[e];
            return i(this, void 0, void 0, function* () {
                let t = e("fetchOrdersAw").call(this);
                return this.createTimer(), t
            })
        }

        handleEventAW(e, t) {
            const n = e => super[e];
            return i(this, void 0, void 0, function* () {
                switch (yield n("handleEventAW").call(this, e, t), e) {
                    case"ad_load":
                        let i = yield this.downloadResourcesAW();
                        this.logger.information("downloadResourcesAW result", i), i && (yield this.downloadScenes(), yield this.loadAllScenes())
                }
            })
        }

        downloadScenes() {
        }

        loadAllScenes() {
            return i(this, void 0, void 0, function* () {
                do {
                    if (null === this.curSelectOrder || void 0 === this.curSelectOrder) break;
                    let e = this.curSelectOrder.scenes;
                    if (e.length <= 0) this.logger.information("没有场景包"); else for (let t = 0; t < e.length; ++t) {
                        let n = e[t], i = n.name, r = this.readyScenesMap.get(i);
                        if (null === r || void 0 === r) {
                            this.readyScenesMap.set(i, n);
                            let e = a.join(this.adDataScenesDir, i);
                            yield o.AdHelperNS.loadScene(e)
                        }
                    }
                } while (0)
            })
        }
    }
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(1), a = n(83), o = n(7), r = n(21), s = n(934), l = n(66), u = n(6),
        d = i.default.getLogger("NativeFunction.Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "AttachCallbackEvent",
                        nativeFunc: this.attachCallbackEvent
                    }, {functionName: "IsTipsWndShow", nativeFunc: this.isTipsWndShow}, {
                        functionName: "IsMainWndShow",
                        nativeFunc: this.isMainWndShow
                    }, {functionName: "CreateTipsWnd", nativeFunc: this.createTipsWnd}, {
                        functionName: "CloseTipsWnd",
                        nativeFunc: this.closeTipsWnd
                    }, {functionName: "ShowOrHideTipsWnd", nativeFunc: this.showOrHideTipsWnd}];
                    a.setDefaultNativeFunctionMap(e)
                }
            }

            attachCallbackEvent(e, t, n, i) {
                if (o.isNullOrUndefined(i) || o.isNullOrUndefined(i[0])) return void e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                let a = i[0], s = i[1];
                u.NativeCallModule.nativeCall.AttachNativeEvent(a, (...e) => {
                    l.NativeCallHostModule.nativeCallHost.fireNativeEvent(s, ...e)
                }), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
            }

            createTipsWnd(e, t, n, i) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n) || o.isNullOrUndefined(i)) break;
                    if (o.isNullOrUndefined(i[0]) || o.isNullOrUndefined(i[1])) {
                        e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = i[0], l = i[1], u = "", d = null, c = null;
                    o.isNullOrUndefined(i[2]) || (d = i[2]), o.isNullOrUndefined(i[3]) || (c = i[3]), o.isNullOrUndefined(i[4]) || (u = i[4]), s.TipsHelperNS.tipsUIHelper.createTipsWnd(a, l, d, c, u), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isTipsWndShow(e, t, n) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    let i = s.TipsHelperNS.tipsUIHelper.isTipsWndShow();
                    e.callNativeFunctionCallback(t, n, i)
                } while (0)
            }

            isMainWndShow(e, t, n) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    let i = s.TipsHelperNS.tipsUIHelper.isMainWndShow();
                    e.callNativeFunctionCallback(t, n, i)
                } while (0)
            }

            closeTipsWnd(e, t, n) {
                do {
                    if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(n)) break;
                    s.TipsHelperNS.tipsUIHelper.closeTipsWnd(), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showOrHideTipsWnd(e, t, n, i) {
                d.information("showOrHideTipsWnd", e, t, n);
                let a = !1, l = null, u = null, c = null, h = null;
                o.isNullOrUndefined(i[0]) || (a = i[0]), o.isNullOrUndefined(i[1]) || (l = i[1]), o.isNullOrUndefined(i[2]) || (u = i[2]), o.isNullOrUndefined(i[3]) || (c = i[3]), o.isNullOrUndefined(i[4]) || (h = i[4]), s.TipsHelperNS.tipsUIHelper.showOrHideTipsWnd(a, l, u, c, h), e.callNativeFunctionCallback(t, n, r.NativeFunctionErrorCode.Success)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.TipsNaviteFunctionNS || (t.TipsNaviteFunctionNS = {}))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(3), a = n(2), o = n(7), r = n(1), s = n(45), l = n(5), u = n(66),
        d = l.default(a.join(__rootDir, "../bin/ThunderHelper.node")), c = r.default.getLogger("login-helper");
    !function (e) {
        e.tipsUIHelper = new class {
            constructor() {
                this.tipsWnd = null, this.isReadyShow = !1, this.isLoadFinish = !1, this.lastTipsWndShowState = !1
            }

            createTipsWnd(e, t, n, a, r) {
                c.information("create TipsWnd:", t, e, r, n, a, this.tipsWnd), null === this.tipsWnd && (o.isNullOrUndefined(e) || (this.isLoadFinish = !1, this.isReadyShow = !1, this.lastTipsWndShowState = t, o.isNullOrUndefined(n) && (n = 460), o.isNullOrUndefined(a) && (a = 360), o.isNullOrUndefined(this.tipsWnd) && (this.tipsWnd = new i.remote.BrowserWindow({
                    width: n,
                    height: a,
                    modal: !1,
                    resizable: !1,
                    skipTaskbar: !0,
                    frame: !1,
                    center: !0,
                    parent: i.remote.getCurrentWindow(),
                    show: !1,
                    webPreferences: {webSecurity: !0}
                })), this.tipsWnd.loadURL(e), this.tipsWnd.on("hide", () => {
                    let e = i.remote.getCurrentWindow();
                    !e.isMinimized() && e.isVisible() && i.remote.getCurrentWindow().show()
                }), this.tipsWnd.once("ready-to-show", () => {
                    this.isReadyShow = !0, c.information("create tipswindow ready-to-show:", this.isReadyShow), this.lastTipsWndShowState && (u.NativeCallHostModule.nativeCallHost.fireNativeEvent("showTipsWnd"), this.tipsWnd.show())
                }), this.tipsWnd.webContents.once("did-finish-load", () => {
                    this.isLoadFinish = !0, c.information("create TipsWnd did-finish-load:", this.isLoadFinish)
                }), this.tipsWnd.on("closed", () => {
                    c.information("TipsWnd closed"), this.tipsWnd = null;
                    let e = i.remote.getCurrentWindow();
                    !e.isMinimized() && e.isVisible() && i.remote.getCurrentWindow().show()
                })))
            }

            closeTipsWnd() {
                c.information("closeTipsWnd"), null !== this.tipsWnd && (this.lastTipsWndShowState = !1, this.tipsWnd.close(), this.tipsWnd = null)
            }

            showOrHideTipsWnd(e, t, n, i, a) {
                if (c.information("updateTipsWnd:", e, t, n, i, this.tipsWnd), o.isNullOrUndefined(e) && (e = !1), o.isNullOrUndefined(this.tipsWnd)) {
                    if (null === t || void 0 === t || "" === t) return;
                    this.createTipsWnd(t, e, n, i, a)
                } else this.lastTipsWndShowState = e, this.lastTipsWndShowState ? (u.NativeCallHostModule.nativeCallHost.fireNativeEvent("showTipsWnd"), c.information("updateLoginWnd:显示tips窗口"), this.tipsWnd.show(), s.ToolsUtilitiesAWNS.setForegroundWindow(d, this.tipsWnd)) : this.tipsWnd.hide()
            }

            isMainWndShow() {
                c.information("getMainWndState");
                let e = !0, t = i.remote.getCurrentWindow();
                return !t.isMinimized() && t.isVisible() || (e = !1), e
            }

            isTipsWndShow() {
                c.information("getTipsWndState");
                let e = !1;
                return this.lastTipsWndShowState && (e = !0), e
            }
        }
    }(t.TipsHelperNS || (t.TipsHelperNS = {}))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(15), o = n(6), r = n(38), s = n(1), l = n(10), u = n(9), d = n(298),
        c = s.default.getLogger("MainRenderer"), {isDef: h, isUndef: f} = l.ThunderUtil;
    let p = !1, g = "", k = `${__profilesDir}/user-skin-info.json`;

    function m(e, t = !1) {
        return i(this, void 0, void 0, function* () {
            if (t || function (e) {
                let t, n, i = !0;
                do {
                    if (e.type !== r.SkinHelperNS.SkinType.Wallpaper) break;
                    try {
                        t = JSON.parse(localStorage.getItem("wallpapers"))
                    } catch (e) {
                        c.warning(e);
                        break
                    }
                    n = (t || []).find(t => t.id === e.skinID), h(n) && n.is_vip && (i = p)
                } while (0);
                return i
            }(e)) {
                if (e.type === r.SkinHelperNS.SkinType.Default) document.body.classList.remove("is-theme"), l.ThunderUtil.setCSSProperties(document.body, {
                    "--background-main": "",
                    "--color-primary-theme": "",
                    "--color-primary-control-1": "",
                    "--color-primary-control-2": "",
                    "--color-primary-control-3": "",
                    "--color-primary-control-4": "",
                    "--color-primary-gradient-1": "",
                    "--color-primary-gradient-2": "",
                    "--color-primary-text": "",
                    "--color-search": "",
                    "--color-secondary": "",
                    "--color-gradient-background-1": "",
                    "--color-gradient-background-2": "",
                    "--color-gradient-foreground-1": "",
                    "--color-gradient-foreground-2": "",
                    "--color-accordion-1": "",
                    "--color-accordion-2": "",
                    "--default-opacity-1": "",
                    "--default-opacity-2": ""
                }); else if (e.type === r.SkinHelperNS.SkinType.Color || e.type === r.SkinHelperNS.SkinType.Wallpaper) {
                    let {colors: {colorGradientBackground: t, colorGradientForeground: n, colorPrimaryControl1: i, colorPrimaryControl2: a, colorPrimaryControl3: o, colorPrimaryControl4: s, colorSearch: u, colorPrimaryText: d, colorPrimary: c, colorPrimaryGradient: h, colorSecondary: f, colorAccordion: p}, opacity: g, image: k} = e;
                    if (document.body.classList.add("is-theme"), l.ThunderUtil.setCSSProperties(document.body, {
                        "--background-main": "",
                        "--color-primary-theme": `${c}`,
                        "--color-primary-control-1": `${i}`,
                        "--color-primary-control-2": `${a}`,
                        "--color-primary-control-3": `${o}`,
                        "--color-primary-control-4": `${s}`,
                        "--color-primary-gradient-1": `${h[0]}`,
                        "--color-primary-gradient-2": `${h[1]}`,
                        "--color-primary-text": `${d}`,
                        "--color-search": `${u}`,
                        "--color-secondary": `${f}`,
                        "--color-gradient-background-1": `${t[0]}`,
                        "--color-gradient-background-2": `${t[1]}`,
                        "--color-gradient-foreground-1": `${n[0]}`,
                        "--color-gradient-foreground-2": `${n[1]}`,
                        "--color-accordion-1": `${p[0]}`,
                        "--color-accordion-2": `${p[1]}`,
                        "--default-opacity-1": `${g - .1}`,
                        "--default-opacity-2": `${g + .1}`
                    }), e.type === r.SkinHelperNS.SkinType.Wallpaper) {
                        let e = new Image;
                        e.addEventListener("load", () => {
                            l.ThunderUtil.setCSSProperties(document.body, {"--background-main": `url("${k}")`})
                        }), e.src = k
                    }
                }
            } else try {
                yield a.default("SetSkinInfo", r.SkinHelperNS.defaultSkinInfo)
            } catch (e) {
                c.warning(e)
            }
            yield v(g)
        })
    }

    function T(e) {
        return i(this, void 0, void 0, function* () {
            if (f(e) || e) try {
                p = "1" === JSON.parse(yield a.default("GetUserInfo", 2)).isVip
            } catch (e) {
                c.warning(e)
            } else p = !1;
            try {
                yield m(yield a.default("GetSkinInfo"))
            } catch (e) {
                c.warning(e)
            }
        })
    }

    function v(e) {
        return i(this, void 0, void 0, function* () {
            try {
                let t = {}, n = yield a.default("GetSkinInfo"), i = "{}";
                if ("" !== e) {
                    (yield u.FileSystemAWNS.existsAW(k)) && (i = (yield u.FileSystemAWNS.readFileAW(k)).toString() || "{}", t = JSON.parse(i)), (t = JSON.parse(i))[e] = n, delete t[e].colors, yield u.FileSystemAWNS.writeFileAW(k, JSON.stringify(t))
                }
            } catch (e) {
                c.warning(e)
            }
        })
    }

    o.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSkin", m), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => i(this, void 0, void 0, function* () {
        try {
            yield T(!0), g = e;
            let t = (yield u.FileSystemAWNS.readFileAW(k)).toString(), n = JSON.parse(t)[e],
                i = yield a.default("GetSkinInfo");
            p = "1" === JSON.parse(yield a.default("GetUserInfo", 2)).isVip;
            let o = JSON.parse(localStorage.getItem("wallpapers"));
            null === o && (o = ((yield d.default.getWallpapers()) || []).sort((e, t) => e.manual_order - t.manual_order) || []);
            let r = o.find(e => e.id === n.skinID), s = o.find(e => e.id === i.skinID);
            if (s && s.is_vip && p) return void(yield v(e));
            "" !== t && (!r || p && r.is_vip || !r.is_vip) && (yield a.default("SetSkinInfo", n))
        } catch (e) {
            c.warning(e)
        }
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => i(this, void 0, void 0, function* () {
        try {
            g = "", yield T(!1)
        } catch (e) {
            c.warning(e)
        }
    }))
}, function (e, t, n) {
    "use strict";
    var i = this && this.__awaiter || function (e, t, n, i) {
        return new (n || (n = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(i.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(i.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new n(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((i = i.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = n(15), o = n(6), r = n(1), s = n(10), l = n(9), u = n(246), d = n(257),
        c = r.default.getLogger("Thunder.speedcurve-skin.init-skin"), {isDef: h, isUndef: f} = s.ThunderUtil;
    let p = !1, g = !1, k = "", m = `${u.SpeedCurveSkinHelperNS.cacheDir}/user-skin-info.json`;

    function T(e) {
        let t = !0;
        return e.type === u.SpeedCurveSkinHelperNS.SkinType.SuperVip ? t = g : e.type === u.SpeedCurveSkinHelperNS.SkinType.Vip && (t = p), t
    }

    function v(e) {
        return h(e.type) && e.type >= u.SpeedCurveSkinHelperNS.SkinType.Vip
    }

    function y(e, t = !1, n = !1) {
        return i(this, void 0, void 0, function* () {
            if (n || T(e)) ; else try {
                yield a.default("SetSpeedCurveSkinInfo", u.SpeedCurveSkinHelperNS.defaultSkinInfo)
            } catch (e) {
                c.warning(e)
            }
            n && !t || (yield w(k))
        })
    }

    function S(e) {
        return i(this, void 0, void 0, function* () {
            if (f(e) || e) try {
                let e = JSON.parse(yield a.default("GetUserInfo", 2));
                if (h(e)) {
                    let t = Number(e.vasType).valueOf();
                    p = "1" === e.isVip, g = p && 5 === t
                }
            } catch (e) {
                c.warning(e)
            } else p = !1, g = !1;
            try {
                yield y(yield a.default("GetSpeedCurveSkinInfo"))
            } catch (e) {
                c.warning(e)
            }
        })
    }

    function w(e) {
        return i(this, void 0, void 0, function* () {
            try {
                let t = {}, n = yield a.default("GetSpeedCurveSkinInfo"), i = "{}";
                if ("" !== e) {
                    (yield l.FileSystemAWNS.existsAW(m)) && (i = (yield l.FileSystemAWNS.readFileAW(m)).toString() || "{}"), (t = JSON.parse(i))[e] = {
                        id: n.id,
                        type: n.type
                    }, yield l.FileSystemAWNS.writeFileAW(m, JSON.stringify(t))
                }
            } catch (e) {
                c.warning(e)
            }
        })
    }

    o.NativeCallModule.nativeCall.AttachNativeEvent("OnChangeSpeedCurveSkin", y), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => i(this, void 0, void 0, function* () {
        try {
            yield S(!0), k = e;
            let t = (yield l.FileSystemAWNS.readFileAW(m)).toString(), n = JSON.parse(t)[e],
                i = yield a.default("GetSpeedCurveSkinInfo"), o = JSON.parse(localStorage.getItem("speedcurveSkins"));
            if (null === o && (o = (yield d.default.getSkins()) || []), (i = o.find(e => e.id === i.id)) && v(i) && T(i)) return void(yield w(e));
            if (!n) return;
            if (n = o.find(e => e.id === n.id)) {
                let e = v(n);
                (e && T(n) || !e) && (yield a.default("SetSpeedCurveSkinInfo", n))
            }
        } catch (e) {
            c.warning(e)
        }
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => i(this, void 0, void 0, function* () {
        try {
            k = "", yield S(!1)
        } catch (e) {
            c.warning(e)
        }
    }))
}, function (e, t, n) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const i = n(724), a = n(21), o = n(65), r = n(7), s = n(6), l = n(13), u = n(2),
        d = n(5).default(u.join(__rootDir, "../bin/ThunderHelper.node"));
    t.defaultNavite = new class {
        constructor() {
        }

        registerDefaultNativeFunction() {
            let e = [{functionName: "GetUserID", nativeFunc: this.getUserID}, {
                functionName: "GetSessionID",
                nativeFunc: this.getSessionID
            }, {functionName: "LoadLoginData", nativeFunc: this.loadLoginData}, {
                functionName: "GetUserInfo",
                nativeFunc: this.getUserInfo
            }, {functionName: "IsLogined", nativeFunc: this.isLogined}, {
                functionName: "OpenNewTab",
                nativeFunc: this.openNewTab
            }, {functionName: "TrackEvent", nativeFunc: this.trackEvent}, {
                functionName: "GetThunderVersion",
                nativeFunc: this.getThunderVersion
            }];
            i.BrowserCtrl.registerDefaultNativeFunction(e)
        }

        getUserID(e, t, n, i) {
            o.LoginHelperNS.loginHelper.getUserInfo("userid", function (i) {
                null !== i && void 0 !== i && "" !== i || (i = "0"), e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, i)
            })
        }

        getSessionID(e, t, n, i) {
            o.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (i) {
                e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, i)
            })
        }

        loadLoginData(e, t, n, i) {
            let s = null;
            do {
                if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) {
                    e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.ParamError);
                    break
                }
                let l = i[0], u = i[1];
                s = "memory" === l && "initconfig" === u ? o.LoginHelperNS.loginSDKHelper.getInitData() : o.LoginHelperNS.loginSDKHelper.loadData(l, u), e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, s)
            } while (0)
        }

        getUserInfo(e, t, n, i) {
            (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(n)) && e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.ParamError);
            let s = 0;
            if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) s = 0; else {
                let e = i[0];
                s = null === e || void 0 === e || "" === e ? 0 : Number(e)
            }
            o.LoginHelperNS.loginHelper.getUserInfoEx(s, function (i) {
                e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, i)
            })
        }

        isLogined(e, t, n, i) {
            (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(n)) && e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.ParamError), o.LoginHelperNS.loginHelper.isLogined(function (i) {
                e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, i)
            })
        }

        openNewTab(e, t, n, i) {
            do {
                if (r.isNullOrUndefined(i)) break;
                if (r.isNullOrUndefined(i[0])) break;
                let o = i[0];
                s.NativeCallModule.nativeCall.CallNativeFunction("OpenNewTab", o), e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success)
            } while (0)
        }

        trackEvent(e, t, n, i) {
            do {
                if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(n)) break;
                if (!i || !i[0]) {
                    e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.ParamError);
                    break
                }
                let o = i[0], s = void 0 === i[1] ? "" : i[1], u = void 0 === i[2] ? "" : i[2],
                    d = void 0 === i[3] ? 0 : i[3], c = void 0 === i[4] ? 0 : i[4], h = void 0 === i[5] ? 0 : i[5],
                    f = void 0 === i[6] ? 0 : i[6], p = void 0 === i[7] ? "" : i[7], g = void 0 === i[8] ? 0 : i[8],
                    k = l.XLStatNS.trackEvent(o, s, u, d, c, h, f, p, g);
                e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, k)
            } while (0)
        }

        getThunderVersion(e, t, n, i) {
            let o = u.join(__rootDir, "../../Thunder.exe"), r = d.getFileVersion(o);
            e.callNativeFunctionCallback(t, n, a.NativeFunctionErrorCode.Success, r)
        }
    }
}, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , function (e, t) {
}, , , , , , , , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , , , , , , , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , , , function (e, t) {
}, , , , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , , , function (e, t) {
}, , function (e, t) {
}]);
//# sourceMappingURL=renderer.js.map
/*! ThunderX BY LUOCHENZHIMU */
/*! Last updated on 2018/12/17 */
/*! https://www.luochenzhimu.com */