const config = { "PATH_IMG_V2_PRO": "https://cdn-image.gandart.com/", "RUN_TYPE": 1, "BOTTOM_LOAD_MORE_THROTTLE": 100, "BASE_API": "https://api.gandart.com/base", "RESALE_API": "https://api.gandart.com/market", "RESALE_API_V2": "https://api2.gandart.com/market/api/v2", "RESALE_API_V3": "https://api2.gandart.com/market/api/v3", "SALE_API": "https://api.gandart.com/read/api", "ORDER_API": "https://api.gandart.com", "WALLET_API": "https://api.gandart.com/api", "HXT_API": "https://api.gandart.com/wallet", "PATH_IMG_V2": "https://cdn-image.gandart.com/", "SAND_RECHARGE_ACTION": "https://cap.sandpay.com.cn/v4/front-electrans/ceas.elec.trans.quick.deposit.apply", "GAME_ElF_API": "https://elf.pentajam.cn/api", "GAME_ELF_URL": "https://elf.pentajam.cn", "CORECENTER_URL": "https://api.gandart.com/corecenter" }; const lk = new ToolKit(`光予合成手`, `GandartCompositor`); const GandartConstKey = { // -----通用助手相关的----- Token: 'lkGandartToken', UserData: 'lkGandartUserData', PrivCollectionBrief: 'lkGandartPrivCollectionBrief', PrivCollectionDetail: 'lkGandartPrivCollectionDetail', CollectionName: 'lkGandartCollectionName', CastingId: 'lkGandartCastingId', LimitPrice: 'lkGandartLimitPrice', TransactionRecordId: 'lkGandartTransactionRecordId', CollectionCateLst: 'lkGandartCollectionCateLst', FloatPriceIntaval: 'lkGandartFloatPriceIntaval', IsCollectionWatchLocked: 'lkIsGandartCollectionWatchLocked', PrivWalletListInUse: 'lkGandartPrivWalletListInUse', IsCollectionMaxNumLimit: 'lkGandartIsCollectionMaxNumLimit', CollectionLockMaxNum: 'lkGandartCollectionLockMaxNum', // -----合成脚本增加的----- CompositeFuncEnalbleList: 'lkGandartCompositeFuncEnalbleList', CompositeTaskList0: 'lkGandartCompositeTaskList0', CompositeTaskList1: 'lkGandartCompositeTaskList1', CompositeTaskList2: 'lkGandartCompositeTaskList2', CompositeTaskId: 'lkGandartCompositeTaskId', CompositeTaskSearchEnable: 'lkIsCompositeTaskSearchEnable', CompositeTaskSearchKey: 'lkGandartCompositeTaskSearchKey', CompositeTaskNameDisplay: 'lkGandartCompositeTaskNameDisplay', CompositeCountArray: 'lkGandartCompositeCountArray', CompositeTaskMateList: 'lkGandartCompositeTaskMateList', CompositeTaskFinalList: 'lkGandartCompositeTaskFinalList', CompositeTaskListStatus: 'lkGandartCompositeTaskListStatus', CompositeTaskListCache: 'lkIsCompositeTaskListCache', CompositeMaterialCache: 'lkIsCompositeMaterialCache', CompositeTaskMode: 'lkGandartCompositeTaskMode', CompositeBatchEnable: 'lkIsCompositeBatchEnable', CompositeBatchGroupCount: 'lkGandartCompositeBatchGroupCount', }; let gandartToken = lk.getVal(GandartConstKey.Token, ''); let gandartUserAgent = `Mozilla/5.0 (iPhone; CPU iPhone OS 16_3_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1`; const GCommonGandartHeads = { 'Accept': `application/json, text/plain, */*`, 'Origin': `https://www.gandart.com`, 'Accept-Encoding': `gzip, deflate, br`, 'Content-Type': `application/x-www-form-urlencoded;charset=UTF-8`, 'Connection': `keep-alive`, 'Host': `api2.gandart.com`, 'User-Agent': gandartUserAgent, 'Referer': `https://www.gandart.com/`, 'Accept-Language': `zh-CN,zh-Hans;q=0.9`, 'token': gandartToken }; let gAllMaterialDetails = null; const gUsedMaterialDetails = {}; let gFuncEnables = lk.getVal(GandartConstKey.CompositeFuncEnalbleList); if (!lk.isEmpty(gFuncEnables)) { gFuncEnables = gFuncEnables.split(','); } else { gFuncEnables = ["TaskList", "MateList", "DecidedList"]; } if (!lk.isExecComm) { if (!lk.isRequest()) { all(); } } async function all() { let taskLst = []; if (isGetTaskListEnable()) { let status = getCompositeTaskListStatus(); let tmpLst = []; switch (status) { case 0: tmpLst = await checkGetCompositeTaskList(status); if (tmpLst) { taskLst = taskLst.concat(tmpLst); } break; case 1: tmpLst = await checkGetCompositeTaskList(status); if (tmpLst) { taskLst = taskLst.concat(tmpLst); } break; case 2: tmpLst = await checkGetCompositeTaskList(status); if (tmpLst) { taskLst = taskLst.concat(tmpLst); } break; case 3: tmpLst = await checkGetCompositeTaskList(1); if (tmpLst) { taskLst = taskLst.concat(tmpLst); } tmpLst = await checkGetCompositeTaskList(0); if (tmpLst) { taskLst = taskLst.concat(tmpLst); } break; default: break; } } if (taskLst.length == 0) { lk.log('合成任务列表为空'); } if (isCaclMateListEnable()) { let isFoundOnce = await checkToCompositeConformingTasks(taskLst); if (!isFoundOnce) { lk.log('没有任何相符合的合成任务'); } } lk.msg(''); lk.done(); } async function checkToCompositeConformingTasks(taskLst) { let taskIds = getWillCompositeTaskIds(); let isFoundOnce = false; let found = false; for (let i = 0; i < taskIds.length; i++) { let taskId = taskIds[i]; found = false; if (taskId > 0) { for (let j = 0; j < taskLst.length; j++) { let taskInfo = taskLst[j]; if (taskInfo.id == taskId) { found = true; lk.setVal(GandartConstKey.CompositeTaskNameDisplay, taskInfo.compositeTaskName); await tryToExecCompositeTask(taskInfo.id, taskInfo, i); break; } } if (!found) { lk.log(`[${i}]当前任务列表找不到指定任务[${taskId}]`); found = await checkTrySearchToCompositeTask(taskLst, i); } } else { lk.log(`[${i}]没有设置指定任务ID,检查是否需进行检索合成`); found = await checkTrySearchToCompositeTask(taskLst, i); } if (found) { isFoundOnce = found; } } found = false; let keyNames = getWillCompositeTaskSearchKeys(); for (let i = taskIds.length; i < keyNames.length; i++) { lk.log(`[${i}]没有设置指定任务ID,检查是否需进行检索合成`); found = await checkTrySearchToCompositeTask(taskLst, i); if (found) { isFoundOnce = found; } } return isFoundOnce; } async function checkTrySearchToCompositeTask(taskLst, sortIdx) { if (!isTaskNameSearchMode()) { return; } lk.log('开始尝试通过名称来检索任务进行合成'); let keyNames = getWillCompositeTaskSearchKeys(); let keyName = keyNames[sortIdx]; if (lk.isEmpty(keyName)) { lk.log(`当前检索关键字为空`); return; } let found = false; for (let i = 0; i < taskLst.length; i++) { let taskInfo = taskLst[i]; let taskName = taskInfo.compositeTaskName; if (taskName.indexOf(keyName) > -1) { found = true; lk.log(`检索到相符的任务[${taskName}#${taskInfo.id}]`); lk.setVal(GandartConstKey.CompositeTaskNameDisplay, taskName); await tryToExecCompositeTask(taskInfo.id, taskInfo, sortIdx); } } if (!found) { lk.log(`当前关键字[${keyName}]没有检索到相关的任务`); } return found; } function getCompositeTaskListStatus() { let val = lk.getVal(GandartConstKey.CompositeTaskListStatus); if (lk.isEmpty(val)) { val = 1; } else { val = Number(val); } return val; } function getCompositeTaskMode() { let val = lk.getVal(GandartConstKey.CompositeTaskMode); if (lk.isEmpty(val)) { val = 0; } else { val = Number(val); } return val; } function isGetTaskListEnable() { if (gFuncEnables.indexOf('TaskList') > -1) { return true; } return false; } function isCaclMateListEnable() { if (gFuncEnables.indexOf('MateList') > -1) { return true; } return false; } function isGenFinalLisstEnable() { if (gFuncEnables.indexOf('DecidedList') > -1) { return true; } return false; } function isExecFinalComposite() { if (gFuncEnables.indexOf('ExecComposite') > -1) { return true; } return false; } function checkIsCompositeTaskExec(taskInfo) { if (taskInfo) { if (taskInfo.endTime && taskInfo.startTime) { let nowDate = new Date(); let endDate = new Date(taskInfo.endTime); if (nowDate.getTime() >= endDate.getTime()) { return true; } let startDate = new Date(taskInfo.startTime); if (nowDate.getTime() > startDate.getTime() - 1000) { return true; } return false; } } return true; } function getWillCompositeTaskIds() { let valArr = lk.getVal(GandartConstKey.CompositeTaskId); if (!lk.isEmpty(valArr)) { let segments = valArr.split('|'); valArr = []; for (let vstr of segments) { valArr.push(Number(vstr)); } } else { valArr = []; } return valArr; } function getWillCompositeTaskSearchKeys() { let keyArr = lk.getVal(GandartConstKey.CompositeTaskSearchKey) if (!lk.isEmpty(keyArr)) { let segments = keyArr.split('|'); keyArr = []; for (let vstr of segments) { keyArr.push(vstr); } } else { keyArr = []; } return keyArr; } function isTaskNameSearchMode() { let enabled = lk.getVal(GandartConstKey.CompositeTaskSearchEnable); if (!lk.isEmpty(enabled)) { enabled = JSON.parse(enabled); } else { enabled = true; } return enabled; } function isCompositeBatchEnable() { let enabled = lk.getVal(GandartConstKey.CompositeBatchEnable); if (!lk.isEmpty(enabled)) { enabled = JSON.parse(enabled); } else { enabled = true; } return enabled; } function printMaterialGroupsInfo(materialGroups) { let detailStr = '组合详情如下:\n'; for (let i = 0; i < materialGroups.length; i++) { let group = materialGroups[i]; let needStr = ''; for (let j = 0; j < group.length; j++) { needStr += `${group[j].collectionName}x${group[j].number},` } detailStr += `组合${i}:${needStr.substring(0, needStr.length - 1)}\n`; } lk.log(detailStr); } async function checkGetMaterialDetails(gUsedMaterialDetails, materialDict) { let useCache = lk.getVal(GandartConstKey.CompositeMaterialCache); if (!lk.isEmpty(useCache)) { useCache = JSON.parse(useCache); } else { useCache = false; } lk.log(`合成材料列表本地缓存:${useCache}`); let isReqServerData = false; if (useCache) { let jsonStr = lk.getVal(GandartConstKey.PrivCollectionDetail); if (!lk.isEmpty(jsonStr)) { try { let data = JSON.parse(jsonStr); gAllMaterialDetails = data; for (let k in materialDict) { gUsedMaterialDetails[k] = data[k]; } } catch (error) { lk.logErr(error); isReqServerData = true; } } else { isReqServerData = true; } } else { isReqServerData = true; } if (isReqServerData) { for (let k in materialDict) { let mInfo = materialDict[k]; gUsedMaterialDetails[k] = await getDetailByCasting(mInfo.castingId, mInfo.collectionName); } } return gUsedMaterialDetails; } async function tryToExecCompositeTask(taskId, taskInfo = {}, sortIdx = 0) { if (getCompositeTaskMode() == 1) { lk.log('开始极速模式执行合成任务'); let data = getCompositeTaskFinalList(); if (data) { let taskInfo = data.taskInfo; if(!taskInfo){ lk.log('暂无可行的星光通道组合,请检查'); return; } let finalGroups = data.finalGroups; if (finalGroups.length == 0) { lk.log('暂无可行的合成组合,请检查'); lk.appendNotifyInfo('⚠️暂无可行的合成组合'); return; } lk.log(`最终选择可执行合成数:${finalGroups.length}`); let tmpJsonStr = JSON.stringify(finalGroups, null, 2); lk.log(`详情如下:\n${tmpJsonStr}`); if (isExecFinalComposite() && checkIsCompositeTaskExec(taskInfo)) { await doExecFinalComposite(taskInfo.id, taskInfo, finalGroups); } else { lk.log('暂未进行最后一步合成'); } } return; } lk.log('开始普通模式执行合成任务'); let materialSelLst = await getCompositeMaterial(taskId, taskInfo); if (materialSelLst && materialSelLst.length > 0) { let ret = calcCompositeGroups(materialSelLst); // 材料排列组合 let materialGroups = ret[0]; lk.log(`排列组合组数:${materialGroups.length}`); // printMaterialGroupsInfo(materialGroups); let materialDict = ret[1]; // 获取用户材料拥有详情 await checkGetMaterialDetails(gUsedMaterialDetails, materialDict); // 找出可行的合成搭配 let validCompositeGroups = findValidGroupMaterialGroups(materialGroups, gUsedMaterialDetails); setCompositeTaskMateListForDisplay(validCompositeGroups); // printMaterialGroupsInfo(validCompositeGroups, '预估可行组合数'); if (isGenFinalLisstEnable()) { let compositeCountDict = getCompositeCountDict(sortIdx); let finalGroups = []; for (let k in compositeCountDict) { let mGroup = validCompositeGroups[k]; if (mGroup) { let arr = checkPickMaterialForComposite(mGroup, gUsedMaterialDetails, compositeCountDict[k]); finalGroups = finalGroups.concat(arr); } } lk.log(`最终选择可执行合成数:${finalGroups.length}`); let tmpJsonStr = JSON.stringify(finalGroups, null, 2); lk.log(`详情如下:\n${tmpJsonStr}`); if (isExecFinalComposite() && checkIsCompositeTaskExec(taskInfo)) { if (finalGroups.length == 0) { lk.log('暂无可行的合成组合,请检查'); // lk.appendNotifyInfo('⚠️暂无可行的合成组合'); return; } await doExecFinalComposite(taskId, taskInfo, finalGroups); } else { lk.log('暂未进行最后一步合成'); setCompositeTaskFinalList(taskInfo, finalGroups); } } else { lk.execFail(); lk.appendNotifyInfo('⚠️请设置光予合成任务ID'); } } return; } function setCompositeTaskMateListForDisplay(validCompositeGroups) { lk.log(`预估可行组合数:${validCompositeGroups.length}`); let disText = ''; for (let i = 0; i < validCompositeGroups.length; i++) { let group = validCompositeGroups[i]; let rowText = `[${i}]`; for (let j = 0; j < group.length; j++) { let mInfo = group[j]; rowText += `${mInfo.collectionName}x${mInfo.number},`; } disText += rowText.substring(0, rowText.length - 1) + '\n'; } lk.log(disText); lk.setVal(GandartConstKey.CompositeTaskMateList, disText); } function getBatchCompositeGroupCount() { let numStr = lk.getVal(GandartConstKey.CompositeBatchGroupCount); if (lk.isEmpty(numStr)) { return 5; } return Number(numStr); } async function doExecFinalComposite(taskId, taskInfo, finalGroups) { let retOrderLst = []; let retWillDelLst = []; let batchGroupCnt = getBatchCompositeGroupCount(); let startIdx = 0; // 检查是否进行多个批量合成 if (isCompositeBatchEnable() && finalGroups.length >= batchGroupCnt) { let batchMaxNum = Math.floor(finalGroups.length / batchGroupCnt); for (let i = 0; i < batchMaxNum; i++) { let compositeList = []; for (let j = 0; j < batchGroupCnt; j++) { compositeList.push({ materialDetailList: finalGroups[startIdx] }); startIdx += 1; } let ret = await confirmCompositeV3(taskId, taskInfo, compositeList); if (ret) { for (let idx = startIdx - batchMaxNum; idx < startIdx; idx++) { retWillDelLst.push(idx); } retOrderLst.push(ret); } } } // 剩下的进行单个合成 for (let i = startIdx; i < finalGroups.length; i++) { let idx = i; let compositeList = [ { materialDetailList: finalGroups[i] } ]; let ret = await confirmCompositeV3(taskId, taskInfo, compositeList); if (ret) { retWillDelLst.push(idx); retOrderLst.push(ret); } } if (retOrderLst.length > 0) { let successCnt = 0; let noStockCnt = 0; for (let i = 0; i < retOrderLst.length; i++) { const orderNum = retOrderLst[i]; lk.log(`[${i}]单号:${orderNum}`); if (orderNum.indexOf('#') > -1) { successCnt += 1; } else if (orderNum.indexOf('!') > -1) { noStockCnt += 1; } else { successCnt += 1; await checkCompositeResult(orderNum); } } lk.log(`合成成功单数:${successCnt}`); lk.log(`库存不足单数:${noStockCnt}`); // 从高的序号删除 let usedGroups = []; for (let i = retWillDelLst.length - 1; i >= 0; i--) { let idx = retWillDelLst[i]; lk.log(`编号[${idx}]一组的材料合成销毁删除`); usedGroups.push(finalGroups[idx]); finalGroups.splice(idx, 1); } let tmpJsonStr = JSON.stringify(finalGroups, null, 2); lk.log(`剩余未完成的组合如下:\n${tmpJsonStr}`); setCompositeTaskFinalList(taskInfo, finalGroups); refreshMaterialAfterComposite(usedGroups); } else { lk.log('合成成功单数:0'); } } function setCompositeTaskFinalList(taskInfo, finalGroups) { let simpleInfo = { id: taskInfo.id, compositeLabel: taskInfo.compositeLabel, compositeTaskName: taskInfo.compositeTaskName, surplus: taskInfo.surplus, } let finalCacheData = { taskInfo: simpleInfo, finalGroups: finalGroups, }; lk.setVal(GandartConstKey.CompositeTaskFinalList, JSON.stringify(finalCacheData, null, 2)); } function refreshMaterialAfterComposite(usedGroups) { if (usedGroups.length == 0) { return; } if (!gAllMaterialDetails) { let jsonStr = lk.getVal(GandartConstKey.PrivCollectionDetail); if (!lk.isEmpty(jsonStr)) { try { let data = JSON.parse(jsonStr); gAllMaterialDetails = data; } catch (error) { lk.logErr(error); } for (let group of usedGroups) { for (let one of group) { deleteUsedMaterial(one.castingId, one.orderList); } } jsonStr = JSON.stringify(gAllMaterialDetails, null, 2); lk.setVal(GandartConstKey.PrivCollectionDetail, jsonStr); } } } function deleteUsedMaterial(castingId, recordIdLst) { let itemLst = gAllMaterialDetails[castingId]; if (itemLst) { let remainLst = []; for (let i = 0; i < itemLst.length; i++) { if (recordIdLst.indexOf(itemLst[i].id) == -1) { remainLst.push(itemLst[i]); } } gAllMaterialDetails[castingId] = remainLst; } } function getCompositeTaskFinalList() { let data; let jsonStr = lk.getVal(GandartConstKey.CompositeTaskFinalList); if (!lk.isEmpty(jsonStr)) { data = JSON.parse(jsonStr); } return data; } function getCompositeCountDict(sortIdx) { let str = lk.getVal(GandartConstKey.CompositeCountArray, '0#1'); let arr0 = str.split('|'); let ret = {}; if (sortIdx < arr0.length) { let arr1 = arr0[sortIdx].split(','); for (let i = 0; i < arr1.length; i++) { let arr2 = arr1[i].split('#'); let key = arr2[0]; ret[key] = Number(arr2[1] || 1); } } else { ret[0] = 1; } return ret; } function findValidGroupMaterialGroups(materialGroups, materialDetails) { let validGroups = []; for (let i = 0; i < materialGroups.length; i++) { let canCount = checkMaterialEnough(materialGroups[i], materialDetails); if (canCount > 0) { validGroups.push(materialGroups[i]); } } return validGroups; } function checkMaterialEnough(materialGroup, materialDetails) { let minCount = 99999; for (let i = 0; i < materialGroup.length; i++) { const materialObj = materialGroup[i]; const castingId = materialObj.castingId; const ownLst = materialDetails[castingId]; if (!ownLst) { minCount = 0; break; } if (ownLst.length >= materialObj.number) { let maxCount = Math.floor(ownLst.length / materialObj.number); if (maxCount < minCount) { minCount = maxCount; } } else { minCount = 0; break; } } if (minCount == 99999) { minCount = 0; } return minCount } function checkPickMaterialForComposite(materialGroup, materialDetails, wantCount) { let needNumDict = {}; for (let i = 0; i < materialGroup.length; i++) { const materialObj = materialGroup[i]; const castingId = materialObj.castingId; if (!needNumDict[castingId]) { needNumDict[castingId] = materialObj.number; } else { needNumDict[castingId] += materialObj.number; } } let minCount = 99999; for (let kid in needNumDict) { const ownLst = materialDetails[kid] || []; const maxCount = Math.floor(ownLst.length / needNumDict[kid]); if (maxCount < minCount) { minCount = maxCount; } } minCount = Math.min(minCount, wantCount); let nCompositeGroup = []; for (let n = 0; n < minCount; n++) { let resultMaterialLst = []; let interrupt = false; for (let i = 0; i < materialGroup.length; i++) { const materialObj = materialGroup[i]; const castingId = materialObj.castingId; let ownLst = materialDetails[castingId]; let num = materialObj.number; if (ownLst.length < num) { interrupt = true; break; } let materialSeries = { castingId: castingId, orderList: [], }; for (let j = ownLst.length - 1; j >= 0; j--) { num -= 1; let info = ownLst[j]; materialSeries.orderList.push(info.id); ownLst.splice(j, 1); if (num == 0) { break; } } resultMaterialLst.push(materialSeries); } if (interrupt) { break; } nCompositeGroup.push(resultMaterialLst); } return nCompositeGroup; } function calcCompositeGroups(materialSelLst) { let materialDict = {}; let materialGroups = []; function doArrangeMeterialGroup(transArr, index, resultArr, resultTmp) { for (let i = 0; i < transArr[index].length; i++) { const materialInfo = transArr[index][i]; resultTmp[index] = materialInfo; const castingId = materialInfo.castingId; materialDict[castingId] = materialInfo; if (index != transArr.length - 1) { doArrangeMeterialGroup(transArr, index + 1, resultArr, resultTmp); } else { resultArr.push([].concat(resultTmp)); } } return resultArr; } doArrangeMeterialGroup(materialSelLst, 0, materialGroups, []); return [materialGroups, materialDict]; } async function checkGetCompositeTaskList(status) { let taskLst; let useCache = lk.getVal(GandartConstKey.CompositeTaskListCache); if (!lk.isEmpty(useCache)) { useCache = JSON.parse(useCache); } else { useCache = false; } lk.log(`合成任务列表本地缓存:${useCache}`); if (useCache) { taskLst = getCompositeTaskListByCache(status); } else { taskLst = []; let taskDetail = await getCompositeTaskListByServer(status, 10, 1); if (taskDetail && taskDetail.rows) { taskLst = concatTaskList(taskLst, taskDetail.rows, 1); let totalPage = taskDetail.totalPage; for (let i = 2; i < totalPage + 1; i++) { taskDetail = await getCompositeTaskListByServer(status, 10, i); if (taskDetail && taskDetail.rows) { taskLst = concatTaskList(taskLst, taskDetail.rows, i); } } } cacheCompositeTaskList(status, taskLst); } return taskLst; } function concatTaskList(latestLst, newLst, page) { for (let i = 0; i < newLst.length; i++) { newLst[i].page = page; latestLst.push(newLst[i]); } return latestLst; } function getCompositeTaskListByCache(status, pageSize = 10, page = 1) { try { let jsonStr = ''; if (status == 0) { jsonStr = lk.getVal(GandartConstKey.CompositeTaskList0); } else if (status == 1) { jsonStr = lk.getVal(GandartConstKey.CompositeTaskList1); } else if (status == 2) { jsonStr = lk.getVal(GandartConstKey.CompositeTaskList2); } if (!lk.isEmpty(jsonStr)) { return JSON.parse(jsonStr); } } catch (error) { lk.logErr(error); } } function cacheCompositeTaskList(status, taskLst) { // 精简一下内容 let simpleLst = []; for (let i = 0; i < taskLst.length; i++) { let info = taskLst[i]; let item = { id: info.id, compositeLabel: info.compositeLabel, compositeTaskName: info.compositeTaskName, surplus: info.surplus, startTime: info.startTime, endTime: info.endTime, page: info.page, }; simpleLst.push(item); } let jsonStr = JSON.stringify(simpleLst, null, 2); if (status == 0) { lk.setVal(GandartConstKey.CompositeTaskList0, jsonStr); } else if (status == 1) { lk.setVal(GandartConstKey.CompositeTaskList1, jsonStr); } else if (status == 2) { lk.setVal(GandartConstKey.CompositeTaskList2, jsonStr); } } async function getCompositeTaskListByServer(status, pageSize = 10, page = 1) { return new Promise((resolve, _reject) => { try { const headers = GCommonGandartHeads; headers['Host'] = 'api.gandart.com'; headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; let body = `page=${page}&pageSize=${pageSize}&total=0&status=${status}&labelName=`; let url = { url: `${config.WALLET_API}/v2/composite/v3/list/v2`, headers: headers, body: body }; let tagNames = [ '待开始', '合成中', '已结束', ]; lk.log(`获取合成任务[${tagNames[status]}]列表:${body}`); lk.post(url, async (error, _response, data) => { let ret = {}; try { if (error) { lk.log(`获取合成任务列表发生错误`); lk.execFail(); lk.appendNotifyInfo(`❌获取合成任务列表失败,请稍后再试`); } else { ret = JSON.parse(data); lk.log(`获取合成任务列表成功`); } } catch (e) { lk.log(`获取合成任务列表发生错误`); lk.logErr(e); lk.execFail(); } finally { resolve(ret); } }); } catch (e) { lk.log(`获取合成任务列表发生错误`); lk.logErr(e); resolve(); } }); } async function getCompositeMaterial(taskId, taskInfo) { return new Promise((resolve, _reject) => { try { const headers = GCommonGandartHeads; headers['Host'] = 'api.gandart.com'; headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; let body = `taskId=${taskId}`; let url = { url: `${config.BASE_API}/v2/composite/v3/compositeMaterial`, headers: headers, body: body }; let taskName = taskInfo.compositeTaskName || ''; //合成标题 lk.log(`获取合成任务[${taskName}#${taskId}]材料详情:${body}`); lk.post(url, async (error, _response, data) => { let retItemLst = []; try { if (error) { lk.log(`获取合成任务材料详情发生错误`); lk.execFail(); lk.appendNotifyInfo(`❌获取合成任务材料详情失败,请稍后再试`); } else { let ret = JSON.parse(data); if (ret.success) { let obj = ret.obj; retItemLst = obj; lk.log(`获取合成任务材料详情成功`); } else { lk.log(`获取合成任务材料详情失败,响应:${data}`); } } } catch (e) { lk.log(`获取合成任务材料详情发生错误`); lk.logErr(e); lk.execFail(); } finally { resolve(retItemLst); } }); } catch (e) { lk.log(`获取合成任务材料详情发生错误`); lk.logErr(e); resolve(); } }); } async function getDetailByCasting(castingId, collectionName, pageSize = 50, page = 1) { return new Promise((resolve, _reject) => { try { const headers = GCommonGandartHeads; headers['Host'] = 'api.gandart.com'; headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; let params = { castingId: castingId, page: page, pageSize: pageSize, }; let signData = getSign(); signData = Object.assign(signData, params); let body = lk.objToQueryStr(signData); let url = { url: `${config.SALE_API}/composite/getDetailByCasting?${lk.objToQueryStr(params)}`, headers: headers, body: body }; collectionName = collectionName || getCollectionNameById(castingId); lk.log(`获取个人产品[${collectionName}(${castingId})]拥有详情:${body}`); lk.post(url, async (error, _response, data) => { let retItemLst = []; try { if (error) { lk.log(`获取个人产品拥有详情发生错误`); lk.execFail(); lk.appendNotifyInfo(`❌获取个人产品拥有详情失败,请稍后再试`); } else { let ret = JSON.parse(data); if (ret.success) { let obj = ret.obj; retItemLst = obj.list; lk.log(`获取个人产品拥有详情成功`); } else { lk.log(`获取个人产品拥有详情失败,响应:${data}`); } } } catch (e) { lk.log(`获取个人产品拥有详情发生错误`); lk.logErr(e); lk.execFail(); } finally { resolve(retItemLst); } }); } catch (e) { lk.log(`获取个人产品拥有详情发生错误`); lk.logErr(e); resolve(); } }); } async function confirmCompositeV3(taskId, taskInfo, compositeList) { return new Promise((resolve, _reject) => { try { const headers = GCommonGandartHeads; headers['Host'] = 'api.gandart.com'; headers['Content-Type'] = 'application/json;charset=UTF-8'; let data = { taskId: Number(taskId), compositeList: compositeList, }; let body = JSON.stringify(data); let url = { url: `${config.BASE_API}/v2/composite/v3/confirmCompositeV3`, headers: headers, body: body }; let taskName = taskInfo.compositeTaskName || ''; //合成标题 lk.log(`请求合成任务[${taskName}#${taskId}]:\n${body}`); lk.post(url, async (error, _response, data) => { let retOrder; try { if (error) { lk.log(`合成发生错误`); lk.execFail(); lk.appendNotifyInfo(`❌合成失败,请稍后再试`); } else { let ret = JSON.parse(data); if (ret.success) { retOrder = ret.obj; let dismsg = `合成任务[${taskId}]成功,订单号:${retOrder}`; lk.log(dismsg); lk.appendNotifyInfo(`🎉${dismsg}`); } else { lk.log(`合成失败,响应:${data}`); let respMsg = ret.msg; if (respMsg) { if (respMsg.indexOf('合成中') > -1 || respMsg.indexOf('已合成') > -1) { lk.appendNotifyInfo(`🎉${respMsg}`); retOrder = '#HC123456789'; } else if (respMsg.indexOf('不足') > -1) { lk.appendNotifyInfo(`⚠️${respMsg}`); retOrder = '!HC123456789'; } } } } } catch (e) { lk.log(`合成发生错误`); lk.logErr(e); lk.execFail(); } finally { resolve(retOrder); } }); } catch (e) { lk.log(`合成发生错误`); lk.logErr(e); resolve(); } }); } async function checkCompositeResult(orderNum) { return new Promise((resolve, _reject) => { try { const headers = GCommonGandartHeads; headers['Host'] = 'api.gandart.com'; headers['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8'; let body = `orderNum=${orderNum}`; let url = { url: `${config.BASE_API}/v2/composite/v3/compositeResult`, headers: headers, body: body }; lk.log(`获取合成结果[${orderNum}]:${body}`); lk.post(url, async (error, _response, data) => { let retItemLst; try { if (error) { lk.log(`获取合成结果发生错误`); lk.execFail(); lk.appendNotifyInfo(`❌获取合成结果失败,请稍后再试`); } else { let ret = JSON.parse(data); if (ret.success) { lk.log(`获取合成结果成功,响应:${data}`); if (typeof ret.obj == 'object') { retItemLst = ret.obj; let cName = ''; for (let i = 0; i < retItemLst.length; i++) { cName += retItemLst[i].collectionName + ","; } cName = cName.substring(0, cName.length - 1); lk.appendNotifyInfo(`🎉合成产品:${cName}`); } else { if (ret.msg && ret.msg.length > 0) { lk.appendNotifyInfo(`🎉${ret.msg}`); } } } else { lk.log(`获取合成结果失败,响应:${data}`); } } } catch (e) { lk.log(`获取合成结果发生错误`); lk.logErr(e); lk.execFail(); } finally { resolve(retItemLst); } }); } catch (e) { lk.log(`获取合成结果发生错误`); lk.logErr(e); resolve(); } }); } function getCollectionMInfoById(castingId) { let ret; try { let clst = JSON.parse(lk.getVal(GandartConstKey.CollectionCateLst, "[]")); for (const d of clst) { if (d.castingId == castingId) { ret = d; break; } } } catch (error) { lk.logErr(error); } return ret; } function getCollectionNameById(castingId) { let name = '未获取'; let info = getCollectionMInfoById(castingId); if (info) { name = info.collectionName; } return name; } function getSign() { const now = new Date().getTime(); let s1 = now - 20000; let s2 = now; let s3 = now + 20000; let s4 = now + 40000; const sssfffeee = 'e9'; //localStorage.getItem('sssfffeee'); const aggaaa = '9'; //localStorage.getItem('aggaaa'); const yyhhhasdww = '0a'; let arr = [sssfffeee, yyhhhasdww, aggaaa, '29', 'e', 'c', 3]; let CryptoJS = createCryptoJS(); let s5 = CryptoJS.MD5(s3 + arr.join('')).toString(); return { 's1': s1, 's2': s2, 's3': s3, 's4': s4, 's5': s5 }; } //---SyncByPyScript---ToolKit-start function ToolKit(t,s,e){return new class{constructor(t,s,e){this.tgEscapeCharMapping={"&":"&","#":"#"},this.userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0.2 Safari/605.1.15",this.prefix="lk",this.name=t,this.id=s,this.data=null,this.dataFile=this.getRealPath(""+this.prefix+this.id+".dat"),this.boxJsJsonFile=this.getRealPath(""+this.prefix+this.id+".boxjs.json"),this.options=e,this.isExecComm=!1,this.isEnableLog=this.getVal(this.prefix+"IsEnableLog"+this.id),this.isEnableLog=!!this.isEmpty(this.isEnableLog)||JSON.parse(this.isEnableLog),this.isNotifyOnlyFail=this.getVal(this.prefix+"NotifyOnlyFail"+this.id),this.isNotifyOnlyFail=!this.isEmpty(this.isNotifyOnlyFail)&&JSON.parse(this.isNotifyOnlyFail),this.isEnableTgNotify=this.getVal(this.prefix+"IsEnableTgNotify"+this.id),this.isEnableTgNotify=!this.isEmpty(this.isEnableTgNotify)&&JSON.parse(this.isEnableTgNotify),this.tgNotifyUrl=this.getVal(this.prefix+"TgNotifyUrl"+this.id),this.isEnableTgNotify=this.isEnableTgNotify&&!this.isEmpty(this.tgNotifyUrl),this.costTotalStringKey=this.prefix+"CostTotalString"+this.id,this.costTotalString=this.getVal(this.costTotalStringKey),this.costTotalString=this.isEmpty(this.costTotalString)?"0,0":this.costTotalString.replace('"',""),this.costTotalMs=this.costTotalString.split(",")[0],this.execCount=this.costTotalString.split(",")[1],this.costTotalMs=this.isEmpty(this.costTotalMs)?0:parseInt(this.costTotalMs),this.execCount=this.isEmpty(this.execCount)?0:parseInt(this.execCount),this.logSeparator="\n██",this.now=new Date,this.startTime=this.now.getTime(),this.node=this.isNode()?{request:require("request")}:null,this.execStatus=!0,this.notifyInfo=[],this.log(this.name+", 开始执行!"),this.initCache(),this.checkRecordRequestBody(),this.execComm()}checkRecordRequestBody(){if(this.isRequest()){var s=$request.body;if(s){var e=$request.path;let t=this.id+"#"+e.replace("/","_");t=t.replace("?","#"),this.isQuanX()&&$prefs.setValueForKey(s,t),(this.isLoon()||this.isSurge())&&$persistentStore.write(s,t),this.isNode()&&this.node.fs.writeFileSync(t+".json",s,{flag:"w"},t=>console.log(t))}}}getRequestBody(){var t=$request.path;let s=this.id+"#"+t.replace("/","_");if(s=s.replace("?","#"),this.isSurge()||this.isLoon())return $persistentStore.read(s);if(this.isQuanX())return $prefs.valueForKey(s);if(this.isNode()){t=s+".json";if(!this.node.fs.existsSync(t))return JSON.parse(this.node.fs.readFileSync(t))}}initCache(){var t,s=this.getPersistKey();this.isQuanX()&&(this.cache=JSON.parse($prefs.valueForKey(s)||"{}")),(this.isLoon()||this.isSurge())&&(this.cache=JSON.parse($persistentStore.read(s)||"{}")),this.isNode()&&(this.node.fs.existsSync(t="root.json")||this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},t=>console.log(t)),this.root={},this.node.fs.existsSync(t=s+".json")?this.cache=JSON.parse(this.node.fs.readFileSync(s+".json")):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:"wx"},t=>console.log(t)),this.cache={}))}getPersistKey(){return this.id+"#privateCache"}persistCache(){var t=this.getPersistKey(),s=JSON.stringify(this.cache,null,2);this.isQuanX()&&$prefs.setValueForKey(s,t),(this.isLoon()||this.isSurge())&&$persistentStore.write(s,t),this.isNode()&&(this.node.fs.writeFileSync(t+".json",s,{flag:"w"},t=>console.log(t)),this.node.fs.writeFileSync("root.json",JSON.stringify(this.root,null,2),{flag:"w"},t=>console.log(t)))}write(t,s){if(this.log("SET "+s),-1!==s.indexOf("#")){if(s=s.substr(1),isSurge||this.isLoon())return $persistentStore.write(t,s);if(this.isQuanX())return $prefs.setValueForKey(t,s);this.isNode()&&(this.root[s]=t)}else this.cache[s]=t;this.persistCache()}read(t){return this.log("READ "+t),-1!==t.indexOf("#")?(t=t.substr(1),this.isSurge()||this.isLoon()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?this.root[t]:void 0):this.cache[t]}delete(t){if(this.log("DELETE "+t),-1!==t.indexOf("#")){if(t=t.substr(1),this.isSurge()||this.isLoon())return $persistentStore.write(null,t);if(this.isQuanX())return $prefs.removeValueForKey(t);this.isNode()&&delete this.root[t]}else delete this.cache[t];this.persistCache()}getRealPath(t){var s;return this.isNode()?((s=process.argv.slice(1,2)[0].split("/"))[s.length-1]=t,s.join("/")):t}getUrlHost(t){return t.slice(0,t.indexOf("/",8))}getUrlPath(t){var s=t.lastIndexOf("/")===t.length-1?-1:void 0;return t.slice(t.indexOf("/",8),s)}async execComm(){if(this.isNode()){this.comm=process.argv.slice(1);let t=!1;"p"==this.comm[1]&&(this.isExecComm=!0,this.log(`开始执行指令【${this.comm[1]}】=> 发送到手机测试脚本!`),this.isEmpty(this.options)||this.isEmpty(this.options.httpApi)?(this.log("未设置options,使用默认值"),this.isEmpty(this.options)&&(this.options={}),this.options.httpApi="ffff@10.0.0.9:6166"):/.*?@.*?:[0-9]+/.test(this.options.httpApi)||(t=!0,this.log("❌httpApi格式错误!格式:ffff@3.3.3.18:6166"),this.done()),t||this.callApi(this.comm[2]))}}callApi(t){let i=this.comm[0],s=(this.log(`获取【${i}】内容传给手机`),"");this.fs=this.fs||require("fs"),this.path=this.path||require("path");var e=this.path.resolve(i),r=this.path.resolve(process.cwd(),i),o=this.fs.existsSync(e),h=!o&&this.fs.existsSync(r);if(o||h){h=o?e:r;try{s=this.fs.readFileSync(h)}catch(t){s=""}}else s="";o={url:`http://${this.options.httpApi.split("@")[1]}/v1/scripting/evaluate`,headers:{"X-Key":""+this.options.httpApi.split("@")[0]},body:{script_text:""+s,mock_type:"cron",timeout:!this.isEmpty(t)&&5{this.log(`已将脚本【${i}】发给手机!`),this.done()})}getCallerFileNameAndLine(){let s;try{throw Error("")}catch(t){s=t}var t=s.stack.split("\n")[1];return this.path=this.path||require("path"),`[${t.substring(t.lastIndexOf(this.path.sep)+1,t.lastIndexOf(":"))}]`}getFunName(t){t=t.toString();return t=(t=t.substr("function ".length)).substr(0,t.indexOf("("))}boxJsJsonBuilder(s,r){if(this.isNode()){let i="/Users/lowking/Desktop/Scripts/lowking.boxjs.json";if(r&&r.hasOwnProperty("target_boxjs_json_path")&&(i=r.target_boxjs_json_path),this.fs.existsSync(i))if(this.isJsonObject(s)&&this.isJsonObject(r)){this.log("using node");var o=["settings","keys"],h="https://raw.githubusercontent.com/Orz-3";let e={},t="#lk{script_url}";if(r&&r.hasOwnProperty("script_url")&&(t=this.isEmpty(r.script_url)?"#lk{script_url}":r.script_url),e.id=""+this.prefix+this.id,e.name=this.name,e.desc_html=`⚠️使用说明
详情【点我查看】`,e.icons=[h+`/mini/master/Alpha/${this.id.toLocaleLowerCase()}.png`,h+`/mini/master/Color/${this.id.toLocaleLowerCase()}.png`],e.keys=[],e.settings=[{id:this.prefix+"IsEnableLog"+this.id,name:"开启/关闭日志",val:!0,type:"boolean",desc:"默认开启"},{id:this.prefix+"NotifyOnlyFail"+this.id,name:"只当执行失败才通知",val:!1,type:"boolean",desc:"默认关闭"},{id:this.prefix+"IsEnableTgNotify"+this.id,name:"开启/关闭Telegram通知",val:!1,type:"boolean",desc:"默认关闭"},{id:this.prefix+"TgNotifyUrl"+this.id,name:"Telegram通知地址",val:"",type:"text",desc:"Tg的通知地址,如:https://api.telegram.org/bot-token/sendMessage?chat_id=-100140&parse_mode=Markdown&text="}],e.author="#lk{author}",e.repo="#lk{repo}",e.script=t+"?raw=true",!this.isEmpty(s))for(var n in o){var a=o[n];if(!this.isEmpty(s[a])){if("settings"===a)for(let t=0;tt.id==e.id)[0]);0<=c?u.apps[c]=e:u.apps.push(e);let s=JSON.stringify(u,null,2);if(!this.isEmpty(r))for(const m in r){let t="";r.hasOwnProperty(m)?t=r[m]:"author"===m?t="@lowking":"repo"===m&&(t="https://github.com/lowking/Scripts"),s=s.replace(`#lk{${m}}`,t)}for(var g,y=/(?:#lk\{)(.+?)(?=\})/,S=(null!==y.exec(s)&&this.log("生成BoxJs还有未配置的参数,请参考https://github.com/lowking/Scripts/blob/master/util/example/ToolKitDemo.js#L17-L18传入参数:\n"),new Set);null!==(g=y.exec(s));)S.add(g[1]),s=s.replace(`#lk{${g[1]}}`,"");S.forEach(t=>{console.log(t+" ")}),this.fs.writeFileSync(i,s)}}}else this.log("构建BoxJsJson传入参数格式错误,请传入json对象")}}isJsonObject(t){return"object"==typeof t&&"[object object]"==Object.prototype.toString.call(t).toLowerCase()&&!t.length}appendNotifyInfo(t,s){1==s?this.notifyInfo=t:this.notifyInfo.push(t)}prependNotifyInfo(t){this.notifyInfo.splice(0,0,t)}execFail(){this.execStatus=!1}isRequest(){return"undefined"!=typeof $request}isSurge(){return"undefined"!=typeof $httpClient}isQuanX(){return"undefined"!=typeof $task}isLoon(){return"undefined"!=typeof $loon}isJSBox(){return"undefined"!=typeof $app&&"undefined"!=typeof $http}isStash(){return"undefined"!=typeof $environment&&$environment["stash-version"]}isNode(){return"function"==typeof require&&!this.isJSBox()}async sleep(s){return new Promise(t=>setTimeout(t,s))}async wait(s){return new Promise(t=>setTimeout(t,s))}async delay(s){return new Promise(t=>setTimeout(t,s))}log(t){this.isEnableLog&&console.log(""+this.logSeparator+t)}logErr(t){this.execStatus=!0,this.isEnableLog&&(console.log(""+this.logSeparator+this.name+"执行异常:"),console.log(t),console.log("\n"+t.message))}msg(t,s,e,i){if((this.isRequest()||!this.isNotifyOnlyFail||!this.execStatus)&&(this.isEmpty(s)&&(s=Array.isArray(this.notifyInfo)?this.notifyInfo.join("\n"):this.notifyInfo),!this.isEmpty(s)))if(this.isEnableTgNotify){for(var r in this.log(this.name+"Tg通知开始"),this.tgEscapeCharMapping)this.tgEscapeCharMapping.hasOwnProperty(r)&&(s=s.replace(r,this.tgEscapeCharMapping[r]));this.get({url:encodeURI(this.tgNotifyUrl+"📌"+this.name+"\n"+s)},(t,s,e)=>{this.log("Tg通知完毕")})}else{var o={},h=!this.isEmpty(e),n=!this.isEmpty(i);this.isQuanX()&&(h&&(o["open-url"]=e),n&&(o["media-url"]=i),$notify(this.name,t,s,o)),(this.isSurge()||this.isStash())&&(h&&(o.url=e),$notification.post(this.name,t,s,o)),this.isNode()&&this.log("⭐️"+this.name+"\n"+t+"\n"+s),this.isJSBox()&&$push.schedule({title:this.name,body:t?t+"\n"+s:s})}}pushWxMsg(t,s,e,i=()=>{}){s={appToken:"AT_rTc93GQYIdMU8XLRnoJaSea8WkfhSzhX",content:s,summary:t,contentType:1,topicIds:[],uids:["UID_6P4B00X6Zv8U2oKC0I2R09emxtqq"],url:"",verifyPay:!1},e&&(s.url=e),t=this.getJsonDoneHeaders(),t.Host="wxpusher.zjiecode.com",t["Content-Type"]="application/json;charset=UTF-8",e={url:"https://wxpusher.zjiecode.com/api/send/message",headers:t,body:JSON.stringify(s)};this.post(e,i)}getVal(t,s=""){let e;return(e=this.isSurge()||this.isLoon()||this.isStash()?$persistentStore.read(t):this.isQuanX()?$prefs.valueForKey(t):this.isNode()?(this.data=this.loadData(),process.env[t]||this.data[t]):this.data&&this.data[t]||null)||s}setVal(t,s){return this.isSurge()||this.isLoon()||this.isStash()?$persistentStore.write(s,t):this.isQuanX()?$prefs.setValueForKey(s,t):this.isNode()?(this.data=this.loadData(),this.data[t]=s,this.writeData(),!0):this.data&&this.data[t]||null}loadData(){if(!this.isNode())return{};this.fs=this.fs||require("fs"),this.path=this.path||require("path");var t=this.path.resolve(this.dataFile),s=this.path.resolve(process.cwd(),this.dataFile),e=this.fs.existsSync(t),i=!e&&this.fs.existsSync(s);if(!e&&!i)return{};i=e?t:s;try{return JSON.parse(this.fs.readFileSync(i))}catch(t){return{}}}writeData(){var t,s,e,i,r;this.isNode()&&(this.fs=this.fs||require("fs"),this.path=this.path||require("path"),t=this.path.resolve(this.dataFile),s=this.path.resolve(process.cwd(),this.dataFile),i=!(e=this.fs.existsSync(t))&&this.fs.existsSync(s),r=JSON.stringify(this.data),!e&&i?this.fs.writeFileSync(s,r):this.fs.writeFileSync(t,r))}adapterStatus(t){return t&&(t.status?t.statusCode=t.status:t.statusCode&&(t.status=t.statusCode)),t}get(t,i=()=>{}){this.isQuanX()&&((t="string"==typeof t?{url:t}:t).method="GET",$task.fetch(t).then(t=>{i(null,this.adapterStatus(t),t.body)},t=>i(t.error,null,null))),(this.isSurge()||this.isLoon()||this.isStash())&&$httpClient.get(t,(t,s,e)=>{i(t,this.adapterStatus(s),e)}),this.isNode()&&this.node.request(t,(t,s,e)=>{i(t,this.adapterStatus(s),e)}),this.isJSBox()&&((t="string"==typeof t?{url:t}:t).header=t.headers,t.handler=function(t){let s=t.error,e=(s=s&&JSON.stringify(t.error),t.data);"object"==typeof e&&(e=JSON.stringify(t.data)),i(s,this.adapterStatus(t.response),e)},$http.get(t))}post(t,i=()=>{}){this.isQuanX()&&((t="string"==typeof t?{url:t}:t).method="POST",$task.fetch(t).then(t=>{i(null,this.adapterStatus(t),t.body)},t=>i(t.error,null,null))),(this.isSurge()||this.isLoon()||this.isStash())&&$httpClient.post(t,(t,s,e)=>{i(t,this.adapterStatus(s),e)}),this.isNode()&&this.node.request.post(t,(t,s,e)=>{i(t,this.adapterStatus(s),e)}),this.isJSBox()&&((t="string"==typeof t?{url:t}:t).header=t.headers,t.handler=function(t){let s=t.error,e=(s=s&&JSON.stringify(t.error),t.data);"object"==typeof e&&(e=JSON.stringify(t.data)),i(s,this.adapterStatus(t.response),e)},$http.post(t))}put(t,i=()=>{}){this.isQuanX()&&((t="string"==typeof t?{url:t}:t).method="PUT",$task.fetch(t).then(t=>{i(null,this.adapterStatus(t),t.body)},t=>i(t.error,null,null))),(this.isSurge()||this.isLoon()||this.isStash())&&(t.method="PUT",$httpClient.put(t,(t,s,e)=>{i(t,this.adapterStatus(s),e)})),this.isNode()&&(t.method="PUT",this.node.request.put(t,(t,s,e)=>{i(t,this.adapterStatus(s),e)})),this.isJSBox()&&((t="string"==typeof t?{url:t}:t).header=t.headers,t.handler=function(t){let s=t.error,e=(s=s&&JSON.stringify(t.error),t.data);"object"==typeof e&&(e=JSON.stringify(t.data)),i(s,this.adapterStatus(t.response),e)},$http.post(t))}costTime(){let t=this.name+"执行完毕!";this.isNode()&&this.isExecComm&&(t=`指令【${this.comm[1]}】执行完毕!`);var s=(new Date).getTime()-this.startTime,e=s/1e3;this.execCount++,this.costTotalMs+=s,this.log(`${t}耗时【${e}】秒\n总共执行【${this.execCount}】次,平均耗时【${(this.costTotalMs/this.execCount/1e3).toFixed(4)}】秒`),this.setVal(this.costTotalStringKey,JSON.stringify(this.costTotalMs+","+this.execCount))}done(t={}){this.costTime(),(this.isSurge()||this.isQuanX()||this.isLoon()||this.isStash())&&$done(t)}getRequestUrl(){return $request.url}getResponseBody(){if($response)return $response.body}isGetCookie(t){return!("OPTIONS"==$request.method||!this.getRequestUrl().match(t))}isEmpty(t){return void 0===t||null==t||""==t||"null"==t||"undefined"==t||0===t.length}randomString(s){s=s||32;var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890",i=e.length,r="";for(let t=0;t{var s,t=t.trim();let e=null,i=!0;if(t.includes("=")?(s=t.split("="),e=s[0].trim(),i=s[1].trim()):e=t,r.includes(e))h[o]&&(h[o][e]=i,h[o].attribs[e]=i);else{o=e;let s={};o.includes(",")&&o.split(",").forEach(t=>{t=t.trim();r.includes(t)?s[t]=!0:o=t}),h[o]={name:o,value:i,attribs:s},n.push(h[o])}}),n}base64Encode(t){var s,e,i,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";let o,h,n;for(n=t.length,h=0,o="";h>2))+r.charAt((3&s)<<4)+"==";break}if(e=t.charCodeAt(h++),h==n){o=(o=(o+=r.charAt(s>>2))+r.charAt((3&s)<<4|(240&e)>>4))+r.charAt((15&e)<<2)+"=";break}i=t.charCodeAt(h++),o=(o=(o=(o+=r.charAt(s>>2))+r.charAt((3&s)<<4|(240&e)>>4))+r.charAt((15&e)<<2|(192&i)>>6))+r.charAt(63&i)}return o}base64Decode(t){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";if(/([^\s]+[^0-9a-zA-Z\+\/\=]|[^0-9a-zA-Z\+\/\=]\s+)/.test(t))throw new Error("Invalid base64 input");var e,i,r,o,h,n,a=t.replace(/\s/g,"");let l="",p=0;for(;p>2,i=(3&h)<<6|(n=s.indexOf(a.charAt(p++))),l+=String.fromCharCode(r<<2|o>>4),64!==h&&(l+=String.fromCharCode(e)),64!==n&&(l+=String.fromCharCode(i));return l=this.utf8Decode(l)}utf8Decode(s){let t=[],e=0,i=0,r=0;for(s=s.replace(/\r\n/g,"\n");e>10&1023)),t.push(String.fromCharCode(56320|1023&i))):t.push(String.fromCharCode(i)),e+=r}return t.join("")}parseJwt(t){try{var s=t.split("."),e=s[0].replace(/-/g,"+").replace(/_/g,"/"),i=this.base64Decode(e).replace(/\0/g,""),r=JSON.parse(i),o=s[1].replace(/-/g,"+").replace(/_/g,"/"),h=this.base64Decode(o).replace(/\0/g,"");return{header:r,payload:JSON.parse(h),signature:s[2]}}catch(t){return this.log(t),null}}}(t,s,e)} //---SyncByPyScript---ToolKit-end //---SyncByPyScript---CryptoJS-start function createCryptoJS(){var r=Object.getOwnPropertyNames,u=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)(function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')}),e=(e,t)=>function(){return t||(0,e[r(e)[0]])((t={exports:{}}).exports,t),t.exports},y=e({"(disabled):crypto"(){}}),n=e({"core.js"(e,t){var r,i;i=function(){var i,f=Math;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),"undefined"!=typeof self&&self.crypto&&(i=self.crypto),!(i=!(i=!(i="undefined"!=typeof globalThis&&globalThis.crypto?globalThis.crypto:i)&&"undefined"!=typeof window&&window.msCrypto?window.msCrypto:i)&&"undefined"!=typeof global&&global.crypto?global.crypto:i)&&"function"==typeof u)try{i=y()}catch(e){}var r=Object.create||function(e){return t.prototype=e,e=new t,t.prototype=null,e};function t(){}var e={},n=e.lib={},o=n.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),(t.init.prototype=t).$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},h=n.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||s).stringify(this)},concat:function(e){var t=this.words,r=e.words,i=this.sigBytes,n=e.sigBytes;if(this.clamp(),i%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[i+o>>>2]|=c<<24-(i+o)%4*8}else for(var s=0;s>>2]=r[s>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=f.ceil(t/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new h.init(r,t/2)}},a=c.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new h.init(r,t)}},d=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(a.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return a.parse(unescape(encodeURIComponent(e)))}},p=n.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new h.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t,r=this._data,i=r.words,n=r.sigBytes,o=this.blockSize,c=n/(4*o),s=(c=e?f.ceil(c):f.max((0|c)-this._minBufferSize,0))*o,e=f.min(4*s,n);if(s){for(var a=0;a>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)}).prototype=t),e.lib.WordArray},"object"==typeof(r=e)?t.exports=e=i(n()):"function"==typeof define&&define.amd?define(["./core"],i):i(r.CryptoJS)}}),s=e({"enc-utf16.js"(e,t){var r,i;i=function(e){var n=e.lib.WordArray,t=e.enc;function c(e){return e<<8&4278255360|e>>>8&16711935}return t.Utf16=t.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}},t.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=[],n=0;n>>2]>>>16-n%4*8&65535);i.push(String.fromCharCode(o))}return i.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i>>1]|=c(e.charCodeAt(i)<<16-i%2*16);return n.create(r,2*t)}},e.enc.Utf16},"object"==typeof(r=e)?t.exports=e=i(n()):"function"==typeof define&&define.amd?define(["./core"],i):i(r.CryptoJS)}}),a=e({"enc-base64.js"(e,t){var r,i;i=function(e){var u;return u=e.lib.WordArray,e.enc.Base64={stringify:function(e){for(var t=e.words,r=e.sigBytes,i=this._map,n=(e.clamp(),[]),o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var a=i.charAt(64);if(a)for(;n.length%4;)n.push(a);return n.join("")},parse:function(e){var t=e.length,r=this._map;if(!(i=this._reverseMap))for(var i=this._reverseMap=[],n=0;n>>6-l%4*2,d[p>>>2]|=(o|c)<<24-p%4*8,p++);return u.create(d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"==typeof(r=e)?t.exports=e=i(n()):"function"==typeof define&&define.amd?define(["./core"],i):i(r.CryptoJS)}}),f=e({"enc-base64url.js"(e,t){var r,i;i=function(e){var u;return u=e.lib.WordArray,e.enc.Base64url={stringify:function(e,t=!0){for(var r=e.words,i=e.sigBytes,n=t?this._safe_map:this._map,o=(e.clamp(),[]),c=0;c>>2]>>>24-c%4*8&255)<<16|(r[c+1>>>2]>>>24-(c+1)%4*8&255)<<8|r[c+2>>>2]>>>24-(c+2)%4*8&255,a=0;a<4&&c+.75*a>>6*(3-a)&63));var f=n.charAt(64);if(f)for(;o.length%4;)o.push(f);return o.join("")},parse:function(e,t=!0){var r=e.length,i=t?this._safe_map:this._map;if(!(n=this._reverseMap))for(var n=this._reverseMap=[],o=0;o>>6-l%4*2,d[p>>>2]|=(c|s)<<24-p%4*8,p++);return u.create(d,p)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},e.enc.Base64url},"object"==typeof(r=e)?t.exports=e=i(n()):"function"==typeof define&&define.amd?define(["./core"],i):i(r.CryptoJS)}}),h=e({"md5.js"(e,t){var r,i;i=function(e){for(var a=Math,t=e,r=(n=t.lib).WordArray,i=n.Hasher,n=t.algo,C=[],o=0;o<64;o++)C[o]=4294967296*a.abs(a.sin(o+1))|0;function A(e,t,r,i,n,o,c){e=e+(t&r|~t&i)+n+c;return(e<>>32-o)+t}function H(e,t,r,i,n,o,c){e=e+(t&i|r&~i)+n+c;return(e<>>32-o)+t}function j(e,t,r,i,n,o,c){e=e+(t^r^i)+n+c;return(e<>>32-o)+t}function z(e,t,r,i,n,o,c){e=e+(r^(t|~i))+n+c;return(e<>>32-o)+t}return n=n.MD5=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var i=t+r,n=e[i];e[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,c=e[t+0],s=e[t+1],a=e[t+2],f=e[t+3],h=e[t+4],d=e[t+5],p=e[t+6],l=e[t+7],u=e[t+8],y=e[t+9],_=e[t+10],v=e[t+11],g=e[t+12],B=e[t+13],m=e[t+14],w=e[t+15],b=A(o[0],x=o[1],S=o[2],k=o[3],c,7,C[0]),k=A(k,b,x,S,s,12,C[1]),S=A(S,k,b,x,a,17,C[2]),x=A(x,S,k,b,f,22,C[3]);b=A(b,x,S,k,h,7,C[4]),k=A(k,b,x,S,d,12,C[5]),S=A(S,k,b,x,p,17,C[6]),x=A(x,S,k,b,l,22,C[7]),b=A(b,x,S,k,u,7,C[8]),k=A(k,b,x,S,y,12,C[9]),S=A(S,k,b,x,_,17,C[10]),x=A(x,S,k,b,v,22,C[11]),b=A(b,x,S,k,g,7,C[12]),k=A(k,b,x,S,B,12,C[13]),S=A(S,k,b,x,m,17,C[14]),b=H(b,x=A(x,S,k,b,w,22,C[15]),S,k,s,5,C[16]),k=H(k,b,x,S,p,9,C[17]),S=H(S,k,b,x,v,14,C[18]),x=H(x,S,k,b,c,20,C[19]),b=H(b,x,S,k,d,5,C[20]),k=H(k,b,x,S,_,9,C[21]),S=H(S,k,b,x,w,14,C[22]),x=H(x,S,k,b,h,20,C[23]),b=H(b,x,S,k,y,5,C[24]),k=H(k,b,x,S,m,9,C[25]),S=H(S,k,b,x,f,14,C[26]),x=H(x,S,k,b,u,20,C[27]),b=H(b,x,S,k,B,5,C[28]),k=H(k,b,x,S,a,9,C[29]),S=H(S,k,b,x,l,14,C[30]),b=j(b,x=H(x,S,k,b,g,20,C[31]),S,k,d,4,C[32]),k=j(k,b,x,S,u,11,C[33]),S=j(S,k,b,x,v,16,C[34]),x=j(x,S,k,b,m,23,C[35]),b=j(b,x,S,k,s,4,C[36]),k=j(k,b,x,S,h,11,C[37]),S=j(S,k,b,x,l,16,C[38]),x=j(x,S,k,b,_,23,C[39]),b=j(b,x,S,k,B,4,C[40]),k=j(k,b,x,S,c,11,C[41]),S=j(S,k,b,x,f,16,C[42]),x=j(x,S,k,b,p,23,C[43]),b=j(b,x,S,k,y,4,C[44]),k=j(k,b,x,S,g,11,C[45]),S=j(S,k,b,x,w,16,C[46]),b=z(b,x=j(x,S,k,b,a,23,C[47]),S,k,c,6,C[48]),k=z(k,b,x,S,l,10,C[49]),S=z(S,k,b,x,m,15,C[50]),x=z(x,S,k,b,d,21,C[51]),b=z(b,x,S,k,g,6,C[52]),k=z(k,b,x,S,f,10,C[53]),S=z(S,k,b,x,_,15,C[54]),x=z(x,S,k,b,s,21,C[55]),b=z(b,x,S,k,u,6,C[56]),k=z(k,b,x,S,w,10,C[57]),S=z(S,k,b,x,p,15,C[58]),x=z(x,S,k,b,B,21,C[59]),b=z(b,x,S,k,h,6,C[60]),k=z(k,b,x,S,v,10,C[61]),S=z(S,k,b,x,a,15,C[62]),x=z(x,S,k,b,y,21,C[63]),o[0]=o[0]+b|0,o[1]=o[1]+x|0,o[2]=o[2]+S|0,o[3]=o[3]+k|0},_doFinalize:function(){for(var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes,n=(t[i>>>5]|=128<<24-i%32,a.floor(r/4294967296)),n=(t[15+(64+i>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t[14+(64+i>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process(),this._hash),o=n.words,c=0;c<4;c++){var s=o[c];o[c]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return n},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}}),t.MD5=i._createHelper(n),t.HmacMD5=i._createHmacHelper(n),e.MD5},"object"==typeof(r=e)?t.exports=e=i(n()):"function"==typeof define&&define.amd?define(["./core"],i):i(r.CryptoJS)}}),d=e({"sha1.js"(e,t){var r,i;i=function(e){var t,r,i,n,h;return r=(t=e).lib,i=r.WordArray,n=r.Hasher,r=t.algo,h=[],r=r.SHA1=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],c=r[3],s=r[4],a=0;a<80;a++){h[a]=a<16?0|e[t+a]:(f=h[a-3]^h[a-8]^h[a-14]^h[a-16])<<1|f>>>31;var f=(i<<5|i>>>27)+s+h[a];f+=a<20?1518500249+(n&o|~n&c):a<40?1859775393+(n^o^c):a<60?(n&o|n&c|o&c)-1894007588:(n^o^c)-899497514,s=c,c=o,o=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+c|0,r[4]=r[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(64+i>>>9<<4)]=Math.floor(r/4294967296),t[15+(64+i>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=n._createHelper(r),t.HmacSHA1=n._createHmacHelper(r),e.SHA1},"object"==typeof(r=e)?t.exports=e=i(n()):"function"==typeof define&&define.amd?define(["./core"],i):i(r.CryptoJS)}}),p=e({"sha256.js"(e,t){var r,i;i=function(e){var n=Math,t=e,r=(o=t.lib).WordArray,i=o.Hasher,o=t.algo,c=[],u=[];function s(e){return 4294967296*(e-(0|e))|0}for(var a=2,f=0;f<64;)!function(e){for(var t=n.sqrt(e),r=2;r<=t;r++)if(!(e%r))return;return 1}(a)||(f<8&&(c[f]=s(n.pow(a,.5))),u[f]=s(n.pow(a,1/3)),f++),a++;var y=[],o=o.SHA256=i.extend({_doReset:function(){this._hash=new r.init(c.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],c=r[3],s=r[4],a=r[5],f=r[6],h=r[7],d=0;d<64;d++){y[d]=d<16?0|e[t+d]:(((p=y[d-15])<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+y[d-7]+(((p=y[d-2])<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+y[d-16];var p=i&n^i&o^n&o,l=h+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&a^~s&f)+u[d]+y[d],h=f,f=a,a=s,s=c+l|0,c=o,o=n,n=i,i=l+(((i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22))+p)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+c|0,r[4]=r[4]+s|0,r[5]=r[5]+a|0,r[6]=r[6]+f|0,r[7]=r[7]+h|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(64+i>>>9<<4)]=n.floor(r/4294967296),t[15+(64+i>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});return t.SHA256=i._createHelper(o),t.HmacSHA256=i._createHmacHelper(o),e.SHA256},"object"==typeof(r=e)?t.exports=e=i(n()):"function"==typeof define&&define.amd?define(["./core"],i):i(r.CryptoJS)}}),l=e({"sha224.js"(e,t){var r,i;i=function(e){var t,r,i,n;return r=(t=e).lib.WordArray,i=t.algo,n=i.SHA256,i=i.SHA224=n.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=4,e}}),t.SHA224=n._createHelper(i),t.HmacSHA224=n._createHmacHelper(i),e.SHA224},"object"==typeof(r=e)?t.exports=e=i(n(),p()):"function"==typeof define&&define.amd?define(["./core","./sha256"],i):i(r.CryptoJS)}}),_=e({"sha512.js"(e,t){var r,i;i=function(e){var t=e,r=t.lib.Hasher,i=(o=t.x64).Word,n=o.WordArray,o=t.algo;function c(){return i.create.apply(i,arguments)}for(var t1=[c(1116352408,3609767458),c(1899447441,602891725),c(3049323471,3964484399),c(3921009573,2173295548),c(961987163,4081628472),c(1508970993,3053834265),c(2453635748,2937671579),c(2870763221,3664609560),c(3624381080,2734883394),c(310598401,1164996542),c(607225278,1323610764),c(1426881987,3590304994),c(1925078388,4068182383),c(2162078206,991336113),c(2614888103,633803317),c(3248222580,3479774868),c(3835390401,2666613458),c(4022224774,944711139),c(264347078,2341262773),c(604807628,2007800933),c(770255983,1495990901),c(1249150122,1856431235),c(1555081692,3175218132),c(1996064986,2198950837),c(2554220882,3999719339),c(2821834349,766784016),c(2952996808,2566594879),c(3210313671,3203337956),c(3336571891,1034457026),c(3584528711,2466948901),c(113926993,3758326383),c(338241895,168717936),c(666307205,1188179964),c(773529912,1546045734),c(1294757372,1522805485),c(1396182291,2643833823),c(1695183700,2343527390),c(1986661051,1014477480),c(2177026350,1206759142),c(2456956037,344077627),c(2730485921,1290863460),c(2820302411,3158454273),c(3259730800,3505952657),c(3345764771,106217008),c(3516065817,3606008344),c(3600352804,1432725776),c(4094571909,1467031594),c(275423344,851169720),c(430227734,3100823752),c(506948616,1363258195),c(659060556,3750685593),c(883997877,3785050280),c(958139571,3318307427),c(1322822218,3812723403),c(1537002063,2003034995),c(1747873779,3602036899),c(1955562222,1575990012),c(2024104815,1125592928),c(2227730452,2716904306),c(2361852424,442776044),c(2428436474,593698344),c(2756734187,3733110249),c(3204031479,2999351573),c(3329325298,3815920427),c(3391569614,3928383900),c(3515267271,566280711),c(3940187606,3454069534),c(4118630271,4000239992),c(116418474,1914138554),c(174292421,2731055270),c(289380356,3203993006),c(460393269,320620315),c(685471733,587496836),c(852142971,1086792851),c(1017036298,365543100),c(1126000580,2618297676),c(1288033470,3409855158),c(1501505948,4234509866),c(1607167915,987167468),c(1816402316,1246189591)],r1=[],s=0;s<80;s++)r1[s]=c();return o=o.SHA512=r.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(P,F){for(var e=this._hash.words,t=e[0],r=e[1],i=e[2],n=e[3],o=e[4],c=e[5],s=e[6],e=e[7],W=t.high,a=t.low,O=r.high,f=r.low,I=i.high,h=i.low,U=n.high,d=n.low,K=o.high,p=o.low,X=c.high,l=c.low,L=s.high,u=s.low,T=e.high,y=e.low,_=W,v=a,g=O,B=f,m=I,w=h,q=U,b=d,k=K,S=p,N=X,x=l,Z=L,G=u,V=T,Q=y,C=0;C<80;C++)var A,H,j=r1[C],z=(C<16?(H=j.high=0|P[F+2*C],A=j.low=0|P[F+2*C+1]):(J=(M=r1[C-15]).high,M=M.low,R=(E=r1[C-2]).high,E=E.low,D=(z=r1[C-7]).high,z=z.low,$=(Y=r1[C-16]).high,H=(H=((J>>>1|M<<31)^(J>>>8|M<<24)^J>>>7)+D+((A=(D=(M>>>1|J<<31)^(M>>>8|J<<24)^(M>>>7|J<<25))+z)>>>0>>0?1:0))+((R>>>19|E<<13)^(R<<3|E>>>29)^R>>>6)+((A+=M=(E>>>19|R<<13)^(E<<3|R>>>29)^(E>>>6|R<<26))>>>0>>0?1:0),A+=J=Y.low,j.high=H=H+$+(A>>>0>>0?1:0),j.low=A),k&N^~k&Z),D=S&x^~S&G,E=_&g^_&m^g&m,R=(v>>>28|_<<4)^(v<<30|_>>>2)^(v<<25|_>>>7),M=t1[C],Y=M.high,$=M.low,J=Q+((S>>>14|k<<18)^(S>>>18|k<<14)^(S<<23|k>>>9)),j=V+((k>>>14|S<<18)^(k>>>18|S<<14)^(k<<23|S>>>9))+(J>>>0>>0?1:0),e1=R+(v&B^v&w^B&w),V=Z,Q=G,Z=N,G=x,N=k,x=S,k=q+(j=j+z+((J=J+D)>>>0>>0?1:0)+Y+((J=J+$)>>>0<$>>>0?1:0)+H+((J=J+A)>>>0>>0?1:0))+((S=b+J|0)>>>0>>0?1:0)|0,q=m,b=w,m=g,w=B,g=_,B=v,_=j+(((_>>>28|v<<4)^(_<<30|v>>>2)^(_<<25|v>>>7))+E+(e1>>>0>>0?1:0))+((v=J+e1|0)>>>0>>0?1:0)|0;a=t.low=a+v,t.high=W+_+(a>>>0>>0?1:0),f=r.low=f+B,r.high=O+g+(f>>>0>>0?1:0),h=i.low=h+w,i.high=I+m+(h>>>0>>0?1:0),d=n.low=d+b,n.high=U+q+(d>>>0>>0?1:0),p=o.low=p+S,o.high=K+k+(p>>>0>>0?1:0),l=c.low=l+x,c.high=X+N+(l>>>0>>0?1:0),u=s.low=u+G,s.high=L+Z+(u>>>0>>0?1:0),y=e.low=y+Q,e.high=T+V+(y>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[30+(128+i>>>10<<5)]=Math.floor(r/4294967296),t[31+(128+i>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=r._createHelper(o),t.HmacSHA512=r._createHmacHelper(o),e.SHA512},"object"==typeof(r=e)?t.exports=e=i(n(),o()):"function"==typeof define&&define.amd?define(["./core","./x64-core"],i):i(r.CryptoJS)}}),v=e({"sha384.js"(e,t){var r,i;i=function(e){var t,r,i,n,o;return r=(t=e).x64,i=r.Word,n=r.WordArray,r=t.algo,o=r.SHA512,r=r.SHA384=o.extend({_doReset:function(){this._hash=new n.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=16,e}}),t.SHA384=o._createHelper(r),t.HmacSHA384=o._createHmacHelper(r),e.SHA384},"object"==typeof(r=e)?t.exports=e=i(n(),o(),_()):"function"==typeof define&&define.amd?define(["./core","./x64-core","./sha512"],i):i(r.CryptoJS)}}),g=e({"sha3.js"(e,t){var r,i;i=function(e){for(var h=Math,t=e,d=(n=t.lib).WordArray,i=n.Hasher,r=t.x64.Word,n=t.algo,C=[],A=[],H=[],o=1,c=0,s=0;s<24;s++){C[o+5*c]=(s+1)*(s+2)/2%64;var a=(2*o+3*c)%5;o=c%5,c=a}for(o=0;o<5;o++)for(c=0;c<5;c++)A[o+5*c]=c+(2*o+3*c)%5*5;for(var f=1,p=0;p<24;p++){for(var l,u=0,y=0,_=0;_<7;_++)1&f&&((l=(1<<_)-1)<32?y^=1<>>24)|4278255360&(o<<24|o>>>8);(b=r[n]).high^=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),b.low^=o}for(var s=0;s<24;s++){for(var a=0;a<5;a++){for(var f=0,h=0,d=0;d<5;d++)f^=(b=r[a+5*d]).high,h^=b.low;var p=j[a];p.high=f,p.low=h}for(a=0;a<5;a++)for(var l=j[(a+4)%5],u=j[(a+1)%5],y=u.high,u=u.low,f=l.high^(y<<1|u>>>31),h=l.low^(u<<1|y>>>31),d=0;d<5;d++)(b=r[a+5*d]).high^=f,b.low^=h;for(var _=1;_<25;_++){var v=(b=r[_]).high,g=b.low,B=C[_],v=(h=B<32?(f=v<>>32-B,g<>>32-B):(f=g<>>64-B,v<>>64-B),j[A[_]]);v.high=f,v.low=h}var m=j[0],w=r[0];m.high=w.high,m.low=w.low;for(a=0;a<5;a++)for(d=0;d<5;d++){var b=r[_=a+5*d],k=j[_],S=j[(a+1)%5+5*d],x=j[(a+2)%5+5*d];b.high=k.high^~S.high&x.high,b.low=k.low^~S.low&x.low}b=r[0],m=H[s];b.high^=m.high,b.low^=m.low}},_doFinalize:function(){for(var e=this._data,t=e.words,r=(this._nDataBytes,8*e.sigBytes),i=32*this.blockSize,n=(t[r>>>5]|=1<<24-r%32,t[(h.ceil((1+r)/i)*i>>>5)-1]|=128,e.sigBytes=4*t.length,this._process(),this._state),r=this.cfg.outputLength/8,o=r/8,c=[],s=0;s>>24)|4278255360&(f<<24|f>>>8);c.push(16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)),c.push(f)}return new d.init(c,r)},clone:function(){for(var e=i.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}}),t.SHA3=i._createHelper(n),t.HmacSHA3=i._createHmacHelper(n),e.SHA3},"object"==typeof(r=e)?t.exports=e=i(n(),o()):"function"==typeof define&&define.amd?define(["./core","./x64-core"],i):i(r.CryptoJS)}}),B=e({"ripemd160.js"(e,t){var r,i;i=function(e){function k(e,t,r){return e&t|~e&r}function S(e,t,r){return e&r|t&~r}function x(e,t){return e<>>32-t}var t,r,i,n,C,A,H,j,z,D;return Math,r=(t=e).lib,i=r.WordArray,n=r.Hasher,r=t.algo,C=i.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),A=i.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),H=i.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),j=i.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),z=i.create([0,1518500249,1859775393,2400959708,2840853838]),D=i.create([1352829926,1548603684,1836072691,2053994217,0]),r=r.RIPEMD160=n.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var i=t+r,n=e[i];e[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}for(var o,c,s,a,f,h,d=this._hash.words,p=z.words,l=D.words,u=C.words,y=A.words,_=H.words,v=j.words,g=o=d[0],B=c=d[1],m=s=d[2],w=a=d[3],b=f=d[4],r=0;r<80;r+=1)h=(h=x(h=(h=o+e[t+u[r]]|0)+(r<16?(c^s^a)+p[0]:r<32?k(c,s,a)+p[1]:r<48?((c|~s)^a)+p[2]:r<64?S(c,s,a)+p[3]:(c^(s|~a))+p[4])|0,_[r]))+f|0,o=f,f=a,a=x(s,10),s=c,c=h,h=(h=x(h=(h=g+e[t+y[r]]|0)+(r<16?(B^(m|~w))+l[0]:r<32?S(B,m,w)+l[1]:r<48?((B|~m)^w)+l[2]:r<64?k(B,m,w)+l[3]:(B^m^w)+l[4])|0,v[r]))+b|0,g=b,b=w,w=x(m,10),m=B,B=h;h=d[1]+s+w|0,d[1]=d[2]+a+b|0,d[2]=d[3]+f+g|0,d[3]=d[4]+o+B|0,d[4]=d[0]+c+m|0,d[0]=h},_doFinalize:function(){for(var e=this._data,t=e.words,r=8*this._nDataBytes,i=8*e.sigBytes,i=(t[i>>>5]|=128<<24-i%32,t[14+(64+i>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process(),this._hash),n=i.words,o=0;o<5;o++){var c=n[o];n[o]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return i},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}}),t.RIPEMD160=n._createHelper(r),t.HmacRIPEMD160=n._createHmacHelper(r),e.RIPEMD160},"object"==typeof(r=e)?t.exports=e=i(n()):"function"==typeof define&&define.amd?define(["./core"],i):i(r.CryptoJS)}}),m=e({"hmac.js"(e,t){var r,i;i=function(e){var t,s;t=e.lib.Base,s=e.enc.Utf8,e.algo.HMAC=t.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=s.parse(t));for(var r=e.blockSize,i=4*r,e=((t=t.sigBytes>i?e.finalize(t):t).clamp(),this._oKey=t.clone()),t=this._iKey=t.clone(),n=e.words,o=t.words,c=0;c>>2];e.sigBytes-=t}},t.BlockCipher=d.extend({cfg:d.cfg.extend({mode:p,padding:a}),reset:function(){d.reset.call(this);var e,t=this.cfg,r=t.iv,t=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=t.createEncryptor:(e=t.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,r&&r.words):(this._mode=e.call(t,this,r&&r.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4}),l=t.CipherParams=r.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),p=(e.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,e=e.salt,e=e?s.create([1398893684,1701076831]).concat(e).concat(t):t;return e.toString(f)},parse:function(e){var t,e=f.parse(e),r=e.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=s.create(r.slice(2,4)),r.splice(0,4),e.sigBytes-=16),l.create({ciphertext:e,salt:t})}},u=t.SerializableCipher=r.extend({cfg:r.extend({format:p}),encrypt:function(e,t,r,i){i=this.cfg.extend(i);var n=e.createEncryptor(r,i),t=n.finalize(t),n=n.cfg;return l.create({ciphertext:t,key:r,iv:n.iv,algorithm:e,mode:n.mode,padding:n.padding,blockSize:e.blockSize,formatter:i.format})},decrypt:function(e,t,r,i){return i=this.cfg.extend(i),t=this._parse(t,i.format),e.createDecryptor(r,i).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),a=(e.kdf={}).OpenSSL={execute:function(e,t,r,i){i=i||s.random(8);e=h.create({keySize:t+r}).compute(e,i),r=s.create(e.words.slice(t),4*r);return e.sigBytes=4*t,l.create({key:e,iv:r,salt:i})}},y=t.PasswordBasedCipher=u.extend({cfg:u.cfg.extend({kdf:a}),encrypt:function(e,t,r,i){r=(i=this.cfg.extend(i)).kdf.execute(r,e.keySize,e.ivSize),i.iv=r.iv,e=u.encrypt.call(this,e,t,r.key,i);return e.mixIn(r),e},decrypt:function(e,t,r,i){i=this.cfg.extend(i),t=this._parse(t,i.format);r=i.kdf.execute(r,e.keySize,e.ivSize,t.salt);return i.iv=r.iv,u.decrypt.call(this,e,t,r.key,i)}}))},"object"==typeof(r=e)?t.exports=e=i(n(),b()):"function"==typeof define&&define.amd?define(["./core","./evpkdf"],i):i(r.CryptoJS)}}),S=e({"mode-cfb.js"(e,t){var r,i;i=function(e){function o(e,t,r,i){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,i.encryptBlock(n,0);for(var c=0;c>24&255)?(r=e>>8&255,i=255&e,255===(t=e>>16&255)?(t=0,255===r?(r=0,255===i?i=0:++i):++r):++t,e=0,e=(e+=t<<16)+(r<<8)+i):e+=1<<24,e}var t,r;return e.mode.CTRGladman=(t=e.lib.BlockCipherMode.extend(),r=t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._counter,c=(n&&(o=this._counter=n.slice(0),this._iv=void 0),0===((n=o)[0]=a(n[0]))&&(n[1]=a(n[1])),o.slice(0));r.encryptBlock(c,0);for(var s=0;s>>2]|=t<<24-r%4*8,e.sigBytes+=t},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"==typeof(r=e)?t.exports=e=i(n(),k()):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)}}),z=e({"pad-iso10126.js"(e,t){var r,i;i=function(r){return r.pad.Iso10126={pad:function(e,t){t*=4,t-=e.sigBytes%t;e.concat(r.lib.WordArray.random(t-1)).concat(r.lib.WordArray.create([t<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126},"object"==typeof(r=e)?t.exports=e=i(n(),k()):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)}}),D=e({"pad-iso97971.js"(e,t){var r,i;i=function(r){return r.pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971},"object"==typeof(r=e)?t.exports=e=i(n(),k()):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)}}),E=e({"pad-zeropadding.js"(e,t){var r,i;i=function(e){return e.pad.ZeroPadding={pad:function(e,t){t*=4;e.clamp(),e.sigBytes+=t-(e.sigBytes%t||t)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1,r=e.sigBytes-1;0<=r;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},e.pad.ZeroPadding},"object"==typeof(r=e)?t.exports=e=i(n(),k()):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)}}),R=e({"pad-nopadding.js"(e,t){var r,i;i=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"==typeof(r=e)?t.exports=e=i(n(),k()):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)}}),M=e({"format-hex.js"(e,t){var r,i;i=function(e){var t,r;return t=e.lib.CipherParams,r=e.enc.Hex,e.format.Hex={stringify:function(e){return e.ciphertext.toString(r)},parse:function(e){e=r.parse(e);return t.create({ciphertext:e})}},e.format.Hex},"object"==typeof(r=e)?t.exports=e=i(n(),k()):"function"==typeof define&&define.amd?define(["./core","./cipher-core"],i):i(r.CryptoJS)}}),J=e({"aes.js"(e,t){var r,i;i=function(e){for(var t=e,r=t.lib.BlockCipher,i=t.algo,f=[],n=[],o=[],c=[],s=[],a=[],h=[],d=[],p=[],l=[],u=[],y=0;y<256;y++)u[y]=y<128?y<<1:y<<1^283;for(var _=0,v=0,y=0;y<256;y++){var g=v^v<<1^v<<2^v<<3^v<<4,B=u[n[f[_]=g=g>>>8^255&g^99]=_],m=u[B],w=u[m],b=257*u[g]^16843008*g;o[_]=b<<24|b>>>8,c[_]=b<<16|b>>>16,s[_]=b<<8|b>>>24,a[_]=b,h[g]=(b=16843009*w^65537*m^257*B^16843008*_)<<24|b>>>8,d[g]=b<<16|b>>>16,p[g]=b<<8|b>>>24,l[g]=b,_?(_=B^u[u[u[w^B]]],v^=u[u[v]]):_=v=1}var k=[0,1,2,4,8,16,32,64,128,27,54],i=i.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,i=4*(1+(this._nRounds=6+r)),n=this._keySchedule=[],o=0;o>>24]<<24|f[a>>>16&255]<<16|f[a>>>8&255]<<8|f[255&a]):(a=f[(a=a<<8|a>>>24)>>>24]<<24|f[a>>>16&255]<<16|f[a>>>8&255]<<8|f[255&a],a^=k[o/r|0]<<24),n[o]=n[o-r]^a);for(var c=this._invKeySchedule=[],s=0;s>>24]]^d[f[a>>>16&255]]^p[f[a>>>8&255]]^l[f[255&a]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,c,s,a,f)},decryptBlock:function(e,t){var r=e[t+1],r=(e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,h,d,p,l,n),e[t+1]);e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,i,n,o,c,s){for(var a=this._nRounds,f=e[t]^r[0],h=e[t+1]^r[1],d=e[t+2]^r[2],p=e[t+3]^r[3],l=4,u=1;u>>24]^n[h>>>16&255]^o[d>>>8&255]^c[255&p]^r[l++],_=i[h>>>24]^n[d>>>16&255]^o[p>>>8&255]^c[255&f]^r[l++],v=i[d>>>24]^n[p>>>16&255]^o[f>>>8&255]^c[255&h]^r[l++],g=i[p>>>24]^n[f>>>16&255]^o[h>>>8&255]^c[255&d]^r[l++],f=y,h=_,d=v,p=g;y=(s[f>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&p])^r[l++],_=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[p>>>8&255]<<8|s[255&f])^r[l++],v=(s[d>>>24]<<24|s[p>>>16&255]<<16|s[f>>>8&255]<<8|s[255&h])^r[l++],g=(s[p>>>24]<<24|s[f>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^r[l++];e[t]=y,e[t+1]=_,e[t+2]=v,e[t+3]=g},keySize:8});return t.AES=r._createHelper(i),e.AES},"object"==typeof(r=e)?t.exports=e=i(n(),a(),h(),b(),k()):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)}}),P=e({"tripledes.js"(e,t){var r,i;i=function(e){var t=e,i=(r=t.lib).WordArray,r=r.BlockCipher,n=t.algo,f=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],h=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],d=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],p=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],o=n.DES=r.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var i=f[r]-1;t[r]=e[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],o=0;o<16;o++){for(var c=n[o]=[],s=d[o],r=0;r<24;r++)c[r/6|0]|=t[(h[r]-1+s)%28]<<31-r%6,c[4+(r/6|0)]|=t[28+(h[r+24]-1+s)%28]<<31-r%6;c[0]=c[0]<<1|c[0]>>>31;for(r=1;r<7;r++)c[r]=c[r]>>>4*(r-1)+3;c[7]=c[7]<<5|c[7]>>>27}for(var a=this._invSubKeys=[],r=0;r<16;r++)a[r]=n[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],u.call(this,4,252645135),u.call(this,16,65535),y.call(this,2,858993459),y.call(this,8,16711935),u.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],o=this._lBlock,c=this._rBlock,s=0,a=0;a<8;a++)s|=p[a][((c^n[a])&l[a])>>>0];this._lBlock=c,this._rBlock=o^s}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,u.call(this,1,1431655765),y.call(this,8,16711935),y.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(e,t){t=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=t,this._lBlock^=t<>>e^this._lBlock)&t;this._lBlock^=t,this._rBlock^=t<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),e=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=o.createEncryptor(i.create(t)),this._des2=o.createEncryptor(i.create(r)),this._des3=o.createEncryptor(i.create(e))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2}),t.TripleDES=r._createHelper(n),e.TripleDES},"object"==typeof(r=e)?t.exports=e=i(n(),a(),h(),b(),k()):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)}}),F=e({"rc4.js"(e,t){var r,i;i=function(e){var t=e,r=t.lib.StreamCipher,i=t.algo,n=i.RC4=r.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,i=this._S=[],n=0;n<256;n++)i[n]=n;for(var n=0,o=0;n<256;n++){var c=n%r,c=t[c>>>2]>>>24-c%4*8&255,o=(o+i[n]+c)%256,c=i[n];i[n]=i[o],i[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,i=0,n=0;n<4;n++){var r=(r+e[t=(t+1)%256])%256,o=e[t];e[t]=e[r],e[r]=o,i|=e[(e[t]+e[r])%256]<<24-8*n}return this._i=t,this._j=r,i}return t.RC4=r._createHelper(n),i=i.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var e=this.cfg.drop;0>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,o=i>>>16;s[r]=((n*n>>>17)+n*o>>>15)+o*o^((4294901760&i)*i|0)+((65535&i)*i|0)}e[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,e[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,e[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,e[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,e[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,e[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,e[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,e[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}var t,r,i,n,c,s;return r=(t=e).lib.StreamCipher,i=t.algo,n=[],c=[],s=[],i=i.Rabbit=r.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);for(var i=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]],r=this._b=0;r<4;r++)a.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(t){var t=t.words,o=t[0],t=t[1],o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8),c=o>>>16|4294901760&t,s=t<<16|65535&o;n[0]^=o,n[1]^=c,n[2]^=t,n[3]^=s,n[4]^=o,n[5]^=c,n[6]^=t,n[7]^=s;for(r=0;r<4;r++)a.call(this)}},_doProcessBlock:function(e,t){var r=this._X;a.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),e[t+i]^=n[i]},blockSize:4,ivSize:2}),t.Rabbit=r._createHelper(i),e.Rabbit},"object"==typeof(r=e)?t.exports=e=i(n(),a(),h(),b(),k()):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)}}),O=e({"rabbit-legacy.js"(e,t){var r,i;i=function(e){function s(){for(var e=this._X,t=this._C,r=0;r<8;r++)c[r]=t[r];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0;for(r=0;r<8;r++){var i=e[r]+t[r],n=65535&i,o=i>>>16;a[r]=((n*n>>>17)+n*o>>>15)+o*o^((4294901760&i)*i|0)+((65535&i)*i|0)}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}var t,r,i,n,c,a;return r=(t=e).lib.StreamCipher,i=t.algo,n=[],c=[],a=[],i=i.RabbitLegacy=r.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]],n=this._b=0;n<4;n++)s.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var e=t.words,t=e[0],e=e[1],t=16711935&(t<<8|t>>>24)|4278255360&(t<<24|t>>>8),e=16711935&(e<<8|e>>>24)|4278255360&(e<<24|e>>>8),o=t>>>16|4294901760&e,c=e<<16|65535&t;i[0]^=t,i[1]^=o,i[2]^=e,i[3]^=c,i[4]^=t,i[5]^=o,i[6]^=e,i[7]^=c;for(n=0;n<4;n++)s.call(this)}},_doProcessBlock:function(e,t){var r=this._X;s.call(this),n[0]=r[0]^r[5]>>>16^r[3]<<16,n[1]=r[2]^r[7]>>>16^r[5]<<16,n[2]=r[4]^r[1]>>>16^r[7]<<16,n[3]=r[6]^r[3]>>>16^r[1]<<16;for(var i=0;i<4;i++)n[i]=16711935&(n[i]<<8|n[i]>>>24)|4278255360&(n[i]<<24|n[i]>>>8),e[t+i]^=n[i]},blockSize:4,ivSize:2}),t.RabbitLegacy=r._createHelper(i),e.RabbitLegacy},"object"==typeof(r=e)?t.exports=e=i(n(),a(),h(),b(),k()):"function"==typeof define&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],i):i(r.CryptoJS)}});return e({"index.js"(e,t){var r,i;i=function(e){return e},"object"==typeof(r=e)?t.exports=e=i(n(),o(),c(),s(),a(),f(),h(),d(),p(),l(),_(),v(),g(),B(),m(),w(),b(),k(),S(),x(),C(),A(),H(),j(),z(),D(),E(),R(),M(),J(),P(),F(),W(),O()):"function"==typeof define&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy"],i):r.CryptoJS=r.CryptoJS}})()} //---SyncByPyScript---CryptoJS-end