diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 612aa75..9dc5845 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -21,9 +21,9 @@ jobs: uses: softprops/action-gh-release@v1 with: prerelease: false - tag_name: v4.4.7 - name: 4.4.7 - body: '- 优化:Freeanywhere获取没有剩余Key时的提示(#27)' + tag_name: v4.4.8 + name: 4.4.8 + body: '- 修复:更新Steam社区凭证报错(#26)' files: |- dist/auto-task-v4-for-giveawaysu.user.js dist/auto-task-v4.compatibility.user.js diff --git a/dist/auto-task-v4-for-giveawaysu.all.user.js b/dist/auto-task-v4-for-giveawaysu.all.user.js index 43c66ba..e90ad54 100644 --- a/dist/auto-task-v4-for-giveawaysu.all.user.js +++ b/dist/auto-task-v4-for-giveawaysu.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4-for-giveawaysu // @namespace auto-task-v4-for-giveawaysu -// @version 4.4.7 +// @version 4.4.8 // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -18,6 +18,8 @@ // @include *://www.twitch.tv/* // @include *://www.youtube.com/* // @include *://*.reddit.com/* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @grant GM_addStyle // @grant GM_setValue @@ -94,7 +96,7 @@ var runtime=function(t){"use strict";var r,e=Object.prototype,n=e.hasOwnProperty console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); -!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o{isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] +!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o{isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] 环境: @@ -111,4 +113,4 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); `+error.stack)}const httpRequest_httpRequest=async(options,times=0)=>{window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest_httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError_throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest_httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ - ${text?.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError_throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)});const defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};discordAuth=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,discordAuth);const languages={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",updateHistory:'历史更新记录点此查看',AsfEnabled:'使用ASF做Steam相关任务(需ASFEnhance插件)',AsfIpcUrl:"ASF IPC 地址",AsfIpcPassword:"ASF IPC 密码",versionNotMatched:"脚本管理器版本过低,需TamperMonkey >= 5.2.0或TamperMonkey Beta >= 5.2.6196",groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",gettingUserLink:"正在获取Steam用户社区链接...",retry:"重试",initingASF:"正在初始化ASF...",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",campaign:"检测到人机验证,请完成验证后重新验证任务!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",tasksNotCompleted:"任务未完成",confirmingTask:"正在跳过警告页面..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",updateHistory:'Click here to view the historical update record.',AsfEnabled:'Use ASF to do Steam related tasks (requires ASFEnhance plugin)',AsfIpcUrl:"ASF IPC URL",AsfIpcPassword:"ASF IPC Password",groups:"Group",officialGroups:"Official Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",gettingCuratorId:"Getting Steam Curator Id",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",versionNotMatched:"The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196",gettingUserLink:"Getting steam user community link...",retry:"Retry",initingASF:"Initing ASF...",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",campaign:"ReCAPTCHA detected, please complete it and re-verify the tasks!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning...",tasksNotCompleted:"Tasks Not Completed",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=(key,...argvs)=>languages[language]?.[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key;discordAuth=class{tasks;getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)))return this.#initialized=!1,"skip";return GM_getValue("dontRemindDiscordAgain")||"do"===action&&!globalOptions.doTask.discord.servers||"undo"===action&&!globalOptions.undoTask.discord.servers?(this.#initialized=!1,"skip"):!!this.#initialized||(this.#auth.auth?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(GM_setValue("discordAuth",{auth:null}),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0))}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Discord")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:this.#auth.auth}});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Discord")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("discordAuth")?.auth;auth?(this.#auth={auth:auth},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async#joinServer(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:this.#auth.auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(data.response?.guild?.id);return guild&&(this.#setCache(inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async#leaveServer(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await this.#getGuild(inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:this.#auth.auth}});return"Success"===result&&204===data?.status?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async#getGuild(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=this.#cache[inviteId];if(guild)return logStatus.success(),guild;var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=data.response?.guild?.id;return guild?(logStatus.success(),this.#setCache(inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}async toggle({doTask=!0,serverLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,link=>link.match(/invite\/(.+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}#setCache(inviteId,guild){try{this.#cache[inviteId]=guild,GM_setValue("discordCache",this.#cache)}catch(error){throwError_throwError(error,"Discord.setCache")}}};const social_Instagram=class extends discordAuth{tasks;whiteList;#cache=GM_getValue("instagramCache")||{};#auth={};#initialized=!1;constructor(){super();var defaultTasksTemplate={users:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.instagram||{}}}async init(){try{return this.#initialized?!0:await this.#getUserInfo()?(scripts_echoLog({}).success(i18n("initSuccess","Instagram")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Instagram")),!1)}catch(error){return throwError_throwError(error,"Instagram.init"),!1}}async#getUserInfo(name="instagram"){try{const logStatus=scripts_echoLog({type:"instagram"===name?"verifyingInsAuth":"gettingInsUserId",text:name});var userId=this.#cache[name];if(userId&&"instagram"!==name)return logStatus.success(),userId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/${name}/`,method:"GET"});if("Success"!==result)return!1;if(data?.finalUrl.includes("accounts/login"))return logStatus.error("Error:"+i18n("loginIns"),!0),!1;if(data?.finalUrl.includes("www.instagram.com/challenge"))return logStatus.error("Error:"+i18n("insBanned")),!1;if(200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;var csrftoken=data.responseText.match(/"csrf_token":"(.+?)"/)?.[1],hash=data.responseText.match(/"rollout_hash":"(.+?)"/)?.[1];if("instagram"===name)return!(!csrftoken||!hash)&&(this.#auth={csrftoken:csrftoken,hash:hash},!0);var id=data.responseText.match(/"profilePage_([\d]+?)"/)?.[1];return id?(this.#setCache(name,id),logStatus.success(),id):(logStatus.error("Error: Get ins data error!"),!1)}catch(error){return throwError_throwError(error,"Instagram.getUserInfo"),!1}}async#followUser(name){try{var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"followingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/follow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"following"===data.response?.result?(logStatus.success(),this.tasks.users=unique([...this.tasks.users,name]),!0):(logStatus.error("Error:"+(data?.response?.feedback_message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.followUser"),!1}}async#unfollowUser(name){try{if(this.whiteList.users.includes(name))return scripts_echoLog({type:"whiteList",text:"Instagram.unfollowUser",id:name}),!0;var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"unfollowingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/unfollow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"ok"===data.response?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.unfollowUser"),!1}}async toggle({doTask=!0,userLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.instagram.users||!doTask&&!globalOptions.undoTask.instagram.users)scripts_echoLog({type:"globalOptionsSkip",text:"instagram.users"});else{var realUsers=this.getRealParams("users",userLinks,doTask,link=>link.match(/https:\/\/www\.instagram\.com\/(.+)?\//)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("instagramCache",this.#cache)}catch(error){throwError_throwError(error,"Instagram.setCache")}}};const social_Reddit=class extends discordAuth{tasks;whiteList;#auth;#initialized=!1;constructor(){super();var defaultTasksTemplate={reddits:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.reddit||{}}}async init(){try{return this.#initialized?!0:await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Reddit")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Reddit")),!1)}catch(error){return throwError_throwError(error,"Reddit.init"),!1}}async#useBeta(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await this.#updateAuth(!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async#updateAuth(beta=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Reddit")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://www.reddit.com/",method:"GET",nochche:!0,headers:{"Cache-Control":"no-cache"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(data?.responseText.includes("www.reddit.com/login/"))return logStatus.error("Error:"+i18n("loginReddit"),!0),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.responseText.includes("redesign-beta-optin-btn")&&!beta)return await this.#useBeta();var accessToken=data.responseText.match(/"accessToken":"(.*?)","expires":"(.*?)"/)?.[1];return accessToken?(this.#auth={token:accessToken},logStatus.success(),!0):(logStatus.error('Error: Parameter "accessToken" not found!'),!1)}catch(error){return throwError_throwError(error,"Reddit.updateAuth"),!1}}async toggleTask({name,doTask=!0}){try{if(!doTask&&this.whiteList.reddits.includes(name))return scripts_echoLog({type:"whiteList",text:"Reddit.undoTask",id:name}),!0;let type=doTask?"joiningReddit":"leavingReddit";/^u_/.test(name)&&(type=doTask?"followingRedditUser":"unfollowingRedditUser");const logStatus=scripts_echoLog({type:type,text:name});var{result,statusText,status,data}=await tools_httpRequest({url:"https://oauth.reddit.com/api/subscribe?redditWebClient=desktop2x&app=desktop2x-client-production&raw_json=1&gilding_detail=1",method:"POST",headers:{authorization:"Bearer "+this.#auth.token,"content-type":"application/x-www-form-urlencoded"},data:$.param({action:doTask?"sub":"unsub",sr_name:name,api_type:"json"})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.reddits=unique([...this.tasks.reddits,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Reddit.toggleTask"),!1}}async toggle({doTask=!0,redditLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.reddit.reddits||!doTask&&!globalOptions.undoTask.reddit.reddits)scripts_echoLog({type:"globalOptionsSkip",text:"reddit.reddits"});else{var realReddits=this.getRealParams("reddits",redditLinks,doTask,userName=>{var name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/)?.[1],userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/)?.[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};const social_Twitch=class extends discordAuth{tasks;whiteList;#auth=GM_getValue("twitchAuth")||{};#cache=GM_getValue("twitchCache")||{};#initialized=!1;#integrityToken;constructor(){super();var defaultTasksTemplate={channels:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.twitch||{}}}async init(){try{return this.#initialized?!0:this.#auth.authToken&&this.#auth.clientId&&this.#auth.clientVersion&&this.#auth.deviceId&&this.#auth.clientSessionId?await this.#verifyAuth(!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(GM_setValue("twitchAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async#verifyAuth(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===data?.status&&data.response?.[0]?.data?.currentUser?(await this.#integrity(isFirst),logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async#integrity(isFirst=!0,ct=""){try{const logStatus=scripts_echoLog({text:i18n("checkingTwitchIntegrity")});if(isFirst&&(!this.#auth.authToken||!this.#auth.clientId||!this.#auth.clientVersion||!this.#auth.deviceId||!this.#auth.clientSessionId))return await this.#updateAuth(!1);var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/integrity",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"x-kpsdk-ct":ct}});return"Success"===result?!ct&&data?.responseHeaders?.["x-kpsdk-ct"]?await this.#integrity(isFirst,data.responseHeaders["x-kpsdk-ct"]):200===data?.status&&data.response?.token?(this.#integrityToken=data.response.token,logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.integrity"),!1}}async#updateAuth(isFirst=!0){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Twitch")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(this.#auth=auth,logStatus.success(),resolve(await this.#verifyAuth(isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async#toggleChannel({name,doTask=!0}){try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await this.#getChannelId(name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"Client-Integrity":this.#integrityToken},data:doTask?followData:unfollowData});return"Success"===result?200===data?.status&&data.response?.[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+(data?.response?.[0].errors?.[0]?.message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async#getChannelId(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=this.#cache[name];if(channelId)return logStatus.success(),channelId;var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const channelId=data.response?.[0]?.data?.user?.id;return channelId?(this.#setCache(name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}async toggle({doTask=!0,channelLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>link.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/)?.[2]);if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("twitchCache",this.#cache)}catch(error){throwError_throwError(error,"Twitch.setCache")}}};const social_Vk=class extends discordAuth{tasks;whiteList;#username="";#cache=GM_getValue("vkCache")||{};#initialized=!1;constructor(){super();var defaultTasksTemplate={names:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.vk||{}}}async init(){try{return this.#initialized?!0:await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Vk")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Vk")),!1)}catch(error){return throwError_throwError(error,"Vk.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});return"Success"===result?data?.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===data?.status?(this.#username=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/)?.[1]||"",logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async#toggleGroup(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkGroup":"leavingVkGroup",text:name});if("enter"===dataParam.groupAct&&!doTask||"leave"===dataParam.groupAct&&doTask)return logStatus.success(),!0;const reqData={act:doTask?"enter":"leave",al:1,gid:dataParam.groupId,hash:dataParam.groupHash};doTask&&(reqData.context="_");var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_groups.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param(reqData)});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.toggleGroup"),!1}}async#togglePublic(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkPublic":"leavingVkPublic",text:name});if(dataParam.publicJoined&&doTask||!dataParam.publicJoined&&!doTask)return logStatus.success(),!0;var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_public.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:doTask?"a_enter":"a_leave",al:1,pid:dataParam.publicPid,hash:dataParam.publicHash})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.togglePublic"),!1}}async#sendWall(name){try{const logStatus=scripts_echoLog({type:"sendingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"publish_box",al:1,object:name})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var hash=data.responseText.match(/shHash:[\s]*'(.*?)'/)?.[1];if(hash){const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({Message:"",act:"a_do_publish",al:1,close_comments:0,friends_only:0,from:"box",hash:hash,list:"",mark_as_ads:0,mute_notifications:0,object:name,ret_data:1,to:0})});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200===dataR?.status){var jsonData=JSON.parse(dataR.responseText?.replace("\x3c!--","")||"{}");if(!0===jsonData?.payload?.[1]?.[1]?.share_my){logStatus.success();var postId=String(jsonData?.payload?.[1]?.[1]?.post_id),ownerId=String(jsonData?.payload?.[1]?.[1]?.owner_id);return postId&&ownerId&&this.#setCache(name,ownerId+"_"+postId),this.tasks.names=unique([...this.tasks.names,name]),!0}}return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1}return logStatus.error('Error: Get "hash" failed'),!1}catch(error){return throwError_throwError(error,"Vk.sendWall"),!1}}async#deleteWall(name,dataParams){try{const logStatus=scripts_echoLog({type:"deletingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_wall.php?act=delete",method:"POST",headers:{origin:"https://vk.com",referer:`https://vk.com/${this.#username}?w=wall${this.#cache[name]}%2Fall`,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"delete",al:1,confirm:0,from:"wkview",hash:dataParams.wallHash,post:this.#cache[name]})});return"Success"===result?200===data?.status&&JSON.parse(data.responseText?.replace("\x3c!--","")||"{}")?.payload?.[1]?.[1]?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.deleteWall"),!1}}async#getId(name,doTask){try{let url="https://vk.com/"+name;if(/^wall-/.test(name)){if(doTask)return{type:"sendWall"};if(!this.#cache[name])return{type:"unSupport"};url=`https://vk.com/${this.#username}?w=wall`+this.#cache[name]}const logStatus=scripts_echoLog({type:"gettingVkId",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var[,groupAct,groupId,,groupHash]=data.responseText.match(/Groups.(enter|leave)\(.*?,.*?([\d]+?), ('|')(.*?)('|')/)||[],publicHash=data.responseText.match(/"enterHash":"(.*?)"/)?.[1],publicPid=data.responseText.match(/"public_id":([\d]+?),/)?.[1],publicJoined=!data.responseText.includes("Public.subscribe");if(groupAct&&groupId&&groupHash)return logStatus.success(),{groupAct:groupAct,groupId:groupId,groupHash:groupHash,type:"group"};if(publicHash&&publicPid)return logStatus.success(),{publicHash:publicHash,publicPid:publicPid,publicJoined:publicJoined,type:"public"};if(data.responseText.includes("wall.deletePost")&&!doTask){var wallHash=data.responseText.match(/wall\.deletePost\(this, '.*?', '(.*?)'\)/)?.[1];if(wallHash)return logStatus.success(),{type:"deleteWall",wallHash:wallHash}}else if(name.includes("wall")&&doTask)return logStatus.success(),{type:"sendWall"};return logStatus.error("Error: Parameters not found!"),!1}catch(error){return throwError_throwError(error,"Vk.getId"),!1}}async#toggleVk({name,doTask=!0}){try{if(!doTask&&this.whiteList.names.includes(name))return scripts_echoLog({type:"whiteList",text:"Vk.undoTask",id:name}),!0;var formatName=name.replace(/\/$/,""),data=await this.#getId(formatName,doTask);if(!data)return!1;switch(data.type){case"group":return await this.#toggleGroup(formatName,data,doTask);case"public":return await this.#togglePublic(formatName,data,doTask);case"sendWall":return!doTask||await this.#sendWall(formatName);case"deleteWall":return!!doTask||await this.#deleteWall(formatName,data);default:return!1}}catch(error){return throwError_throwError(error,"Vk.toggleVk"),!1}}async toggle({doTask=!0,nameLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.vk.names||!doTask&&!globalOptions.undoTask.vk.names)scripts_echoLog({type:"globalOptionsSkip",text:"vk.names"});else{var realNames=this.getRealParams("names",nameLinks,doTask,link=>link.match(/https:\/\/vk\.com\/([^/]+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}#setCache(name,postId){try{this.#cache[name]=postId,GM_setValue("vkCache",this.#cache)}catch(error){throwError_throwError(error,"Vk.setCache")}}};class Youtube extends discordAuth{tasks;whiteList;#auth=GM_getValue("youtubeAuth")||{};#initialized=!1;#verifyChannel="https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel;constructor(){super();var defaultTasksTemplate={channels:[],likes:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.youtube||{}}}async init(){try{return this.#initialized?!0:this.#auth.PAPISID?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(GM_setValue("youtubeAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async#verifyAuth(){try{return await this.#toggleChannel({link:this.#verifyChannel,doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{GM_cookie.list({url:"https://www.youtube.com/@YouTube"},async(PAPISID,error)=>{error?(logStatus.error("Error: Update youtube auth failed!"),resolve(!1)):(PAPISID=PAPISID.find(cookie=>"__Secure-3PAPISID"===cookie.name)?.value)?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),this.#auth={PAPISID:PAPISID},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error(i18n("needLogin")),resolve(!1))})})}catch(error){return throwError_throwError(error,"Youtube.updateAuth"),!1}}#getInfo(link,type){return async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/)?.[1],context=(data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))?.[1]||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var channelId=data.responseText.match(/"channelId":"(.+?)"/)?.[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var videoId=data.responseText.match(//)?.[1],likeParams=data.responseText.match(/"likeParams":"(.*?)"/)?.[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}}(link,type)}async#toggleChannel({link,doTask=!0,verify=!1}){try{var{params,needLogin}=await this.#getInfo(link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=${apiKey}&prettyPrint=false`,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client?.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:request?.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===data?.status?doTask&&(/"subscribed":true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed":false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async#toggleLikeVideo({link,doTask=!0}){try{var{params,needLogin}=await this.#getInfo(link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===data?.status?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}async toggle({doTask=!0,channelLinks=[],videoLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}const social_SteamASF=class{#asfOptions;#botName="asf";#groupInfo;async init(){try{var asfCommandsUrl=new URL("/Api/Command/",globalOptions.ASF.AsfIpcUrl);this.#asfOptions={url:asfCommandsUrl.href,method:"POST",responseType:"json",headers:{accept:"application/json","Content-Type":"application/json",Host:asfCommandsUrl.host,Origin:asfCommandsUrl.origin,Referer:asfCommandsUrl.href,Authentication:globalOptions.ASF.AsfIpcPassword}},globalOptions.ASF.AsfBotname&&(this.#botName=globalOptions.ASF.AsfBotname);const logStatus=scripts_echoLog({text:i18n("initingASF")});var{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:'{"Command":"!stats"}'});return"Success"===result?!0===data?.response?.Success&&"OK"===data.response.Message&&data.response.Result?(logStatus.success(),!0):(data?.response?.Result||data?.response?.Message?logStatus.error(data?.response?.Result||data.response.Message):logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.init"),!1}}async joinGroup(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!JOINGROUP ${this.#botName} `+groupName})});return"Success"===result?200===data?.status&&["已加入","已申请","Joined","Applied","Присоединился","costs"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.joinGroup"),!1}}async leaveGroup(groupName){try{if(!this.#groupInfo&&!await this.#getGroupId())return!1;var groupId=await this.#groupInfo[groupName];if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!LEAVEGROUP ${this.#botName} `+groupId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.leaveGroup"),!1}}async#getGroupId(){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:"All"}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:"!GROUPLIST "+this.#botName})});return"Success"===result?200===data?.status&&data.response?.Result?.includes("|")?(this.#groupInfo=Object.fromEntries(data.response.Result.split("\n").map(id=>{var[,name,id]=id.trim().split("|");return name&&id?[name,id]:null}).filter(ele=>ele)),logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.getGroupID"),!1}}async addToWishlist(gameId){try{const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!ADDWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.addToWishlist"),!1}}async removeFromWishlist(gameId){try{const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REMOVEWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.removeFromWishlist"),!1}}async toggleFollowGame(gameId,doTask){try{const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWGAME ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.toggleFollowGame"),!1}}async toggleCurator(curatorId,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWCURATOR ${this.#botName} `+curatorId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async addLicense(id){try{const[type,ids]=id.split("-");if("appid"===type){const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} app/`+ids})});return"Success"===result?200===data?.status&&["AlreadyPurchased","OK"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{const idsArr=ids.split(","),logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} `+idsArr.map(id=>"sub/"+id).join(",")})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200===data?.status&&data.response?.Result){const resultLines=data.response.Result.split("\n");return idsArr.forEach(subid=>{const targetLine=resultLines.find(text=>text.includes(subid));targetLine&&["成功","Success","Успех"].find(text=>targetLine.includes(text))?scripts_echoLog({}).success(targetLine):scripts_echoLog({}).error(targetLine)}),!0}return logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1}}catch(error){return throwError_throwError(error,"SteamASF.addLicense"),!1}}async requestPlayTestAccess(id){try{const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REQUESTACCESS ${this.#botName} `+id})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}};const social_Steam=class extends discordAuth{tasks;whiteList;#cache={group:{},officialGroup:{},forum:{},workshop:{},curator:{},...GM_getValue("steamCache")};#auth={};#storeInitialized=!1;#communityInitialized=!1;#area="CN";#areaStatus="end";#ASF;constructor(){super();var defaultTasksTemplate={groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.steam||{}}}async init(type="all"){try{if(globalOptions.ASF.AsfEnabled&&globalOptions.ASF.AsfIpcUrl&&globalOptions.ASF.AsfIpcPassword)return this.#ASF=new social_SteamASF,!!await this.#ASF.init()&&(this.#storeInitialized=!0,this.#communityInitialized=!0);if("store"===type){if(this.#storeInitialized)return!0;let storeInitialized=await this.#updateStoreAuth();return(storeInitialized=storeInitialized||await this.#updateStoreAuthTab(),this.#storeInitialized=storeInitialized,this.#storeInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamStore")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}if("community"!==type)return this.#storeInitialized&&this.#communityInitialized?(scripts_echoLog({}).success(i18n("initSuccess","Steam")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1);{if(this.#communityInitialized)return!0;let communityInitialized=await this.#getUserLink();return(communityInitialized=communityInitialized||await this.#updateCommunityAuthTab(),this.#communityInitialized=communityInitialized,this.#communityInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamCommunity")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}}catch(error){return throwError_throwError(error,"Steam.init"),!1}}async#refreshToken(type="steamStore"){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n(type))}),formData=new FormData;formData.append("redir",`https://${host[type]}/`);var{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://"+host[type],Referer:`https://${host[type]}/`},data:formData});return"Success"===result?data?.response?.success?await this.#setStoreToken(data.response,type)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshToken"),!1}}async#setStoreToken(param,type){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("settingToken",i18n(type))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:`https://${host[type]}/login/settoken`,method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:host[type],Origin:"https://"+host[type]},data:formData});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async#updateStoreAuth(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200!==data?.status)return[301,302].includes(data?.status)?await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):(logStatus.error(result+`:${statusText}(${status})`),!1);if(!data.responseText.includes("data-miniprofile="))return await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1);var storeSessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(this.#auth.storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async#updateStoreAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))});return await new Promise(resolve=>{const newTab=window.open("https://store.steampowered.com/","mozillaWindow","pop=1;");GM_setValue("steamStoreAuth","update");const listenerId=GM_addValueChangeListener("steamStoreAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.storeSessionID=newValue.storeSessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateStoreAuthTab"),!1}}async#updateCommunityAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))});return await new Promise(resolve=>{const newTab=window.open("https://steamcommunity.com/my","mozillaWindow","pop=1;");GM_setValue("steamCommunityAuth","update");const listenerId=GM_addValueChangeListener("steamCommunityAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.steam64Id=newValue.steam64Id,this.#auth.userName=newValue.userName,this.#auth.communitySessionID=newValue.communitySessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuthTab"),!1}}async#getUserLink(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("gettingUserLink")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200===data?.status){if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}if(302===data?.status)return!await this.#refreshToken("steamCommunity")||retry?(logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1):(logStatus.warning(i18n("retry")),this.#getUserLink(!0));const location=data?.responseHeaders?.split("\n")?.find(header=>header.includes("location")?header.replace("loctation:","").trim():null);return 301===data?.status&&location?.includes("steamcommunity.com/id")?(logStatus.success(),await this.#updateCommunityAuth(data.finalUrl)):(301===data?.status&&location?.includes("https://steamcommunity.com/login/home")?logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0):logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#updateCommunityAuth(url){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#getAreaInfo(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{var cartConfigRaw=data.responseText.match(/data-cart_config="(.*?)"/)?.[1];const temp=document.createElement("div");temp.innerHTML=cartConfigRaw||"{}";var cartConfigStr=temp.textContent||temp.innerText;let cartConfig;try{cartConfig=JSON.parse(cartConfigStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}if(!cartConfig.rgUserCountryOptions)return logStatus.warning("Warning: Area cannot be changed"),{};var userInfoRaw=data.responseText.match(/data-userinfo="(.*?)"/)?.[1];const temp1=document.createElement("div");temp1.innerHTML=userInfoRaw||"{}";var userInfoStr=temp1.textContent||temp1.innerText;let userInfo;try{userInfo=JSON.parse(userInfoStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}var currentArea=userInfo.country_code,areas=Object.keys(cartConfig.rgUserCountryOptions).filter(area=>"help"!==area);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==this.#areaStatus&&(clearInterval(checker),resolve(!0))})}),this.#area===area||!area&&"CN"!==this.#area)return!0;this.#areaStatus="waiting";let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await this.#getAreaInfo();if(!currentArea||!areas)return!(this.#areaStatus="error");if("CN"!==currentArea)return this.#areaStatus="skip",scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return this.#areaStatus="noAnotherArea",scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/country/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:this.#auth.storeSessionID})});if("Success"!==result)return this.#areaStatus="error",logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==data?.status||"true"!==data.responseText)return this.#areaStatus="error",logStatus.error(`Error:${data?.statusText}(${data?.status})`),"CN";var currentArea=(await this.#getAreaInfo())["currentArea"];return currentArea===aimedArea?(this.#areaStatus="success",logStatus.success(),currentArea):(this.#areaStatus="error",logStatus.error("Error: change country filed"),"CN")}catch(error){return this.#areaStatus="error",throwError_throwError(error,"Steam.changeArea"),!1}}async#joinGroup(groupName){try{if(this.#ASF)return!!await this.#ASF.joinGroup(groupName)&&(this.tasks.groups=unique([...this.tasks.groups,groupName]),!0);const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async#leaveGroup(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(groupName);var groupId=await this.#getGroupId(groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===data?.status&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async#getGroupId(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var groupId=this.#cache.group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)?.[1];return groupId?(this.#setCache("group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#joinOfficialGroup(gameId){try{if(this.#ASF)return!!await this.#ASF.joinGroup(gameId)&&(this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]),!0);const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+this.#auth.communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId&&this.#setCache("officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async#leaveOfficialGroup(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(gameId);var groupId=await this.#getOfficialGroupId(gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===dataR?.status&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async#getOfficialGroupId(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var groupId=this.#cache.officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId?(this.#setCache("officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#addToWishlist(gameId){try{if(this.#ASF)return!!await this.#ASF.addToWishlist(gameId)&&(this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0);const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===dataR?.status?"CN"===this.#area&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#addToWishlist(gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async#removeFromWishlist(gameId){try{if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;if(this.#ASF)return await this.#ASF.removeFromWishlist(gameId);const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==dataR?.status)return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1;if("CN"===this.#area&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#removeFromWishlist(gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async#toggleFollowGame(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;if(this.#ASF)return!!await this.#ASF.toggleFollowGame(gameId,doTask)&&(doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0);const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:this.#auth.storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===data?.status&&"true"===data.responseText)return logStatus.success(),!0;var followed=await this.#isFollowedGame(gameId);return"CN"===this.#area&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#removeFromWishlist(gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async#isFollowedGame(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===data?.status&&("CN"===this.#area&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async#toggleForum(gameId,doTask=!0){try{if(!doTask&&this.whiteList.forums.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unsubscribeForum",id:gameId}),!0;const forumId=await this.#getForumId(gameId);if(!forumId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}subscribingForum`,text:gameId});var[id,feature]=forumId.split("_"),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/forum/${id}/General/${doTask?"":"un"}subscribe/${feature||"0"}/`,method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.communitySessionID})});return"Success"===result?(200!==data?.status||1!==data.response?.success&&29!==data.response?.success?logStatus.error(`Error:${data?.statusText}(${data?.status})`):(doTask&&(this.tasks.forums=unique([...this.tasks.forums,gameId])),logStatus.success()),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.toggleForum"),!0}}async#getForumId(gameId){try{const logStatus=scripts_echoLog({type:"gettingForumId",text:gameId});var forumId=this.#cache.forum[gameId];if(forumId)return logStatus.success(),forumId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/app/${gameId}/discussions/`,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const forumId=data.responseText?.match(/General_([\d]+(_[\d]+)?)/)?.[1];return forumId?(this.#setCache("forum",gameId,forumId),logStatus.success(),forumId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getForumId"),!1}}async#toggleFavoriteWorkshop(id,doTask=!0){try{if(!doTask&&this.whiteList.workshops.includes(id))return scripts_echoLog({type:"whiteList",text:"Steam.unfavoriteWorkshop",id:id}),!0;var appid=await this.#getWorkshopAppId(id);if(!appid)return!1;const logStatus=scripts_echoLog({type:doTask?"favoritingWorkshop":"unfavoritingWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/sharedfiles/${doTask?"":"un"}favorite`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,appid:appid,sessionid:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(doTask&&(this.tasks.workshops=unique([...this.tasks.workshops,id])),logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFavoriteWorkshop"),!1}}async#getWorkshopAppId(id){try{const logStatus=scripts_echoLog({type:"gettingWorkshopAppId",text:id});var appId=this.#cache.workshop[id];if(appId)return logStatus.success(),appId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/filedetails/?id="+id,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const appId=data.responseText.match(//)?.[1];return appId?(this.#setCache("workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async#voteUpWorkshop(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:this.#auth.communitySessionID})});return"Success"===result?(200===data?.status&&1===data.response?.success?logStatus.success():logStatus.error(`Error:${data?.statusText}(${data?.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async#toggleCurator(curatorId,doTask=!0){try{if(!doTask&&this.whiteList.curators.includes(curatorId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowCurator",id:curatorId}),!0;if(this.#ASF)return await this.#ASF.toggleCurator(curatorId,doTask);const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/curators/ajaxfollow",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({clanid:curatorId,sessionid:this.#auth.storeSessionID,follow:doTask}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response?.success?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(`+data?.response?.success||data?.status+")"),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async getCuratorId(path,name){try{const logStatus=scripts_echoLog({type:"gettingCuratorId",text:path+"/"+name});var curatorId=this.#cache.curator[path+"/"+name];if(curatorId)return logStatus.success(),curatorId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/${path}/`+name,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const curatorId=data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)?.[1];return curatorId?(this.#setCache("curator",path+"/"+name,curatorId),logStatus.success(),curatorId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getCuratorID"),!1}}async#toggleCuratorLike(link,doTask=!0){try{var[path,name]=link.split("/");if(!path||!name)return scripts_echoLog({text:i18n("errorLink",link)}),!1;var curatorId=await this.getCuratorId(path,name);return curatorId?await this.#toggleCurator(curatorId,doTask):!1}catch(error){return throwError_throwError(error,"Steam.toggleCuratorLike"),!1}}async#getAnnouncementParams(appId,viewId){try{const logStatus=scripts_echoLog({type:"gettingAnnouncementParams",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/events/ajaxgetpartnerevent?appid=${appId}&announcement_gid=${viewId}&lang_list=6_0&last_modified_time=0&origin=https:%2F%2Fstore.steampowered.com&for_edit=false`,method:"GET",responseType:"json",headers:{Host:"store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status||1!==data?.response?.success)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};var{clanid,gid}=data.response.event?.announcement_body||{};return clanid?(logStatus.success(),{clanId:clanid,gid:gid}):(logStatus.error(`Error:${data.statusText}(${data.status})`),{})}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),{}}}async#likeAnnouncement(id){try{var[appId,viewId]=id.split("/");if(!appId||!viewId)return scripts_echoLog({}).error(i18n("missParams")+"(id)"),!1;var{clanId,gid}=await this.#getAnnouncementParams(appId,viewId);if(!clanId)return!1;const logStatus=scripts_echoLog({type:"likingAnnouncement",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/updated/ajaxrateupdate/"+(gid||viewId),method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId},data:$.param({sessionid:this.#auth.storeSessionID,voteup:1,clanid:clanId,ajax:1}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),!1}}async#appid2subid(id){try{const logStatus=scripts_echoLog({type:"gettingSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+id,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#appid2subid(id):!1}var subid=data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];return subid?(logStatus.success(),subid):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.appid2subid"),!1}}async#getLicenses(){try{const logStatus=scripts_echoLog({text:i18n("gettingLicenses")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/dynamicstore/userdata/?t="+(new Date).getTime(),method:"GET",responseType:"json"});return"Success"===result?200===data?.status?(logStatus.success(),data.response?.rgOwnedPackages):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.getLicenses"),!1}}async#addLicense(id){try{if(this.#ASF)return await this.#ASF.addLicense(id);const[type,ids]=id.split("-");if("appid"===type){var subid=await this.#appid2subid(ids);if(!subid)return!1;const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids});if(!await this.#addFreeLicense(subid,logStatus))return!1;const{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+ids,method:"GET"});return"Success"===result?200===data?.status?data.responseText.includes("ds_owned_flag ds_flag")||data.responseText.includes('class="already_in_library"')?(logStatus.success(),!0):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{"CN"===this.#area&&(scripts_echoLog({}).success(i18n("tryChangeAreaNotice")),await this.#changeArea());const logStatusArr={};var idsArr=ids.split(",");for(const subid of idsArr){var logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:subid});if(!await this.#addFreeLicense(subid,logStatus))return!1;logStatusArr[subid]=logStatus}const licenses=await this.#getLicenses();if(!licenses)return!1;for(const subid of idsArr)licenses.includes(parseInt(subid,10))?logStatusArr[subid].success():logStatusArr[subid].error();return!0}}catch(error){return throwError_throwError(error,"Steam.addLicense"),!1}}async#addFreeLicense(id,logStatusPre){try{const logStatus=logStatusPre||scripts_echoLog({type:"addingFreeLicenseSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:this.#auth.storeSessionID,subid:id}),dataType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result?await this.#addFreeLicense(id):!1}return logStatus.success(),!0}catch(error){return throwError_throwError(error,"Steam.addFreeLicense"),!1}}async#requestPlayTestAccess(id){try{if(this.#ASF)return await this.#ASF.requestPlayTestAccess(id);const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+id,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+id},data:$.param({sessionid:this.#auth.storeSessionID}),dataType:"json"});return"Success"===result?200===data?.status&&1===data?.response?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}async toggle({doTask=!0,groupLinks=[],officialGroupLinks=[],wishlistLinks=[],followLinks=[],forumLinks=[],workshopLinks=[],workshopVoteLinks=[],curatorLinks=[],curatorLikeLinks=[],announcementLinks=[],licenseLinks=[],playtestLinks=[]}){try{if(0<[...groupLinks,...officialGroupLinks,...forumLinks,...workshopLinks,...workshopVoteLinks].length&&!this.#communityInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;if(0<[...wishlistLinks,...followLinks,...curatorLinks,...curatorLikeLinks,...announcementLinks,...licenseLinks,...playtestLinks].length&&!this.#storeInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.steam.groups||!doTask&&!globalOptions.undoTask.steam.groups)scripts_echoLog({type:"globalOptionsSkip",text:"steam.groups"});else{var realGroups=this.getRealParams("groups",groupLinks,doTask,link=>link.match(/groups\/(.+)\/?/)?.[1]);if(0link.match(/games\/(.+)\/?/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(doTask&&0link.match(/curator\/([\d]+)/)?.[1]),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,link=>link.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/)?.slice(1,3).join("/"));if(0(link.includes("store.steampowered.com")?link.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/):link.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))?.slice(1,3).join("/"));if(doTask&&0link.match(/app\/([\d]+)/)?.[1]);if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==this.#area&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await this.#changeArea("CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}#setCache(type,name,id){try{this.#cache[type][name]=id,GM_setValue("steamCache",this.#cache)}catch(error){throwError_throwError(error,"Steam.setCache")}}};const Giveawaysu=class{undoneTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};giveawayId;socialInitialized={discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0};initialized=!1;social={};static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{this.#checkLogin()||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await this.#checkLeftKey()||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!this.#getGiveawayId()&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async#classifyTask(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError_throwError(error,"getRedirectLink"),null}})(taskDes.attr("href")).then(taskLink=>taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.#uniqueTasks(this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}#checkLogin(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async#checkLeftKey(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(({value})=>{value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}#getGiveawayId(){var giveawayId=window.location.href.match(/\/view\/([\d]+)/)?.[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async#bind(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async#initSocial(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(this.#bind("discord",this.social.discord.init("do")))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(this.#bind("instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(this.#bind("reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(this.#bind("twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(this.#bind("vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(this.#bind("youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&tasks.steam?.[type]?.length||0).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(this.#bind("steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}#uniqueTasks(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async#toggleTask(){try{if(!this.initialized&&!this.init())return!1;if(!await this.#classifyTask())return!1;if(!await this.#initSocial())return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await this.#toggleTask()}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};discordAuth=__webpack_require__(225);if(window.STYLE=GM_addStyle(discordAuth.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{var authToken;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(authToken=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientId:commonOptions?.headers?.["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"x.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${text?.replace("u_","")}]...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError_throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)});const defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};discordAuth=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,discordAuth);const languages={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",updateHistory:'历史更新记录点此查看',AsfEnabled:'使用ASF做Steam相关任务(需ASFEnhance插件)',AsfIpcUrl:"ASF IPC 地址",AsfIpcPassword:"ASF IPC 密码",versionNotMatched:"脚本管理器版本过低,需TamperMonkey >= 5.2.0或TamperMonkey Beta >= 5.2.6196",groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",gettingUserLink:"正在获取Steam用户社区链接...",retry:"重试",initingASF:"正在初始化ASF...",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",campaign:"检测到人机验证,请完成验证后重新验证任务!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",tasksNotCompleted:"任务未完成",confirmingTask:"正在跳过警告页面..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",updateHistory:'Click here to view the historical update record.',AsfEnabled:'Use ASF to do Steam related tasks (requires ASFEnhance plugin)',AsfIpcUrl:"ASF IPC URL",AsfIpcPassword:"ASF IPC Password",groups:"Group",officialGroups:"Official Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",gettingCuratorId:"Getting Steam Curator Id",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",versionNotMatched:"The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196",gettingUserLink:"Getting steam user community link...",retry:"Retry",initingASF:"Initing ASF...",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",campaign:"ReCAPTCHA detected, please complete it and re-verify the tasks!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning...",tasksNotCompleted:"Tasks Not Completed",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=(key,...argvs)=>languages[language]?.[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key;discordAuth=class{tasks;getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)))return this.#initialized=!1,"skip";return GM_getValue("dontRemindDiscordAgain")||"do"===action&&!globalOptions.doTask.discord.servers||"undo"===action&&!globalOptions.undoTask.discord.servers?(this.#initialized=!1,"skip"):!!this.#initialized||(this.#auth.auth?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(GM_setValue("discordAuth",{auth:null}),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0))}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Discord")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:this.#auth.auth}});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Discord")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("discordAuth")?.auth;auth?(this.#auth={auth:auth},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async#joinServer(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:this.#auth.auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(data.response?.guild?.id);return guild&&(this.#setCache(inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async#leaveServer(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await this.#getGuild(inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:this.#auth.auth}});return"Success"===result&&204===data?.status?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async#getGuild(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=this.#cache[inviteId];if(guild)return logStatus.success(),guild;var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=data.response?.guild?.id;return guild?(logStatus.success(),this.#setCache(inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}async toggle({doTask=!0,serverLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,link=>link.match(/invite\/(.+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}#setCache(inviteId,guild){try{this.#cache[inviteId]=guild,GM_setValue("discordCache",this.#cache)}catch(error){throwError_throwError(error,"Discord.setCache")}}};const social_Instagram=class extends discordAuth{tasks;whiteList;#cache=GM_getValue("instagramCache")||{};#auth={};#initialized=!1;constructor(){super();var defaultTasksTemplate={users:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.instagram||{}}}async init(){try{return this.#initialized?!0:await this.#getUserInfo()?(scripts_echoLog({}).success(i18n("initSuccess","Instagram")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Instagram")),!1)}catch(error){return throwError_throwError(error,"Instagram.init"),!1}}async#getUserInfo(name="instagram"){try{const logStatus=scripts_echoLog({type:"instagram"===name?"verifyingInsAuth":"gettingInsUserId",text:name});var userId=this.#cache[name];if(userId&&"instagram"!==name)return logStatus.success(),userId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/${name}/`,method:"GET"});if("Success"!==result)return!1;if(data?.finalUrl.includes("accounts/login"))return logStatus.error("Error:"+i18n("loginIns"),!0),!1;if(data?.finalUrl.includes("www.instagram.com/challenge"))return logStatus.error("Error:"+i18n("insBanned")),!1;if(200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;var csrftoken=data.responseText.match(/"csrf_token":"(.+?)"/)?.[1],hash=data.responseText.match(/"rollout_hash":"(.+?)"/)?.[1];if("instagram"===name)return!(!csrftoken||!hash)&&(this.#auth={csrftoken:csrftoken,hash:hash},!0);var id=data.responseText.match(/"profilePage_([\d]+?)"/)?.[1];return id?(this.#setCache(name,id),logStatus.success(),id):(logStatus.error("Error: Get ins data error!"),!1)}catch(error){return throwError_throwError(error,"Instagram.getUserInfo"),!1}}async#followUser(name){try{var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"followingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/follow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"following"===data.response?.result?(logStatus.success(),this.tasks.users=unique([...this.tasks.users,name]),!0):(logStatus.error("Error:"+(data?.response?.feedback_message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.followUser"),!1}}async#unfollowUser(name){try{if(this.whiteList.users.includes(name))return scripts_echoLog({type:"whiteList",text:"Instagram.unfollowUser",id:name}),!0;var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"unfollowingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/unfollow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"ok"===data.response?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.unfollowUser"),!1}}async toggle({doTask=!0,userLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.instagram.users||!doTask&&!globalOptions.undoTask.instagram.users)scripts_echoLog({type:"globalOptionsSkip",text:"instagram.users"});else{var realUsers=this.getRealParams("users",userLinks,doTask,link=>link.match(/https:\/\/www\.instagram\.com\/(.+)?\//)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("instagramCache",this.#cache)}catch(error){throwError_throwError(error,"Instagram.setCache")}}};const social_Reddit=class extends discordAuth{tasks;whiteList;#auth;#initialized=!1;constructor(){super();var defaultTasksTemplate={reddits:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.reddit||{}}}async init(){try{return this.#initialized?!0:await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Reddit")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Reddit")),!1)}catch(error){return throwError_throwError(error,"Reddit.init"),!1}}async#useBeta(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await this.#updateAuth(!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async#updateAuth(beta=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Reddit")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://www.reddit.com/",method:"GET",nochche:!0,headers:{"Cache-Control":"no-cache"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(data?.responseText.includes("www.reddit.com/login/"))return logStatus.error("Error:"+i18n("loginReddit"),!0),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.responseText.includes("redesign-beta-optin-btn")&&!beta)return await this.#useBeta();var accessToken=data.responseText.match(/"accessToken":"(.*?)","expires":"(.*?)"/)?.[1];return accessToken?(this.#auth={token:accessToken},logStatus.success(),!0):(logStatus.error('Error: Parameter "accessToken" not found!'),!1)}catch(error){return throwError_throwError(error,"Reddit.updateAuth"),!1}}async toggleTask({name,doTask=!0}){try{if(!doTask&&this.whiteList.reddits.includes(name))return scripts_echoLog({type:"whiteList",text:"Reddit.undoTask",id:name}),!0;let type=doTask?"joiningReddit":"leavingReddit";/^u_/.test(name)&&(type=doTask?"followingRedditUser":"unfollowingRedditUser");const logStatus=scripts_echoLog({type:type,text:name});var{result,statusText,status,data}=await tools_httpRequest({url:"https://oauth.reddit.com/api/subscribe?redditWebClient=desktop2x&app=desktop2x-client-production&raw_json=1&gilding_detail=1",method:"POST",headers:{authorization:"Bearer "+this.#auth.token,"content-type":"application/x-www-form-urlencoded"},data:$.param({action:doTask?"sub":"unsub",sr_name:name,api_type:"json"})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.reddits=unique([...this.tasks.reddits,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Reddit.toggleTask"),!1}}async toggle({doTask=!0,redditLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.reddit.reddits||!doTask&&!globalOptions.undoTask.reddit.reddits)scripts_echoLog({type:"globalOptionsSkip",text:"reddit.reddits"});else{var realReddits=this.getRealParams("reddits",redditLinks,doTask,userName=>{var name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/)?.[1],userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/)?.[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};const social_Twitch=class extends discordAuth{tasks;whiteList;#auth=GM_getValue("twitchAuth")||{};#cache=GM_getValue("twitchCache")||{};#initialized=!1;#integrityToken;constructor(){super();var defaultTasksTemplate={channels:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.twitch||{}}}async init(){try{return this.#initialized?!0:this.#auth.authToken&&this.#auth.clientId&&this.#auth.clientVersion&&this.#auth.deviceId&&this.#auth.clientSessionId?await this.#verifyAuth(!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(GM_setValue("twitchAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async#verifyAuth(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===data?.status&&data.response?.[0]?.data?.currentUser?(await this.#integrity(isFirst),logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async#integrity(isFirst=!0,ct=""){try{const logStatus=scripts_echoLog({text:i18n("checkingTwitchIntegrity")});if(isFirst&&(!this.#auth.authToken||!this.#auth.clientId||!this.#auth.clientVersion||!this.#auth.deviceId||!this.#auth.clientSessionId))return await this.#updateAuth(!1);var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/integrity",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"x-kpsdk-ct":ct}});return"Success"===result?!ct&&data?.responseHeaders?.["x-kpsdk-ct"]?await this.#integrity(isFirst,data.responseHeaders["x-kpsdk-ct"]):200===data?.status&&data.response?.token?(this.#integrityToken=data.response.token,logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.integrity"),!1}}async#updateAuth(isFirst=!0){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Twitch")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(this.#auth=auth,logStatus.success(),resolve(await this.#verifyAuth(isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async#toggleChannel({name,doTask=!0}){try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await this.#getChannelId(name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"Client-Integrity":this.#integrityToken},data:doTask?followData:unfollowData});return"Success"===result?200===data?.status&&data.response?.[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+(data?.response?.[0].errors?.[0]?.message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async#getChannelId(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=this.#cache[name];if(channelId)return logStatus.success(),channelId;var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const channelId=data.response?.[0]?.data?.user?.id;return channelId?(this.#setCache(name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}async toggle({doTask=!0,channelLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>link.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/)?.[2]);if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("twitchCache",this.#cache)}catch(error){throwError_throwError(error,"Twitch.setCache")}}};const social_Vk=class extends discordAuth{tasks;whiteList;#username="";#cache=GM_getValue("vkCache")||{};#initialized=!1;constructor(){super();var defaultTasksTemplate={names:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.vk||{}}}async init(){try{return this.#initialized?!0:await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Vk")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Vk")),!1)}catch(error){return throwError_throwError(error,"Vk.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});return"Success"===result?data?.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===data?.status?(this.#username=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/)?.[1]||"",logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async#toggleGroup(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkGroup":"leavingVkGroup",text:name});if("enter"===dataParam.groupAct&&!doTask||"leave"===dataParam.groupAct&&doTask)return logStatus.success(),!0;const reqData={act:doTask?"enter":"leave",al:1,gid:dataParam.groupId,hash:dataParam.groupHash};doTask&&(reqData.context="_");var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_groups.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param(reqData)});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.toggleGroup"),!1}}async#togglePublic(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkPublic":"leavingVkPublic",text:name});if(dataParam.publicJoined&&doTask||!dataParam.publicJoined&&!doTask)return logStatus.success(),!0;var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_public.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:doTask?"a_enter":"a_leave",al:1,pid:dataParam.publicPid,hash:dataParam.publicHash})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.togglePublic"),!1}}async#sendWall(name){try{const logStatus=scripts_echoLog({type:"sendingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"publish_box",al:1,object:name})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var hash=data.responseText.match(/shHash:[\s]*'(.*?)'/)?.[1];if(hash){const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({Message:"",act:"a_do_publish",al:1,close_comments:0,friends_only:0,from:"box",hash:hash,list:"",mark_as_ads:0,mute_notifications:0,object:name,ret_data:1,to:0})});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200===dataR?.status){var jsonData=JSON.parse(dataR.responseText?.replace("\x3c!--","")||"{}");if(!0===jsonData?.payload?.[1]?.[1]?.share_my){logStatus.success();var postId=String(jsonData?.payload?.[1]?.[1]?.post_id),ownerId=String(jsonData?.payload?.[1]?.[1]?.owner_id);return postId&&ownerId&&this.#setCache(name,ownerId+"_"+postId),this.tasks.names=unique([...this.tasks.names,name]),!0}}return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1}return logStatus.error('Error: Get "hash" failed'),!1}catch(error){return throwError_throwError(error,"Vk.sendWall"),!1}}async#deleteWall(name,dataParams){try{const logStatus=scripts_echoLog({type:"deletingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_wall.php?act=delete",method:"POST",headers:{origin:"https://vk.com",referer:`https://vk.com/${this.#username}?w=wall${this.#cache[name]}%2Fall`,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"delete",al:1,confirm:0,from:"wkview",hash:dataParams.wallHash,post:this.#cache[name]})});return"Success"===result?200===data?.status&&JSON.parse(data.responseText?.replace("\x3c!--","")||"{}")?.payload?.[1]?.[1]?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.deleteWall"),!1}}async#getId(name,doTask){try{let url="https://vk.com/"+name;if(/^wall-/.test(name)){if(doTask)return{type:"sendWall"};if(!this.#cache[name])return{type:"unSupport"};url=`https://vk.com/${this.#username}?w=wall`+this.#cache[name]}const logStatus=scripts_echoLog({type:"gettingVkId",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var[,groupAct,groupId,,groupHash]=data.responseText.match(/Groups.(enter|leave)\(.*?,.*?([\d]+?), ('|')(.*?)('|')/)||[],publicHash=data.responseText.match(/"enterHash":"(.*?)"/)?.[1],publicPid=data.responseText.match(/"public_id":([\d]+?),/)?.[1],publicJoined=!data.responseText.includes("Public.subscribe");if(groupAct&&groupId&&groupHash)return logStatus.success(),{groupAct:groupAct,groupId:groupId,groupHash:groupHash,type:"group"};if(publicHash&&publicPid)return logStatus.success(),{publicHash:publicHash,publicPid:publicPid,publicJoined:publicJoined,type:"public"};if(data.responseText.includes("wall.deletePost")&&!doTask){var wallHash=data.responseText.match(/wall\.deletePost\(this, '.*?', '(.*?)'\)/)?.[1];if(wallHash)return logStatus.success(),{type:"deleteWall",wallHash:wallHash}}else if(name.includes("wall")&&doTask)return logStatus.success(),{type:"sendWall"};return logStatus.error("Error: Parameters not found!"),!1}catch(error){return throwError_throwError(error,"Vk.getId"),!1}}async#toggleVk({name,doTask=!0}){try{if(!doTask&&this.whiteList.names.includes(name))return scripts_echoLog({type:"whiteList",text:"Vk.undoTask",id:name}),!0;var formatName=name.replace(/\/$/,""),data=await this.#getId(formatName,doTask);if(!data)return!1;switch(data.type){case"group":return await this.#toggleGroup(formatName,data,doTask);case"public":return await this.#togglePublic(formatName,data,doTask);case"sendWall":return!doTask||await this.#sendWall(formatName);case"deleteWall":return!!doTask||await this.#deleteWall(formatName,data);default:return!1}}catch(error){return throwError_throwError(error,"Vk.toggleVk"),!1}}async toggle({doTask=!0,nameLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.vk.names||!doTask&&!globalOptions.undoTask.vk.names)scripts_echoLog({type:"globalOptionsSkip",text:"vk.names"});else{var realNames=this.getRealParams("names",nameLinks,doTask,link=>link.match(/https:\/\/vk\.com\/([^/]+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}#setCache(name,postId){try{this.#cache[name]=postId,GM_setValue("vkCache",this.#cache)}catch(error){throwError_throwError(error,"Vk.setCache")}}};class Youtube extends discordAuth{tasks;whiteList;#auth=GM_getValue("youtubeAuth")||{};#initialized=!1;#verifyChannel="https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel;constructor(){super();var defaultTasksTemplate={channels:[],likes:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.youtube||{}}}async init(){try{return this.#initialized?!0:this.#auth.PAPISID?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(GM_setValue("youtubeAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async#verifyAuth(){try{return await this.#toggleChannel({link:this.#verifyChannel,doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{GM_cookie.list({url:"https://www.youtube.com/@YouTube"},async(PAPISID,error)=>{error?(logStatus.error("Error: Update youtube auth failed!"),resolve(!1)):(PAPISID=PAPISID.find(cookie=>"__Secure-3PAPISID"===cookie.name)?.value)?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),this.#auth={PAPISID:PAPISID},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error(i18n("needLogin")),resolve(!1))})})}catch(error){return throwError_throwError(error,"Youtube.updateAuth"),!1}}#getInfo(link,type){return async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/)?.[1],context=(data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))?.[1]||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var channelId=data.responseText.match(/"channelId":"(.+?)"/)?.[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var videoId=data.responseText.match(//)?.[1],likeParams=data.responseText.match(/"likeParams":"(.*?)"/)?.[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}}(link,type)}async#toggleChannel({link,doTask=!0,verify=!1}){try{var{params,needLogin}=await this.#getInfo(link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=${apiKey}&prettyPrint=false`,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client?.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:request?.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===data?.status?doTask&&(/"subscribed":true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed":false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async#toggleLikeVideo({link,doTask=!0}){try{var{params,needLogin}=await this.#getInfo(link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===data?.status?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}async toggle({doTask=!0,channelLinks=[],videoLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}const social_SteamASF=class{#asfOptions;#botName="asf";#groupInfo;async init(){try{var asfCommandsUrl=new URL("/Api/Command/",globalOptions.ASF.AsfIpcUrl);this.#asfOptions={url:asfCommandsUrl.href,method:"POST",responseType:"json",headers:{accept:"application/json","Content-Type":"application/json",Host:asfCommandsUrl.host,Origin:asfCommandsUrl.origin,Referer:asfCommandsUrl.href,Authentication:globalOptions.ASF.AsfIpcPassword}},globalOptions.ASF.AsfBotname&&(this.#botName=globalOptions.ASF.AsfBotname);const logStatus=scripts_echoLog({text:i18n("initingASF")});var{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:'{"Command":"!stats"}'});return"Success"===result?!0===data?.response?.Success&&"OK"===data.response.Message&&data.response.Result?(logStatus.success(),!0):(data?.response?.Result||data?.response?.Message?logStatus.error(data?.response?.Result||data.response.Message):logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.init"),!1}}async joinGroup(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!JOINGROUP ${this.#botName} `+groupName})});return"Success"===result?200===data?.status&&["已加入","已申请","Joined","Applied","Присоединился","costs"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.joinGroup"),!1}}async leaveGroup(groupName){try{if(!this.#groupInfo&&!await this.#getGroupId())return!1;var groupId=await this.#groupInfo[groupName];if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!LEAVEGROUP ${this.#botName} `+groupId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.leaveGroup"),!1}}async#getGroupId(){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:"All"}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:"!GROUPLIST "+this.#botName})});return"Success"===result?200===data?.status&&data.response?.Result?.includes("|")?(this.#groupInfo=Object.fromEntries(data.response.Result.split("\n").map(id=>{var[,name,id]=id.trim().split("|");return name&&id?[name,id]:null}).filter(ele=>ele)),logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.getGroupID"),!1}}async addToWishlist(gameId){try{const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!ADDWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.addToWishlist"),!1}}async removeFromWishlist(gameId){try{const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REMOVEWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.removeFromWishlist"),!1}}async toggleFollowGame(gameId,doTask){try{const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWGAME ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.toggleFollowGame"),!1}}async toggleCurator(curatorId,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWCURATOR ${this.#botName} `+curatorId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async addLicense(id){try{const[type,ids]=id.split("-");if("appid"===type){const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} app/`+ids})});return"Success"===result?200===data?.status&&["AlreadyPurchased","OK"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{const idsArr=ids.split(","),logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} `+idsArr.map(id=>"sub/"+id).join(",")})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200===data?.status&&data.response?.Result){const resultLines=data.response.Result.split("\n");return idsArr.forEach(subid=>{const targetLine=resultLines.find(text=>text.includes(subid));targetLine&&["成功","Success","Успех"].find(text=>targetLine.includes(text))?scripts_echoLog({}).success(targetLine):scripts_echoLog({}).error(targetLine)}),!0}return logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1}}catch(error){return throwError_throwError(error,"SteamASF.addLicense"),!1}}async requestPlayTestAccess(id){try{const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REQUESTACCESS ${this.#botName} `+id})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}};const social_Steam=class extends discordAuth{tasks;whiteList;#cache={group:{},officialGroup:{},forum:{},workshop:{},curator:{},...GM_getValue("steamCache")};#auth={};#storeInitialized=!1;#communityInitialized=!1;#area="CN";#areaStatus="end";#ASF;constructor(){super();var defaultTasksTemplate={groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.steam||{}}}async init(type="all"){try{if(globalOptions.ASF.AsfEnabled&&globalOptions.ASF.AsfIpcUrl&&globalOptions.ASF.AsfIpcPassword)return this.#ASF=new social_SteamASF,!!await this.#ASF.init()&&(this.#storeInitialized=!0,this.#communityInitialized=!0);if("store"===type){if(this.#storeInitialized)return!0;let storeInitialized=await this.#updateStoreAuth();return(storeInitialized=storeInitialized||await this.#updateStoreAuthTab(),this.#storeInitialized=storeInitialized,this.#storeInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamStore")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}if("community"!==type)return this.#storeInitialized&&this.#communityInitialized?(scripts_echoLog({}).success(i18n("initSuccess","Steam")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1);{if(this.#communityInitialized)return!0;let communityInitialized=await this.#getUserLink();return(communityInitialized=communityInitialized||await this.#updateCommunityAuthTab(),this.#communityInitialized=communityInitialized,this.#communityInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamCommunity")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}}catch(error){return throwError_throwError(error,"Steam.init"),!1}}async#refreshToken(type="steamStore"){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n(type))}),formData=new FormData;formData.append("redir",`https://${host[type]}/`);var{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://"+host[type],Referer:`https://${host[type]}/`},data:formData});return"Success"===result?data?.response?.success?await this.#setStoreToken(data.response,type)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshToken"),!1}}async#setStoreToken(param,type){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("settingToken",i18n(type))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:`https://${host[type]}/login/settoken`,method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:host[type],Origin:"https://"+host[type]},data:formData});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async#updateStoreAuth(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200!==data?.status)return[301,302].includes(data?.status)?await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):(logStatus.error(result+`:${statusText}(${status})`),!1);if(!data.responseText.includes("data-miniprofile="))return await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1);var storeSessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(this.#auth.storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async#updateStoreAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))});return await new Promise(resolve=>{const newTab=window.open("https://store.steampowered.com/","mozillaWindow","pop=1;");GM_setValue("steamStoreAuth","update");const listenerId=GM_addValueChangeListener("steamStoreAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.storeSessionID=newValue.storeSessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateStoreAuthTab"),!1}}async#updateCommunityAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))});return await new Promise(resolve=>{const newTab=window.open("https://steamcommunity.com/my","mozillaWindow","pop=1;");GM_setValue("steamCommunityAuth","update");const listenerId=GM_addValueChangeListener("steamCommunityAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.steam64Id=newValue.steam64Id,this.#auth.userName=newValue.userName,this.#auth.communitySessionID=newValue.communitySessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuthTab"),!1}}async#getUserLink(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("gettingUserLink")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200===data?.status){if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}if(302===data?.status)return!await this.#refreshToken("steamCommunity")||retry?(logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1):(logStatus.warning(i18n("retry")),this.#getUserLink(!0));const location=data?.responseHeaders?.split("\n")?.find(header=>header.includes("location")?header.replace("loctation:","").trim():null);return 301===data?.status&&location?.includes("steamcommunity.com/id")?(logStatus.success(),await this.#updateCommunityAuth(data.finalUrl)):(301===data?.status&&location?.includes("https://steamcommunity.com/login/home")?logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0):logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#updateCommunityAuth(url){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#getAreaInfo(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{var cartConfigRaw=data.responseText.match(/data-cart_config="(.*?)"/)?.[1];const temp=document.createElement("div");temp.innerHTML=cartConfigRaw||"{}";var cartConfigStr=temp.textContent||temp.innerText;let cartConfig;try{cartConfig=JSON.parse(cartConfigStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}if(!cartConfig.rgUserCountryOptions)return logStatus.warning("Warning: Area cannot be changed"),{};var userInfoRaw=data.responseText.match(/data-userinfo="(.*?)"/)?.[1];const temp1=document.createElement("div");temp1.innerHTML=userInfoRaw||"{}";var userInfoStr=temp1.textContent||temp1.innerText;let userInfo;try{userInfo=JSON.parse(userInfoStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}var currentArea=userInfo.country_code,areas=Object.keys(cartConfig.rgUserCountryOptions).filter(area=>"help"!==area);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==this.#areaStatus&&(clearInterval(checker),resolve(!0))})}),this.#area===area||!area&&"CN"!==this.#area)return!0;this.#areaStatus="waiting";let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await this.#getAreaInfo();if(!currentArea||!areas)return!(this.#areaStatus="error");if("CN"!==currentArea)return this.#areaStatus="skip",scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return this.#areaStatus="noAnotherArea",scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/country/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:this.#auth.storeSessionID})});if("Success"!==result)return this.#areaStatus="error",logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==data?.status||"true"!==data.responseText)return this.#areaStatus="error",logStatus.error(`Error:${data?.statusText}(${data?.status})`),"CN";var currentArea=(await this.#getAreaInfo())["currentArea"];return currentArea===aimedArea?(this.#areaStatus="success",logStatus.success(),currentArea):(this.#areaStatus="error",logStatus.error("Error: change country filed"),"CN")}catch(error){return this.#areaStatus="error",throwError_throwError(error,"Steam.changeArea"),!1}}async#joinGroup(groupName){try{if(this.#ASF)return!!await this.#ASF.joinGroup(groupName)&&(this.tasks.groups=unique([...this.tasks.groups,groupName]),!0);const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async#leaveGroup(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(groupName);var groupId=await this.#getGroupId(groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===data?.status&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async#getGroupId(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var groupId=this.#cache.group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)?.[1];return groupId?(this.#setCache("group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#joinOfficialGroup(gameId){try{if(this.#ASF)return!!await this.#ASF.joinGroup(gameId)&&(this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]),!0);const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+this.#auth.communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId&&this.#setCache("officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async#leaveOfficialGroup(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(gameId);var groupId=await this.#getOfficialGroupId(gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===dataR?.status&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async#getOfficialGroupId(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var groupId=this.#cache.officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId?(this.#setCache("officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#addToWishlist(gameId){try{if(this.#ASF)return!!await this.#ASF.addToWishlist(gameId)&&(this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0);const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===dataR?.status?"CN"===this.#area&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#addToWishlist(gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async#removeFromWishlist(gameId){try{if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;if(this.#ASF)return await this.#ASF.removeFromWishlist(gameId);const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==dataR?.status)return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1;if("CN"===this.#area&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#removeFromWishlist(gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async#toggleFollowGame(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;if(this.#ASF)return!!await this.#ASF.toggleFollowGame(gameId,doTask)&&(doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0);const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:this.#auth.storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===data?.status&&"true"===data.responseText)return logStatus.success(),!0;var followed=await this.#isFollowedGame(gameId);return"CN"===this.#area&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#removeFromWishlist(gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async#isFollowedGame(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===data?.status&&("CN"===this.#area&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async#toggleForum(gameId,doTask=!0){try{if(!doTask&&this.whiteList.forums.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unsubscribeForum",id:gameId}),!0;const forumId=await this.#getForumId(gameId);if(!forumId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}subscribingForum`,text:gameId});var[id,feature]=forumId.split("_"),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/forum/${id}/General/${doTask?"":"un"}subscribe/${feature||"0"}/`,method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.communitySessionID})});return"Success"===result?(200!==data?.status||1!==data.response?.success&&29!==data.response?.success?logStatus.error(`Error:${data?.statusText}(${data?.status})`):(doTask&&(this.tasks.forums=unique([...this.tasks.forums,gameId])),logStatus.success()),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.toggleForum"),!0}}async#getForumId(gameId){try{const logStatus=scripts_echoLog({type:"gettingForumId",text:gameId});var forumId=this.#cache.forum[gameId];if(forumId)return logStatus.success(),forumId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/app/${gameId}/discussions/`,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const forumId=data.responseText?.match(/General_([\d]+(_[\d]+)?)/)?.[1];return forumId?(this.#setCache("forum",gameId,forumId),logStatus.success(),forumId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getForumId"),!1}}async#toggleFavoriteWorkshop(id,doTask=!0){try{if(!doTask&&this.whiteList.workshops.includes(id))return scripts_echoLog({type:"whiteList",text:"Steam.unfavoriteWorkshop",id:id}),!0;var appid=await this.#getWorkshopAppId(id);if(!appid)return!1;const logStatus=scripts_echoLog({type:doTask?"favoritingWorkshop":"unfavoritingWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/sharedfiles/${doTask?"":"un"}favorite`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,appid:appid,sessionid:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(doTask&&(this.tasks.workshops=unique([...this.tasks.workshops,id])),logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFavoriteWorkshop"),!1}}async#getWorkshopAppId(id){try{const logStatus=scripts_echoLog({type:"gettingWorkshopAppId",text:id});var appId=this.#cache.workshop[id];if(appId)return logStatus.success(),appId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/filedetails/?id="+id,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const appId=data.responseText.match(//)?.[1];return appId?(this.#setCache("workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async#voteUpWorkshop(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:this.#auth.communitySessionID})});return"Success"===result?(200===data?.status&&1===data.response?.success?logStatus.success():logStatus.error(`Error:${data?.statusText}(${data?.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async#toggleCurator(curatorId,doTask=!0){try{if(!doTask&&this.whiteList.curators.includes(curatorId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowCurator",id:curatorId}),!0;if(this.#ASF)return await this.#ASF.toggleCurator(curatorId,doTask);const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/curators/ajaxfollow",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({clanid:curatorId,sessionid:this.#auth.storeSessionID,follow:doTask}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response?.success?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(`+data?.response?.success||data?.status+")"),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async getCuratorId(path,name){try{const logStatus=scripts_echoLog({type:"gettingCuratorId",text:path+"/"+name});var curatorId=this.#cache.curator[path+"/"+name];if(curatorId)return logStatus.success(),curatorId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/${path}/`+name,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const curatorId=data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)?.[1];return curatorId?(this.#setCache("curator",path+"/"+name,curatorId),logStatus.success(),curatorId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getCuratorID"),!1}}async#toggleCuratorLike(link,doTask=!0){try{var[path,name]=link.split("/");if(!path||!name)return scripts_echoLog({text:i18n("errorLink",link)}),!1;var curatorId=await this.getCuratorId(path,name);return curatorId?await this.#toggleCurator(curatorId,doTask):!1}catch(error){return throwError_throwError(error,"Steam.toggleCuratorLike"),!1}}async#getAnnouncementParams(appId,viewId){try{const logStatus=scripts_echoLog({type:"gettingAnnouncementParams",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/events/ajaxgetpartnerevent?appid=${appId}&announcement_gid=${viewId}&lang_list=6_0&last_modified_time=0&origin=https:%2F%2Fstore.steampowered.com&for_edit=false`,method:"GET",responseType:"json",headers:{Host:"store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status||1!==data?.response?.success)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};var{clanid,gid}=data.response.event?.announcement_body||{};return clanid?(logStatus.success(),{clanId:clanid,gid:gid}):(logStatus.error(`Error:${data.statusText}(${data.status})`),{})}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),{}}}async#likeAnnouncement(id){try{var[appId,viewId]=id.split("/");if(!appId||!viewId)return scripts_echoLog({}).error(i18n("missParams")+"(id)"),!1;var{clanId,gid}=await this.#getAnnouncementParams(appId,viewId);if(!clanId)return!1;const logStatus=scripts_echoLog({type:"likingAnnouncement",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/updated/ajaxrateupdate/"+(gid||viewId),method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId},data:$.param({sessionid:this.#auth.storeSessionID,voteup:1,clanid:clanId,ajax:1}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),!1}}async#appid2subid(id){try{const logStatus=scripts_echoLog({type:"gettingSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+id,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#appid2subid(id):!1}var subid=data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];return subid?(logStatus.success(),subid):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.appid2subid"),!1}}async#getLicenses(){try{const logStatus=scripts_echoLog({text:i18n("gettingLicenses")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/dynamicstore/userdata/?t="+(new Date).getTime(),method:"GET",responseType:"json"});return"Success"===result?200===data?.status?(logStatus.success(),data.response?.rgOwnedPackages):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.getLicenses"),!1}}async#addLicense(id){try{if(this.#ASF)return await this.#ASF.addLicense(id);const[type,ids]=id.split("-");if("appid"===type){var subid=await this.#appid2subid(ids);if(!subid)return!1;const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids});if(!await this.#addFreeLicense(subid,logStatus))return!1;const{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+ids,method:"GET"});return"Success"===result?200===data?.status?data.responseText.includes("ds_owned_flag ds_flag")||data.responseText.includes('class="already_in_library"')?(logStatus.success(),!0):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{"CN"===this.#area&&(scripts_echoLog({}).success(i18n("tryChangeAreaNotice")),await this.#changeArea());const logStatusArr={};var idsArr=ids.split(",");for(const subid of idsArr){var logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:subid});if(!await this.#addFreeLicense(subid,logStatus))return!1;logStatusArr[subid]=logStatus}const licenses=await this.#getLicenses();if(!licenses)return!1;for(const subid of idsArr)licenses.includes(parseInt(subid,10))?logStatusArr[subid].success():logStatusArr[subid].error();return!0}}catch(error){return throwError_throwError(error,"Steam.addLicense"),!1}}async#addFreeLicense(id,logStatusPre){try{const logStatus=logStatusPre||scripts_echoLog({type:"addingFreeLicenseSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:this.#auth.storeSessionID,subid:id}),dataType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result?await this.#addFreeLicense(id):!1}return logStatus.success(),!0}catch(error){return throwError_throwError(error,"Steam.addFreeLicense"),!1}}async#requestPlayTestAccess(id){try{if(this.#ASF)return await this.#ASF.requestPlayTestAccess(id);const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+id,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+id},data:$.param({sessionid:this.#auth.storeSessionID}),dataType:"json"});return"Success"===result?200===data?.status&&1===data?.response?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}async toggle({doTask=!0,groupLinks=[],officialGroupLinks=[],wishlistLinks=[],followLinks=[],forumLinks=[],workshopLinks=[],workshopVoteLinks=[],curatorLinks=[],curatorLikeLinks=[],announcementLinks=[],licenseLinks=[],playtestLinks=[]}){try{if(0<[...groupLinks,...officialGroupLinks,...forumLinks,...workshopLinks,...workshopVoteLinks].length&&!this.#communityInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;if(0<[...wishlistLinks,...followLinks,...curatorLinks,...curatorLikeLinks,...announcementLinks,...licenseLinks,...playtestLinks].length&&!this.#storeInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.steam.groups||!doTask&&!globalOptions.undoTask.steam.groups)scripts_echoLog({type:"globalOptionsSkip",text:"steam.groups"});else{var realGroups=this.getRealParams("groups",groupLinks,doTask,link=>link.match(/groups\/(.+)\/?/)?.[1]);if(0link.match(/games\/(.+)\/?/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(doTask&&0link.match(/curator\/([\d]+)/)?.[1]),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,link=>link.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/)?.slice(1,3).join("/"));if(0(link.includes("store.steampowered.com")?link.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/):link.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))?.slice(1,3).join("/"));if(doTask&&0link.match(/app\/([\d]+)/)?.[1]);if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==this.#area&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await this.#changeArea("CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}#setCache(type,name,id){try{this.#cache[type][name]=id,GM_setValue("steamCache",this.#cache)}catch(error){throwError_throwError(error,"Steam.setCache")}}};const Giveawaysu=class{undoneTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};giveawayId;socialInitialized={discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0};initialized=!1;social={};static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{this.#checkLogin()||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await this.#checkLeftKey()||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!this.#getGiveawayId()&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async#classifyTask(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError_throwError(error,"getRedirectLink"),null}})(taskDes.attr("href")).then(taskLink=>taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.#uniqueTasks(this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}#checkLogin(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async#checkLeftKey(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(({value})=>{value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}#getGiveawayId(){var giveawayId=window.location.href.match(/\/view\/([\d]+)/)?.[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async#bind(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async#initSocial(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(this.#bind("discord",this.social.discord.init("do")))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(this.#bind("instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(this.#bind("reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(this.#bind("twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(this.#bind("vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(this.#bind("youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&tasks.steam?.[type]?.length||0).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(this.#bind("steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}#uniqueTasks(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async#toggleTask(){try{if(!this.initialized&&!this.init())return!1;if(!await this.#classifyTask())return!1;if(!await this.#initSocial())return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await this.#toggleTask()}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};discordAuth=__webpack_require__(82);if(window.STYLE=GM_addStyle(discordAuth.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{var authToken;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(authToken=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientId:commonOptions?.headers?.["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"x.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file diff --git a/dist/auto-task-v4-for-giveawaysu.user.js b/dist/auto-task-v4-for-giveawaysu.user.js index 48fb1d0..b15edfb 100644 --- a/dist/auto-task-v4-for-giveawaysu.user.js +++ b/dist/auto-task-v4-for-giveawaysu.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4-for-giveawaysu // @namespace auto-task-v4-for-giveawaysu -// @version 4.4.7 +// @version 4.4.8 // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -18,6 +18,8 @@ // @include *://www.twitch.tv/* // @include *://www.youtube.com/* // @include *://*.reddit.com/* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @grant GM_addStyle // @grant GM_setValue @@ -74,7 +76,7 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); -!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o{isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] +!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o{isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] 环境: @@ -91,4 +93,4 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); `+error.stack)}const httpRequest_httpRequest=async(options,times=0)=>{window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest_httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError_throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest_httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ - ${text?.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError_throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)});const defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};discordAuth=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,discordAuth);const languages={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",updateHistory:'历史更新记录点此查看',AsfEnabled:'使用ASF做Steam相关任务(需ASFEnhance插件)',AsfIpcUrl:"ASF IPC 地址",AsfIpcPassword:"ASF IPC 密码",versionNotMatched:"脚本管理器版本过低,需TamperMonkey >= 5.2.0或TamperMonkey Beta >= 5.2.6196",groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",gettingUserLink:"正在获取Steam用户社区链接...",retry:"重试",initingASF:"正在初始化ASF...",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",campaign:"检测到人机验证,请完成验证后重新验证任务!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",tasksNotCompleted:"任务未完成",confirmingTask:"正在跳过警告页面..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",updateHistory:'Click here to view the historical update record.',AsfEnabled:'Use ASF to do Steam related tasks (requires ASFEnhance plugin)',AsfIpcUrl:"ASF IPC URL",AsfIpcPassword:"ASF IPC Password",groups:"Group",officialGroups:"Official Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",gettingCuratorId:"Getting Steam Curator Id",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",versionNotMatched:"The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196",gettingUserLink:"Getting steam user community link...",retry:"Retry",initingASF:"Initing ASF...",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",campaign:"ReCAPTCHA detected, please complete it and re-verify the tasks!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning...",tasksNotCompleted:"Tasks Not Completed",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=(key,...argvs)=>languages[language]?.[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key;discordAuth=class{tasks;getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)))return this.#initialized=!1,"skip";return GM_getValue("dontRemindDiscordAgain")||"do"===action&&!globalOptions.doTask.discord.servers||"undo"===action&&!globalOptions.undoTask.discord.servers?(this.#initialized=!1,"skip"):!!this.#initialized||(this.#auth.auth?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(GM_setValue("discordAuth",{auth:null}),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0))}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Discord")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:this.#auth.auth}});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Discord")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("discordAuth")?.auth;auth?(this.#auth={auth:auth},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async#joinServer(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:this.#auth.auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(data.response?.guild?.id);return guild&&(this.#setCache(inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async#leaveServer(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await this.#getGuild(inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:this.#auth.auth}});return"Success"===result&&204===data?.status?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async#getGuild(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=this.#cache[inviteId];if(guild)return logStatus.success(),guild;var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=data.response?.guild?.id;return guild?(logStatus.success(),this.#setCache(inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}async toggle({doTask=!0,serverLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,link=>link.match(/invite\/(.+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}#setCache(inviteId,guild){try{this.#cache[inviteId]=guild,GM_setValue("discordCache",this.#cache)}catch(error){throwError_throwError(error,"Discord.setCache")}}};const social_Instagram=class extends discordAuth{tasks;whiteList;#cache=GM_getValue("instagramCache")||{};#auth={};#initialized=!1;constructor(){super();var defaultTasksTemplate={users:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.instagram||{}}}async init(){try{return this.#initialized?!0:await this.#getUserInfo()?(scripts_echoLog({}).success(i18n("initSuccess","Instagram")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Instagram")),!1)}catch(error){return throwError_throwError(error,"Instagram.init"),!1}}async#getUserInfo(name="instagram"){try{const logStatus=scripts_echoLog({type:"instagram"===name?"verifyingInsAuth":"gettingInsUserId",text:name});var userId=this.#cache[name];if(userId&&"instagram"!==name)return logStatus.success(),userId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/${name}/`,method:"GET"});if("Success"!==result)return!1;if(data?.finalUrl.includes("accounts/login"))return logStatus.error("Error:"+i18n("loginIns"),!0),!1;if(data?.finalUrl.includes("www.instagram.com/challenge"))return logStatus.error("Error:"+i18n("insBanned")),!1;if(200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;var csrftoken=data.responseText.match(/"csrf_token":"(.+?)"/)?.[1],hash=data.responseText.match(/"rollout_hash":"(.+?)"/)?.[1];if("instagram"===name)return!(!csrftoken||!hash)&&(this.#auth={csrftoken:csrftoken,hash:hash},!0);var id=data.responseText.match(/"profilePage_([\d]+?)"/)?.[1];return id?(this.#setCache(name,id),logStatus.success(),id):(logStatus.error("Error: Get ins data error!"),!1)}catch(error){return throwError_throwError(error,"Instagram.getUserInfo"),!1}}async#followUser(name){try{var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"followingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/follow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"following"===data.response?.result?(logStatus.success(),this.tasks.users=unique([...this.tasks.users,name]),!0):(logStatus.error("Error:"+(data?.response?.feedback_message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.followUser"),!1}}async#unfollowUser(name){try{if(this.whiteList.users.includes(name))return scripts_echoLog({type:"whiteList",text:"Instagram.unfollowUser",id:name}),!0;var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"unfollowingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/unfollow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"ok"===data.response?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.unfollowUser"),!1}}async toggle({doTask=!0,userLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.instagram.users||!doTask&&!globalOptions.undoTask.instagram.users)scripts_echoLog({type:"globalOptionsSkip",text:"instagram.users"});else{var realUsers=this.getRealParams("users",userLinks,doTask,link=>link.match(/https:\/\/www\.instagram\.com\/(.+)?\//)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("instagramCache",this.#cache)}catch(error){throwError_throwError(error,"Instagram.setCache")}}};const social_Reddit=class extends discordAuth{tasks;whiteList;#auth;#initialized=!1;constructor(){super();var defaultTasksTemplate={reddits:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.reddit||{}}}async init(){try{return this.#initialized?!0:await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Reddit")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Reddit")),!1)}catch(error){return throwError_throwError(error,"Reddit.init"),!1}}async#useBeta(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await this.#updateAuth(!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async#updateAuth(beta=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Reddit")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://www.reddit.com/",method:"GET",nochche:!0,headers:{"Cache-Control":"no-cache"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(data?.responseText.includes("www.reddit.com/login/"))return logStatus.error("Error:"+i18n("loginReddit"),!0),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.responseText.includes("redesign-beta-optin-btn")&&!beta)return await this.#useBeta();var accessToken=data.responseText.match(/"accessToken":"(.*?)","expires":"(.*?)"/)?.[1];return accessToken?(this.#auth={token:accessToken},logStatus.success(),!0):(logStatus.error('Error: Parameter "accessToken" not found!'),!1)}catch(error){return throwError_throwError(error,"Reddit.updateAuth"),!1}}async toggleTask({name,doTask=!0}){try{if(!doTask&&this.whiteList.reddits.includes(name))return scripts_echoLog({type:"whiteList",text:"Reddit.undoTask",id:name}),!0;let type=doTask?"joiningReddit":"leavingReddit";/^u_/.test(name)&&(type=doTask?"followingRedditUser":"unfollowingRedditUser");const logStatus=scripts_echoLog({type:type,text:name});var{result,statusText,status,data}=await tools_httpRequest({url:"https://oauth.reddit.com/api/subscribe?redditWebClient=desktop2x&app=desktop2x-client-production&raw_json=1&gilding_detail=1",method:"POST",headers:{authorization:"Bearer "+this.#auth.token,"content-type":"application/x-www-form-urlencoded"},data:$.param({action:doTask?"sub":"unsub",sr_name:name,api_type:"json"})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.reddits=unique([...this.tasks.reddits,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Reddit.toggleTask"),!1}}async toggle({doTask=!0,redditLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.reddit.reddits||!doTask&&!globalOptions.undoTask.reddit.reddits)scripts_echoLog({type:"globalOptionsSkip",text:"reddit.reddits"});else{var realReddits=this.getRealParams("reddits",redditLinks,doTask,userName=>{var name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/)?.[1],userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/)?.[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};const social_Twitch=class extends discordAuth{tasks;whiteList;#auth=GM_getValue("twitchAuth")||{};#cache=GM_getValue("twitchCache")||{};#initialized=!1;#integrityToken;constructor(){super();var defaultTasksTemplate={channels:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.twitch||{}}}async init(){try{return this.#initialized?!0:this.#auth.authToken&&this.#auth.clientId&&this.#auth.clientVersion&&this.#auth.deviceId&&this.#auth.clientSessionId?await this.#verifyAuth(!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(GM_setValue("twitchAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async#verifyAuth(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===data?.status&&data.response?.[0]?.data?.currentUser?(await this.#integrity(isFirst),logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async#integrity(isFirst=!0,ct=""){try{const logStatus=scripts_echoLog({text:i18n("checkingTwitchIntegrity")});if(isFirst&&(!this.#auth.authToken||!this.#auth.clientId||!this.#auth.clientVersion||!this.#auth.deviceId||!this.#auth.clientSessionId))return await this.#updateAuth(!1);var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/integrity",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"x-kpsdk-ct":ct}});return"Success"===result?!ct&&data?.responseHeaders?.["x-kpsdk-ct"]?await this.#integrity(isFirst,data.responseHeaders["x-kpsdk-ct"]):200===data?.status&&data.response?.token?(this.#integrityToken=data.response.token,logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.integrity"),!1}}async#updateAuth(isFirst=!0){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Twitch")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(this.#auth=auth,logStatus.success(),resolve(await this.#verifyAuth(isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async#toggleChannel({name,doTask=!0}){try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await this.#getChannelId(name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"Client-Integrity":this.#integrityToken},data:doTask?followData:unfollowData});return"Success"===result?200===data?.status&&data.response?.[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+(data?.response?.[0].errors?.[0]?.message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async#getChannelId(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=this.#cache[name];if(channelId)return logStatus.success(),channelId;var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const channelId=data.response?.[0]?.data?.user?.id;return channelId?(this.#setCache(name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}async toggle({doTask=!0,channelLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>link.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/)?.[2]);if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("twitchCache",this.#cache)}catch(error){throwError_throwError(error,"Twitch.setCache")}}};const social_Vk=class extends discordAuth{tasks;whiteList;#username="";#cache=GM_getValue("vkCache")||{};#initialized=!1;constructor(){super();var defaultTasksTemplate={names:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.vk||{}}}async init(){try{return this.#initialized?!0:await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Vk")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Vk")),!1)}catch(error){return throwError_throwError(error,"Vk.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});return"Success"===result?data?.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===data?.status?(this.#username=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/)?.[1]||"",logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async#toggleGroup(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkGroup":"leavingVkGroup",text:name});if("enter"===dataParam.groupAct&&!doTask||"leave"===dataParam.groupAct&&doTask)return logStatus.success(),!0;const reqData={act:doTask?"enter":"leave",al:1,gid:dataParam.groupId,hash:dataParam.groupHash};doTask&&(reqData.context="_");var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_groups.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param(reqData)});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.toggleGroup"),!1}}async#togglePublic(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkPublic":"leavingVkPublic",text:name});if(dataParam.publicJoined&&doTask||!dataParam.publicJoined&&!doTask)return logStatus.success(),!0;var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_public.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:doTask?"a_enter":"a_leave",al:1,pid:dataParam.publicPid,hash:dataParam.publicHash})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.togglePublic"),!1}}async#sendWall(name){try{const logStatus=scripts_echoLog({type:"sendingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"publish_box",al:1,object:name})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var hash=data.responseText.match(/shHash:[\s]*'(.*?)'/)?.[1];if(hash){const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({Message:"",act:"a_do_publish",al:1,close_comments:0,friends_only:0,from:"box",hash:hash,list:"",mark_as_ads:0,mute_notifications:0,object:name,ret_data:1,to:0})});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200===dataR?.status){var jsonData=JSON.parse(dataR.responseText?.replace("\x3c!--","")||"{}");if(!0===jsonData?.payload?.[1]?.[1]?.share_my){logStatus.success();var postId=String(jsonData?.payload?.[1]?.[1]?.post_id),ownerId=String(jsonData?.payload?.[1]?.[1]?.owner_id);return postId&&ownerId&&this.#setCache(name,ownerId+"_"+postId),this.tasks.names=unique([...this.tasks.names,name]),!0}}return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1}return logStatus.error('Error: Get "hash" failed'),!1}catch(error){return throwError_throwError(error,"Vk.sendWall"),!1}}async#deleteWall(name,dataParams){try{const logStatus=scripts_echoLog({type:"deletingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_wall.php?act=delete",method:"POST",headers:{origin:"https://vk.com",referer:`https://vk.com/${this.#username}?w=wall${this.#cache[name]}%2Fall`,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"delete",al:1,confirm:0,from:"wkview",hash:dataParams.wallHash,post:this.#cache[name]})});return"Success"===result?200===data?.status&&JSON.parse(data.responseText?.replace("\x3c!--","")||"{}")?.payload?.[1]?.[1]?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.deleteWall"),!1}}async#getId(name,doTask){try{let url="https://vk.com/"+name;if(/^wall-/.test(name)){if(doTask)return{type:"sendWall"};if(!this.#cache[name])return{type:"unSupport"};url=`https://vk.com/${this.#username}?w=wall`+this.#cache[name]}const logStatus=scripts_echoLog({type:"gettingVkId",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var[,groupAct,groupId,,groupHash]=data.responseText.match(/Groups.(enter|leave)\(.*?,.*?([\d]+?), ('|')(.*?)('|')/)||[],publicHash=data.responseText.match(/"enterHash":"(.*?)"/)?.[1],publicPid=data.responseText.match(/"public_id":([\d]+?),/)?.[1],publicJoined=!data.responseText.includes("Public.subscribe");if(groupAct&&groupId&&groupHash)return logStatus.success(),{groupAct:groupAct,groupId:groupId,groupHash:groupHash,type:"group"};if(publicHash&&publicPid)return logStatus.success(),{publicHash:publicHash,publicPid:publicPid,publicJoined:publicJoined,type:"public"};if(data.responseText.includes("wall.deletePost")&&!doTask){var wallHash=data.responseText.match(/wall\.deletePost\(this, '.*?', '(.*?)'\)/)?.[1];if(wallHash)return logStatus.success(),{type:"deleteWall",wallHash:wallHash}}else if(name.includes("wall")&&doTask)return logStatus.success(),{type:"sendWall"};return logStatus.error("Error: Parameters not found!"),!1}catch(error){return throwError_throwError(error,"Vk.getId"),!1}}async#toggleVk({name,doTask=!0}){try{if(!doTask&&this.whiteList.names.includes(name))return scripts_echoLog({type:"whiteList",text:"Vk.undoTask",id:name}),!0;var formatName=name.replace(/\/$/,""),data=await this.#getId(formatName,doTask);if(!data)return!1;switch(data.type){case"group":return await this.#toggleGroup(formatName,data,doTask);case"public":return await this.#togglePublic(formatName,data,doTask);case"sendWall":return!doTask||await this.#sendWall(formatName);case"deleteWall":return!!doTask||await this.#deleteWall(formatName,data);default:return!1}}catch(error){return throwError_throwError(error,"Vk.toggleVk"),!1}}async toggle({doTask=!0,nameLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.vk.names||!doTask&&!globalOptions.undoTask.vk.names)scripts_echoLog({type:"globalOptionsSkip",text:"vk.names"});else{var realNames=this.getRealParams("names",nameLinks,doTask,link=>link.match(/https:\/\/vk\.com\/([^/]+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}#setCache(name,postId){try{this.#cache[name]=postId,GM_setValue("vkCache",this.#cache)}catch(error){throwError_throwError(error,"Vk.setCache")}}};class Youtube extends discordAuth{tasks;whiteList;#auth=GM_getValue("youtubeAuth")||{};#initialized=!1;#verifyChannel="https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel;constructor(){super();var defaultTasksTemplate={channels:[],likes:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.youtube||{}}}async init(){try{return this.#initialized?!0:this.#auth.PAPISID?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(GM_setValue("youtubeAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async#verifyAuth(){try{return await this.#toggleChannel({link:this.#verifyChannel,doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{GM_cookie.list({url:"https://www.youtube.com/@YouTube"},async(PAPISID,error)=>{error?(logStatus.error("Error: Update youtube auth failed!"),resolve(!1)):(PAPISID=PAPISID.find(cookie=>"__Secure-3PAPISID"===cookie.name)?.value)?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),this.#auth={PAPISID:PAPISID},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error(i18n("needLogin")),resolve(!1))})})}catch(error){return throwError_throwError(error,"Youtube.updateAuth"),!1}}#getInfo(link,type){return async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/)?.[1],context=(data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))?.[1]||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var channelId=data.responseText.match(/"channelId":"(.+?)"/)?.[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var videoId=data.responseText.match(//)?.[1],likeParams=data.responseText.match(/"likeParams":"(.*?)"/)?.[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}}(link,type)}async#toggleChannel({link,doTask=!0,verify=!1}){try{var{params,needLogin}=await this.#getInfo(link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=${apiKey}&prettyPrint=false`,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client?.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:request?.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===data?.status?doTask&&(/"subscribed":true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed":false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async#toggleLikeVideo({link,doTask=!0}){try{var{params,needLogin}=await this.#getInfo(link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===data?.status?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}async toggle({doTask=!0,channelLinks=[],videoLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}const social_SteamASF=class{#asfOptions;#botName="asf";#groupInfo;async init(){try{var asfCommandsUrl=new URL("/Api/Command/",globalOptions.ASF.AsfIpcUrl);this.#asfOptions={url:asfCommandsUrl.href,method:"POST",responseType:"json",headers:{accept:"application/json","Content-Type":"application/json",Host:asfCommandsUrl.host,Origin:asfCommandsUrl.origin,Referer:asfCommandsUrl.href,Authentication:globalOptions.ASF.AsfIpcPassword}},globalOptions.ASF.AsfBotname&&(this.#botName=globalOptions.ASF.AsfBotname);const logStatus=scripts_echoLog({text:i18n("initingASF")});var{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:'{"Command":"!stats"}'});return"Success"===result?!0===data?.response?.Success&&"OK"===data.response.Message&&data.response.Result?(logStatus.success(),!0):(data?.response?.Result||data?.response?.Message?logStatus.error(data?.response?.Result||data.response.Message):logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.init"),!1}}async joinGroup(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!JOINGROUP ${this.#botName} `+groupName})});return"Success"===result?200===data?.status&&["已加入","已申请","Joined","Applied","Присоединился","costs"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.joinGroup"),!1}}async leaveGroup(groupName){try{if(!this.#groupInfo&&!await this.#getGroupId())return!1;var groupId=await this.#groupInfo[groupName];if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!LEAVEGROUP ${this.#botName} `+groupId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.leaveGroup"),!1}}async#getGroupId(){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:"All"}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:"!GROUPLIST "+this.#botName})});return"Success"===result?200===data?.status&&data.response?.Result?.includes("|")?(this.#groupInfo=Object.fromEntries(data.response.Result.split("\n").map(id=>{var[,name,id]=id.trim().split("|");return name&&id?[name,id]:null}).filter(ele=>ele)),logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.getGroupID"),!1}}async addToWishlist(gameId){try{const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!ADDWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.addToWishlist"),!1}}async removeFromWishlist(gameId){try{const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REMOVEWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.removeFromWishlist"),!1}}async toggleFollowGame(gameId,doTask){try{const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWGAME ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.toggleFollowGame"),!1}}async toggleCurator(curatorId,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWCURATOR ${this.#botName} `+curatorId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async addLicense(id){try{const[type,ids]=id.split("-");if("appid"===type){const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} app/`+ids})});return"Success"===result?200===data?.status&&["AlreadyPurchased","OK"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{const idsArr=ids.split(","),logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} `+idsArr.map(id=>"sub/"+id).join(",")})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200===data?.status&&data.response?.Result){const resultLines=data.response.Result.split("\n");return idsArr.forEach(subid=>{const targetLine=resultLines.find(text=>text.includes(subid));targetLine&&["成功","Success","Успех"].find(text=>targetLine.includes(text))?scripts_echoLog({}).success(targetLine):scripts_echoLog({}).error(targetLine)}),!0}return logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1}}catch(error){return throwError_throwError(error,"SteamASF.addLicense"),!1}}async requestPlayTestAccess(id){try{const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REQUESTACCESS ${this.#botName} `+id})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}};const social_Steam=class extends discordAuth{tasks;whiteList;#cache={group:{},officialGroup:{},forum:{},workshop:{},curator:{},...GM_getValue("steamCache")};#auth={};#storeInitialized=!1;#communityInitialized=!1;#area="CN";#areaStatus="end";#ASF;constructor(){super();var defaultTasksTemplate={groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.steam||{}}}async init(type="all"){try{if(globalOptions.ASF.AsfEnabled&&globalOptions.ASF.AsfIpcUrl&&globalOptions.ASF.AsfIpcPassword)return this.#ASF=new social_SteamASF,!!await this.#ASF.init()&&(this.#storeInitialized=!0,this.#communityInitialized=!0);if("store"===type){if(this.#storeInitialized)return!0;let storeInitialized=await this.#updateStoreAuth();return(storeInitialized=storeInitialized||await this.#updateStoreAuthTab(),this.#storeInitialized=storeInitialized,this.#storeInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamStore")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}if("community"!==type)return this.#storeInitialized&&this.#communityInitialized?(scripts_echoLog({}).success(i18n("initSuccess","Steam")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1);{if(this.#communityInitialized)return!0;let communityInitialized=await this.#getUserLink();return(communityInitialized=communityInitialized||await this.#updateCommunityAuthTab(),this.#communityInitialized=communityInitialized,this.#communityInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamCommunity")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}}catch(error){return throwError_throwError(error,"Steam.init"),!1}}async#refreshToken(type="steamStore"){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n(type))}),formData=new FormData;formData.append("redir",`https://${host[type]}/`);var{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://"+host[type],Referer:`https://${host[type]}/`},data:formData});return"Success"===result?data?.response?.success?await this.#setStoreToken(data.response,type)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshToken"),!1}}async#setStoreToken(param,type){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("settingToken",i18n(type))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:`https://${host[type]}/login/settoken`,method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:host[type],Origin:"https://"+host[type]},data:formData});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async#updateStoreAuth(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200!==data?.status)return[301,302].includes(data?.status)?await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):(logStatus.error(result+`:${statusText}(${status})`),!1);if(!data.responseText.includes("data-miniprofile="))return await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1);var storeSessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(this.#auth.storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async#updateStoreAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))});return await new Promise(resolve=>{const newTab=window.open("https://store.steampowered.com/","mozillaWindow","pop=1;");GM_setValue("steamStoreAuth","update");const listenerId=GM_addValueChangeListener("steamStoreAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.storeSessionID=newValue.storeSessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateStoreAuthTab"),!1}}async#updateCommunityAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))});return await new Promise(resolve=>{const newTab=window.open("https://steamcommunity.com/my","mozillaWindow","pop=1;");GM_setValue("steamCommunityAuth","update");const listenerId=GM_addValueChangeListener("steamCommunityAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.steam64Id=newValue.steam64Id,this.#auth.userName=newValue.userName,this.#auth.communitySessionID=newValue.communitySessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuthTab"),!1}}async#getUserLink(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("gettingUserLink")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200===data?.status){if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}if(302===data?.status)return!await this.#refreshToken("steamCommunity")||retry?(logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1):(logStatus.warning(i18n("retry")),this.#getUserLink(!0));const location=data?.responseHeaders?.split("\n")?.find(header=>header.includes("location")?header.replace("loctation:","").trim():null);return 301===data?.status&&location?.includes("steamcommunity.com/id")?(logStatus.success(),await this.#updateCommunityAuth(data.finalUrl)):(301===data?.status&&location?.includes("https://steamcommunity.com/login/home")?logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0):logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#updateCommunityAuth(url){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#getAreaInfo(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{var cartConfigRaw=data.responseText.match(/data-cart_config="(.*?)"/)?.[1];const temp=document.createElement("div");temp.innerHTML=cartConfigRaw||"{}";var cartConfigStr=temp.textContent||temp.innerText;let cartConfig;try{cartConfig=JSON.parse(cartConfigStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}if(!cartConfig.rgUserCountryOptions)return logStatus.warning("Warning: Area cannot be changed"),{};var userInfoRaw=data.responseText.match(/data-userinfo="(.*?)"/)?.[1];const temp1=document.createElement("div");temp1.innerHTML=userInfoRaw||"{}";var userInfoStr=temp1.textContent||temp1.innerText;let userInfo;try{userInfo=JSON.parse(userInfoStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}var currentArea=userInfo.country_code,areas=Object.keys(cartConfig.rgUserCountryOptions).filter(area=>"help"!==area);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==this.#areaStatus&&(clearInterval(checker),resolve(!0))})}),this.#area===area||!area&&"CN"!==this.#area)return!0;this.#areaStatus="waiting";let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await this.#getAreaInfo();if(!currentArea||!areas)return!(this.#areaStatus="error");if("CN"!==currentArea)return this.#areaStatus="skip",scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return this.#areaStatus="noAnotherArea",scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/country/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:this.#auth.storeSessionID})});if("Success"!==result)return this.#areaStatus="error",logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==data?.status||"true"!==data.responseText)return this.#areaStatus="error",logStatus.error(`Error:${data?.statusText}(${data?.status})`),"CN";var currentArea=(await this.#getAreaInfo())["currentArea"];return currentArea===aimedArea?(this.#areaStatus="success",logStatus.success(),currentArea):(this.#areaStatus="error",logStatus.error("Error: change country filed"),"CN")}catch(error){return this.#areaStatus="error",throwError_throwError(error,"Steam.changeArea"),!1}}async#joinGroup(groupName){try{if(this.#ASF)return!!await this.#ASF.joinGroup(groupName)&&(this.tasks.groups=unique([...this.tasks.groups,groupName]),!0);const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async#leaveGroup(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(groupName);var groupId=await this.#getGroupId(groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===data?.status&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async#getGroupId(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var groupId=this.#cache.group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)?.[1];return groupId?(this.#setCache("group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#joinOfficialGroup(gameId){try{if(this.#ASF)return!!await this.#ASF.joinGroup(gameId)&&(this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]),!0);const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+this.#auth.communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId&&this.#setCache("officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async#leaveOfficialGroup(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(gameId);var groupId=await this.#getOfficialGroupId(gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===dataR?.status&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async#getOfficialGroupId(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var groupId=this.#cache.officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId?(this.#setCache("officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#addToWishlist(gameId){try{if(this.#ASF)return!!await this.#ASF.addToWishlist(gameId)&&(this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0);const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===dataR?.status?"CN"===this.#area&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#addToWishlist(gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async#removeFromWishlist(gameId){try{if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;if(this.#ASF)return await this.#ASF.removeFromWishlist(gameId);const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==dataR?.status)return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1;if("CN"===this.#area&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#removeFromWishlist(gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async#toggleFollowGame(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;if(this.#ASF)return!!await this.#ASF.toggleFollowGame(gameId,doTask)&&(doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0);const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:this.#auth.storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===data?.status&&"true"===data.responseText)return logStatus.success(),!0;var followed=await this.#isFollowedGame(gameId);return"CN"===this.#area&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#removeFromWishlist(gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async#isFollowedGame(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===data?.status&&("CN"===this.#area&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async#toggleForum(gameId,doTask=!0){try{if(!doTask&&this.whiteList.forums.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unsubscribeForum",id:gameId}),!0;const forumId=await this.#getForumId(gameId);if(!forumId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}subscribingForum`,text:gameId});var[id,feature]=forumId.split("_"),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/forum/${id}/General/${doTask?"":"un"}subscribe/${feature||"0"}/`,method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.communitySessionID})});return"Success"===result?(200!==data?.status||1!==data.response?.success&&29!==data.response?.success?logStatus.error(`Error:${data?.statusText}(${data?.status})`):(doTask&&(this.tasks.forums=unique([...this.tasks.forums,gameId])),logStatus.success()),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.toggleForum"),!0}}async#getForumId(gameId){try{const logStatus=scripts_echoLog({type:"gettingForumId",text:gameId});var forumId=this.#cache.forum[gameId];if(forumId)return logStatus.success(),forumId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/app/${gameId}/discussions/`,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const forumId=data.responseText?.match(/General_([\d]+(_[\d]+)?)/)?.[1];return forumId?(this.#setCache("forum",gameId,forumId),logStatus.success(),forumId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getForumId"),!1}}async#toggleFavoriteWorkshop(id,doTask=!0){try{if(!doTask&&this.whiteList.workshops.includes(id))return scripts_echoLog({type:"whiteList",text:"Steam.unfavoriteWorkshop",id:id}),!0;var appid=await this.#getWorkshopAppId(id);if(!appid)return!1;const logStatus=scripts_echoLog({type:doTask?"favoritingWorkshop":"unfavoritingWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/sharedfiles/${doTask?"":"un"}favorite`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,appid:appid,sessionid:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(doTask&&(this.tasks.workshops=unique([...this.tasks.workshops,id])),logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFavoriteWorkshop"),!1}}async#getWorkshopAppId(id){try{const logStatus=scripts_echoLog({type:"gettingWorkshopAppId",text:id});var appId=this.#cache.workshop[id];if(appId)return logStatus.success(),appId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/filedetails/?id="+id,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const appId=data.responseText.match(//)?.[1];return appId?(this.#setCache("workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async#voteUpWorkshop(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:this.#auth.communitySessionID})});return"Success"===result?(200===data?.status&&1===data.response?.success?logStatus.success():logStatus.error(`Error:${data?.statusText}(${data?.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async#toggleCurator(curatorId,doTask=!0){try{if(!doTask&&this.whiteList.curators.includes(curatorId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowCurator",id:curatorId}),!0;if(this.#ASF)return await this.#ASF.toggleCurator(curatorId,doTask);const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/curators/ajaxfollow",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({clanid:curatorId,sessionid:this.#auth.storeSessionID,follow:doTask}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response?.success?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(`+data?.response?.success||data?.status+")"),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async getCuratorId(path,name){try{const logStatus=scripts_echoLog({type:"gettingCuratorId",text:path+"/"+name});var curatorId=this.#cache.curator[path+"/"+name];if(curatorId)return logStatus.success(),curatorId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/${path}/`+name,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const curatorId=data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)?.[1];return curatorId?(this.#setCache("curator",path+"/"+name,curatorId),logStatus.success(),curatorId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getCuratorID"),!1}}async#toggleCuratorLike(link,doTask=!0){try{var[path,name]=link.split("/");if(!path||!name)return scripts_echoLog({text:i18n("errorLink",link)}),!1;var curatorId=await this.getCuratorId(path,name);return curatorId?await this.#toggleCurator(curatorId,doTask):!1}catch(error){return throwError_throwError(error,"Steam.toggleCuratorLike"),!1}}async#getAnnouncementParams(appId,viewId){try{const logStatus=scripts_echoLog({type:"gettingAnnouncementParams",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/events/ajaxgetpartnerevent?appid=${appId}&announcement_gid=${viewId}&lang_list=6_0&last_modified_time=0&origin=https:%2F%2Fstore.steampowered.com&for_edit=false`,method:"GET",responseType:"json",headers:{Host:"store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status||1!==data?.response?.success)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};var{clanid,gid}=data.response.event?.announcement_body||{};return clanid?(logStatus.success(),{clanId:clanid,gid:gid}):(logStatus.error(`Error:${data.statusText}(${data.status})`),{})}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),{}}}async#likeAnnouncement(id){try{var[appId,viewId]=id.split("/");if(!appId||!viewId)return scripts_echoLog({}).error(i18n("missParams")+"(id)"),!1;var{clanId,gid}=await this.#getAnnouncementParams(appId,viewId);if(!clanId)return!1;const logStatus=scripts_echoLog({type:"likingAnnouncement",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/updated/ajaxrateupdate/"+(gid||viewId),method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId},data:$.param({sessionid:this.#auth.storeSessionID,voteup:1,clanid:clanId,ajax:1}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),!1}}async#appid2subid(id){try{const logStatus=scripts_echoLog({type:"gettingSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+id,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#appid2subid(id):!1}var subid=data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];return subid?(logStatus.success(),subid):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.appid2subid"),!1}}async#getLicenses(){try{const logStatus=scripts_echoLog({text:i18n("gettingLicenses")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/dynamicstore/userdata/?t="+(new Date).getTime(),method:"GET",responseType:"json"});return"Success"===result?200===data?.status?(logStatus.success(),data.response?.rgOwnedPackages):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.getLicenses"),!1}}async#addLicense(id){try{if(this.#ASF)return await this.#ASF.addLicense(id);const[type,ids]=id.split("-");if("appid"===type){var subid=await this.#appid2subid(ids);if(!subid)return!1;const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids});if(!await this.#addFreeLicense(subid,logStatus))return!1;const{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+ids,method:"GET"});return"Success"===result?200===data?.status?data.responseText.includes("ds_owned_flag ds_flag")||data.responseText.includes('class="already_in_library"')?(logStatus.success(),!0):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{"CN"===this.#area&&(scripts_echoLog({}).success(i18n("tryChangeAreaNotice")),await this.#changeArea());const logStatusArr={};var idsArr=ids.split(",");for(const subid of idsArr){var logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:subid});if(!await this.#addFreeLicense(subid,logStatus))return!1;logStatusArr[subid]=logStatus}const licenses=await this.#getLicenses();if(!licenses)return!1;for(const subid of idsArr)licenses.includes(parseInt(subid,10))?logStatusArr[subid].success():logStatusArr[subid].error();return!0}}catch(error){return throwError_throwError(error,"Steam.addLicense"),!1}}async#addFreeLicense(id,logStatusPre){try{const logStatus=logStatusPre||scripts_echoLog({type:"addingFreeLicenseSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:this.#auth.storeSessionID,subid:id}),dataType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result?await this.#addFreeLicense(id):!1}return logStatus.success(),!0}catch(error){return throwError_throwError(error,"Steam.addFreeLicense"),!1}}async#requestPlayTestAccess(id){try{if(this.#ASF)return await this.#ASF.requestPlayTestAccess(id);const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+id,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+id},data:$.param({sessionid:this.#auth.storeSessionID}),dataType:"json"});return"Success"===result?200===data?.status&&1===data?.response?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}async toggle({doTask=!0,groupLinks=[],officialGroupLinks=[],wishlistLinks=[],followLinks=[],forumLinks=[],workshopLinks=[],workshopVoteLinks=[],curatorLinks=[],curatorLikeLinks=[],announcementLinks=[],licenseLinks=[],playtestLinks=[]}){try{if(0<[...groupLinks,...officialGroupLinks,...forumLinks,...workshopLinks,...workshopVoteLinks].length&&!this.#communityInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;if(0<[...wishlistLinks,...followLinks,...curatorLinks,...curatorLikeLinks,...announcementLinks,...licenseLinks,...playtestLinks].length&&!this.#storeInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.steam.groups||!doTask&&!globalOptions.undoTask.steam.groups)scripts_echoLog({type:"globalOptionsSkip",text:"steam.groups"});else{var realGroups=this.getRealParams("groups",groupLinks,doTask,link=>link.match(/groups\/(.+)\/?/)?.[1]);if(0link.match(/games\/(.+)\/?/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(doTask&&0link.match(/curator\/([\d]+)/)?.[1]),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,link=>link.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/)?.slice(1,3).join("/"));if(0(link.includes("store.steampowered.com")?link.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/):link.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))?.slice(1,3).join("/"));if(doTask&&0link.match(/app\/([\d]+)/)?.[1]);if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==this.#area&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await this.#changeArea("CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}#setCache(type,name,id){try{this.#cache[type][name]=id,GM_setValue("steamCache",this.#cache)}catch(error){throwError_throwError(error,"Steam.setCache")}}};const Giveawaysu=class{undoneTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};giveawayId;socialInitialized={discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0};initialized=!1;social={};static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{this.#checkLogin()||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await this.#checkLeftKey()||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!this.#getGiveawayId()&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async#classifyTask(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError_throwError(error,"getRedirectLink"),null}})(taskDes.attr("href")).then(taskLink=>taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.#uniqueTasks(this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}#checkLogin(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async#checkLeftKey(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(({value})=>{value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}#getGiveawayId(){var giveawayId=window.location.href.match(/\/view\/([\d]+)/)?.[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async#bind(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async#initSocial(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(this.#bind("discord",this.social.discord.init("do")))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(this.#bind("instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(this.#bind("reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(this.#bind("twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(this.#bind("vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(this.#bind("youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&tasks.steam?.[type]?.length||0).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(this.#bind("steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}#uniqueTasks(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async#toggleTask(){try{if(!this.initialized&&!this.init())return!1;if(!await this.#classifyTask())return!1;if(!await this.#initSocial())return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await this.#toggleTask()}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};discordAuth=__webpack_require__(225);if(window.STYLE=GM_addStyle(discordAuth.Z+GM_getResourceText("style")),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{var authToken;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(authToken=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientId:commonOptions?.headers?.["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"x.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${text?.replace("u_","")}]...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError_throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)});const defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};discordAuth=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,discordAuth);const languages={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",updateHistory:'历史更新记录点此查看',AsfEnabled:'使用ASF做Steam相关任务(需ASFEnhance插件)',AsfIpcUrl:"ASF IPC 地址",AsfIpcPassword:"ASF IPC 密码",versionNotMatched:"脚本管理器版本过低,需TamperMonkey >= 5.2.0或TamperMonkey Beta >= 5.2.6196",groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",gettingUserLink:"正在获取Steam用户社区链接...",retry:"重试",initingASF:"正在初始化ASF...",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",campaign:"检测到人机验证,请完成验证后重新验证任务!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",tasksNotCompleted:"任务未完成",confirmingTask:"正在跳过警告页面..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",updateHistory:'Click here to view the historical update record.',AsfEnabled:'Use ASF to do Steam related tasks (requires ASFEnhance plugin)',AsfIpcUrl:"ASF IPC URL",AsfIpcPassword:"ASF IPC Password",groups:"Group",officialGroups:"Official Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",gettingCuratorId:"Getting Steam Curator Id",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",versionNotMatched:"The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196",gettingUserLink:"Getting steam user community link...",retry:"Retry",initingASF:"Initing ASF...",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",campaign:"ReCAPTCHA detected, please complete it and re-verify the tasks!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning...",tasksNotCompleted:"Tasks Not Completed",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=(key,...argvs)=>languages[language]?.[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key;discordAuth=class{tasks;getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)))return this.#initialized=!1,"skip";return GM_getValue("dontRemindDiscordAgain")||"do"===action&&!globalOptions.doTask.discord.servers||"undo"===action&&!globalOptions.undoTask.discord.servers?(this.#initialized=!1,"skip"):!!this.#initialized||(this.#auth.auth?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(GM_setValue("discordAuth",{auth:null}),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0))}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Discord")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:this.#auth.auth}});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Discord")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("discordAuth")?.auth;auth?(this.#auth={auth:auth},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async#joinServer(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:this.#auth.auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(data.response?.guild?.id);return guild&&(this.#setCache(inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async#leaveServer(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await this.#getGuild(inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:this.#auth.auth}});return"Success"===result&&204===data?.status?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async#getGuild(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=this.#cache[inviteId];if(guild)return logStatus.success(),guild;var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=data.response?.guild?.id;return guild?(logStatus.success(),this.#setCache(inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}async toggle({doTask=!0,serverLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,link=>link.match(/invite\/(.+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}#setCache(inviteId,guild){try{this.#cache[inviteId]=guild,GM_setValue("discordCache",this.#cache)}catch(error){throwError_throwError(error,"Discord.setCache")}}};const social_Instagram=class extends discordAuth{tasks;whiteList;#cache=GM_getValue("instagramCache")||{};#auth={};#initialized=!1;constructor(){super();var defaultTasksTemplate={users:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.instagram||{}}}async init(){try{return this.#initialized?!0:await this.#getUserInfo()?(scripts_echoLog({}).success(i18n("initSuccess","Instagram")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Instagram")),!1)}catch(error){return throwError_throwError(error,"Instagram.init"),!1}}async#getUserInfo(name="instagram"){try{const logStatus=scripts_echoLog({type:"instagram"===name?"verifyingInsAuth":"gettingInsUserId",text:name});var userId=this.#cache[name];if(userId&&"instagram"!==name)return logStatus.success(),userId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/${name}/`,method:"GET"});if("Success"!==result)return!1;if(data?.finalUrl.includes("accounts/login"))return logStatus.error("Error:"+i18n("loginIns"),!0),!1;if(data?.finalUrl.includes("www.instagram.com/challenge"))return logStatus.error("Error:"+i18n("insBanned")),!1;if(200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;var csrftoken=data.responseText.match(/"csrf_token":"(.+?)"/)?.[1],hash=data.responseText.match(/"rollout_hash":"(.+?)"/)?.[1];if("instagram"===name)return!(!csrftoken||!hash)&&(this.#auth={csrftoken:csrftoken,hash:hash},!0);var id=data.responseText.match(/"profilePage_([\d]+?)"/)?.[1];return id?(this.#setCache(name,id),logStatus.success(),id):(logStatus.error("Error: Get ins data error!"),!1)}catch(error){return throwError_throwError(error,"Instagram.getUserInfo"),!1}}async#followUser(name){try{var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"followingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/follow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"following"===data.response?.result?(logStatus.success(),this.tasks.users=unique([...this.tasks.users,name]),!0):(logStatus.error("Error:"+(data?.response?.feedback_message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.followUser"),!1}}async#unfollowUser(name){try{if(this.whiteList.users.includes(name))return scripts_echoLog({type:"whiteList",text:"Instagram.unfollowUser",id:name}),!0;var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"unfollowingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/unfollow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"ok"===data.response?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.unfollowUser"),!1}}async toggle({doTask=!0,userLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.instagram.users||!doTask&&!globalOptions.undoTask.instagram.users)scripts_echoLog({type:"globalOptionsSkip",text:"instagram.users"});else{var realUsers=this.getRealParams("users",userLinks,doTask,link=>link.match(/https:\/\/www\.instagram\.com\/(.+)?\//)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("instagramCache",this.#cache)}catch(error){throwError_throwError(error,"Instagram.setCache")}}};const social_Reddit=class extends discordAuth{tasks;whiteList;#auth;#initialized=!1;constructor(){super();var defaultTasksTemplate={reddits:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.reddit||{}}}async init(){try{return this.#initialized?!0:await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Reddit")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Reddit")),!1)}catch(error){return throwError_throwError(error,"Reddit.init"),!1}}async#useBeta(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await this.#updateAuth(!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async#updateAuth(beta=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Reddit")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://www.reddit.com/",method:"GET",nochche:!0,headers:{"Cache-Control":"no-cache"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(data?.responseText.includes("www.reddit.com/login/"))return logStatus.error("Error:"+i18n("loginReddit"),!0),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.responseText.includes("redesign-beta-optin-btn")&&!beta)return await this.#useBeta();var accessToken=data.responseText.match(/"accessToken":"(.*?)","expires":"(.*?)"/)?.[1];return accessToken?(this.#auth={token:accessToken},logStatus.success(),!0):(logStatus.error('Error: Parameter "accessToken" not found!'),!1)}catch(error){return throwError_throwError(error,"Reddit.updateAuth"),!1}}async toggleTask({name,doTask=!0}){try{if(!doTask&&this.whiteList.reddits.includes(name))return scripts_echoLog({type:"whiteList",text:"Reddit.undoTask",id:name}),!0;let type=doTask?"joiningReddit":"leavingReddit";/^u_/.test(name)&&(type=doTask?"followingRedditUser":"unfollowingRedditUser");const logStatus=scripts_echoLog({type:type,text:name});var{result,statusText,status,data}=await tools_httpRequest({url:"https://oauth.reddit.com/api/subscribe?redditWebClient=desktop2x&app=desktop2x-client-production&raw_json=1&gilding_detail=1",method:"POST",headers:{authorization:"Bearer "+this.#auth.token,"content-type":"application/x-www-form-urlencoded"},data:$.param({action:doTask?"sub":"unsub",sr_name:name,api_type:"json"})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.reddits=unique([...this.tasks.reddits,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Reddit.toggleTask"),!1}}async toggle({doTask=!0,redditLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.reddit.reddits||!doTask&&!globalOptions.undoTask.reddit.reddits)scripts_echoLog({type:"globalOptionsSkip",text:"reddit.reddits"});else{var realReddits=this.getRealParams("reddits",redditLinks,doTask,userName=>{var name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/)?.[1],userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/)?.[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};const social_Twitch=class extends discordAuth{tasks;whiteList;#auth=GM_getValue("twitchAuth")||{};#cache=GM_getValue("twitchCache")||{};#initialized=!1;#integrityToken;constructor(){super();var defaultTasksTemplate={channels:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.twitch||{}}}async init(){try{return this.#initialized?!0:this.#auth.authToken&&this.#auth.clientId&&this.#auth.clientVersion&&this.#auth.deviceId&&this.#auth.clientSessionId?await this.#verifyAuth(!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(GM_setValue("twitchAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async#verifyAuth(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===data?.status&&data.response?.[0]?.data?.currentUser?(await this.#integrity(isFirst),logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async#integrity(isFirst=!0,ct=""){try{const logStatus=scripts_echoLog({text:i18n("checkingTwitchIntegrity")});if(isFirst&&(!this.#auth.authToken||!this.#auth.clientId||!this.#auth.clientVersion||!this.#auth.deviceId||!this.#auth.clientSessionId))return await this.#updateAuth(!1);var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/integrity",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"x-kpsdk-ct":ct}});return"Success"===result?!ct&&data?.responseHeaders?.["x-kpsdk-ct"]?await this.#integrity(isFirst,data.responseHeaders["x-kpsdk-ct"]):200===data?.status&&data.response?.token?(this.#integrityToken=data.response.token,logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.integrity"),!1}}async#updateAuth(isFirst=!0){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Twitch")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(this.#auth=auth,logStatus.success(),resolve(await this.#verifyAuth(isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async#toggleChannel({name,doTask=!0}){try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await this.#getChannelId(name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"Client-Integrity":this.#integrityToken},data:doTask?followData:unfollowData});return"Success"===result?200===data?.status&&data.response?.[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+(data?.response?.[0].errors?.[0]?.message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async#getChannelId(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=this.#cache[name];if(channelId)return logStatus.success(),channelId;var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const channelId=data.response?.[0]?.data?.user?.id;return channelId?(this.#setCache(name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}async toggle({doTask=!0,channelLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>link.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/)?.[2]);if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("twitchCache",this.#cache)}catch(error){throwError_throwError(error,"Twitch.setCache")}}};const social_Vk=class extends discordAuth{tasks;whiteList;#username="";#cache=GM_getValue("vkCache")||{};#initialized=!1;constructor(){super();var defaultTasksTemplate={names:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.vk||{}}}async init(){try{return this.#initialized?!0:await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Vk")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Vk")),!1)}catch(error){return throwError_throwError(error,"Vk.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});return"Success"===result?data?.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===data?.status?(this.#username=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/)?.[1]||"",logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async#toggleGroup(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkGroup":"leavingVkGroup",text:name});if("enter"===dataParam.groupAct&&!doTask||"leave"===dataParam.groupAct&&doTask)return logStatus.success(),!0;const reqData={act:doTask?"enter":"leave",al:1,gid:dataParam.groupId,hash:dataParam.groupHash};doTask&&(reqData.context="_");var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_groups.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param(reqData)});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.toggleGroup"),!1}}async#togglePublic(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkPublic":"leavingVkPublic",text:name});if(dataParam.publicJoined&&doTask||!dataParam.publicJoined&&!doTask)return logStatus.success(),!0;var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_public.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:doTask?"a_enter":"a_leave",al:1,pid:dataParam.publicPid,hash:dataParam.publicHash})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.togglePublic"),!1}}async#sendWall(name){try{const logStatus=scripts_echoLog({type:"sendingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"publish_box",al:1,object:name})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var hash=data.responseText.match(/shHash:[\s]*'(.*?)'/)?.[1];if(hash){const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({Message:"",act:"a_do_publish",al:1,close_comments:0,friends_only:0,from:"box",hash:hash,list:"",mark_as_ads:0,mute_notifications:0,object:name,ret_data:1,to:0})});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200===dataR?.status){var jsonData=JSON.parse(dataR.responseText?.replace("\x3c!--","")||"{}");if(!0===jsonData?.payload?.[1]?.[1]?.share_my){logStatus.success();var postId=String(jsonData?.payload?.[1]?.[1]?.post_id),ownerId=String(jsonData?.payload?.[1]?.[1]?.owner_id);return postId&&ownerId&&this.#setCache(name,ownerId+"_"+postId),this.tasks.names=unique([...this.tasks.names,name]),!0}}return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1}return logStatus.error('Error: Get "hash" failed'),!1}catch(error){return throwError_throwError(error,"Vk.sendWall"),!1}}async#deleteWall(name,dataParams){try{const logStatus=scripts_echoLog({type:"deletingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_wall.php?act=delete",method:"POST",headers:{origin:"https://vk.com",referer:`https://vk.com/${this.#username}?w=wall${this.#cache[name]}%2Fall`,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"delete",al:1,confirm:0,from:"wkview",hash:dataParams.wallHash,post:this.#cache[name]})});return"Success"===result?200===data?.status&&JSON.parse(data.responseText?.replace("\x3c!--","")||"{}")?.payload?.[1]?.[1]?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.deleteWall"),!1}}async#getId(name,doTask){try{let url="https://vk.com/"+name;if(/^wall-/.test(name)){if(doTask)return{type:"sendWall"};if(!this.#cache[name])return{type:"unSupport"};url=`https://vk.com/${this.#username}?w=wall`+this.#cache[name]}const logStatus=scripts_echoLog({type:"gettingVkId",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var[,groupAct,groupId,,groupHash]=data.responseText.match(/Groups.(enter|leave)\(.*?,.*?([\d]+?), ('|')(.*?)('|')/)||[],publicHash=data.responseText.match(/"enterHash":"(.*?)"/)?.[1],publicPid=data.responseText.match(/"public_id":([\d]+?),/)?.[1],publicJoined=!data.responseText.includes("Public.subscribe");if(groupAct&&groupId&&groupHash)return logStatus.success(),{groupAct:groupAct,groupId:groupId,groupHash:groupHash,type:"group"};if(publicHash&&publicPid)return logStatus.success(),{publicHash:publicHash,publicPid:publicPid,publicJoined:publicJoined,type:"public"};if(data.responseText.includes("wall.deletePost")&&!doTask){var wallHash=data.responseText.match(/wall\.deletePost\(this, '.*?', '(.*?)'\)/)?.[1];if(wallHash)return logStatus.success(),{type:"deleteWall",wallHash:wallHash}}else if(name.includes("wall")&&doTask)return logStatus.success(),{type:"sendWall"};return logStatus.error("Error: Parameters not found!"),!1}catch(error){return throwError_throwError(error,"Vk.getId"),!1}}async#toggleVk({name,doTask=!0}){try{if(!doTask&&this.whiteList.names.includes(name))return scripts_echoLog({type:"whiteList",text:"Vk.undoTask",id:name}),!0;var formatName=name.replace(/\/$/,""),data=await this.#getId(formatName,doTask);if(!data)return!1;switch(data.type){case"group":return await this.#toggleGroup(formatName,data,doTask);case"public":return await this.#togglePublic(formatName,data,doTask);case"sendWall":return!doTask||await this.#sendWall(formatName);case"deleteWall":return!!doTask||await this.#deleteWall(formatName,data);default:return!1}}catch(error){return throwError_throwError(error,"Vk.toggleVk"),!1}}async toggle({doTask=!0,nameLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.vk.names||!doTask&&!globalOptions.undoTask.vk.names)scripts_echoLog({type:"globalOptionsSkip",text:"vk.names"});else{var realNames=this.getRealParams("names",nameLinks,doTask,link=>link.match(/https:\/\/vk\.com\/([^/]+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}#setCache(name,postId){try{this.#cache[name]=postId,GM_setValue("vkCache",this.#cache)}catch(error){throwError_throwError(error,"Vk.setCache")}}};class Youtube extends discordAuth{tasks;whiteList;#auth=GM_getValue("youtubeAuth")||{};#initialized=!1;#verifyChannel="https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel;constructor(){super();var defaultTasksTemplate={channels:[],likes:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.youtube||{}}}async init(){try{return this.#initialized?!0:this.#auth.PAPISID?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(GM_setValue("youtubeAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async#verifyAuth(){try{return await this.#toggleChannel({link:this.#verifyChannel,doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{GM_cookie.list({url:"https://www.youtube.com/@YouTube"},async(PAPISID,error)=>{error?(logStatus.error("Error: Update youtube auth failed!"),resolve(!1)):(PAPISID=PAPISID.find(cookie=>"__Secure-3PAPISID"===cookie.name)?.value)?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),this.#auth={PAPISID:PAPISID},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error(i18n("needLogin")),resolve(!1))})})}catch(error){return throwError_throwError(error,"Youtube.updateAuth"),!1}}#getInfo(link,type){return async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/)?.[1],context=(data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))?.[1]||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var channelId=data.responseText.match(/"channelId":"(.+?)"/)?.[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var videoId=data.responseText.match(//)?.[1],likeParams=data.responseText.match(/"likeParams":"(.*?)"/)?.[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}}(link,type)}async#toggleChannel({link,doTask=!0,verify=!1}){try{var{params,needLogin}=await this.#getInfo(link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=${apiKey}&prettyPrint=false`,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client?.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:request?.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===data?.status?doTask&&(/"subscribed":true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed":false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async#toggleLikeVideo({link,doTask=!0}){try{var{params,needLogin}=await this.#getInfo(link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===data?.status?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}async toggle({doTask=!0,channelLinks=[],videoLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}const social_SteamASF=class{#asfOptions;#botName="asf";#groupInfo;async init(){try{var asfCommandsUrl=new URL("/Api/Command/",globalOptions.ASF.AsfIpcUrl);this.#asfOptions={url:asfCommandsUrl.href,method:"POST",responseType:"json",headers:{accept:"application/json","Content-Type":"application/json",Host:asfCommandsUrl.host,Origin:asfCommandsUrl.origin,Referer:asfCommandsUrl.href,Authentication:globalOptions.ASF.AsfIpcPassword}},globalOptions.ASF.AsfBotname&&(this.#botName=globalOptions.ASF.AsfBotname);const logStatus=scripts_echoLog({text:i18n("initingASF")});var{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:'{"Command":"!stats"}'});return"Success"===result?!0===data?.response?.Success&&"OK"===data.response.Message&&data.response.Result?(logStatus.success(),!0):(data?.response?.Result||data?.response?.Message?logStatus.error(data?.response?.Result||data.response.Message):logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.init"),!1}}async joinGroup(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!JOINGROUP ${this.#botName} `+groupName})});return"Success"===result?200===data?.status&&["已加入","已申请","Joined","Applied","Присоединился","costs"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.joinGroup"),!1}}async leaveGroup(groupName){try{if(!this.#groupInfo&&!await this.#getGroupId())return!1;var groupId=await this.#groupInfo[groupName];if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!LEAVEGROUP ${this.#botName} `+groupId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.leaveGroup"),!1}}async#getGroupId(){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:"All"}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:"!GROUPLIST "+this.#botName})});return"Success"===result?200===data?.status&&data.response?.Result?.includes("|")?(this.#groupInfo=Object.fromEntries(data.response.Result.split("\n").map(id=>{var[,name,id]=id.trim().split("|");return name&&id?[name,id]:null}).filter(ele=>ele)),logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.getGroupID"),!1}}async addToWishlist(gameId){try{const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!ADDWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.addToWishlist"),!1}}async removeFromWishlist(gameId){try{const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REMOVEWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.removeFromWishlist"),!1}}async toggleFollowGame(gameId,doTask){try{const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWGAME ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.toggleFollowGame"),!1}}async toggleCurator(curatorId,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWCURATOR ${this.#botName} `+curatorId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async addLicense(id){try{const[type,ids]=id.split("-");if("appid"===type){const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} app/`+ids})});return"Success"===result?200===data?.status&&["AlreadyPurchased","OK"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{const idsArr=ids.split(","),logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} `+idsArr.map(id=>"sub/"+id).join(",")})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200===data?.status&&data.response?.Result){const resultLines=data.response.Result.split("\n");return idsArr.forEach(subid=>{const targetLine=resultLines.find(text=>text.includes(subid));targetLine&&["成功","Success","Успех"].find(text=>targetLine.includes(text))?scripts_echoLog({}).success(targetLine):scripts_echoLog({}).error(targetLine)}),!0}return logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1}}catch(error){return throwError_throwError(error,"SteamASF.addLicense"),!1}}async requestPlayTestAccess(id){try{const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REQUESTACCESS ${this.#botName} `+id})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}};const social_Steam=class extends discordAuth{tasks;whiteList;#cache={group:{},officialGroup:{},forum:{},workshop:{},curator:{},...GM_getValue("steamCache")};#auth={};#storeInitialized=!1;#communityInitialized=!1;#area="CN";#areaStatus="end";#ASF;constructor(){super();var defaultTasksTemplate={groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.steam||{}}}async init(type="all"){try{if(globalOptions.ASF.AsfEnabled&&globalOptions.ASF.AsfIpcUrl&&globalOptions.ASF.AsfIpcPassword)return this.#ASF=new social_SteamASF,!!await this.#ASF.init()&&(this.#storeInitialized=!0,this.#communityInitialized=!0);if("store"===type){if(this.#storeInitialized)return!0;let storeInitialized=await this.#updateStoreAuth();return(storeInitialized=storeInitialized||await this.#updateStoreAuthTab(),this.#storeInitialized=storeInitialized,this.#storeInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamStore")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}if("community"!==type)return this.#storeInitialized&&this.#communityInitialized?(scripts_echoLog({}).success(i18n("initSuccess","Steam")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1);{if(this.#communityInitialized)return!0;let communityInitialized=await this.#getUserLink();return(communityInitialized=communityInitialized||await this.#updateCommunityAuthTab(),this.#communityInitialized=communityInitialized,this.#communityInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamCommunity")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}}catch(error){return throwError_throwError(error,"Steam.init"),!1}}async#refreshToken(type="steamStore"){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n(type))}),formData=new FormData;formData.append("redir",`https://${host[type]}/`);var{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://"+host[type],Referer:`https://${host[type]}/`},data:formData});return"Success"===result?data?.response?.success?await this.#setStoreToken(data.response,type)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshToken"),!1}}async#setStoreToken(param,type){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("settingToken",i18n(type))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:`https://${host[type]}/login/settoken`,method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:host[type],Origin:"https://"+host[type]},data:formData});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async#updateStoreAuth(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200!==data?.status)return[301,302].includes(data?.status)?await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):(logStatus.error(result+`:${statusText}(${status})`),!1);if(!data.responseText.includes("data-miniprofile="))return await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1);var storeSessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(this.#auth.storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async#updateStoreAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))});return await new Promise(resolve=>{const newTab=window.open("https://store.steampowered.com/","mozillaWindow","pop=1;");GM_setValue("steamStoreAuth","update");const listenerId=GM_addValueChangeListener("steamStoreAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.storeSessionID=newValue.storeSessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateStoreAuthTab"),!1}}async#updateCommunityAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))});return await new Promise(resolve=>{const newTab=window.open("https://steamcommunity.com/my","mozillaWindow","pop=1;");GM_setValue("steamCommunityAuth","update");const listenerId=GM_addValueChangeListener("steamCommunityAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.steam64Id=newValue.steam64Id,this.#auth.userName=newValue.userName,this.#auth.communitySessionID=newValue.communitySessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuthTab"),!1}}async#getUserLink(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("gettingUserLink")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200===data?.status){if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}if(302===data?.status)return!await this.#refreshToken("steamCommunity")||retry?(logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1):(logStatus.warning(i18n("retry")),this.#getUserLink(!0));const location=data?.responseHeaders?.split("\n")?.find(header=>header.includes("location")?header.replace("loctation:","").trim():null);return 301===data?.status&&location?.includes("steamcommunity.com/id")?(logStatus.success(),await this.#updateCommunityAuth(data.finalUrl)):(301===data?.status&&location?.includes("https://steamcommunity.com/login/home")?logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0):logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#updateCommunityAuth(url){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#getAreaInfo(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{var cartConfigRaw=data.responseText.match(/data-cart_config="(.*?)"/)?.[1];const temp=document.createElement("div");temp.innerHTML=cartConfigRaw||"{}";var cartConfigStr=temp.textContent||temp.innerText;let cartConfig;try{cartConfig=JSON.parse(cartConfigStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}if(!cartConfig.rgUserCountryOptions)return logStatus.warning("Warning: Area cannot be changed"),{};var userInfoRaw=data.responseText.match(/data-userinfo="(.*?)"/)?.[1];const temp1=document.createElement("div");temp1.innerHTML=userInfoRaw||"{}";var userInfoStr=temp1.textContent||temp1.innerText;let userInfo;try{userInfo=JSON.parse(userInfoStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}var currentArea=userInfo.country_code,areas=Object.keys(cartConfig.rgUserCountryOptions).filter(area=>"help"!==area);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==this.#areaStatus&&(clearInterval(checker),resolve(!0))})}),this.#area===area||!area&&"CN"!==this.#area)return!0;this.#areaStatus="waiting";let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await this.#getAreaInfo();if(!currentArea||!areas)return!(this.#areaStatus="error");if("CN"!==currentArea)return this.#areaStatus="skip",scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return this.#areaStatus="noAnotherArea",scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/country/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:this.#auth.storeSessionID})});if("Success"!==result)return this.#areaStatus="error",logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==data?.status||"true"!==data.responseText)return this.#areaStatus="error",logStatus.error(`Error:${data?.statusText}(${data?.status})`),"CN";var currentArea=(await this.#getAreaInfo())["currentArea"];return currentArea===aimedArea?(this.#areaStatus="success",logStatus.success(),currentArea):(this.#areaStatus="error",logStatus.error("Error: change country filed"),"CN")}catch(error){return this.#areaStatus="error",throwError_throwError(error,"Steam.changeArea"),!1}}async#joinGroup(groupName){try{if(this.#ASF)return!!await this.#ASF.joinGroup(groupName)&&(this.tasks.groups=unique([...this.tasks.groups,groupName]),!0);const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async#leaveGroup(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(groupName);var groupId=await this.#getGroupId(groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===data?.status&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async#getGroupId(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var groupId=this.#cache.group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)?.[1];return groupId?(this.#setCache("group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#joinOfficialGroup(gameId){try{if(this.#ASF)return!!await this.#ASF.joinGroup(gameId)&&(this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]),!0);const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+this.#auth.communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId&&this.#setCache("officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async#leaveOfficialGroup(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(gameId);var groupId=await this.#getOfficialGroupId(gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===dataR?.status&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async#getOfficialGroupId(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var groupId=this.#cache.officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId?(this.#setCache("officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#addToWishlist(gameId){try{if(this.#ASF)return!!await this.#ASF.addToWishlist(gameId)&&(this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0);const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===dataR?.status?"CN"===this.#area&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#addToWishlist(gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async#removeFromWishlist(gameId){try{if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;if(this.#ASF)return await this.#ASF.removeFromWishlist(gameId);const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==dataR?.status)return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1;if("CN"===this.#area&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#removeFromWishlist(gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async#toggleFollowGame(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;if(this.#ASF)return!!await this.#ASF.toggleFollowGame(gameId,doTask)&&(doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0);const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:this.#auth.storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===data?.status&&"true"===data.responseText)return logStatus.success(),!0;var followed=await this.#isFollowedGame(gameId);return"CN"===this.#area&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#removeFromWishlist(gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async#isFollowedGame(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===data?.status&&("CN"===this.#area&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async#toggleForum(gameId,doTask=!0){try{if(!doTask&&this.whiteList.forums.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unsubscribeForum",id:gameId}),!0;const forumId=await this.#getForumId(gameId);if(!forumId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}subscribingForum`,text:gameId});var[id,feature]=forumId.split("_"),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/forum/${id}/General/${doTask?"":"un"}subscribe/${feature||"0"}/`,method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.communitySessionID})});return"Success"===result?(200!==data?.status||1!==data.response?.success&&29!==data.response?.success?logStatus.error(`Error:${data?.statusText}(${data?.status})`):(doTask&&(this.tasks.forums=unique([...this.tasks.forums,gameId])),logStatus.success()),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.toggleForum"),!0}}async#getForumId(gameId){try{const logStatus=scripts_echoLog({type:"gettingForumId",text:gameId});var forumId=this.#cache.forum[gameId];if(forumId)return logStatus.success(),forumId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/app/${gameId}/discussions/`,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const forumId=data.responseText?.match(/General_([\d]+(_[\d]+)?)/)?.[1];return forumId?(this.#setCache("forum",gameId,forumId),logStatus.success(),forumId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getForumId"),!1}}async#toggleFavoriteWorkshop(id,doTask=!0){try{if(!doTask&&this.whiteList.workshops.includes(id))return scripts_echoLog({type:"whiteList",text:"Steam.unfavoriteWorkshop",id:id}),!0;var appid=await this.#getWorkshopAppId(id);if(!appid)return!1;const logStatus=scripts_echoLog({type:doTask?"favoritingWorkshop":"unfavoritingWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/sharedfiles/${doTask?"":"un"}favorite`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,appid:appid,sessionid:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(doTask&&(this.tasks.workshops=unique([...this.tasks.workshops,id])),logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFavoriteWorkshop"),!1}}async#getWorkshopAppId(id){try{const logStatus=scripts_echoLog({type:"gettingWorkshopAppId",text:id});var appId=this.#cache.workshop[id];if(appId)return logStatus.success(),appId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/filedetails/?id="+id,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const appId=data.responseText.match(//)?.[1];return appId?(this.#setCache("workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async#voteUpWorkshop(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:this.#auth.communitySessionID})});return"Success"===result?(200===data?.status&&1===data.response?.success?logStatus.success():logStatus.error(`Error:${data?.statusText}(${data?.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async#toggleCurator(curatorId,doTask=!0){try{if(!doTask&&this.whiteList.curators.includes(curatorId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowCurator",id:curatorId}),!0;if(this.#ASF)return await this.#ASF.toggleCurator(curatorId,doTask);const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/curators/ajaxfollow",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({clanid:curatorId,sessionid:this.#auth.storeSessionID,follow:doTask}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response?.success?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(`+data?.response?.success||data?.status+")"),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async getCuratorId(path,name){try{const logStatus=scripts_echoLog({type:"gettingCuratorId",text:path+"/"+name});var curatorId=this.#cache.curator[path+"/"+name];if(curatorId)return logStatus.success(),curatorId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/${path}/`+name,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const curatorId=data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)?.[1];return curatorId?(this.#setCache("curator",path+"/"+name,curatorId),logStatus.success(),curatorId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getCuratorID"),!1}}async#toggleCuratorLike(link,doTask=!0){try{var[path,name]=link.split("/");if(!path||!name)return scripts_echoLog({text:i18n("errorLink",link)}),!1;var curatorId=await this.getCuratorId(path,name);return curatorId?await this.#toggleCurator(curatorId,doTask):!1}catch(error){return throwError_throwError(error,"Steam.toggleCuratorLike"),!1}}async#getAnnouncementParams(appId,viewId){try{const logStatus=scripts_echoLog({type:"gettingAnnouncementParams",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/events/ajaxgetpartnerevent?appid=${appId}&announcement_gid=${viewId}&lang_list=6_0&last_modified_time=0&origin=https:%2F%2Fstore.steampowered.com&for_edit=false`,method:"GET",responseType:"json",headers:{Host:"store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status||1!==data?.response?.success)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};var{clanid,gid}=data.response.event?.announcement_body||{};return clanid?(logStatus.success(),{clanId:clanid,gid:gid}):(logStatus.error(`Error:${data.statusText}(${data.status})`),{})}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),{}}}async#likeAnnouncement(id){try{var[appId,viewId]=id.split("/");if(!appId||!viewId)return scripts_echoLog({}).error(i18n("missParams")+"(id)"),!1;var{clanId,gid}=await this.#getAnnouncementParams(appId,viewId);if(!clanId)return!1;const logStatus=scripts_echoLog({type:"likingAnnouncement",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/updated/ajaxrateupdate/"+(gid||viewId),method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId},data:$.param({sessionid:this.#auth.storeSessionID,voteup:1,clanid:clanId,ajax:1}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),!1}}async#appid2subid(id){try{const logStatus=scripts_echoLog({type:"gettingSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+id,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#appid2subid(id):!1}var subid=data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];return subid?(logStatus.success(),subid):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.appid2subid"),!1}}async#getLicenses(){try{const logStatus=scripts_echoLog({text:i18n("gettingLicenses")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/dynamicstore/userdata/?t="+(new Date).getTime(),method:"GET",responseType:"json"});return"Success"===result?200===data?.status?(logStatus.success(),data.response?.rgOwnedPackages):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.getLicenses"),!1}}async#addLicense(id){try{if(this.#ASF)return await this.#ASF.addLicense(id);const[type,ids]=id.split("-");if("appid"===type){var subid=await this.#appid2subid(ids);if(!subid)return!1;const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids});if(!await this.#addFreeLicense(subid,logStatus))return!1;const{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+ids,method:"GET"});return"Success"===result?200===data?.status?data.responseText.includes("ds_owned_flag ds_flag")||data.responseText.includes('class="already_in_library"')?(logStatus.success(),!0):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{"CN"===this.#area&&(scripts_echoLog({}).success(i18n("tryChangeAreaNotice")),await this.#changeArea());const logStatusArr={};var idsArr=ids.split(",");for(const subid of idsArr){var logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:subid});if(!await this.#addFreeLicense(subid,logStatus))return!1;logStatusArr[subid]=logStatus}const licenses=await this.#getLicenses();if(!licenses)return!1;for(const subid of idsArr)licenses.includes(parseInt(subid,10))?logStatusArr[subid].success():logStatusArr[subid].error();return!0}}catch(error){return throwError_throwError(error,"Steam.addLicense"),!1}}async#addFreeLicense(id,logStatusPre){try{const logStatus=logStatusPre||scripts_echoLog({type:"addingFreeLicenseSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:this.#auth.storeSessionID,subid:id}),dataType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result?await this.#addFreeLicense(id):!1}return logStatus.success(),!0}catch(error){return throwError_throwError(error,"Steam.addFreeLicense"),!1}}async#requestPlayTestAccess(id){try{if(this.#ASF)return await this.#ASF.requestPlayTestAccess(id);const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+id,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+id},data:$.param({sessionid:this.#auth.storeSessionID}),dataType:"json"});return"Success"===result?200===data?.status&&1===data?.response?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}async toggle({doTask=!0,groupLinks=[],officialGroupLinks=[],wishlistLinks=[],followLinks=[],forumLinks=[],workshopLinks=[],workshopVoteLinks=[],curatorLinks=[],curatorLikeLinks=[],announcementLinks=[],licenseLinks=[],playtestLinks=[]}){try{if(0<[...groupLinks,...officialGroupLinks,...forumLinks,...workshopLinks,...workshopVoteLinks].length&&!this.#communityInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;if(0<[...wishlistLinks,...followLinks,...curatorLinks,...curatorLikeLinks,...announcementLinks,...licenseLinks,...playtestLinks].length&&!this.#storeInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.steam.groups||!doTask&&!globalOptions.undoTask.steam.groups)scripts_echoLog({type:"globalOptionsSkip",text:"steam.groups"});else{var realGroups=this.getRealParams("groups",groupLinks,doTask,link=>link.match(/groups\/(.+)\/?/)?.[1]);if(0link.match(/games\/(.+)\/?/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(doTask&&0link.match(/curator\/([\d]+)/)?.[1]),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,link=>link.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/)?.slice(1,3).join("/"));if(0(link.includes("store.steampowered.com")?link.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/):link.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))?.slice(1,3).join("/"));if(doTask&&0link.match(/app\/([\d]+)/)?.[1]);if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==this.#area&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await this.#changeArea("CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}#setCache(type,name,id){try{this.#cache[type][name]=id,GM_setValue("steamCache",this.#cache)}catch(error){throwError_throwError(error,"Steam.setCache")}}};const Giveawaysu=class{undoneTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};giveawayId;socialInitialized={discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0};initialized=!1;social={};static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{this.#checkLogin()||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await this.#checkLeftKey()||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!this.#getGiveawayId()&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async#classifyTask(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError_throwError(error,"getRedirectLink"),null}})(taskDes.attr("href")).then(taskLink=>taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.#uniqueTasks(this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}#checkLogin(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async#checkLeftKey(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(({value})=>{value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}#getGiveawayId(){var giveawayId=window.location.href.match(/\/view\/([\d]+)/)?.[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async#bind(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async#initSocial(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(this.#bind("discord",this.social.discord.init("do")))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(this.#bind("instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(this.#bind("reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(this.#bind("twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(this.#bind("vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(this.#bind("youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&tasks.steam?.[type]?.length||0).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(this.#bind("steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}#uniqueTasks(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async#toggleTask(){try{if(!this.initialized&&!this.init())return!1;if(!await this.#classifyTask())return!1;if(!await this.#initSocial())return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await this.#toggleTask()}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};discordAuth=__webpack_require__(82);if(window.STYLE=GM_addStyle(discordAuth.Z+GM_getResourceText("style")),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{var authToken;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(authToken=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientId:commonOptions?.headers?.["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"x.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file diff --git a/dist/auto-task-v4.all.user.js b/dist/auto-task-v4.all.user.js index 713036e..b7460a8 100644 --- a/dist/auto-task-v4.all.user.js +++ b/dist/auto-task-v4.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4 // @namespace auto-task-v4 -// @version 4.4.7 +// @version 4.4.8 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -32,6 +32,8 @@ // @include *://*.reddit.com/* // @include *://twitter.com/settings/account?k* // @include *://x.com/settings/account* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @include https://auto-task-v4.hclonely.com/setting.html // @include https://auto-task-v4.hclonely.com/history.html @@ -428,22 +430,22 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); }); }); }, - 221: function(module, __webpack_exports__, __webpack_require__) { + 568: function(module, __webpack_exports__, __webpack_require__) { 'use strict'; __webpack_require__.d(__webpack_exports__, { Z: function() { return __WEBPACK_DEFAULT_EXPORT__; } }); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(398); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); - var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(494); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(999); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, '.colorful-button,#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn,body.auto-task-options .auto-task-form table button{position:relative;padding:5px 10px;text-align:center;color:#fff;text-decoration:none;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:30px;background-size:400%;text-transform:capitalize}.colorful-button:hover,#auto-task-buttons a.auto-task-website-btn:hover,.show-button-div a.auto-task-website-btn:hover,body.auto-task-options .auto-task-form table button:hover{transform:scale(1.05);box-shadow:0 6px 20px rgba(0,0,0,.3);cursor:pointer}.colorful-button:hover::before,#auto-task-buttons a.auto-task-website-btn:hover::before,.show-button-div a.auto-task-website-btn:hover::before,body.auto-task-options .auto-task-form table button:hover::before{filter:blur(10px);opacity:1}.colorful-button::before,#auto-task-buttons a.auto-task-website-btn::before,.show-button-div a.auto-task-website-btn::before,body.auto-task-options .auto-task-form table button::before{content:"";position:absolute;top:-5px;left:-5px;right:-5px;bottom:-5px;z-index:-1;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:40px;background-size:400%;opacity:-1}#auto-task-info{position:fixed;bottom:10px;right:10px;width:60%;max-width:500px;max-height:60%;overflow-y:auto;color:#000;background-color:#fff;padding-left:5px;z-index:999999999 !important;border:solid 2px #add8e6;border-radius:10px}#auto-task-info li{text-align:left}#auto-task-info li a.high-light{color:#00aeff;font-weight:bold}#auto-task-info .success{color:green}#auto-task-info .error{color:red}#auto-task-info .warning{color:blue}#auto-task-info .info{color:#ff0}#auto-task-info .update-text{color:green;border:solid 2px #8dcb69;margin:5px 10px 5px 20px;border-radius:10px;padding:5px 20px}.auto-task-keylol{display:inline-block;text-transform:capitalize;margin-left:10px;text-decoration:none !important;border:solid 1px;border-radius:5px;padding:0 2px}.auto-task-keylol[selected=selected]{background-color:blue !important;color:#fff !important}.auto-task-form table{font-family:verdana,arial,sans-serif;font-size:11px;color:#333;border-width:1px;border-color:#999;border-collapse:collapse;width:100%}.auto-task-form table thead td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;font-weight:bold;background-color:#fff}.auto-task-form table tbody tr{background-color:#d4e3e5}.auto-task-form table tbody tr:hover{background-color:#ff6 !important}.auto-task-form table tbody tr th{background-color:#c3dde0;border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;text-transform:capitalize}.auto-task-form table tbody tr td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9}.swal2-modal{width:70% !important;max-width:1000px !important}body.auto-task-options{padding-top:10px;text-align:center}body.auto-task-options .auto-task-form{width:80%;max-width:1000px;margin:0 auto;padding-bottom:20px}body.auto-task-options .auto-task-form table input.editOption{width:80%}body.auto-task-options .auto-task-form table #getTwitterUserId,body.auto-task-options .auto-task-form table #getYoutubeChannelId{margin-top:5px}body.auto-task-options .auto-task-form table button{z-index:1}body.auto-task-options .auto-task-form table input[type=text]{outline-style:none;border:1px solid #ccc;border-radius:3px;padding:5px 10px;font-size:14px}body.auto-task-options .auto-task-form table input[type=text]:focus{border-color:#66afe9;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}body.auto-task-options .auto-task-form table label{position:relative;width:160px;height:80px;cursor:pointer;transform:scale(0.25);margin:-25% 0;top:-30px;display:inline-block}body.auto-task-options .auto-task-form table label input{position:relative;z-index:1;appearance:none}body.auto-task-options .auto-task-form table label input:checked~span{background:#05be05;box-shadow:0 15px 25px #05be0566}body.auto-task-options .auto-task-form table label input:checked~span i{left:84px}body.auto-task-options .auto-task-form table label input:checked~span i::before{background:#05be05;box-shadow:35px 0 0 #05be05}body.auto-task-options .auto-task-form table label input:checked~span i::after{bottom:12px;height:15px;border-bottom-left-radius:15px;border-bottom-right-radius:15px;background:#05be05}body.auto-task-options .auto-task-form table label span{position:absolute;top:0;left:0;width:100%;height:100%;background:#fe0000;border-radius:80px;transition:.5s;box-shadow:0 15px 25px #fe000066}body.auto-task-options .auto-task-form table label span i{position:absolute;top:4px;left:4px;width:72px;height:72px;background:#fff;border-radius:50%}body.auto-task-options .auto-task-form table label span i::before{content:"";position:absolute;top:22px;left:12px;width:12px;height:12px;border-radius:50%;background:#fe0000;box-shadow:35px 0 0 #fe0000;transition:.5s}body.auto-task-options .auto-task-form table label span i::after{content:"";position:absolute;bottom:15px;left:calc(50% - 15px);width:30px;height:6px;border-radius:6px;background:#fe0000;transition:.5s}body.auto-task-history{font-size:15px;font-weight:400;line-height:1.5}body.auto-task-history .container a{color:#007bff;text-decoration:none;background-color:transparent}body.auto-task-history .container .card{width:80%;max-width:800px;border-radius:10px;background:#7676761a;border-top:1px solid #ffffff80;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:0 15px 25px #0000001a;margin:20px auto;position:relative;display:flex;flex-direction:column;word-wrap:break-word;-webkit-background-clip:border-box;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}body.auto-task-history .container .card .title{text-align:center;font-size:30px;font-weight:bold;margin:5px 0}body.auto-task-history .container .card .title a:hover{text-decoration:none;background:#93e1ff;border-radius:10px;padding:3px}body.auto-task-history .container .card ul{margin-bottom:25px}body.auto-task-history .container .card ul li{margin-bottom:5px;line-height:20px}body.auto-task-history .container .card ul a:hover{text-decoration:underline}body.auto-task-history .container .card .delete-task{right:10px;width:38px;height:35px;position:absolute;font-size:24px;cursor:pointer;border-radius:10px}body.auto-task-history .container .card .delete-task:hover{background:#fff}body.auto-task-history .container .card .time{right:5px;position:absolute;bottom:0;color:#e83e8c;font-family:\'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace\';font-size:15px}#auto-task-buttons,.show-button-div{position:fixed;top:30px;right:15px;width:124px;z-index:999999999 !important;transform:scale(0.85)}#auto-task-buttons p,.show-button-div p{line-height:30px;height:40px;text-align:center;margin:5px !important}#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn{width:105px;line-height:27px;font-size:20px;display:block}.show-button-div{width:20px}.auto-task-capitalize{text-transform:capitalize !important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{box-shadow:inset 0px 0px 4px 1px rgba(100,150,200,.5) !important}.swal2-checkbox-custom{align-items:center;justify-content:center;background:#fff;color:inherit;margin:1em auto}.swal2-checkbox-custom input{flex-shrink:0;margin:0 .4em}.giveaway-actions #getKey{display:none !important}.auto-task-giveaway-status{color:#fff;border-radius:10px;padding:0 5px;margin-left:5px}.auto-task-giveaway-status.active{background-color:#5cb85c}.auto-task-giveaway-status.not-active{background-color:#d9534f}', '' ]); const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___.toString(); }, - 1: function(module) { + 999: function(module) { 'use strict'; module.exports = function(cssWithMappingToString) { var list = []; @@ -521,7 +523,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); return list; }; }, - 398: function(module) { + 494: function(module) { 'use strict'; module.exports = function(i) { return i[1]; @@ -577,7 +579,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); const external_Swal_namespaceObject = Swal; var external_Swal_default = __webpack_require__.n(external_Swal_namespaceObject); const external_Cookies_namespaceObject = Cookies; - var auto_task = __webpack_require__(221); + var auto_task = __webpack_require__(568); var javascript_utils_umd_min = __webpack_require__(108); const httpRequest = async (options, times = 0) => { if (window.TRACE) { @@ -10700,8 +10702,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); }; const scripts_updateChecker = updateChecker; window.STYLE = GM_addStyle(auto_task.Z + `.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`); - window.DEBUG = !!globalOptions.other.debug; - window.TRACE = !!globalOptions.other.debug && typeof console.trace === 'function'; + window.DEBUG = !!globalOptions.other?.debug; + window.TRACE = !!globalOptions.other?.debug && typeof console.trace === 'function'; const loadScript = async () => { if (window.location.hostname === 'www.twitch.tv' && window.location.hash === '#auth') { const authToken = external_Cookies_namespaceObject.get('auth-token'); diff --git a/dist/auto-task-v4.compatibility.all.user.js b/dist/auto-task-v4.compatibility.all.user.js index 0e1d4c7..dd47687 100644 --- a/dist/auto-task-v4.compatibility.all.user.js +++ b/dist/auto-task-v4.compatibility.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4.compatibility // @namespace auto-task-v4.compatibility -// @version 4.4.7 +// @version 4.4.8 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -32,6 +32,8 @@ // @include *://*.reddit.com/* // @include *://twitter.com/settings/account?k* // @include *://x.com/settings/account* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @include https://auto-task-v4.hclonely.com/setting.html // @include https://auto-task-v4.hclonely.com/history.html @@ -121,7 +123,7 @@ var runtime=function(t){"use strict";var r,e=Object.prototype,n=e.hasOwnProperty console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); -!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date(){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ +!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date(){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ ${text?.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)}),getRedirectLink=async link=>{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError(error,"getRedirectLink"),null}},visitLink=async(link,options)=>{try{const logStatus=scripts_echoLog({type:"visitLink",text:link});return await tools_httpRequest({url:link,method:"GET",...options}).then(({result,statusText,status})=>"Success"===result?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1))}catch(error){return throwError(error,"visitLink"),!1}};const stringToColour=str=>{try{let hash=0;for(let i=0;i>8*i&255;colour+=("00"+value.toString(16)).slice(-2)}return colour}catch(error){return throwError(error,"stringToColour"),"#fff"}},defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};var website_Opquests=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,website_Opquests),saveData=()=>{try{const data={};$("#globalOptionsForm").serializeArray().map(value=>(data[value.name]=value.value,value)),$.makeArray($("#globalOptionsForm input")).map(element=>{const name=$(element).attr("name");var keys=name.split(".");return 3===keys.length?globalOptions[keys[0]][keys[1]][keys[2]]=!!data[name]&&("on"===data[name]||data[name]):2===keys.length&&(globalOptions[keys[0]][keys[1]]=!!data[name]&&("on"===data[name]||data[name])),element}),GM_setValue("globalOptions",globalOptions),external_Swal_default().fire({title:i18n("changeGlobalOptionsSuccess"),icon:"success"})}catch(error){throwError(error,"saveData")}},changeGlobalOptions=showType=>{try{let globalOptionsForm=`
    @@ -152,6 +154,6 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); ${i18n("scriptManager")}${GM_info.scriptHandler}${GM_info.version} ${i18n("script")}${GM_info.script.name}${GM_info.script.version}
    `;$("body").append(`

    ${i18n("environment")}

    `+environmentForm)}catch(error){throwError(error,"Setting.environment")}}},class extends loadScript{name="History";buttons=["doTask","undoTask","selectAll","selectNone","invertSelect","clearHistory"];static test(){return"auto-task-v4.hclonely.com"===window.location.host&&"/history.html"===window.location.pathname}before(){try{$("body").html('
    ').addClass("auto-task-history");const data=GM_listValues()||[];for(const item of data.map(value=>/^[\w]+?Tasks-/.test(value)?value:null).filter(value=>value))this.#addItem(item)}catch(error){throwError(error,"History.before")}}clearHistory(){try{const data=GM_listValues()||[];for(const item of data.map(value=>/^[\w]+?Tasks-/.test(value)?value:null).filter(value=>value))GM_deleteValue(item);external_Swal_default().fire({title:i18n("clearHistoryFinished"),icon:"success"})}catch(error){throwError(error,"History.after")}}#addItem(item){try{var tasksData=GM_getValue(item);if(!tasksData?.tasks)return;let html="",title="",link="";var social,types,[website,id]=item.split("-");switch(website){case"fawTasks":title=`Freeanywhere[${id}]`,link="https://freeanywhere.net/#/giveaway/"+id;break;case"gasTasks":title=`Giveawaysu[${id}]`,link="https://giveaway.su/giveaway/view/"+id;break;case"gcTasks":title=`GiveeClub[${id}]`,link="https://givee.club/event/"+id;break;case"gkTasks":title=`Givekey[${id}]`,link="https://givekey.ru/giveaway/"+id;break;case"gleamTasks":title=`Gleam[${id}]`,link="https://gleam.io"+id;break;case"khTasks":title=`keyhub[${id}]`,link="https://key-hub.eu/giveaway/"+id;break;case"prysTasks":title=`Prys[${id}]`,link="https://prys.revadike.com/giveaway/?id="+id;break;default:return}for([social,types]of Object.entries(tasksData.tasks))for(var[type,tasks]of Object.entries(types))for(const task of tasks)html+=`
  • ${social}.${i18n(type.replace("Link",""))}: ${55
  • `;$(".container").append(`
      ${html}
    ${i18n("lastChangeTime")}: ${dayjs_min(tasksData.time).format("YYYY-MM-DD HH:mm:ss")}
    `),$("span.delete-task").on("click",function(){var itemName=$(this).attr("data-name");itemName?(GM_deleteValue(itemName),$(`div.card[data-name="${itemName}"]`).remove(),external_Swal_default().fire({title:i18n("clearTaskFinished"),text:itemName,icon:"success"})):external_Swal_default().fire({title:i18n("clearTaskFailed"),icon:"error"})})}catch(error){throwError(error,"History.addItem")}}}];const options=function(website,options){try{let websiteOptionsForm=`
    - `;for(var[option,value]of Object.entries(options))websiteOptionsForm+=``;websiteOptionsForm+="
    ${i18n("option")}${i18n("value")}
    ${option}
    ",external_Swal_default().fire({title:i18n("websiteOptions"),html:websiteOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(({isConfirmed})=>{isConfirmed&&($("#websiteOptionsForm").serializeArray().map(value=>(options[value.name]=value.value,value)),GM_setValue(website+"Options",options),external_Swal_default().fire({title:i18n("changeWebsiteOptionsSuccess"),icon:"success"}))})}catch(error){throwError(error,"websiteOptions")}};var loadScript=keyboardJS,external_keyboardJS_default=__webpack_require__.n(loadScript);const checkUpdate=async(updateLink,auto)=>{try{var checkUrl=updateLink+"package.json?time="+(new Date).getTime(),{result,statusText,status,data}=await tools_httpRequest({url:checkUrl,responseType:"json",method:"GET",timeout:3e4});return"Success"===result?data?.response?.version?data.response:(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${data?.statusText}(${data?.status})]`),!1):(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${result}:${statusText}(${status})]`),!1)}catch(error){return throwError(error,"checkUpdate"),!1}};const scripts_updateChecker=async()=>{try{var currentVersion=GM_info.script.version,updateSource=globalOptions.other.autoUpdateSource.toLowerCase(),updateLinks={github:"https://github.com/HCLonely/auto-task-new/raw/main/",jsdelivr:"https://cdn.jsdelivr.net/gh/HCLonely/auto-task-v4@main/",standby:"https://auto-task-v4.hclonely.com/"};let version,updateLink="",packageData;["github","jsdelivr","standby"].includes(updateSource)?(updateLink=updateLinks[updateSource],packageData=await checkUpdate(updateLink,!1)):(updateLink=updateLinks.github,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.jsdelivr,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.standby,packageData=await checkUpdate(updateLink,!0)))),packageData?version=packageData.version||currentVersion:(version=currentVersion,scripts_echoLog({}).error(i18n("checkUpdateFailed"))),packageData&&((currentVersion,remoteVersion)=>{try{const[currentRealVersion]=currentVersion.split("-"),[remoteRealVersion,isPreview]=remoteVersion.split("-");if(isPreview&&!globalOptions.other.receivePreview)return!1;var[currentVersion1,currentVersion2,currentVersion3]=currentRealVersion.split(".").map(value=>parseInt(value,10)),[remoteVersion1,remoteVersion2,remoteVersion3]=remoteRealVersion.split(".").map(value=>parseInt(value,10));return currentVersion1${i18n("newVersionNotice",version,`${updateLink}dist/${GM_info.script.name}.user.js`)}`}),scripts_echoLog({html:`
  • ${i18n("updateText",version)}
    1. ${packageData.change?.map(change=>`
    2. ${change}
    3. `).join("")}
    4. ${i18n("updateHistory")}
    `}))}catch(error){throwError(error,"updateChecker")}};window.STYLE=GM_addStyle(discordAuth.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),window.DEBUG=!!globalOptions.other.debug,window.TRACE=!!globalOptions.other.debug&&"function"==typeof console.trace;loadScript=async()=>{if("www.twitch.tv"!==window.location.hostname||"#auth"!==window.location.hash){if("www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");return 0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var authToken=()=>{const $this=$("#toggle-log");"show"===$this.attr("data-status")?($("#auto-task-info").hide(),$this.attr("data-status","hide").text(i18n("showLog"))):($("#auto-task-info").show(),$this.attr("data-status","show").text(i18n("hideLog")))};if(external_keyboardJS_default().bind(globalOptions.hotKey.doTaskKey,()=>{website.doTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.undoTaskKey,()=>{website.undoTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.toggleLogKey,authToken),website?.after&&await website?.after(),website?.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(website.name+"-buttons");for(const button of website.buttons)if(website[button]){const btnElement=$(`

    ${i18n(button)}

    `);btnElement.find("a.auto-task-website-btn").on("click",()=>{website[button]()}),$("#auto-task-buttons").append(btnElement)}}const hideButtonElement=$(`

    + `;for(var[option,value]of Object.entries(options))websiteOptionsForm+=``;websiteOptionsForm+="
    ${i18n("option")}${i18n("value")}
    ${option}
    ",external_Swal_default().fire({title:i18n("websiteOptions"),html:websiteOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(({isConfirmed})=>{isConfirmed&&($("#websiteOptionsForm").serializeArray().map(value=>(options[value.name]=value.value,value)),GM_setValue(website+"Options",options),external_Swal_default().fire({title:i18n("changeWebsiteOptionsSuccess"),icon:"success"}))})}catch(error){throwError(error,"websiteOptions")}};var loadScript=keyboardJS,external_keyboardJS_default=__webpack_require__.n(loadScript);const checkUpdate=async(updateLink,auto)=>{try{var checkUrl=updateLink+"package.json?time="+(new Date).getTime(),{result,statusText,status,data}=await tools_httpRequest({url:checkUrl,responseType:"json",method:"GET",timeout:3e4});return"Success"===result?data?.response?.version?data.response:(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${data?.statusText}(${data?.status})]`),!1):(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${result}:${statusText}(${status})]`),!1)}catch(error){return throwError(error,"checkUpdate"),!1}};const scripts_updateChecker=async()=>{try{var currentVersion=GM_info.script.version,updateSource=globalOptions.other.autoUpdateSource.toLowerCase(),updateLinks={github:"https://github.com/HCLonely/auto-task-new/raw/main/",jsdelivr:"https://cdn.jsdelivr.net/gh/HCLonely/auto-task-v4@main/",standby:"https://auto-task-v4.hclonely.com/"};let version,updateLink="",packageData;["github","jsdelivr","standby"].includes(updateSource)?(updateLink=updateLinks[updateSource],packageData=await checkUpdate(updateLink,!1)):(updateLink=updateLinks.github,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.jsdelivr,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.standby,packageData=await checkUpdate(updateLink,!0)))),packageData?version=packageData.version||currentVersion:(version=currentVersion,scripts_echoLog({}).error(i18n("checkUpdateFailed"))),packageData&&((currentVersion,remoteVersion)=>{try{const[currentRealVersion]=currentVersion.split("-"),[remoteRealVersion,isPreview]=remoteVersion.split("-");if(isPreview&&!globalOptions.other.receivePreview)return!1;var[currentVersion1,currentVersion2,currentVersion3]=currentRealVersion.split(".").map(value=>parseInt(value,10)),[remoteVersion1,remoteVersion2,remoteVersion3]=remoteRealVersion.split(".").map(value=>parseInt(value,10));return currentVersion1${i18n("newVersionNotice",version,`${updateLink}dist/${GM_info.script.name}.user.js`)}`}),scripts_echoLog({html:`

  • ${i18n("updateText",version)}
    1. ${packageData.change?.map(change=>`
    2. ${change}
    3. `).join("")}
    4. ${i18n("updateHistory")}
    `}))}catch(error){throwError(error,"updateChecker")}};window.STYLE=GM_addStyle(discordAuth.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),window.DEBUG=!!globalOptions.other?.debug,window.TRACE=!!globalOptions.other?.debug&&"function"==typeof console.trace;loadScript=async()=>{if("www.twitch.tv"!==window.location.hostname||"#auth"!==window.location.hash){if("www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");return 0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var authToken=()=>{const $this=$("#toggle-log");"show"===$this.attr("data-status")?($("#auto-task-info").hide(),$this.attr("data-status","hide").text(i18n("showLog"))):($("#auto-task-info").show(),$this.attr("data-status","show").text(i18n("hideLog")))};if(external_keyboardJS_default().bind(globalOptions.hotKey.doTaskKey,()=>{website.doTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.undoTaskKey,()=>{website.undoTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.toggleLogKey,authToken),website?.after&&await website?.after(),website?.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(website.name+"-buttons");for(const button of website.buttons)if(website[button]){const btnElement=$(`

    ${i18n(button)}

    `);btnElement.find("a.auto-task-website-btn").on("click",()=>{website[button]()}),$("#auto-task-buttons").append(btnElement)}}const hideButtonElement=$(`

    ${i18n("hideButton")}

    `);hideButtonElement.find("a.auto-task-website-btn").on("click",()=>{$("#auto-task-buttons").hide(),$("div.show-button-div").show()});const toggleLogElement=$(`

    ${globalOptions.other.defaultShowLog?i18n("hideLog"):i18n("showLog")}

    `);toggleLogElement.find("a.auto-task-website-btn").on("click",authToken),$("#auto-task-buttons").append(hideButtonElement).append(toggleLogElement),website?.options&&GM_registerMenuCommand(i18n("changeWebsiteOptions"),()=>{options(website.name,website.options)}),"Setting"!==website.name&&(GM_registerMenuCommand(i18n("changeGlobalOptions"),()=>{changeGlobalOptions("swal")}),GM_registerMenuCommand(i18n("settingPage"),()=>{window.open("https://auto-task-v4.hclonely.com/setting.html","_blank")})),console.log("%c%s","color:#1bbe1a","Auto-Task[Load]: 脚本加载完成");var[v1,authToken]=GM_info.version.split(".");5<=parseInt(v1,10)&&2<=parseInt(authToken,10)||scripts_echoLog({}).error(i18n("versionNotMatched")),GM_getValue("notice")||(external_Swal_default().fire({title:i18n("swalNotice"),icon:"warning"}).then(()=>{window.open(i18n("noticeLink"),"_blank"),GM_setValue("notice",(new Date).getTime())}),scripts_echoLog({html:`
  • ${i18n("echoNotice",i18n("noticeLink"))}
  • `}).font?.find("a").on("click",()=>{GM_setValue("notice",(new Date).getTime())})),scripts_updateChecker()}else console.log("%c%s","color:#ff0000","Auto-Task[Warning]: 脚本停止加载,当前网站不支持!")}else{authToken=external_Cookies_namespaceObject.get("auth-token");!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientVersion:__twilightBuildID,clientId:commonOptions?.headers?.["Client-ID"],deviceId:commonOptions?.headers?.["Device-ID"],clientSessionId:window.localStorage.local_storage_app_session_id.replace(/"/g,"")}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}};if("discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{if(0!==$("[data-miniprofile]").length){window.onbeforeunload=function(event){return GM_setValue("steamStoreAuth",null),null};var storeSessionID=document.body.innerHTML.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(GM_setValue("steamStoreAuth",{storeSessionID:storeSessionID}),!0):void 0}}):window.opener&&"steamcommunity.com"===window.location.host&&window.location.pathname.includes("/id/")?$(()=>{window.onbeforeunload=function(event){return GM_setValue("steamCommunityAuth",null),null};var steam64Id=document.body.innerHTML.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=document.body.innerHTML.match(/g_sessionID = "(.+?)";/)?.[1],userName=document.body.innerHTML.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];const data={};if(steam64Id&&(data.steam64Id=steam64Id),userName&&(data.userName=userName),communitySessionID)return data.communitySessionID=communitySessionID,GM_setValue("steamCommunityAuth",data),!0}):("key-hub.eu"===window.location.hostname&&(unsafeWindow.keyhubtracker=1,unsafeWindow.gaData={}),$(loadScript))}()}(); \ No newline at end of file diff --git a/dist/auto-task-v4.compatibility.user.js b/dist/auto-task-v4.compatibility.user.js index 86f6017..6f2c2b7 100644 --- a/dist/auto-task-v4.compatibility.user.js +++ b/dist/auto-task-v4.compatibility.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4.compatibility // @namespace auto-task-v4.compatibility -// @version 4.4.7 +// @version 4.4.8 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -32,6 +32,8 @@ // @include *://*.reddit.com/* // @include *://twitter.com/settings/account?k* // @include *://x.com/settings/account* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @include https://auto-task-v4.hclonely.com/setting.html // @include https://auto-task-v4.hclonely.com/history.html @@ -102,7 +104,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); -!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date(){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ +!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date(){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ ${text?.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)}),getRedirectLink=async link=>{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError(error,"getRedirectLink"),null}},visitLink=async(link,options)=>{try{const logStatus=scripts_echoLog({type:"visitLink",text:link});return await tools_httpRequest({url:link,method:"GET",...options}).then(({result,statusText,status})=>"Success"===result?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1))}catch(error){return throwError(error,"visitLink"),!1}};const stringToColour=str=>{try{let hash=0;for(let i=0;i>8*i&255;colour+=("00"+value.toString(16)).slice(-2)}return colour}catch(error){return throwError(error,"stringToColour"),"#fff"}},defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};var website_Opquests=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,website_Opquests),saveData=()=>{try{const data={};$("#globalOptionsForm").serializeArray().map(value=>(data[value.name]=value.value,value)),$.makeArray($("#globalOptionsForm input")).map(element=>{const name=$(element).attr("name");var keys=name.split(".");return 3===keys.length?globalOptions[keys[0]][keys[1]][keys[2]]=!!data[name]&&("on"===data[name]||data[name]):2===keys.length&&(globalOptions[keys[0]][keys[1]]=!!data[name]&&("on"===data[name]||data[name])),element}),GM_setValue("globalOptions",globalOptions),external_Swal_default().fire({title:i18n("changeGlobalOptionsSuccess"),icon:"success"})}catch(error){throwError(error,"saveData")}},changeGlobalOptions=showType=>{try{let globalOptionsForm=`
    @@ -133,6 +135,6 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); ${i18n("scriptManager")}${GM_info.scriptHandler}${GM_info.version} ${i18n("script")}${GM_info.script.name}${GM_info.script.version}
    `;$("body").append(`

    ${i18n("environment")}

    `+environmentForm)}catch(error){throwError(error,"Setting.environment")}}},class extends loadScript{name="History";buttons=["doTask","undoTask","selectAll","selectNone","invertSelect","clearHistory"];static test(){return"auto-task-v4.hclonely.com"===window.location.host&&"/history.html"===window.location.pathname}before(){try{$("body").html('
    ').addClass("auto-task-history");const data=GM_listValues()||[];for(const item of data.map(value=>/^[\w]+?Tasks-/.test(value)?value:null).filter(value=>value))this.#addItem(item)}catch(error){throwError(error,"History.before")}}clearHistory(){try{const data=GM_listValues()||[];for(const item of data.map(value=>/^[\w]+?Tasks-/.test(value)?value:null).filter(value=>value))GM_deleteValue(item);external_Swal_default().fire({title:i18n("clearHistoryFinished"),icon:"success"})}catch(error){throwError(error,"History.after")}}#addItem(item){try{var tasksData=GM_getValue(item);if(!tasksData?.tasks)return;let html="",title="",link="";var social,types,[website,id]=item.split("-");switch(website){case"fawTasks":title=`Freeanywhere[${id}]`,link="https://freeanywhere.net/#/giveaway/"+id;break;case"gasTasks":title=`Giveawaysu[${id}]`,link="https://giveaway.su/giveaway/view/"+id;break;case"gcTasks":title=`GiveeClub[${id}]`,link="https://givee.club/event/"+id;break;case"gkTasks":title=`Givekey[${id}]`,link="https://givekey.ru/giveaway/"+id;break;case"gleamTasks":title=`Gleam[${id}]`,link="https://gleam.io"+id;break;case"khTasks":title=`keyhub[${id}]`,link="https://key-hub.eu/giveaway/"+id;break;case"prysTasks":title=`Prys[${id}]`,link="https://prys.revadike.com/giveaway/?id="+id;break;default:return}for([social,types]of Object.entries(tasksData.tasks))for(var[type,tasks]of Object.entries(types))for(const task of tasks)html+=`
  • ${social}.${i18n(type.replace("Link",""))}: ${55
  • `;$(".container").append(`
      ${html}
    ${i18n("lastChangeTime")}: ${dayjs_min(tasksData.time).format("YYYY-MM-DD HH:mm:ss")}
    `),$("span.delete-task").on("click",function(){var itemName=$(this).attr("data-name");itemName?(GM_deleteValue(itemName),$(`div.card[data-name="${itemName}"]`).remove(),external_Swal_default().fire({title:i18n("clearTaskFinished"),text:itemName,icon:"success"})):external_Swal_default().fire({title:i18n("clearTaskFailed"),icon:"error"})})}catch(error){throwError(error,"History.addItem")}}}];const options=function(website,options){try{let websiteOptionsForm=`
    - `;for(var[option,value]of Object.entries(options))websiteOptionsForm+=``;websiteOptionsForm+="
    ${i18n("option")}${i18n("value")}
    ${option}
    ",external_Swal_default().fire({title:i18n("websiteOptions"),html:websiteOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(({isConfirmed})=>{isConfirmed&&($("#websiteOptionsForm").serializeArray().map(value=>(options[value.name]=value.value,value)),GM_setValue(website+"Options",options),external_Swal_default().fire({title:i18n("changeWebsiteOptionsSuccess"),icon:"success"}))})}catch(error){throwError(error,"websiteOptions")}};var loadScript=keyboardJS,external_keyboardJS_default=__webpack_require__.n(loadScript);const checkUpdate=async(updateLink,auto)=>{try{var checkUrl=updateLink+"package.json?time="+(new Date).getTime(),{result,statusText,status,data}=await tools_httpRequest({url:checkUrl,responseType:"json",method:"GET",timeout:3e4});return"Success"===result?data?.response?.version?data.response:(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${data?.statusText}(${data?.status})]`),!1):(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${result}:${statusText}(${status})]`),!1)}catch(error){return throwError(error,"checkUpdate"),!1}};const scripts_updateChecker=async()=>{try{var currentVersion=GM_info.script.version,updateSource=globalOptions.other.autoUpdateSource.toLowerCase(),updateLinks={github:"https://github.com/HCLonely/auto-task-new/raw/main/",jsdelivr:"https://cdn.jsdelivr.net/gh/HCLonely/auto-task-v4@main/",standby:"https://auto-task-v4.hclonely.com/"};let version,updateLink="",packageData;["github","jsdelivr","standby"].includes(updateSource)?(updateLink=updateLinks[updateSource],packageData=await checkUpdate(updateLink,!1)):(updateLink=updateLinks.github,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.jsdelivr,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.standby,packageData=await checkUpdate(updateLink,!0)))),packageData?version=packageData.version||currentVersion:(version=currentVersion,scripts_echoLog({}).error(i18n("checkUpdateFailed"))),packageData&&((currentVersion,remoteVersion)=>{try{const[currentRealVersion]=currentVersion.split("-"),[remoteRealVersion,isPreview]=remoteVersion.split("-");if(isPreview&&!globalOptions.other.receivePreview)return!1;var[currentVersion1,currentVersion2,currentVersion3]=currentRealVersion.split(".").map(value=>parseInt(value,10)),[remoteVersion1,remoteVersion2,remoteVersion3]=remoteRealVersion.split(".").map(value=>parseInt(value,10));return currentVersion1${i18n("newVersionNotice",version,`${updateLink}dist/${GM_info.script.name}.user.js`)}`}),scripts_echoLog({html:`
  • ${i18n("updateText",version)}
    1. ${packageData.change?.map(change=>`
    2. ${change}
    3. `).join("")}
    4. ${i18n("updateHistory")}
    `}))}catch(error){throwError(error,"updateChecker")}};window.STYLE=GM_addStyle(discordAuth.Z+GM_getResourceText("style")),window.DEBUG=!!globalOptions.other.debug,window.TRACE=!!globalOptions.other.debug&&"function"==typeof console.trace;loadScript=async()=>{if("www.twitch.tv"!==window.location.hostname||"#auth"!==window.location.hash){if("www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");return 0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var authToken=()=>{const $this=$("#toggle-log");"show"===$this.attr("data-status")?($("#auto-task-info").hide(),$this.attr("data-status","hide").text(i18n("showLog"))):($("#auto-task-info").show(),$this.attr("data-status","show").text(i18n("hideLog")))};if(external_keyboardJS_default().bind(globalOptions.hotKey.doTaskKey,()=>{website.doTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.undoTaskKey,()=>{website.undoTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.toggleLogKey,authToken),website?.after&&await website?.after(),website?.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(website.name+"-buttons");for(const button of website.buttons)if(website[button]){const btnElement=$(`

    ${i18n(button)}

    `);btnElement.find("a.auto-task-website-btn").on("click",()=>{website[button]()}),$("#auto-task-buttons").append(btnElement)}}const hideButtonElement=$(`

    + `;for(var[option,value]of Object.entries(options))websiteOptionsForm+=``;websiteOptionsForm+="
    ${i18n("option")}${i18n("value")}
    ${option}
    ",external_Swal_default().fire({title:i18n("websiteOptions"),html:websiteOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(({isConfirmed})=>{isConfirmed&&($("#websiteOptionsForm").serializeArray().map(value=>(options[value.name]=value.value,value)),GM_setValue(website+"Options",options),external_Swal_default().fire({title:i18n("changeWebsiteOptionsSuccess"),icon:"success"}))})}catch(error){throwError(error,"websiteOptions")}};var loadScript=keyboardJS,external_keyboardJS_default=__webpack_require__.n(loadScript);const checkUpdate=async(updateLink,auto)=>{try{var checkUrl=updateLink+"package.json?time="+(new Date).getTime(),{result,statusText,status,data}=await tools_httpRequest({url:checkUrl,responseType:"json",method:"GET",timeout:3e4});return"Success"===result?data?.response?.version?data.response:(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${data?.statusText}(${data?.status})]`),!1):(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${result}:${statusText}(${status})]`),!1)}catch(error){return throwError(error,"checkUpdate"),!1}};const scripts_updateChecker=async()=>{try{var currentVersion=GM_info.script.version,updateSource=globalOptions.other.autoUpdateSource.toLowerCase(),updateLinks={github:"https://github.com/HCLonely/auto-task-new/raw/main/",jsdelivr:"https://cdn.jsdelivr.net/gh/HCLonely/auto-task-v4@main/",standby:"https://auto-task-v4.hclonely.com/"};let version,updateLink="",packageData;["github","jsdelivr","standby"].includes(updateSource)?(updateLink=updateLinks[updateSource],packageData=await checkUpdate(updateLink,!1)):(updateLink=updateLinks.github,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.jsdelivr,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.standby,packageData=await checkUpdate(updateLink,!0)))),packageData?version=packageData.version||currentVersion:(version=currentVersion,scripts_echoLog({}).error(i18n("checkUpdateFailed"))),packageData&&((currentVersion,remoteVersion)=>{try{const[currentRealVersion]=currentVersion.split("-"),[remoteRealVersion,isPreview]=remoteVersion.split("-");if(isPreview&&!globalOptions.other.receivePreview)return!1;var[currentVersion1,currentVersion2,currentVersion3]=currentRealVersion.split(".").map(value=>parseInt(value,10)),[remoteVersion1,remoteVersion2,remoteVersion3]=remoteRealVersion.split(".").map(value=>parseInt(value,10));return currentVersion1${i18n("newVersionNotice",version,`${updateLink}dist/${GM_info.script.name}.user.js`)}`}),scripts_echoLog({html:`

  • ${i18n("updateText",version)}
    1. ${packageData.change?.map(change=>`
    2. ${change}
    3. `).join("")}
    4. ${i18n("updateHistory")}
    `}))}catch(error){throwError(error,"updateChecker")}};window.STYLE=GM_addStyle(discordAuth.Z+GM_getResourceText("style")),window.DEBUG=!!globalOptions.other?.debug,window.TRACE=!!globalOptions.other?.debug&&"function"==typeof console.trace;loadScript=async()=>{if("www.twitch.tv"!==window.location.hostname||"#auth"!==window.location.hash){if("www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");return 0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var authToken=()=>{const $this=$("#toggle-log");"show"===$this.attr("data-status")?($("#auto-task-info").hide(),$this.attr("data-status","hide").text(i18n("showLog"))):($("#auto-task-info").show(),$this.attr("data-status","show").text(i18n("hideLog")))};if(external_keyboardJS_default().bind(globalOptions.hotKey.doTaskKey,()=>{website.doTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.undoTaskKey,()=>{website.undoTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.toggleLogKey,authToken),website?.after&&await website?.after(),website?.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(website.name+"-buttons");for(const button of website.buttons)if(website[button]){const btnElement=$(`

    ${i18n(button)}

    `);btnElement.find("a.auto-task-website-btn").on("click",()=>{website[button]()}),$("#auto-task-buttons").append(btnElement)}}const hideButtonElement=$(`

    ${i18n("hideButton")}

    `);hideButtonElement.find("a.auto-task-website-btn").on("click",()=>{$("#auto-task-buttons").hide(),$("div.show-button-div").show()});const toggleLogElement=$(`

    ${globalOptions.other.defaultShowLog?i18n("hideLog"):i18n("showLog")}

    `);toggleLogElement.find("a.auto-task-website-btn").on("click",authToken),$("#auto-task-buttons").append(hideButtonElement).append(toggleLogElement),website?.options&&GM_registerMenuCommand(i18n("changeWebsiteOptions"),()=>{options(website.name,website.options)}),"Setting"!==website.name&&(GM_registerMenuCommand(i18n("changeGlobalOptions"),()=>{changeGlobalOptions("swal")}),GM_registerMenuCommand(i18n("settingPage"),()=>{window.open("https://auto-task-v4.hclonely.com/setting.html","_blank")})),console.log("%c%s","color:#1bbe1a","Auto-Task[Load]: 脚本加载完成");var[v1,authToken]=GM_info.version.split(".");5<=parseInt(v1,10)&&2<=parseInt(authToken,10)||scripts_echoLog({}).error(i18n("versionNotMatched")),GM_getValue("notice")||(external_Swal_default().fire({title:i18n("swalNotice"),icon:"warning"}).then(()=>{window.open(i18n("noticeLink"),"_blank"),GM_setValue("notice",(new Date).getTime())}),scripts_echoLog({html:`
  • ${i18n("echoNotice",i18n("noticeLink"))}
  • `}).font?.find("a").on("click",()=>{GM_setValue("notice",(new Date).getTime())})),scripts_updateChecker()}else console.log("%c%s","color:#ff0000","Auto-Task[Warning]: 脚本停止加载,当前网站不支持!")}else{authToken=external_Cookies_namespaceObject.get("auth-token");!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientVersion:__twilightBuildID,clientId:commonOptions?.headers?.["Client-ID"],deviceId:commonOptions?.headers?.["Device-ID"],clientSessionId:window.localStorage.local_storage_app_session_id.replace(/"/g,"")}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}};if("discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{if(0!==$("[data-miniprofile]").length){window.onbeforeunload=function(event){return GM_setValue("steamStoreAuth",null),null};var storeSessionID=document.body.innerHTML.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(GM_setValue("steamStoreAuth",{storeSessionID:storeSessionID}),!0):void 0}}):window.opener&&"steamcommunity.com"===window.location.host&&window.location.pathname.includes("/id/")?$(()=>{window.onbeforeunload=function(event){return GM_setValue("steamCommunityAuth",null),null};var steam64Id=document.body.innerHTML.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=document.body.innerHTML.match(/g_sessionID = "(.+?)";/)?.[1],userName=document.body.innerHTML.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];const data={};if(steam64Id&&(data.steam64Id=steam64Id),userName&&(data.userName=userName),communitySessionID)return data.communitySessionID=communitySessionID,GM_setValue("steamCommunityAuth",data),!0}):("key-hub.eu"===window.location.hostname&&(unsafeWindow.keyhubtracker=1,unsafeWindow.gaData={}),$(loadScript))}()}(); \ No newline at end of file diff --git a/dist/auto-task-v4.user.js b/dist/auto-task-v4.user.js index 473b52d..c7b2975 100644 --- a/dist/auto-task-v4.user.js +++ b/dist/auto-task-v4.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4 // @namespace auto-task-v4 -// @version 4.4.7 +// @version 4.4.8 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -32,6 +32,8 @@ // @include *://*.reddit.com/* // @include *://twitter.com/settings/account?k* // @include *://x.com/settings/account* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @include https://auto-task-v4.hclonely.com/setting.html // @include https://auto-task-v4.hclonely.com/history.html @@ -409,22 +411,22 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); }); }); }, - 221: function(module, __webpack_exports__, __webpack_require__) { + 568: function(module, __webpack_exports__, __webpack_require__) { 'use strict'; __webpack_require__.d(__webpack_exports__, { Z: function() { return __WEBPACK_DEFAULT_EXPORT__; } }); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(398); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); - var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(494); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(999); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, '.colorful-button,#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn,body.auto-task-options .auto-task-form table button{position:relative;padding:5px 10px;text-align:center;color:#fff;text-decoration:none;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:30px;background-size:400%;text-transform:capitalize}.colorful-button:hover,#auto-task-buttons a.auto-task-website-btn:hover,.show-button-div a.auto-task-website-btn:hover,body.auto-task-options .auto-task-form table button:hover{transform:scale(1.05);box-shadow:0 6px 20px rgba(0,0,0,.3);cursor:pointer}.colorful-button:hover::before,#auto-task-buttons a.auto-task-website-btn:hover::before,.show-button-div a.auto-task-website-btn:hover::before,body.auto-task-options .auto-task-form table button:hover::before{filter:blur(10px);opacity:1}.colorful-button::before,#auto-task-buttons a.auto-task-website-btn::before,.show-button-div a.auto-task-website-btn::before,body.auto-task-options .auto-task-form table button::before{content:"";position:absolute;top:-5px;left:-5px;right:-5px;bottom:-5px;z-index:-1;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:40px;background-size:400%;opacity:-1}#auto-task-info{position:fixed;bottom:10px;right:10px;width:60%;max-width:500px;max-height:60%;overflow-y:auto;color:#000;background-color:#fff;padding-left:5px;z-index:999999999 !important;border:solid 2px #add8e6;border-radius:10px}#auto-task-info li{text-align:left}#auto-task-info li a.high-light{color:#00aeff;font-weight:bold}#auto-task-info .success{color:green}#auto-task-info .error{color:red}#auto-task-info .warning{color:blue}#auto-task-info .info{color:#ff0}#auto-task-info .update-text{color:green;border:solid 2px #8dcb69;margin:5px 10px 5px 20px;border-radius:10px;padding:5px 20px}.auto-task-keylol{display:inline-block;text-transform:capitalize;margin-left:10px;text-decoration:none !important;border:solid 1px;border-radius:5px;padding:0 2px}.auto-task-keylol[selected=selected]{background-color:blue !important;color:#fff !important}.auto-task-form table{font-family:verdana,arial,sans-serif;font-size:11px;color:#333;border-width:1px;border-color:#999;border-collapse:collapse;width:100%}.auto-task-form table thead td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;font-weight:bold;background-color:#fff}.auto-task-form table tbody tr{background-color:#d4e3e5}.auto-task-form table tbody tr:hover{background-color:#ff6 !important}.auto-task-form table tbody tr th{background-color:#c3dde0;border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;text-transform:capitalize}.auto-task-form table tbody tr td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9}.swal2-modal{width:70% !important;max-width:1000px !important}body.auto-task-options{padding-top:10px;text-align:center}body.auto-task-options .auto-task-form{width:80%;max-width:1000px;margin:0 auto;padding-bottom:20px}body.auto-task-options .auto-task-form table input.editOption{width:80%}body.auto-task-options .auto-task-form table #getTwitterUserId,body.auto-task-options .auto-task-form table #getYoutubeChannelId{margin-top:5px}body.auto-task-options .auto-task-form table button{z-index:1}body.auto-task-options .auto-task-form table input[type=text]{outline-style:none;border:1px solid #ccc;border-radius:3px;padding:5px 10px;font-size:14px}body.auto-task-options .auto-task-form table input[type=text]:focus{border-color:#66afe9;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}body.auto-task-options .auto-task-form table label{position:relative;width:160px;height:80px;cursor:pointer;transform:scale(0.25);margin:-25% 0;top:-30px;display:inline-block}body.auto-task-options .auto-task-form table label input{position:relative;z-index:1;appearance:none}body.auto-task-options .auto-task-form table label input:checked~span{background:#05be05;box-shadow:0 15px 25px #05be0566}body.auto-task-options .auto-task-form table label input:checked~span i{left:84px}body.auto-task-options .auto-task-form table label input:checked~span i::before{background:#05be05;box-shadow:35px 0 0 #05be05}body.auto-task-options .auto-task-form table label input:checked~span i::after{bottom:12px;height:15px;border-bottom-left-radius:15px;border-bottom-right-radius:15px;background:#05be05}body.auto-task-options .auto-task-form table label span{position:absolute;top:0;left:0;width:100%;height:100%;background:#fe0000;border-radius:80px;transition:.5s;box-shadow:0 15px 25px #fe000066}body.auto-task-options .auto-task-form table label span i{position:absolute;top:4px;left:4px;width:72px;height:72px;background:#fff;border-radius:50%}body.auto-task-options .auto-task-form table label span i::before{content:"";position:absolute;top:22px;left:12px;width:12px;height:12px;border-radius:50%;background:#fe0000;box-shadow:35px 0 0 #fe0000;transition:.5s}body.auto-task-options .auto-task-form table label span i::after{content:"";position:absolute;bottom:15px;left:calc(50% - 15px);width:30px;height:6px;border-radius:6px;background:#fe0000;transition:.5s}body.auto-task-history{font-size:15px;font-weight:400;line-height:1.5}body.auto-task-history .container a{color:#007bff;text-decoration:none;background-color:transparent}body.auto-task-history .container .card{width:80%;max-width:800px;border-radius:10px;background:#7676761a;border-top:1px solid #ffffff80;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:0 15px 25px #0000001a;margin:20px auto;position:relative;display:flex;flex-direction:column;word-wrap:break-word;-webkit-background-clip:border-box;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}body.auto-task-history .container .card .title{text-align:center;font-size:30px;font-weight:bold;margin:5px 0}body.auto-task-history .container .card .title a:hover{text-decoration:none;background:#93e1ff;border-radius:10px;padding:3px}body.auto-task-history .container .card ul{margin-bottom:25px}body.auto-task-history .container .card ul li{margin-bottom:5px;line-height:20px}body.auto-task-history .container .card ul a:hover{text-decoration:underline}body.auto-task-history .container .card .delete-task{right:10px;width:38px;height:35px;position:absolute;font-size:24px;cursor:pointer;border-radius:10px}body.auto-task-history .container .card .delete-task:hover{background:#fff}body.auto-task-history .container .card .time{right:5px;position:absolute;bottom:0;color:#e83e8c;font-family:\'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace\';font-size:15px}#auto-task-buttons,.show-button-div{position:fixed;top:30px;right:15px;width:124px;z-index:999999999 !important;transform:scale(0.85)}#auto-task-buttons p,.show-button-div p{line-height:30px;height:40px;text-align:center;margin:5px !important}#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn{width:105px;line-height:27px;font-size:20px;display:block}.show-button-div{width:20px}.auto-task-capitalize{text-transform:capitalize !important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{box-shadow:inset 0px 0px 4px 1px rgba(100,150,200,.5) !important}.swal2-checkbox-custom{align-items:center;justify-content:center;background:#fff;color:inherit;margin:1em auto}.swal2-checkbox-custom input{flex-shrink:0;margin:0 .4em}.giveaway-actions #getKey{display:none !important}.auto-task-giveaway-status{color:#fff;border-radius:10px;padding:0 5px;margin-left:5px}.auto-task-giveaway-status.active{background-color:#5cb85c}.auto-task-giveaway-status.not-active{background-color:#d9534f}', '' ]); const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___.toString(); }, - 1: function(module) { + 999: function(module) { 'use strict'; module.exports = function(cssWithMappingToString) { var list = []; @@ -502,7 +504,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); return list; }; }, - 398: function(module) { + 494: function(module) { 'use strict'; module.exports = function(i) { return i[1]; @@ -558,7 +560,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); const external_Swal_namespaceObject = Swal; var external_Swal_default = __webpack_require__.n(external_Swal_namespaceObject); const external_Cookies_namespaceObject = Cookies; - var auto_task = __webpack_require__(221); + var auto_task = __webpack_require__(568); var javascript_utils_umd_min = __webpack_require__(108); const httpRequest = async (options, times = 0) => { if (window.TRACE) { @@ -10681,8 +10683,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); }; const scripts_updateChecker = updateChecker; window.STYLE = GM_addStyle(auto_task.Z + GM_getResourceText('style')); - window.DEBUG = !!globalOptions.other.debug; - window.TRACE = !!globalOptions.other.debug && typeof console.trace === 'function'; + window.DEBUG = !!globalOptions.other?.debug; + window.TRACE = !!globalOptions.other?.debug && typeof console.trace === 'function'; const loadScript = async () => { if (window.location.hostname === 'www.twitch.tv' && window.location.hash === '#auth') { const authToken = external_Cookies_namespaceObject.get('auth-token'); diff --git a/doc/docs/logs/README.md b/doc/docs/logs/README.md index 0e40862..886000f 100644 --- a/doc/docs/logs/README.md +++ b/doc/docs/logs/README.md @@ -5,6 +5,12 @@ lang: zh-CN ## V4.4 +### V4.4.8 + +[Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.4.8) + +- 修复:更新Steam社区凭证报错([#26](https://github.com/HCLonely/auto-task-v4/issues/26)) + ### V4.4.7 [Release](https://github.com/HCLonely/auto-task-v4/releases/tag/v4.4.7) diff --git a/package.json b/package.json index e064735..fefe694 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "auto-task-v4", - "version": "4.4.7", + "version": "4.4.8", "change": [ - "优化:Freeanywhere获取没有剩余Key时的提示(#27)" + "修复:更新Steam社区凭证报错(#26)" ], "description": "赠Key站自动任务脚本", "main": "package.json", diff --git a/page/dist/auto-task-v4-for-giveawaysu.all.user.js b/page/dist/auto-task-v4-for-giveawaysu.all.user.js index 43c66ba..e90ad54 100644 --- a/page/dist/auto-task-v4-for-giveawaysu.all.user.js +++ b/page/dist/auto-task-v4-for-giveawaysu.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4-for-giveawaysu // @namespace auto-task-v4-for-giveawaysu -// @version 4.4.7 +// @version 4.4.8 // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -18,6 +18,8 @@ // @include *://www.twitch.tv/* // @include *://www.youtube.com/* // @include *://*.reddit.com/* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @grant GM_addStyle // @grant GM_setValue @@ -94,7 +96,7 @@ var runtime=function(t){"use strict";var r,e=Object.prototype,n=e.hasOwnProperty console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); -!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o{isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] +!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o{isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] 环境: @@ -111,4 +113,4 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); `+error.stack)}const httpRequest_httpRequest=async(options,times=0)=>{window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest_httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError_throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest_httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ - ${text?.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError_throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)});const defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};discordAuth=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,discordAuth);const languages={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",updateHistory:'历史更新记录点此查看',AsfEnabled:'使用ASF做Steam相关任务(需ASFEnhance插件)',AsfIpcUrl:"ASF IPC 地址",AsfIpcPassword:"ASF IPC 密码",versionNotMatched:"脚本管理器版本过低,需TamperMonkey >= 5.2.0或TamperMonkey Beta >= 5.2.6196",groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",gettingUserLink:"正在获取Steam用户社区链接...",retry:"重试",initingASF:"正在初始化ASF...",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",campaign:"检测到人机验证,请完成验证后重新验证任务!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",tasksNotCompleted:"任务未完成",confirmingTask:"正在跳过警告页面..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",updateHistory:'Click here to view the historical update record.',AsfEnabled:'Use ASF to do Steam related tasks (requires ASFEnhance plugin)',AsfIpcUrl:"ASF IPC URL",AsfIpcPassword:"ASF IPC Password",groups:"Group",officialGroups:"Official Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",gettingCuratorId:"Getting Steam Curator Id",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",versionNotMatched:"The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196",gettingUserLink:"Getting steam user community link...",retry:"Retry",initingASF:"Initing ASF...",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",campaign:"ReCAPTCHA detected, please complete it and re-verify the tasks!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning...",tasksNotCompleted:"Tasks Not Completed",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=(key,...argvs)=>languages[language]?.[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key;discordAuth=class{tasks;getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)))return this.#initialized=!1,"skip";return GM_getValue("dontRemindDiscordAgain")||"do"===action&&!globalOptions.doTask.discord.servers||"undo"===action&&!globalOptions.undoTask.discord.servers?(this.#initialized=!1,"skip"):!!this.#initialized||(this.#auth.auth?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(GM_setValue("discordAuth",{auth:null}),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0))}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Discord")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:this.#auth.auth}});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Discord")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("discordAuth")?.auth;auth?(this.#auth={auth:auth},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async#joinServer(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:this.#auth.auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(data.response?.guild?.id);return guild&&(this.#setCache(inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async#leaveServer(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await this.#getGuild(inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:this.#auth.auth}});return"Success"===result&&204===data?.status?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async#getGuild(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=this.#cache[inviteId];if(guild)return logStatus.success(),guild;var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=data.response?.guild?.id;return guild?(logStatus.success(),this.#setCache(inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}async toggle({doTask=!0,serverLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,link=>link.match(/invite\/(.+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}#setCache(inviteId,guild){try{this.#cache[inviteId]=guild,GM_setValue("discordCache",this.#cache)}catch(error){throwError_throwError(error,"Discord.setCache")}}};const social_Instagram=class extends discordAuth{tasks;whiteList;#cache=GM_getValue("instagramCache")||{};#auth={};#initialized=!1;constructor(){super();var defaultTasksTemplate={users:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.instagram||{}}}async init(){try{return this.#initialized?!0:await this.#getUserInfo()?(scripts_echoLog({}).success(i18n("initSuccess","Instagram")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Instagram")),!1)}catch(error){return throwError_throwError(error,"Instagram.init"),!1}}async#getUserInfo(name="instagram"){try{const logStatus=scripts_echoLog({type:"instagram"===name?"verifyingInsAuth":"gettingInsUserId",text:name});var userId=this.#cache[name];if(userId&&"instagram"!==name)return logStatus.success(),userId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/${name}/`,method:"GET"});if("Success"!==result)return!1;if(data?.finalUrl.includes("accounts/login"))return logStatus.error("Error:"+i18n("loginIns"),!0),!1;if(data?.finalUrl.includes("www.instagram.com/challenge"))return logStatus.error("Error:"+i18n("insBanned")),!1;if(200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;var csrftoken=data.responseText.match(/"csrf_token":"(.+?)"/)?.[1],hash=data.responseText.match(/"rollout_hash":"(.+?)"/)?.[1];if("instagram"===name)return!(!csrftoken||!hash)&&(this.#auth={csrftoken:csrftoken,hash:hash},!0);var id=data.responseText.match(/"profilePage_([\d]+?)"/)?.[1];return id?(this.#setCache(name,id),logStatus.success(),id):(logStatus.error("Error: Get ins data error!"),!1)}catch(error){return throwError_throwError(error,"Instagram.getUserInfo"),!1}}async#followUser(name){try{var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"followingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/follow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"following"===data.response?.result?(logStatus.success(),this.tasks.users=unique([...this.tasks.users,name]),!0):(logStatus.error("Error:"+(data?.response?.feedback_message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.followUser"),!1}}async#unfollowUser(name){try{if(this.whiteList.users.includes(name))return scripts_echoLog({type:"whiteList",text:"Instagram.unfollowUser",id:name}),!0;var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"unfollowingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/unfollow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"ok"===data.response?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.unfollowUser"),!1}}async toggle({doTask=!0,userLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.instagram.users||!doTask&&!globalOptions.undoTask.instagram.users)scripts_echoLog({type:"globalOptionsSkip",text:"instagram.users"});else{var realUsers=this.getRealParams("users",userLinks,doTask,link=>link.match(/https:\/\/www\.instagram\.com\/(.+)?\//)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("instagramCache",this.#cache)}catch(error){throwError_throwError(error,"Instagram.setCache")}}};const social_Reddit=class extends discordAuth{tasks;whiteList;#auth;#initialized=!1;constructor(){super();var defaultTasksTemplate={reddits:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.reddit||{}}}async init(){try{return this.#initialized?!0:await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Reddit")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Reddit")),!1)}catch(error){return throwError_throwError(error,"Reddit.init"),!1}}async#useBeta(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await this.#updateAuth(!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async#updateAuth(beta=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Reddit")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://www.reddit.com/",method:"GET",nochche:!0,headers:{"Cache-Control":"no-cache"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(data?.responseText.includes("www.reddit.com/login/"))return logStatus.error("Error:"+i18n("loginReddit"),!0),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.responseText.includes("redesign-beta-optin-btn")&&!beta)return await this.#useBeta();var accessToken=data.responseText.match(/"accessToken":"(.*?)","expires":"(.*?)"/)?.[1];return accessToken?(this.#auth={token:accessToken},logStatus.success(),!0):(logStatus.error('Error: Parameter "accessToken" not found!'),!1)}catch(error){return throwError_throwError(error,"Reddit.updateAuth"),!1}}async toggleTask({name,doTask=!0}){try{if(!doTask&&this.whiteList.reddits.includes(name))return scripts_echoLog({type:"whiteList",text:"Reddit.undoTask",id:name}),!0;let type=doTask?"joiningReddit":"leavingReddit";/^u_/.test(name)&&(type=doTask?"followingRedditUser":"unfollowingRedditUser");const logStatus=scripts_echoLog({type:type,text:name});var{result,statusText,status,data}=await tools_httpRequest({url:"https://oauth.reddit.com/api/subscribe?redditWebClient=desktop2x&app=desktop2x-client-production&raw_json=1&gilding_detail=1",method:"POST",headers:{authorization:"Bearer "+this.#auth.token,"content-type":"application/x-www-form-urlencoded"},data:$.param({action:doTask?"sub":"unsub",sr_name:name,api_type:"json"})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.reddits=unique([...this.tasks.reddits,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Reddit.toggleTask"),!1}}async toggle({doTask=!0,redditLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.reddit.reddits||!doTask&&!globalOptions.undoTask.reddit.reddits)scripts_echoLog({type:"globalOptionsSkip",text:"reddit.reddits"});else{var realReddits=this.getRealParams("reddits",redditLinks,doTask,userName=>{var name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/)?.[1],userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/)?.[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};const social_Twitch=class extends discordAuth{tasks;whiteList;#auth=GM_getValue("twitchAuth")||{};#cache=GM_getValue("twitchCache")||{};#initialized=!1;#integrityToken;constructor(){super();var defaultTasksTemplate={channels:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.twitch||{}}}async init(){try{return this.#initialized?!0:this.#auth.authToken&&this.#auth.clientId&&this.#auth.clientVersion&&this.#auth.deviceId&&this.#auth.clientSessionId?await this.#verifyAuth(!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(GM_setValue("twitchAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async#verifyAuth(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===data?.status&&data.response?.[0]?.data?.currentUser?(await this.#integrity(isFirst),logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async#integrity(isFirst=!0,ct=""){try{const logStatus=scripts_echoLog({text:i18n("checkingTwitchIntegrity")});if(isFirst&&(!this.#auth.authToken||!this.#auth.clientId||!this.#auth.clientVersion||!this.#auth.deviceId||!this.#auth.clientSessionId))return await this.#updateAuth(!1);var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/integrity",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"x-kpsdk-ct":ct}});return"Success"===result?!ct&&data?.responseHeaders?.["x-kpsdk-ct"]?await this.#integrity(isFirst,data.responseHeaders["x-kpsdk-ct"]):200===data?.status&&data.response?.token?(this.#integrityToken=data.response.token,logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.integrity"),!1}}async#updateAuth(isFirst=!0){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Twitch")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(this.#auth=auth,logStatus.success(),resolve(await this.#verifyAuth(isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async#toggleChannel({name,doTask=!0}){try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await this.#getChannelId(name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"Client-Integrity":this.#integrityToken},data:doTask?followData:unfollowData});return"Success"===result?200===data?.status&&data.response?.[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+(data?.response?.[0].errors?.[0]?.message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async#getChannelId(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=this.#cache[name];if(channelId)return logStatus.success(),channelId;var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const channelId=data.response?.[0]?.data?.user?.id;return channelId?(this.#setCache(name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}async toggle({doTask=!0,channelLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>link.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/)?.[2]);if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("twitchCache",this.#cache)}catch(error){throwError_throwError(error,"Twitch.setCache")}}};const social_Vk=class extends discordAuth{tasks;whiteList;#username="";#cache=GM_getValue("vkCache")||{};#initialized=!1;constructor(){super();var defaultTasksTemplate={names:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.vk||{}}}async init(){try{return this.#initialized?!0:await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Vk")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Vk")),!1)}catch(error){return throwError_throwError(error,"Vk.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});return"Success"===result?data?.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===data?.status?(this.#username=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/)?.[1]||"",logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async#toggleGroup(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkGroup":"leavingVkGroup",text:name});if("enter"===dataParam.groupAct&&!doTask||"leave"===dataParam.groupAct&&doTask)return logStatus.success(),!0;const reqData={act:doTask?"enter":"leave",al:1,gid:dataParam.groupId,hash:dataParam.groupHash};doTask&&(reqData.context="_");var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_groups.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param(reqData)});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.toggleGroup"),!1}}async#togglePublic(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkPublic":"leavingVkPublic",text:name});if(dataParam.publicJoined&&doTask||!dataParam.publicJoined&&!doTask)return logStatus.success(),!0;var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_public.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:doTask?"a_enter":"a_leave",al:1,pid:dataParam.publicPid,hash:dataParam.publicHash})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.togglePublic"),!1}}async#sendWall(name){try{const logStatus=scripts_echoLog({type:"sendingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"publish_box",al:1,object:name})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var hash=data.responseText.match(/shHash:[\s]*'(.*?)'/)?.[1];if(hash){const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({Message:"",act:"a_do_publish",al:1,close_comments:0,friends_only:0,from:"box",hash:hash,list:"",mark_as_ads:0,mute_notifications:0,object:name,ret_data:1,to:0})});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200===dataR?.status){var jsonData=JSON.parse(dataR.responseText?.replace("\x3c!--","")||"{}");if(!0===jsonData?.payload?.[1]?.[1]?.share_my){logStatus.success();var postId=String(jsonData?.payload?.[1]?.[1]?.post_id),ownerId=String(jsonData?.payload?.[1]?.[1]?.owner_id);return postId&&ownerId&&this.#setCache(name,ownerId+"_"+postId),this.tasks.names=unique([...this.tasks.names,name]),!0}}return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1}return logStatus.error('Error: Get "hash" failed'),!1}catch(error){return throwError_throwError(error,"Vk.sendWall"),!1}}async#deleteWall(name,dataParams){try{const logStatus=scripts_echoLog({type:"deletingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_wall.php?act=delete",method:"POST",headers:{origin:"https://vk.com",referer:`https://vk.com/${this.#username}?w=wall${this.#cache[name]}%2Fall`,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"delete",al:1,confirm:0,from:"wkview",hash:dataParams.wallHash,post:this.#cache[name]})});return"Success"===result?200===data?.status&&JSON.parse(data.responseText?.replace("\x3c!--","")||"{}")?.payload?.[1]?.[1]?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.deleteWall"),!1}}async#getId(name,doTask){try{let url="https://vk.com/"+name;if(/^wall-/.test(name)){if(doTask)return{type:"sendWall"};if(!this.#cache[name])return{type:"unSupport"};url=`https://vk.com/${this.#username}?w=wall`+this.#cache[name]}const logStatus=scripts_echoLog({type:"gettingVkId",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var[,groupAct,groupId,,groupHash]=data.responseText.match(/Groups.(enter|leave)\(.*?,.*?([\d]+?), ('|')(.*?)('|')/)||[],publicHash=data.responseText.match(/"enterHash":"(.*?)"/)?.[1],publicPid=data.responseText.match(/"public_id":([\d]+?),/)?.[1],publicJoined=!data.responseText.includes("Public.subscribe");if(groupAct&&groupId&&groupHash)return logStatus.success(),{groupAct:groupAct,groupId:groupId,groupHash:groupHash,type:"group"};if(publicHash&&publicPid)return logStatus.success(),{publicHash:publicHash,publicPid:publicPid,publicJoined:publicJoined,type:"public"};if(data.responseText.includes("wall.deletePost")&&!doTask){var wallHash=data.responseText.match(/wall\.deletePost\(this, '.*?', '(.*?)'\)/)?.[1];if(wallHash)return logStatus.success(),{type:"deleteWall",wallHash:wallHash}}else if(name.includes("wall")&&doTask)return logStatus.success(),{type:"sendWall"};return logStatus.error("Error: Parameters not found!"),!1}catch(error){return throwError_throwError(error,"Vk.getId"),!1}}async#toggleVk({name,doTask=!0}){try{if(!doTask&&this.whiteList.names.includes(name))return scripts_echoLog({type:"whiteList",text:"Vk.undoTask",id:name}),!0;var formatName=name.replace(/\/$/,""),data=await this.#getId(formatName,doTask);if(!data)return!1;switch(data.type){case"group":return await this.#toggleGroup(formatName,data,doTask);case"public":return await this.#togglePublic(formatName,data,doTask);case"sendWall":return!doTask||await this.#sendWall(formatName);case"deleteWall":return!!doTask||await this.#deleteWall(formatName,data);default:return!1}}catch(error){return throwError_throwError(error,"Vk.toggleVk"),!1}}async toggle({doTask=!0,nameLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.vk.names||!doTask&&!globalOptions.undoTask.vk.names)scripts_echoLog({type:"globalOptionsSkip",text:"vk.names"});else{var realNames=this.getRealParams("names",nameLinks,doTask,link=>link.match(/https:\/\/vk\.com\/([^/]+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}#setCache(name,postId){try{this.#cache[name]=postId,GM_setValue("vkCache",this.#cache)}catch(error){throwError_throwError(error,"Vk.setCache")}}};class Youtube extends discordAuth{tasks;whiteList;#auth=GM_getValue("youtubeAuth")||{};#initialized=!1;#verifyChannel="https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel;constructor(){super();var defaultTasksTemplate={channels:[],likes:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.youtube||{}}}async init(){try{return this.#initialized?!0:this.#auth.PAPISID?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(GM_setValue("youtubeAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async#verifyAuth(){try{return await this.#toggleChannel({link:this.#verifyChannel,doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{GM_cookie.list({url:"https://www.youtube.com/@YouTube"},async(PAPISID,error)=>{error?(logStatus.error("Error: Update youtube auth failed!"),resolve(!1)):(PAPISID=PAPISID.find(cookie=>"__Secure-3PAPISID"===cookie.name)?.value)?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),this.#auth={PAPISID:PAPISID},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error(i18n("needLogin")),resolve(!1))})})}catch(error){return throwError_throwError(error,"Youtube.updateAuth"),!1}}#getInfo(link,type){return async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/)?.[1],context=(data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))?.[1]||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var channelId=data.responseText.match(/"channelId":"(.+?)"/)?.[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var videoId=data.responseText.match(//)?.[1],likeParams=data.responseText.match(/"likeParams":"(.*?)"/)?.[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}}(link,type)}async#toggleChannel({link,doTask=!0,verify=!1}){try{var{params,needLogin}=await this.#getInfo(link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=${apiKey}&prettyPrint=false`,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client?.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:request?.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===data?.status?doTask&&(/"subscribed":true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed":false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async#toggleLikeVideo({link,doTask=!0}){try{var{params,needLogin}=await this.#getInfo(link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===data?.status?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}async toggle({doTask=!0,channelLinks=[],videoLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}const social_SteamASF=class{#asfOptions;#botName="asf";#groupInfo;async init(){try{var asfCommandsUrl=new URL("/Api/Command/",globalOptions.ASF.AsfIpcUrl);this.#asfOptions={url:asfCommandsUrl.href,method:"POST",responseType:"json",headers:{accept:"application/json","Content-Type":"application/json",Host:asfCommandsUrl.host,Origin:asfCommandsUrl.origin,Referer:asfCommandsUrl.href,Authentication:globalOptions.ASF.AsfIpcPassword}},globalOptions.ASF.AsfBotname&&(this.#botName=globalOptions.ASF.AsfBotname);const logStatus=scripts_echoLog({text:i18n("initingASF")});var{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:'{"Command":"!stats"}'});return"Success"===result?!0===data?.response?.Success&&"OK"===data.response.Message&&data.response.Result?(logStatus.success(),!0):(data?.response?.Result||data?.response?.Message?logStatus.error(data?.response?.Result||data.response.Message):logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.init"),!1}}async joinGroup(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!JOINGROUP ${this.#botName} `+groupName})});return"Success"===result?200===data?.status&&["已加入","已申请","Joined","Applied","Присоединился","costs"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.joinGroup"),!1}}async leaveGroup(groupName){try{if(!this.#groupInfo&&!await this.#getGroupId())return!1;var groupId=await this.#groupInfo[groupName];if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!LEAVEGROUP ${this.#botName} `+groupId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.leaveGroup"),!1}}async#getGroupId(){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:"All"}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:"!GROUPLIST "+this.#botName})});return"Success"===result?200===data?.status&&data.response?.Result?.includes("|")?(this.#groupInfo=Object.fromEntries(data.response.Result.split("\n").map(id=>{var[,name,id]=id.trim().split("|");return name&&id?[name,id]:null}).filter(ele=>ele)),logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.getGroupID"),!1}}async addToWishlist(gameId){try{const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!ADDWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.addToWishlist"),!1}}async removeFromWishlist(gameId){try{const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REMOVEWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.removeFromWishlist"),!1}}async toggleFollowGame(gameId,doTask){try{const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWGAME ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.toggleFollowGame"),!1}}async toggleCurator(curatorId,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWCURATOR ${this.#botName} `+curatorId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async addLicense(id){try{const[type,ids]=id.split("-");if("appid"===type){const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} app/`+ids})});return"Success"===result?200===data?.status&&["AlreadyPurchased","OK"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{const idsArr=ids.split(","),logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} `+idsArr.map(id=>"sub/"+id).join(",")})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200===data?.status&&data.response?.Result){const resultLines=data.response.Result.split("\n");return idsArr.forEach(subid=>{const targetLine=resultLines.find(text=>text.includes(subid));targetLine&&["成功","Success","Успех"].find(text=>targetLine.includes(text))?scripts_echoLog({}).success(targetLine):scripts_echoLog({}).error(targetLine)}),!0}return logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1}}catch(error){return throwError_throwError(error,"SteamASF.addLicense"),!1}}async requestPlayTestAccess(id){try{const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REQUESTACCESS ${this.#botName} `+id})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}};const social_Steam=class extends discordAuth{tasks;whiteList;#cache={group:{},officialGroup:{},forum:{},workshop:{},curator:{},...GM_getValue("steamCache")};#auth={};#storeInitialized=!1;#communityInitialized=!1;#area="CN";#areaStatus="end";#ASF;constructor(){super();var defaultTasksTemplate={groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.steam||{}}}async init(type="all"){try{if(globalOptions.ASF.AsfEnabled&&globalOptions.ASF.AsfIpcUrl&&globalOptions.ASF.AsfIpcPassword)return this.#ASF=new social_SteamASF,!!await this.#ASF.init()&&(this.#storeInitialized=!0,this.#communityInitialized=!0);if("store"===type){if(this.#storeInitialized)return!0;let storeInitialized=await this.#updateStoreAuth();return(storeInitialized=storeInitialized||await this.#updateStoreAuthTab(),this.#storeInitialized=storeInitialized,this.#storeInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamStore")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}if("community"!==type)return this.#storeInitialized&&this.#communityInitialized?(scripts_echoLog({}).success(i18n("initSuccess","Steam")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1);{if(this.#communityInitialized)return!0;let communityInitialized=await this.#getUserLink();return(communityInitialized=communityInitialized||await this.#updateCommunityAuthTab(),this.#communityInitialized=communityInitialized,this.#communityInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamCommunity")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}}catch(error){return throwError_throwError(error,"Steam.init"),!1}}async#refreshToken(type="steamStore"){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n(type))}),formData=new FormData;formData.append("redir",`https://${host[type]}/`);var{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://"+host[type],Referer:`https://${host[type]}/`},data:formData});return"Success"===result?data?.response?.success?await this.#setStoreToken(data.response,type)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshToken"),!1}}async#setStoreToken(param,type){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("settingToken",i18n(type))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:`https://${host[type]}/login/settoken`,method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:host[type],Origin:"https://"+host[type]},data:formData});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async#updateStoreAuth(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200!==data?.status)return[301,302].includes(data?.status)?await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):(logStatus.error(result+`:${statusText}(${status})`),!1);if(!data.responseText.includes("data-miniprofile="))return await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1);var storeSessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(this.#auth.storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async#updateStoreAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))});return await new Promise(resolve=>{const newTab=window.open("https://store.steampowered.com/","mozillaWindow","pop=1;");GM_setValue("steamStoreAuth","update");const listenerId=GM_addValueChangeListener("steamStoreAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.storeSessionID=newValue.storeSessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateStoreAuthTab"),!1}}async#updateCommunityAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))});return await new Promise(resolve=>{const newTab=window.open("https://steamcommunity.com/my","mozillaWindow","pop=1;");GM_setValue("steamCommunityAuth","update");const listenerId=GM_addValueChangeListener("steamCommunityAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.steam64Id=newValue.steam64Id,this.#auth.userName=newValue.userName,this.#auth.communitySessionID=newValue.communitySessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuthTab"),!1}}async#getUserLink(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("gettingUserLink")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200===data?.status){if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}if(302===data?.status)return!await this.#refreshToken("steamCommunity")||retry?(logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1):(logStatus.warning(i18n("retry")),this.#getUserLink(!0));const location=data?.responseHeaders?.split("\n")?.find(header=>header.includes("location")?header.replace("loctation:","").trim():null);return 301===data?.status&&location?.includes("steamcommunity.com/id")?(logStatus.success(),await this.#updateCommunityAuth(data.finalUrl)):(301===data?.status&&location?.includes("https://steamcommunity.com/login/home")?logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0):logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#updateCommunityAuth(url){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#getAreaInfo(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{var cartConfigRaw=data.responseText.match(/data-cart_config="(.*?)"/)?.[1];const temp=document.createElement("div");temp.innerHTML=cartConfigRaw||"{}";var cartConfigStr=temp.textContent||temp.innerText;let cartConfig;try{cartConfig=JSON.parse(cartConfigStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}if(!cartConfig.rgUserCountryOptions)return logStatus.warning("Warning: Area cannot be changed"),{};var userInfoRaw=data.responseText.match(/data-userinfo="(.*?)"/)?.[1];const temp1=document.createElement("div");temp1.innerHTML=userInfoRaw||"{}";var userInfoStr=temp1.textContent||temp1.innerText;let userInfo;try{userInfo=JSON.parse(userInfoStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}var currentArea=userInfo.country_code,areas=Object.keys(cartConfig.rgUserCountryOptions).filter(area=>"help"!==area);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==this.#areaStatus&&(clearInterval(checker),resolve(!0))})}),this.#area===area||!area&&"CN"!==this.#area)return!0;this.#areaStatus="waiting";let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await this.#getAreaInfo();if(!currentArea||!areas)return!(this.#areaStatus="error");if("CN"!==currentArea)return this.#areaStatus="skip",scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return this.#areaStatus="noAnotherArea",scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/country/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:this.#auth.storeSessionID})});if("Success"!==result)return this.#areaStatus="error",logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==data?.status||"true"!==data.responseText)return this.#areaStatus="error",logStatus.error(`Error:${data?.statusText}(${data?.status})`),"CN";var currentArea=(await this.#getAreaInfo())["currentArea"];return currentArea===aimedArea?(this.#areaStatus="success",logStatus.success(),currentArea):(this.#areaStatus="error",logStatus.error("Error: change country filed"),"CN")}catch(error){return this.#areaStatus="error",throwError_throwError(error,"Steam.changeArea"),!1}}async#joinGroup(groupName){try{if(this.#ASF)return!!await this.#ASF.joinGroup(groupName)&&(this.tasks.groups=unique([...this.tasks.groups,groupName]),!0);const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async#leaveGroup(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(groupName);var groupId=await this.#getGroupId(groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===data?.status&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async#getGroupId(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var groupId=this.#cache.group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)?.[1];return groupId?(this.#setCache("group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#joinOfficialGroup(gameId){try{if(this.#ASF)return!!await this.#ASF.joinGroup(gameId)&&(this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]),!0);const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+this.#auth.communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId&&this.#setCache("officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async#leaveOfficialGroup(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(gameId);var groupId=await this.#getOfficialGroupId(gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===dataR?.status&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async#getOfficialGroupId(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var groupId=this.#cache.officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId?(this.#setCache("officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#addToWishlist(gameId){try{if(this.#ASF)return!!await this.#ASF.addToWishlist(gameId)&&(this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0);const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===dataR?.status?"CN"===this.#area&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#addToWishlist(gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async#removeFromWishlist(gameId){try{if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;if(this.#ASF)return await this.#ASF.removeFromWishlist(gameId);const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==dataR?.status)return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1;if("CN"===this.#area&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#removeFromWishlist(gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async#toggleFollowGame(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;if(this.#ASF)return!!await this.#ASF.toggleFollowGame(gameId,doTask)&&(doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0);const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:this.#auth.storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===data?.status&&"true"===data.responseText)return logStatus.success(),!0;var followed=await this.#isFollowedGame(gameId);return"CN"===this.#area&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#removeFromWishlist(gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async#isFollowedGame(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===data?.status&&("CN"===this.#area&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async#toggleForum(gameId,doTask=!0){try{if(!doTask&&this.whiteList.forums.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unsubscribeForum",id:gameId}),!0;const forumId=await this.#getForumId(gameId);if(!forumId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}subscribingForum`,text:gameId});var[id,feature]=forumId.split("_"),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/forum/${id}/General/${doTask?"":"un"}subscribe/${feature||"0"}/`,method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.communitySessionID})});return"Success"===result?(200!==data?.status||1!==data.response?.success&&29!==data.response?.success?logStatus.error(`Error:${data?.statusText}(${data?.status})`):(doTask&&(this.tasks.forums=unique([...this.tasks.forums,gameId])),logStatus.success()),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.toggleForum"),!0}}async#getForumId(gameId){try{const logStatus=scripts_echoLog({type:"gettingForumId",text:gameId});var forumId=this.#cache.forum[gameId];if(forumId)return logStatus.success(),forumId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/app/${gameId}/discussions/`,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const forumId=data.responseText?.match(/General_([\d]+(_[\d]+)?)/)?.[1];return forumId?(this.#setCache("forum",gameId,forumId),logStatus.success(),forumId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getForumId"),!1}}async#toggleFavoriteWorkshop(id,doTask=!0){try{if(!doTask&&this.whiteList.workshops.includes(id))return scripts_echoLog({type:"whiteList",text:"Steam.unfavoriteWorkshop",id:id}),!0;var appid=await this.#getWorkshopAppId(id);if(!appid)return!1;const logStatus=scripts_echoLog({type:doTask?"favoritingWorkshop":"unfavoritingWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/sharedfiles/${doTask?"":"un"}favorite`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,appid:appid,sessionid:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(doTask&&(this.tasks.workshops=unique([...this.tasks.workshops,id])),logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFavoriteWorkshop"),!1}}async#getWorkshopAppId(id){try{const logStatus=scripts_echoLog({type:"gettingWorkshopAppId",text:id});var appId=this.#cache.workshop[id];if(appId)return logStatus.success(),appId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/filedetails/?id="+id,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const appId=data.responseText.match(//)?.[1];return appId?(this.#setCache("workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async#voteUpWorkshop(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:this.#auth.communitySessionID})});return"Success"===result?(200===data?.status&&1===data.response?.success?logStatus.success():logStatus.error(`Error:${data?.statusText}(${data?.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async#toggleCurator(curatorId,doTask=!0){try{if(!doTask&&this.whiteList.curators.includes(curatorId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowCurator",id:curatorId}),!0;if(this.#ASF)return await this.#ASF.toggleCurator(curatorId,doTask);const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/curators/ajaxfollow",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({clanid:curatorId,sessionid:this.#auth.storeSessionID,follow:doTask}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response?.success?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(`+data?.response?.success||data?.status+")"),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async getCuratorId(path,name){try{const logStatus=scripts_echoLog({type:"gettingCuratorId",text:path+"/"+name});var curatorId=this.#cache.curator[path+"/"+name];if(curatorId)return logStatus.success(),curatorId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/${path}/`+name,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const curatorId=data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)?.[1];return curatorId?(this.#setCache("curator",path+"/"+name,curatorId),logStatus.success(),curatorId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getCuratorID"),!1}}async#toggleCuratorLike(link,doTask=!0){try{var[path,name]=link.split("/");if(!path||!name)return scripts_echoLog({text:i18n("errorLink",link)}),!1;var curatorId=await this.getCuratorId(path,name);return curatorId?await this.#toggleCurator(curatorId,doTask):!1}catch(error){return throwError_throwError(error,"Steam.toggleCuratorLike"),!1}}async#getAnnouncementParams(appId,viewId){try{const logStatus=scripts_echoLog({type:"gettingAnnouncementParams",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/events/ajaxgetpartnerevent?appid=${appId}&announcement_gid=${viewId}&lang_list=6_0&last_modified_time=0&origin=https:%2F%2Fstore.steampowered.com&for_edit=false`,method:"GET",responseType:"json",headers:{Host:"store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status||1!==data?.response?.success)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};var{clanid,gid}=data.response.event?.announcement_body||{};return clanid?(logStatus.success(),{clanId:clanid,gid:gid}):(logStatus.error(`Error:${data.statusText}(${data.status})`),{})}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),{}}}async#likeAnnouncement(id){try{var[appId,viewId]=id.split("/");if(!appId||!viewId)return scripts_echoLog({}).error(i18n("missParams")+"(id)"),!1;var{clanId,gid}=await this.#getAnnouncementParams(appId,viewId);if(!clanId)return!1;const logStatus=scripts_echoLog({type:"likingAnnouncement",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/updated/ajaxrateupdate/"+(gid||viewId),method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId},data:$.param({sessionid:this.#auth.storeSessionID,voteup:1,clanid:clanId,ajax:1}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),!1}}async#appid2subid(id){try{const logStatus=scripts_echoLog({type:"gettingSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+id,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#appid2subid(id):!1}var subid=data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];return subid?(logStatus.success(),subid):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.appid2subid"),!1}}async#getLicenses(){try{const logStatus=scripts_echoLog({text:i18n("gettingLicenses")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/dynamicstore/userdata/?t="+(new Date).getTime(),method:"GET",responseType:"json"});return"Success"===result?200===data?.status?(logStatus.success(),data.response?.rgOwnedPackages):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.getLicenses"),!1}}async#addLicense(id){try{if(this.#ASF)return await this.#ASF.addLicense(id);const[type,ids]=id.split("-");if("appid"===type){var subid=await this.#appid2subid(ids);if(!subid)return!1;const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids});if(!await this.#addFreeLicense(subid,logStatus))return!1;const{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+ids,method:"GET"});return"Success"===result?200===data?.status?data.responseText.includes("ds_owned_flag ds_flag")||data.responseText.includes('class="already_in_library"')?(logStatus.success(),!0):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{"CN"===this.#area&&(scripts_echoLog({}).success(i18n("tryChangeAreaNotice")),await this.#changeArea());const logStatusArr={};var idsArr=ids.split(",");for(const subid of idsArr){var logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:subid});if(!await this.#addFreeLicense(subid,logStatus))return!1;logStatusArr[subid]=logStatus}const licenses=await this.#getLicenses();if(!licenses)return!1;for(const subid of idsArr)licenses.includes(parseInt(subid,10))?logStatusArr[subid].success():logStatusArr[subid].error();return!0}}catch(error){return throwError_throwError(error,"Steam.addLicense"),!1}}async#addFreeLicense(id,logStatusPre){try{const logStatus=logStatusPre||scripts_echoLog({type:"addingFreeLicenseSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:this.#auth.storeSessionID,subid:id}),dataType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result?await this.#addFreeLicense(id):!1}return logStatus.success(),!0}catch(error){return throwError_throwError(error,"Steam.addFreeLicense"),!1}}async#requestPlayTestAccess(id){try{if(this.#ASF)return await this.#ASF.requestPlayTestAccess(id);const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+id,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+id},data:$.param({sessionid:this.#auth.storeSessionID}),dataType:"json"});return"Success"===result?200===data?.status&&1===data?.response?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}async toggle({doTask=!0,groupLinks=[],officialGroupLinks=[],wishlistLinks=[],followLinks=[],forumLinks=[],workshopLinks=[],workshopVoteLinks=[],curatorLinks=[],curatorLikeLinks=[],announcementLinks=[],licenseLinks=[],playtestLinks=[]}){try{if(0<[...groupLinks,...officialGroupLinks,...forumLinks,...workshopLinks,...workshopVoteLinks].length&&!this.#communityInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;if(0<[...wishlistLinks,...followLinks,...curatorLinks,...curatorLikeLinks,...announcementLinks,...licenseLinks,...playtestLinks].length&&!this.#storeInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.steam.groups||!doTask&&!globalOptions.undoTask.steam.groups)scripts_echoLog({type:"globalOptionsSkip",text:"steam.groups"});else{var realGroups=this.getRealParams("groups",groupLinks,doTask,link=>link.match(/groups\/(.+)\/?/)?.[1]);if(0link.match(/games\/(.+)\/?/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(doTask&&0link.match(/curator\/([\d]+)/)?.[1]),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,link=>link.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/)?.slice(1,3).join("/"));if(0(link.includes("store.steampowered.com")?link.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/):link.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))?.slice(1,3).join("/"));if(doTask&&0link.match(/app\/([\d]+)/)?.[1]);if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==this.#area&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await this.#changeArea("CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}#setCache(type,name,id){try{this.#cache[type][name]=id,GM_setValue("steamCache",this.#cache)}catch(error){throwError_throwError(error,"Steam.setCache")}}};const Giveawaysu=class{undoneTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};giveawayId;socialInitialized={discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0};initialized=!1;social={};static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{this.#checkLogin()||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await this.#checkLeftKey()||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!this.#getGiveawayId()&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async#classifyTask(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError_throwError(error,"getRedirectLink"),null}})(taskDes.attr("href")).then(taskLink=>taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.#uniqueTasks(this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}#checkLogin(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async#checkLeftKey(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(({value})=>{value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}#getGiveawayId(){var giveawayId=window.location.href.match(/\/view\/([\d]+)/)?.[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async#bind(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async#initSocial(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(this.#bind("discord",this.social.discord.init("do")))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(this.#bind("instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(this.#bind("reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(this.#bind("twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(this.#bind("vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(this.#bind("youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&tasks.steam?.[type]?.length||0).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(this.#bind("steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}#uniqueTasks(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async#toggleTask(){try{if(!this.initialized&&!this.init())return!1;if(!await this.#classifyTask())return!1;if(!await this.#initSocial())return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await this.#toggleTask()}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};discordAuth=__webpack_require__(225);if(window.STYLE=GM_addStyle(discordAuth.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{var authToken;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(authToken=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientId:commonOptions?.headers?.["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"x.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${text?.replace("u_","")}]...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError_throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)});const defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};discordAuth=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,discordAuth);const languages={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",updateHistory:'历史更新记录点此查看',AsfEnabled:'使用ASF做Steam相关任务(需ASFEnhance插件)',AsfIpcUrl:"ASF IPC 地址",AsfIpcPassword:"ASF IPC 密码",versionNotMatched:"脚本管理器版本过低,需TamperMonkey >= 5.2.0或TamperMonkey Beta >= 5.2.6196",groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",gettingUserLink:"正在获取Steam用户社区链接...",retry:"重试",initingASF:"正在初始化ASF...",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",campaign:"检测到人机验证,请完成验证后重新验证任务!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",tasksNotCompleted:"任务未完成",confirmingTask:"正在跳过警告页面..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",updateHistory:'Click here to view the historical update record.',AsfEnabled:'Use ASF to do Steam related tasks (requires ASFEnhance plugin)',AsfIpcUrl:"ASF IPC URL",AsfIpcPassword:"ASF IPC Password",groups:"Group",officialGroups:"Official Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",gettingCuratorId:"Getting Steam Curator Id",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",versionNotMatched:"The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196",gettingUserLink:"Getting steam user community link...",retry:"Retry",initingASF:"Initing ASF...",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",campaign:"ReCAPTCHA detected, please complete it and re-verify the tasks!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning...",tasksNotCompleted:"Tasks Not Completed",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=(key,...argvs)=>languages[language]?.[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key;discordAuth=class{tasks;getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)))return this.#initialized=!1,"skip";return GM_getValue("dontRemindDiscordAgain")||"do"===action&&!globalOptions.doTask.discord.servers||"undo"===action&&!globalOptions.undoTask.discord.servers?(this.#initialized=!1,"skip"):!!this.#initialized||(this.#auth.auth?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(GM_setValue("discordAuth",{auth:null}),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0))}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Discord")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:this.#auth.auth}});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Discord")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("discordAuth")?.auth;auth?(this.#auth={auth:auth},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async#joinServer(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:this.#auth.auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(data.response?.guild?.id);return guild&&(this.#setCache(inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async#leaveServer(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await this.#getGuild(inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:this.#auth.auth}});return"Success"===result&&204===data?.status?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async#getGuild(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=this.#cache[inviteId];if(guild)return logStatus.success(),guild;var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=data.response?.guild?.id;return guild?(logStatus.success(),this.#setCache(inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}async toggle({doTask=!0,serverLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,link=>link.match(/invite\/(.+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}#setCache(inviteId,guild){try{this.#cache[inviteId]=guild,GM_setValue("discordCache",this.#cache)}catch(error){throwError_throwError(error,"Discord.setCache")}}};const social_Instagram=class extends discordAuth{tasks;whiteList;#cache=GM_getValue("instagramCache")||{};#auth={};#initialized=!1;constructor(){super();var defaultTasksTemplate={users:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.instagram||{}}}async init(){try{return this.#initialized?!0:await this.#getUserInfo()?(scripts_echoLog({}).success(i18n("initSuccess","Instagram")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Instagram")),!1)}catch(error){return throwError_throwError(error,"Instagram.init"),!1}}async#getUserInfo(name="instagram"){try{const logStatus=scripts_echoLog({type:"instagram"===name?"verifyingInsAuth":"gettingInsUserId",text:name});var userId=this.#cache[name];if(userId&&"instagram"!==name)return logStatus.success(),userId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/${name}/`,method:"GET"});if("Success"!==result)return!1;if(data?.finalUrl.includes("accounts/login"))return logStatus.error("Error:"+i18n("loginIns"),!0),!1;if(data?.finalUrl.includes("www.instagram.com/challenge"))return logStatus.error("Error:"+i18n("insBanned")),!1;if(200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;var csrftoken=data.responseText.match(/"csrf_token":"(.+?)"/)?.[1],hash=data.responseText.match(/"rollout_hash":"(.+?)"/)?.[1];if("instagram"===name)return!(!csrftoken||!hash)&&(this.#auth={csrftoken:csrftoken,hash:hash},!0);var id=data.responseText.match(/"profilePage_([\d]+?)"/)?.[1];return id?(this.#setCache(name,id),logStatus.success(),id):(logStatus.error("Error: Get ins data error!"),!1)}catch(error){return throwError_throwError(error,"Instagram.getUserInfo"),!1}}async#followUser(name){try{var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"followingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/follow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"following"===data.response?.result?(logStatus.success(),this.tasks.users=unique([...this.tasks.users,name]),!0):(logStatus.error("Error:"+(data?.response?.feedback_message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.followUser"),!1}}async#unfollowUser(name){try{if(this.whiteList.users.includes(name))return scripts_echoLog({type:"whiteList",text:"Instagram.unfollowUser",id:name}),!0;var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"unfollowingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/unfollow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"ok"===data.response?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.unfollowUser"),!1}}async toggle({doTask=!0,userLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.instagram.users||!doTask&&!globalOptions.undoTask.instagram.users)scripts_echoLog({type:"globalOptionsSkip",text:"instagram.users"});else{var realUsers=this.getRealParams("users",userLinks,doTask,link=>link.match(/https:\/\/www\.instagram\.com\/(.+)?\//)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("instagramCache",this.#cache)}catch(error){throwError_throwError(error,"Instagram.setCache")}}};const social_Reddit=class extends discordAuth{tasks;whiteList;#auth;#initialized=!1;constructor(){super();var defaultTasksTemplate={reddits:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.reddit||{}}}async init(){try{return this.#initialized?!0:await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Reddit")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Reddit")),!1)}catch(error){return throwError_throwError(error,"Reddit.init"),!1}}async#useBeta(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await this.#updateAuth(!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async#updateAuth(beta=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Reddit")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://www.reddit.com/",method:"GET",nochche:!0,headers:{"Cache-Control":"no-cache"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(data?.responseText.includes("www.reddit.com/login/"))return logStatus.error("Error:"+i18n("loginReddit"),!0),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.responseText.includes("redesign-beta-optin-btn")&&!beta)return await this.#useBeta();var accessToken=data.responseText.match(/"accessToken":"(.*?)","expires":"(.*?)"/)?.[1];return accessToken?(this.#auth={token:accessToken},logStatus.success(),!0):(logStatus.error('Error: Parameter "accessToken" not found!'),!1)}catch(error){return throwError_throwError(error,"Reddit.updateAuth"),!1}}async toggleTask({name,doTask=!0}){try{if(!doTask&&this.whiteList.reddits.includes(name))return scripts_echoLog({type:"whiteList",text:"Reddit.undoTask",id:name}),!0;let type=doTask?"joiningReddit":"leavingReddit";/^u_/.test(name)&&(type=doTask?"followingRedditUser":"unfollowingRedditUser");const logStatus=scripts_echoLog({type:type,text:name});var{result,statusText,status,data}=await tools_httpRequest({url:"https://oauth.reddit.com/api/subscribe?redditWebClient=desktop2x&app=desktop2x-client-production&raw_json=1&gilding_detail=1",method:"POST",headers:{authorization:"Bearer "+this.#auth.token,"content-type":"application/x-www-form-urlencoded"},data:$.param({action:doTask?"sub":"unsub",sr_name:name,api_type:"json"})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.reddits=unique([...this.tasks.reddits,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Reddit.toggleTask"),!1}}async toggle({doTask=!0,redditLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.reddit.reddits||!doTask&&!globalOptions.undoTask.reddit.reddits)scripts_echoLog({type:"globalOptionsSkip",text:"reddit.reddits"});else{var realReddits=this.getRealParams("reddits",redditLinks,doTask,userName=>{var name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/)?.[1],userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/)?.[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};const social_Twitch=class extends discordAuth{tasks;whiteList;#auth=GM_getValue("twitchAuth")||{};#cache=GM_getValue("twitchCache")||{};#initialized=!1;#integrityToken;constructor(){super();var defaultTasksTemplate={channels:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.twitch||{}}}async init(){try{return this.#initialized?!0:this.#auth.authToken&&this.#auth.clientId&&this.#auth.clientVersion&&this.#auth.deviceId&&this.#auth.clientSessionId?await this.#verifyAuth(!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(GM_setValue("twitchAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async#verifyAuth(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===data?.status&&data.response?.[0]?.data?.currentUser?(await this.#integrity(isFirst),logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async#integrity(isFirst=!0,ct=""){try{const logStatus=scripts_echoLog({text:i18n("checkingTwitchIntegrity")});if(isFirst&&(!this.#auth.authToken||!this.#auth.clientId||!this.#auth.clientVersion||!this.#auth.deviceId||!this.#auth.clientSessionId))return await this.#updateAuth(!1);var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/integrity",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"x-kpsdk-ct":ct}});return"Success"===result?!ct&&data?.responseHeaders?.["x-kpsdk-ct"]?await this.#integrity(isFirst,data.responseHeaders["x-kpsdk-ct"]):200===data?.status&&data.response?.token?(this.#integrityToken=data.response.token,logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.integrity"),!1}}async#updateAuth(isFirst=!0){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Twitch")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(this.#auth=auth,logStatus.success(),resolve(await this.#verifyAuth(isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async#toggleChannel({name,doTask=!0}){try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await this.#getChannelId(name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"Client-Integrity":this.#integrityToken},data:doTask?followData:unfollowData});return"Success"===result?200===data?.status&&data.response?.[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+(data?.response?.[0].errors?.[0]?.message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async#getChannelId(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=this.#cache[name];if(channelId)return logStatus.success(),channelId;var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const channelId=data.response?.[0]?.data?.user?.id;return channelId?(this.#setCache(name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}async toggle({doTask=!0,channelLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>link.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/)?.[2]);if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("twitchCache",this.#cache)}catch(error){throwError_throwError(error,"Twitch.setCache")}}};const social_Vk=class extends discordAuth{tasks;whiteList;#username="";#cache=GM_getValue("vkCache")||{};#initialized=!1;constructor(){super();var defaultTasksTemplate={names:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.vk||{}}}async init(){try{return this.#initialized?!0:await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Vk")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Vk")),!1)}catch(error){return throwError_throwError(error,"Vk.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});return"Success"===result?data?.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===data?.status?(this.#username=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/)?.[1]||"",logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async#toggleGroup(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkGroup":"leavingVkGroup",text:name});if("enter"===dataParam.groupAct&&!doTask||"leave"===dataParam.groupAct&&doTask)return logStatus.success(),!0;const reqData={act:doTask?"enter":"leave",al:1,gid:dataParam.groupId,hash:dataParam.groupHash};doTask&&(reqData.context="_");var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_groups.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param(reqData)});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.toggleGroup"),!1}}async#togglePublic(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkPublic":"leavingVkPublic",text:name});if(dataParam.publicJoined&&doTask||!dataParam.publicJoined&&!doTask)return logStatus.success(),!0;var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_public.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:doTask?"a_enter":"a_leave",al:1,pid:dataParam.publicPid,hash:dataParam.publicHash})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.togglePublic"),!1}}async#sendWall(name){try{const logStatus=scripts_echoLog({type:"sendingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"publish_box",al:1,object:name})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var hash=data.responseText.match(/shHash:[\s]*'(.*?)'/)?.[1];if(hash){const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({Message:"",act:"a_do_publish",al:1,close_comments:0,friends_only:0,from:"box",hash:hash,list:"",mark_as_ads:0,mute_notifications:0,object:name,ret_data:1,to:0})});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200===dataR?.status){var jsonData=JSON.parse(dataR.responseText?.replace("\x3c!--","")||"{}");if(!0===jsonData?.payload?.[1]?.[1]?.share_my){logStatus.success();var postId=String(jsonData?.payload?.[1]?.[1]?.post_id),ownerId=String(jsonData?.payload?.[1]?.[1]?.owner_id);return postId&&ownerId&&this.#setCache(name,ownerId+"_"+postId),this.tasks.names=unique([...this.tasks.names,name]),!0}}return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1}return logStatus.error('Error: Get "hash" failed'),!1}catch(error){return throwError_throwError(error,"Vk.sendWall"),!1}}async#deleteWall(name,dataParams){try{const logStatus=scripts_echoLog({type:"deletingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_wall.php?act=delete",method:"POST",headers:{origin:"https://vk.com",referer:`https://vk.com/${this.#username}?w=wall${this.#cache[name]}%2Fall`,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"delete",al:1,confirm:0,from:"wkview",hash:dataParams.wallHash,post:this.#cache[name]})});return"Success"===result?200===data?.status&&JSON.parse(data.responseText?.replace("\x3c!--","")||"{}")?.payload?.[1]?.[1]?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.deleteWall"),!1}}async#getId(name,doTask){try{let url="https://vk.com/"+name;if(/^wall-/.test(name)){if(doTask)return{type:"sendWall"};if(!this.#cache[name])return{type:"unSupport"};url=`https://vk.com/${this.#username}?w=wall`+this.#cache[name]}const logStatus=scripts_echoLog({type:"gettingVkId",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var[,groupAct,groupId,,groupHash]=data.responseText.match(/Groups.(enter|leave)\(.*?,.*?([\d]+?), ('|')(.*?)('|')/)||[],publicHash=data.responseText.match(/"enterHash":"(.*?)"/)?.[1],publicPid=data.responseText.match(/"public_id":([\d]+?),/)?.[1],publicJoined=!data.responseText.includes("Public.subscribe");if(groupAct&&groupId&&groupHash)return logStatus.success(),{groupAct:groupAct,groupId:groupId,groupHash:groupHash,type:"group"};if(publicHash&&publicPid)return logStatus.success(),{publicHash:publicHash,publicPid:publicPid,publicJoined:publicJoined,type:"public"};if(data.responseText.includes("wall.deletePost")&&!doTask){var wallHash=data.responseText.match(/wall\.deletePost\(this, '.*?', '(.*?)'\)/)?.[1];if(wallHash)return logStatus.success(),{type:"deleteWall",wallHash:wallHash}}else if(name.includes("wall")&&doTask)return logStatus.success(),{type:"sendWall"};return logStatus.error("Error: Parameters not found!"),!1}catch(error){return throwError_throwError(error,"Vk.getId"),!1}}async#toggleVk({name,doTask=!0}){try{if(!doTask&&this.whiteList.names.includes(name))return scripts_echoLog({type:"whiteList",text:"Vk.undoTask",id:name}),!0;var formatName=name.replace(/\/$/,""),data=await this.#getId(formatName,doTask);if(!data)return!1;switch(data.type){case"group":return await this.#toggleGroup(formatName,data,doTask);case"public":return await this.#togglePublic(formatName,data,doTask);case"sendWall":return!doTask||await this.#sendWall(formatName);case"deleteWall":return!!doTask||await this.#deleteWall(formatName,data);default:return!1}}catch(error){return throwError_throwError(error,"Vk.toggleVk"),!1}}async toggle({doTask=!0,nameLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.vk.names||!doTask&&!globalOptions.undoTask.vk.names)scripts_echoLog({type:"globalOptionsSkip",text:"vk.names"});else{var realNames=this.getRealParams("names",nameLinks,doTask,link=>link.match(/https:\/\/vk\.com\/([^/]+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}#setCache(name,postId){try{this.#cache[name]=postId,GM_setValue("vkCache",this.#cache)}catch(error){throwError_throwError(error,"Vk.setCache")}}};class Youtube extends discordAuth{tasks;whiteList;#auth=GM_getValue("youtubeAuth")||{};#initialized=!1;#verifyChannel="https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel;constructor(){super();var defaultTasksTemplate={channels:[],likes:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.youtube||{}}}async init(){try{return this.#initialized?!0:this.#auth.PAPISID?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(GM_setValue("youtubeAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async#verifyAuth(){try{return await this.#toggleChannel({link:this.#verifyChannel,doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{GM_cookie.list({url:"https://www.youtube.com/@YouTube"},async(PAPISID,error)=>{error?(logStatus.error("Error: Update youtube auth failed!"),resolve(!1)):(PAPISID=PAPISID.find(cookie=>"__Secure-3PAPISID"===cookie.name)?.value)?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),this.#auth={PAPISID:PAPISID},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error(i18n("needLogin")),resolve(!1))})})}catch(error){return throwError_throwError(error,"Youtube.updateAuth"),!1}}#getInfo(link,type){return async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/)?.[1],context=(data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))?.[1]||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var channelId=data.responseText.match(/"channelId":"(.+?)"/)?.[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var videoId=data.responseText.match(//)?.[1],likeParams=data.responseText.match(/"likeParams":"(.*?)"/)?.[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}}(link,type)}async#toggleChannel({link,doTask=!0,verify=!1}){try{var{params,needLogin}=await this.#getInfo(link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=${apiKey}&prettyPrint=false`,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client?.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:request?.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===data?.status?doTask&&(/"subscribed":true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed":false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async#toggleLikeVideo({link,doTask=!0}){try{var{params,needLogin}=await this.#getInfo(link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===data?.status?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}async toggle({doTask=!0,channelLinks=[],videoLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}const social_SteamASF=class{#asfOptions;#botName="asf";#groupInfo;async init(){try{var asfCommandsUrl=new URL("/Api/Command/",globalOptions.ASF.AsfIpcUrl);this.#asfOptions={url:asfCommandsUrl.href,method:"POST",responseType:"json",headers:{accept:"application/json","Content-Type":"application/json",Host:asfCommandsUrl.host,Origin:asfCommandsUrl.origin,Referer:asfCommandsUrl.href,Authentication:globalOptions.ASF.AsfIpcPassword}},globalOptions.ASF.AsfBotname&&(this.#botName=globalOptions.ASF.AsfBotname);const logStatus=scripts_echoLog({text:i18n("initingASF")});var{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:'{"Command":"!stats"}'});return"Success"===result?!0===data?.response?.Success&&"OK"===data.response.Message&&data.response.Result?(logStatus.success(),!0):(data?.response?.Result||data?.response?.Message?logStatus.error(data?.response?.Result||data.response.Message):logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.init"),!1}}async joinGroup(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!JOINGROUP ${this.#botName} `+groupName})});return"Success"===result?200===data?.status&&["已加入","已申请","Joined","Applied","Присоединился","costs"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.joinGroup"),!1}}async leaveGroup(groupName){try{if(!this.#groupInfo&&!await this.#getGroupId())return!1;var groupId=await this.#groupInfo[groupName];if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!LEAVEGROUP ${this.#botName} `+groupId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.leaveGroup"),!1}}async#getGroupId(){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:"All"}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:"!GROUPLIST "+this.#botName})});return"Success"===result?200===data?.status&&data.response?.Result?.includes("|")?(this.#groupInfo=Object.fromEntries(data.response.Result.split("\n").map(id=>{var[,name,id]=id.trim().split("|");return name&&id?[name,id]:null}).filter(ele=>ele)),logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.getGroupID"),!1}}async addToWishlist(gameId){try{const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!ADDWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.addToWishlist"),!1}}async removeFromWishlist(gameId){try{const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REMOVEWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.removeFromWishlist"),!1}}async toggleFollowGame(gameId,doTask){try{const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWGAME ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.toggleFollowGame"),!1}}async toggleCurator(curatorId,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWCURATOR ${this.#botName} `+curatorId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async addLicense(id){try{const[type,ids]=id.split("-");if("appid"===type){const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} app/`+ids})});return"Success"===result?200===data?.status&&["AlreadyPurchased","OK"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{const idsArr=ids.split(","),logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} `+idsArr.map(id=>"sub/"+id).join(",")})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200===data?.status&&data.response?.Result){const resultLines=data.response.Result.split("\n");return idsArr.forEach(subid=>{const targetLine=resultLines.find(text=>text.includes(subid));targetLine&&["成功","Success","Успех"].find(text=>targetLine.includes(text))?scripts_echoLog({}).success(targetLine):scripts_echoLog({}).error(targetLine)}),!0}return logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1}}catch(error){return throwError_throwError(error,"SteamASF.addLicense"),!1}}async requestPlayTestAccess(id){try{const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REQUESTACCESS ${this.#botName} `+id})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}};const social_Steam=class extends discordAuth{tasks;whiteList;#cache={group:{},officialGroup:{},forum:{},workshop:{},curator:{},...GM_getValue("steamCache")};#auth={};#storeInitialized=!1;#communityInitialized=!1;#area="CN";#areaStatus="end";#ASF;constructor(){super();var defaultTasksTemplate={groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.steam||{}}}async init(type="all"){try{if(globalOptions.ASF.AsfEnabled&&globalOptions.ASF.AsfIpcUrl&&globalOptions.ASF.AsfIpcPassword)return this.#ASF=new social_SteamASF,!!await this.#ASF.init()&&(this.#storeInitialized=!0,this.#communityInitialized=!0);if("store"===type){if(this.#storeInitialized)return!0;let storeInitialized=await this.#updateStoreAuth();return(storeInitialized=storeInitialized||await this.#updateStoreAuthTab(),this.#storeInitialized=storeInitialized,this.#storeInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamStore")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}if("community"!==type)return this.#storeInitialized&&this.#communityInitialized?(scripts_echoLog({}).success(i18n("initSuccess","Steam")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1);{if(this.#communityInitialized)return!0;let communityInitialized=await this.#getUserLink();return(communityInitialized=communityInitialized||await this.#updateCommunityAuthTab(),this.#communityInitialized=communityInitialized,this.#communityInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamCommunity")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}}catch(error){return throwError_throwError(error,"Steam.init"),!1}}async#refreshToken(type="steamStore"){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n(type))}),formData=new FormData;formData.append("redir",`https://${host[type]}/`);var{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://"+host[type],Referer:`https://${host[type]}/`},data:formData});return"Success"===result?data?.response?.success?await this.#setStoreToken(data.response,type)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshToken"),!1}}async#setStoreToken(param,type){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("settingToken",i18n(type))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:`https://${host[type]}/login/settoken`,method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:host[type],Origin:"https://"+host[type]},data:formData});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async#updateStoreAuth(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200!==data?.status)return[301,302].includes(data?.status)?await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):(logStatus.error(result+`:${statusText}(${status})`),!1);if(!data.responseText.includes("data-miniprofile="))return await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1);var storeSessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(this.#auth.storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async#updateStoreAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))});return await new Promise(resolve=>{const newTab=window.open("https://store.steampowered.com/","mozillaWindow","pop=1;");GM_setValue("steamStoreAuth","update");const listenerId=GM_addValueChangeListener("steamStoreAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.storeSessionID=newValue.storeSessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateStoreAuthTab"),!1}}async#updateCommunityAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))});return await new Promise(resolve=>{const newTab=window.open("https://steamcommunity.com/my","mozillaWindow","pop=1;");GM_setValue("steamCommunityAuth","update");const listenerId=GM_addValueChangeListener("steamCommunityAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.steam64Id=newValue.steam64Id,this.#auth.userName=newValue.userName,this.#auth.communitySessionID=newValue.communitySessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuthTab"),!1}}async#getUserLink(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("gettingUserLink")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200===data?.status){if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}if(302===data?.status)return!await this.#refreshToken("steamCommunity")||retry?(logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1):(logStatus.warning(i18n("retry")),this.#getUserLink(!0));const location=data?.responseHeaders?.split("\n")?.find(header=>header.includes("location")?header.replace("loctation:","").trim():null);return 301===data?.status&&location?.includes("steamcommunity.com/id")?(logStatus.success(),await this.#updateCommunityAuth(data.finalUrl)):(301===data?.status&&location?.includes("https://steamcommunity.com/login/home")?logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0):logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#updateCommunityAuth(url){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#getAreaInfo(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{var cartConfigRaw=data.responseText.match(/data-cart_config="(.*?)"/)?.[1];const temp=document.createElement("div");temp.innerHTML=cartConfigRaw||"{}";var cartConfigStr=temp.textContent||temp.innerText;let cartConfig;try{cartConfig=JSON.parse(cartConfigStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}if(!cartConfig.rgUserCountryOptions)return logStatus.warning("Warning: Area cannot be changed"),{};var userInfoRaw=data.responseText.match(/data-userinfo="(.*?)"/)?.[1];const temp1=document.createElement("div");temp1.innerHTML=userInfoRaw||"{}";var userInfoStr=temp1.textContent||temp1.innerText;let userInfo;try{userInfo=JSON.parse(userInfoStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}var currentArea=userInfo.country_code,areas=Object.keys(cartConfig.rgUserCountryOptions).filter(area=>"help"!==area);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==this.#areaStatus&&(clearInterval(checker),resolve(!0))})}),this.#area===area||!area&&"CN"!==this.#area)return!0;this.#areaStatus="waiting";let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await this.#getAreaInfo();if(!currentArea||!areas)return!(this.#areaStatus="error");if("CN"!==currentArea)return this.#areaStatus="skip",scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return this.#areaStatus="noAnotherArea",scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/country/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:this.#auth.storeSessionID})});if("Success"!==result)return this.#areaStatus="error",logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==data?.status||"true"!==data.responseText)return this.#areaStatus="error",logStatus.error(`Error:${data?.statusText}(${data?.status})`),"CN";var currentArea=(await this.#getAreaInfo())["currentArea"];return currentArea===aimedArea?(this.#areaStatus="success",logStatus.success(),currentArea):(this.#areaStatus="error",logStatus.error("Error: change country filed"),"CN")}catch(error){return this.#areaStatus="error",throwError_throwError(error,"Steam.changeArea"),!1}}async#joinGroup(groupName){try{if(this.#ASF)return!!await this.#ASF.joinGroup(groupName)&&(this.tasks.groups=unique([...this.tasks.groups,groupName]),!0);const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async#leaveGroup(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(groupName);var groupId=await this.#getGroupId(groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===data?.status&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async#getGroupId(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var groupId=this.#cache.group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)?.[1];return groupId?(this.#setCache("group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#joinOfficialGroup(gameId){try{if(this.#ASF)return!!await this.#ASF.joinGroup(gameId)&&(this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]),!0);const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+this.#auth.communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId&&this.#setCache("officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async#leaveOfficialGroup(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(gameId);var groupId=await this.#getOfficialGroupId(gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===dataR?.status&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async#getOfficialGroupId(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var groupId=this.#cache.officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId?(this.#setCache("officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#addToWishlist(gameId){try{if(this.#ASF)return!!await this.#ASF.addToWishlist(gameId)&&(this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0);const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===dataR?.status?"CN"===this.#area&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#addToWishlist(gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async#removeFromWishlist(gameId){try{if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;if(this.#ASF)return await this.#ASF.removeFromWishlist(gameId);const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==dataR?.status)return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1;if("CN"===this.#area&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#removeFromWishlist(gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async#toggleFollowGame(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;if(this.#ASF)return!!await this.#ASF.toggleFollowGame(gameId,doTask)&&(doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0);const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:this.#auth.storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===data?.status&&"true"===data.responseText)return logStatus.success(),!0;var followed=await this.#isFollowedGame(gameId);return"CN"===this.#area&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#removeFromWishlist(gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async#isFollowedGame(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===data?.status&&("CN"===this.#area&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async#toggleForum(gameId,doTask=!0){try{if(!doTask&&this.whiteList.forums.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unsubscribeForum",id:gameId}),!0;const forumId=await this.#getForumId(gameId);if(!forumId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}subscribingForum`,text:gameId});var[id,feature]=forumId.split("_"),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/forum/${id}/General/${doTask?"":"un"}subscribe/${feature||"0"}/`,method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.communitySessionID})});return"Success"===result?(200!==data?.status||1!==data.response?.success&&29!==data.response?.success?logStatus.error(`Error:${data?.statusText}(${data?.status})`):(doTask&&(this.tasks.forums=unique([...this.tasks.forums,gameId])),logStatus.success()),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.toggleForum"),!0}}async#getForumId(gameId){try{const logStatus=scripts_echoLog({type:"gettingForumId",text:gameId});var forumId=this.#cache.forum[gameId];if(forumId)return logStatus.success(),forumId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/app/${gameId}/discussions/`,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const forumId=data.responseText?.match(/General_([\d]+(_[\d]+)?)/)?.[1];return forumId?(this.#setCache("forum",gameId,forumId),logStatus.success(),forumId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getForumId"),!1}}async#toggleFavoriteWorkshop(id,doTask=!0){try{if(!doTask&&this.whiteList.workshops.includes(id))return scripts_echoLog({type:"whiteList",text:"Steam.unfavoriteWorkshop",id:id}),!0;var appid=await this.#getWorkshopAppId(id);if(!appid)return!1;const logStatus=scripts_echoLog({type:doTask?"favoritingWorkshop":"unfavoritingWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/sharedfiles/${doTask?"":"un"}favorite`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,appid:appid,sessionid:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(doTask&&(this.tasks.workshops=unique([...this.tasks.workshops,id])),logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFavoriteWorkshop"),!1}}async#getWorkshopAppId(id){try{const logStatus=scripts_echoLog({type:"gettingWorkshopAppId",text:id});var appId=this.#cache.workshop[id];if(appId)return logStatus.success(),appId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/filedetails/?id="+id,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const appId=data.responseText.match(//)?.[1];return appId?(this.#setCache("workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async#voteUpWorkshop(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:this.#auth.communitySessionID})});return"Success"===result?(200===data?.status&&1===data.response?.success?logStatus.success():logStatus.error(`Error:${data?.statusText}(${data?.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async#toggleCurator(curatorId,doTask=!0){try{if(!doTask&&this.whiteList.curators.includes(curatorId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowCurator",id:curatorId}),!0;if(this.#ASF)return await this.#ASF.toggleCurator(curatorId,doTask);const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/curators/ajaxfollow",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({clanid:curatorId,sessionid:this.#auth.storeSessionID,follow:doTask}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response?.success?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(`+data?.response?.success||data?.status+")"),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async getCuratorId(path,name){try{const logStatus=scripts_echoLog({type:"gettingCuratorId",text:path+"/"+name});var curatorId=this.#cache.curator[path+"/"+name];if(curatorId)return logStatus.success(),curatorId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/${path}/`+name,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const curatorId=data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)?.[1];return curatorId?(this.#setCache("curator",path+"/"+name,curatorId),logStatus.success(),curatorId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getCuratorID"),!1}}async#toggleCuratorLike(link,doTask=!0){try{var[path,name]=link.split("/");if(!path||!name)return scripts_echoLog({text:i18n("errorLink",link)}),!1;var curatorId=await this.getCuratorId(path,name);return curatorId?await this.#toggleCurator(curatorId,doTask):!1}catch(error){return throwError_throwError(error,"Steam.toggleCuratorLike"),!1}}async#getAnnouncementParams(appId,viewId){try{const logStatus=scripts_echoLog({type:"gettingAnnouncementParams",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/events/ajaxgetpartnerevent?appid=${appId}&announcement_gid=${viewId}&lang_list=6_0&last_modified_time=0&origin=https:%2F%2Fstore.steampowered.com&for_edit=false`,method:"GET",responseType:"json",headers:{Host:"store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status||1!==data?.response?.success)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};var{clanid,gid}=data.response.event?.announcement_body||{};return clanid?(logStatus.success(),{clanId:clanid,gid:gid}):(logStatus.error(`Error:${data.statusText}(${data.status})`),{})}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),{}}}async#likeAnnouncement(id){try{var[appId,viewId]=id.split("/");if(!appId||!viewId)return scripts_echoLog({}).error(i18n("missParams")+"(id)"),!1;var{clanId,gid}=await this.#getAnnouncementParams(appId,viewId);if(!clanId)return!1;const logStatus=scripts_echoLog({type:"likingAnnouncement",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/updated/ajaxrateupdate/"+(gid||viewId),method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId},data:$.param({sessionid:this.#auth.storeSessionID,voteup:1,clanid:clanId,ajax:1}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),!1}}async#appid2subid(id){try{const logStatus=scripts_echoLog({type:"gettingSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+id,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#appid2subid(id):!1}var subid=data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];return subid?(logStatus.success(),subid):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.appid2subid"),!1}}async#getLicenses(){try{const logStatus=scripts_echoLog({text:i18n("gettingLicenses")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/dynamicstore/userdata/?t="+(new Date).getTime(),method:"GET",responseType:"json"});return"Success"===result?200===data?.status?(logStatus.success(),data.response?.rgOwnedPackages):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.getLicenses"),!1}}async#addLicense(id){try{if(this.#ASF)return await this.#ASF.addLicense(id);const[type,ids]=id.split("-");if("appid"===type){var subid=await this.#appid2subid(ids);if(!subid)return!1;const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids});if(!await this.#addFreeLicense(subid,logStatus))return!1;const{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+ids,method:"GET"});return"Success"===result?200===data?.status?data.responseText.includes("ds_owned_flag ds_flag")||data.responseText.includes('class="already_in_library"')?(logStatus.success(),!0):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{"CN"===this.#area&&(scripts_echoLog({}).success(i18n("tryChangeAreaNotice")),await this.#changeArea());const logStatusArr={};var idsArr=ids.split(",");for(const subid of idsArr){var logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:subid});if(!await this.#addFreeLicense(subid,logStatus))return!1;logStatusArr[subid]=logStatus}const licenses=await this.#getLicenses();if(!licenses)return!1;for(const subid of idsArr)licenses.includes(parseInt(subid,10))?logStatusArr[subid].success():logStatusArr[subid].error();return!0}}catch(error){return throwError_throwError(error,"Steam.addLicense"),!1}}async#addFreeLicense(id,logStatusPre){try{const logStatus=logStatusPre||scripts_echoLog({type:"addingFreeLicenseSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:this.#auth.storeSessionID,subid:id}),dataType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result?await this.#addFreeLicense(id):!1}return logStatus.success(),!0}catch(error){return throwError_throwError(error,"Steam.addFreeLicense"),!1}}async#requestPlayTestAccess(id){try{if(this.#ASF)return await this.#ASF.requestPlayTestAccess(id);const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+id,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+id},data:$.param({sessionid:this.#auth.storeSessionID}),dataType:"json"});return"Success"===result?200===data?.status&&1===data?.response?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}async toggle({doTask=!0,groupLinks=[],officialGroupLinks=[],wishlistLinks=[],followLinks=[],forumLinks=[],workshopLinks=[],workshopVoteLinks=[],curatorLinks=[],curatorLikeLinks=[],announcementLinks=[],licenseLinks=[],playtestLinks=[]}){try{if(0<[...groupLinks,...officialGroupLinks,...forumLinks,...workshopLinks,...workshopVoteLinks].length&&!this.#communityInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;if(0<[...wishlistLinks,...followLinks,...curatorLinks,...curatorLikeLinks,...announcementLinks,...licenseLinks,...playtestLinks].length&&!this.#storeInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.steam.groups||!doTask&&!globalOptions.undoTask.steam.groups)scripts_echoLog({type:"globalOptionsSkip",text:"steam.groups"});else{var realGroups=this.getRealParams("groups",groupLinks,doTask,link=>link.match(/groups\/(.+)\/?/)?.[1]);if(0link.match(/games\/(.+)\/?/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(doTask&&0link.match(/curator\/([\d]+)/)?.[1]),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,link=>link.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/)?.slice(1,3).join("/"));if(0(link.includes("store.steampowered.com")?link.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/):link.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))?.slice(1,3).join("/"));if(doTask&&0link.match(/app\/([\d]+)/)?.[1]);if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==this.#area&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await this.#changeArea("CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}#setCache(type,name,id){try{this.#cache[type][name]=id,GM_setValue("steamCache",this.#cache)}catch(error){throwError_throwError(error,"Steam.setCache")}}};const Giveawaysu=class{undoneTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};giveawayId;socialInitialized={discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0};initialized=!1;social={};static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{this.#checkLogin()||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await this.#checkLeftKey()||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!this.#getGiveawayId()&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async#classifyTask(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError_throwError(error,"getRedirectLink"),null}})(taskDes.attr("href")).then(taskLink=>taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.#uniqueTasks(this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}#checkLogin(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async#checkLeftKey(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(({value})=>{value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}#getGiveawayId(){var giveawayId=window.location.href.match(/\/view\/([\d]+)/)?.[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async#bind(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async#initSocial(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(this.#bind("discord",this.social.discord.init("do")))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(this.#bind("instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(this.#bind("reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(this.#bind("twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(this.#bind("vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(this.#bind("youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&tasks.steam?.[type]?.length||0).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(this.#bind("steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}#uniqueTasks(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async#toggleTask(){try{if(!this.initialized&&!this.init())return!1;if(!await this.#classifyTask())return!1;if(!await this.#initSocial())return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await this.#toggleTask()}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};discordAuth=__webpack_require__(82);if(window.STYLE=GM_addStyle(discordAuth.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{var authToken;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(authToken=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientId:commonOptions?.headers?.["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"x.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file diff --git a/page/dist/auto-task-v4-for-giveawaysu.user.js b/page/dist/auto-task-v4-for-giveawaysu.user.js index 48fb1d0..b15edfb 100644 --- a/page/dist/auto-task-v4-for-giveawaysu.user.js +++ b/page/dist/auto-task-v4-for-giveawaysu.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4-for-giveawaysu // @namespace auto-task-v4-for-giveawaysu -// @version 4.4.7 +// @version 4.4.8 // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -18,6 +18,8 @@ // @include *://www.twitch.tv/* // @include *://www.youtube.com/* // @include *://*.reddit.com/* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @grant GM_addStyle // @grant GM_setValue @@ -74,7 +76,7 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); -!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o{isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] +!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o{isConfirmed?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("[BUG] 脚本报错: "+name)}&labels=bug&template=bug_report.yml&website=${encodeURIComponent(window.location.href)}&browser=${encodeURIComponent(JSON.stringify((0,javascript_utils_umd_min.ua)(),null,4))}&manager=${encodeURIComponent(GM_info.scriptHandler+" "+GM_info.version)}&user-script=${encodeURIComponent(GM_info.script.version)}&logs=${encodeURIComponent(error.stack||"null")}&run-logs=`+encodeURIComponent($.makeArray($("#auto-task-info>li")).map(element=>element.innerText).join("\n")),"_blank"):text&&(text=`错误链接: [url=${window.location.href}]${window.location.href}[/url] 环境: @@ -91,4 +93,4 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); `+error.stack)}const httpRequest_httpRequest=async(options,times=0)=>{window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest_httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError_throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest_httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ - ${text?.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError_throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)});const defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};discordAuth=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,discordAuth);const languages={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",updateHistory:'历史更新记录点此查看',AsfEnabled:'使用ASF做Steam相关任务(需ASFEnhance插件)',AsfIpcUrl:"ASF IPC 地址",AsfIpcPassword:"ASF IPC 密码",versionNotMatched:"脚本管理器版本过低,需TamperMonkey >= 5.2.0或TamperMonkey Beta >= 5.2.6196",groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",gettingUserLink:"正在获取Steam用户社区链接...",retry:"重试",initingASF:"正在初始化ASF...",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",campaign:"检测到人机验证,请完成验证后重新验证任务!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",tasksNotCompleted:"任务未完成",confirmingTask:"正在跳过警告页面..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",updateHistory:'Click here to view the historical update record.',AsfEnabled:'Use ASF to do Steam related tasks (requires ASFEnhance plugin)',AsfIpcUrl:"ASF IPC URL",AsfIpcPassword:"ASF IPC Password",groups:"Group",officialGroups:"Official Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",gettingCuratorId:"Getting Steam Curator Id",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",versionNotMatched:"The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196",gettingUserLink:"Getting steam user community link...",retry:"Retry",initingASF:"Initing ASF...",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",campaign:"ReCAPTCHA detected, please complete it and re-verify the tasks!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning...",tasksNotCompleted:"Tasks Not Completed",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=(key,...argvs)=>languages[language]?.[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key;discordAuth=class{tasks;getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)))return this.#initialized=!1,"skip";return GM_getValue("dontRemindDiscordAgain")||"do"===action&&!globalOptions.doTask.discord.servers||"undo"===action&&!globalOptions.undoTask.discord.servers?(this.#initialized=!1,"skip"):!!this.#initialized||(this.#auth.auth?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(GM_setValue("discordAuth",{auth:null}),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0))}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Discord")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:this.#auth.auth}});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Discord")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("discordAuth")?.auth;auth?(this.#auth={auth:auth},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async#joinServer(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:this.#auth.auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(data.response?.guild?.id);return guild&&(this.#setCache(inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async#leaveServer(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await this.#getGuild(inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:this.#auth.auth}});return"Success"===result&&204===data?.status?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async#getGuild(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=this.#cache[inviteId];if(guild)return logStatus.success(),guild;var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=data.response?.guild?.id;return guild?(logStatus.success(),this.#setCache(inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}async toggle({doTask=!0,serverLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,link=>link.match(/invite\/(.+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}#setCache(inviteId,guild){try{this.#cache[inviteId]=guild,GM_setValue("discordCache",this.#cache)}catch(error){throwError_throwError(error,"Discord.setCache")}}};const social_Instagram=class extends discordAuth{tasks;whiteList;#cache=GM_getValue("instagramCache")||{};#auth={};#initialized=!1;constructor(){super();var defaultTasksTemplate={users:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.instagram||{}}}async init(){try{return this.#initialized?!0:await this.#getUserInfo()?(scripts_echoLog({}).success(i18n("initSuccess","Instagram")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Instagram")),!1)}catch(error){return throwError_throwError(error,"Instagram.init"),!1}}async#getUserInfo(name="instagram"){try{const logStatus=scripts_echoLog({type:"instagram"===name?"verifyingInsAuth":"gettingInsUserId",text:name});var userId=this.#cache[name];if(userId&&"instagram"!==name)return logStatus.success(),userId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/${name}/`,method:"GET"});if("Success"!==result)return!1;if(data?.finalUrl.includes("accounts/login"))return logStatus.error("Error:"+i18n("loginIns"),!0),!1;if(data?.finalUrl.includes("www.instagram.com/challenge"))return logStatus.error("Error:"+i18n("insBanned")),!1;if(200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;var csrftoken=data.responseText.match(/"csrf_token":"(.+?)"/)?.[1],hash=data.responseText.match(/"rollout_hash":"(.+?)"/)?.[1];if("instagram"===name)return!(!csrftoken||!hash)&&(this.#auth={csrftoken:csrftoken,hash:hash},!0);var id=data.responseText.match(/"profilePage_([\d]+?)"/)?.[1];return id?(this.#setCache(name,id),logStatus.success(),id):(logStatus.error("Error: Get ins data error!"),!1)}catch(error){return throwError_throwError(error,"Instagram.getUserInfo"),!1}}async#followUser(name){try{var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"followingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/follow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"following"===data.response?.result?(logStatus.success(),this.tasks.users=unique([...this.tasks.users,name]),!0):(logStatus.error("Error:"+(data?.response?.feedback_message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.followUser"),!1}}async#unfollowUser(name){try{if(this.whiteList.users.includes(name))return scripts_echoLog({type:"whiteList",text:"Instagram.unfollowUser",id:name}),!0;var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"unfollowingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/unfollow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"ok"===data.response?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.unfollowUser"),!1}}async toggle({doTask=!0,userLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.instagram.users||!doTask&&!globalOptions.undoTask.instagram.users)scripts_echoLog({type:"globalOptionsSkip",text:"instagram.users"});else{var realUsers=this.getRealParams("users",userLinks,doTask,link=>link.match(/https:\/\/www\.instagram\.com\/(.+)?\//)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("instagramCache",this.#cache)}catch(error){throwError_throwError(error,"Instagram.setCache")}}};const social_Reddit=class extends discordAuth{tasks;whiteList;#auth;#initialized=!1;constructor(){super();var defaultTasksTemplate={reddits:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.reddit||{}}}async init(){try{return this.#initialized?!0:await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Reddit")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Reddit")),!1)}catch(error){return throwError_throwError(error,"Reddit.init"),!1}}async#useBeta(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await this.#updateAuth(!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async#updateAuth(beta=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Reddit")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://www.reddit.com/",method:"GET",nochche:!0,headers:{"Cache-Control":"no-cache"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(data?.responseText.includes("www.reddit.com/login/"))return logStatus.error("Error:"+i18n("loginReddit"),!0),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.responseText.includes("redesign-beta-optin-btn")&&!beta)return await this.#useBeta();var accessToken=data.responseText.match(/"accessToken":"(.*?)","expires":"(.*?)"/)?.[1];return accessToken?(this.#auth={token:accessToken},logStatus.success(),!0):(logStatus.error('Error: Parameter "accessToken" not found!'),!1)}catch(error){return throwError_throwError(error,"Reddit.updateAuth"),!1}}async toggleTask({name,doTask=!0}){try{if(!doTask&&this.whiteList.reddits.includes(name))return scripts_echoLog({type:"whiteList",text:"Reddit.undoTask",id:name}),!0;let type=doTask?"joiningReddit":"leavingReddit";/^u_/.test(name)&&(type=doTask?"followingRedditUser":"unfollowingRedditUser");const logStatus=scripts_echoLog({type:type,text:name});var{result,statusText,status,data}=await tools_httpRequest({url:"https://oauth.reddit.com/api/subscribe?redditWebClient=desktop2x&app=desktop2x-client-production&raw_json=1&gilding_detail=1",method:"POST",headers:{authorization:"Bearer "+this.#auth.token,"content-type":"application/x-www-form-urlencoded"},data:$.param({action:doTask?"sub":"unsub",sr_name:name,api_type:"json"})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.reddits=unique([...this.tasks.reddits,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Reddit.toggleTask"),!1}}async toggle({doTask=!0,redditLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.reddit.reddits||!doTask&&!globalOptions.undoTask.reddit.reddits)scripts_echoLog({type:"globalOptionsSkip",text:"reddit.reddits"});else{var realReddits=this.getRealParams("reddits",redditLinks,doTask,userName=>{var name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/)?.[1],userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/)?.[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};const social_Twitch=class extends discordAuth{tasks;whiteList;#auth=GM_getValue("twitchAuth")||{};#cache=GM_getValue("twitchCache")||{};#initialized=!1;#integrityToken;constructor(){super();var defaultTasksTemplate={channels:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.twitch||{}}}async init(){try{return this.#initialized?!0:this.#auth.authToken&&this.#auth.clientId&&this.#auth.clientVersion&&this.#auth.deviceId&&this.#auth.clientSessionId?await this.#verifyAuth(!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(GM_setValue("twitchAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async#verifyAuth(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===data?.status&&data.response?.[0]?.data?.currentUser?(await this.#integrity(isFirst),logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async#integrity(isFirst=!0,ct=""){try{const logStatus=scripts_echoLog({text:i18n("checkingTwitchIntegrity")});if(isFirst&&(!this.#auth.authToken||!this.#auth.clientId||!this.#auth.clientVersion||!this.#auth.deviceId||!this.#auth.clientSessionId))return await this.#updateAuth(!1);var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/integrity",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"x-kpsdk-ct":ct}});return"Success"===result?!ct&&data?.responseHeaders?.["x-kpsdk-ct"]?await this.#integrity(isFirst,data.responseHeaders["x-kpsdk-ct"]):200===data?.status&&data.response?.token?(this.#integrityToken=data.response.token,logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.integrity"),!1}}async#updateAuth(isFirst=!0){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Twitch")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(this.#auth=auth,logStatus.success(),resolve(await this.#verifyAuth(isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async#toggleChannel({name,doTask=!0}){try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await this.#getChannelId(name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"Client-Integrity":this.#integrityToken},data:doTask?followData:unfollowData});return"Success"===result?200===data?.status&&data.response?.[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+(data?.response?.[0].errors?.[0]?.message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async#getChannelId(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=this.#cache[name];if(channelId)return logStatus.success(),channelId;var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const channelId=data.response?.[0]?.data?.user?.id;return channelId?(this.#setCache(name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}async toggle({doTask=!0,channelLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>link.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/)?.[2]);if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("twitchCache",this.#cache)}catch(error){throwError_throwError(error,"Twitch.setCache")}}};const social_Vk=class extends discordAuth{tasks;whiteList;#username="";#cache=GM_getValue("vkCache")||{};#initialized=!1;constructor(){super();var defaultTasksTemplate={names:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.vk||{}}}async init(){try{return this.#initialized?!0:await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Vk")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Vk")),!1)}catch(error){return throwError_throwError(error,"Vk.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});return"Success"===result?data?.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===data?.status?(this.#username=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/)?.[1]||"",logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async#toggleGroup(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkGroup":"leavingVkGroup",text:name});if("enter"===dataParam.groupAct&&!doTask||"leave"===dataParam.groupAct&&doTask)return logStatus.success(),!0;const reqData={act:doTask?"enter":"leave",al:1,gid:dataParam.groupId,hash:dataParam.groupHash};doTask&&(reqData.context="_");var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_groups.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param(reqData)});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.toggleGroup"),!1}}async#togglePublic(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkPublic":"leavingVkPublic",text:name});if(dataParam.publicJoined&&doTask||!dataParam.publicJoined&&!doTask)return logStatus.success(),!0;var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_public.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:doTask?"a_enter":"a_leave",al:1,pid:dataParam.publicPid,hash:dataParam.publicHash})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.togglePublic"),!1}}async#sendWall(name){try{const logStatus=scripts_echoLog({type:"sendingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"publish_box",al:1,object:name})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var hash=data.responseText.match(/shHash:[\s]*'(.*?)'/)?.[1];if(hash){const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({Message:"",act:"a_do_publish",al:1,close_comments:0,friends_only:0,from:"box",hash:hash,list:"",mark_as_ads:0,mute_notifications:0,object:name,ret_data:1,to:0})});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200===dataR?.status){var jsonData=JSON.parse(dataR.responseText?.replace("\x3c!--","")||"{}");if(!0===jsonData?.payload?.[1]?.[1]?.share_my){logStatus.success();var postId=String(jsonData?.payload?.[1]?.[1]?.post_id),ownerId=String(jsonData?.payload?.[1]?.[1]?.owner_id);return postId&&ownerId&&this.#setCache(name,ownerId+"_"+postId),this.tasks.names=unique([...this.tasks.names,name]),!0}}return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1}return logStatus.error('Error: Get "hash" failed'),!1}catch(error){return throwError_throwError(error,"Vk.sendWall"),!1}}async#deleteWall(name,dataParams){try{const logStatus=scripts_echoLog({type:"deletingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_wall.php?act=delete",method:"POST",headers:{origin:"https://vk.com",referer:`https://vk.com/${this.#username}?w=wall${this.#cache[name]}%2Fall`,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"delete",al:1,confirm:0,from:"wkview",hash:dataParams.wallHash,post:this.#cache[name]})});return"Success"===result?200===data?.status&&JSON.parse(data.responseText?.replace("\x3c!--","")||"{}")?.payload?.[1]?.[1]?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.deleteWall"),!1}}async#getId(name,doTask){try{let url="https://vk.com/"+name;if(/^wall-/.test(name)){if(doTask)return{type:"sendWall"};if(!this.#cache[name])return{type:"unSupport"};url=`https://vk.com/${this.#username}?w=wall`+this.#cache[name]}const logStatus=scripts_echoLog({type:"gettingVkId",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var[,groupAct,groupId,,groupHash]=data.responseText.match(/Groups.(enter|leave)\(.*?,.*?([\d]+?), ('|')(.*?)('|')/)||[],publicHash=data.responseText.match(/"enterHash":"(.*?)"/)?.[1],publicPid=data.responseText.match(/"public_id":([\d]+?),/)?.[1],publicJoined=!data.responseText.includes("Public.subscribe");if(groupAct&&groupId&&groupHash)return logStatus.success(),{groupAct:groupAct,groupId:groupId,groupHash:groupHash,type:"group"};if(publicHash&&publicPid)return logStatus.success(),{publicHash:publicHash,publicPid:publicPid,publicJoined:publicJoined,type:"public"};if(data.responseText.includes("wall.deletePost")&&!doTask){var wallHash=data.responseText.match(/wall\.deletePost\(this, '.*?', '(.*?)'\)/)?.[1];if(wallHash)return logStatus.success(),{type:"deleteWall",wallHash:wallHash}}else if(name.includes("wall")&&doTask)return logStatus.success(),{type:"sendWall"};return logStatus.error("Error: Parameters not found!"),!1}catch(error){return throwError_throwError(error,"Vk.getId"),!1}}async#toggleVk({name,doTask=!0}){try{if(!doTask&&this.whiteList.names.includes(name))return scripts_echoLog({type:"whiteList",text:"Vk.undoTask",id:name}),!0;var formatName=name.replace(/\/$/,""),data=await this.#getId(formatName,doTask);if(!data)return!1;switch(data.type){case"group":return await this.#toggleGroup(formatName,data,doTask);case"public":return await this.#togglePublic(formatName,data,doTask);case"sendWall":return!doTask||await this.#sendWall(formatName);case"deleteWall":return!!doTask||await this.#deleteWall(formatName,data);default:return!1}}catch(error){return throwError_throwError(error,"Vk.toggleVk"),!1}}async toggle({doTask=!0,nameLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.vk.names||!doTask&&!globalOptions.undoTask.vk.names)scripts_echoLog({type:"globalOptionsSkip",text:"vk.names"});else{var realNames=this.getRealParams("names",nameLinks,doTask,link=>link.match(/https:\/\/vk\.com\/([^/]+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}#setCache(name,postId){try{this.#cache[name]=postId,GM_setValue("vkCache",this.#cache)}catch(error){throwError_throwError(error,"Vk.setCache")}}};class Youtube extends discordAuth{tasks;whiteList;#auth=GM_getValue("youtubeAuth")||{};#initialized=!1;#verifyChannel="https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel;constructor(){super();var defaultTasksTemplate={channels:[],likes:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.youtube||{}}}async init(){try{return this.#initialized?!0:this.#auth.PAPISID?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(GM_setValue("youtubeAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async#verifyAuth(){try{return await this.#toggleChannel({link:this.#verifyChannel,doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{GM_cookie.list({url:"https://www.youtube.com/@YouTube"},async(PAPISID,error)=>{error?(logStatus.error("Error: Update youtube auth failed!"),resolve(!1)):(PAPISID=PAPISID.find(cookie=>"__Secure-3PAPISID"===cookie.name)?.value)?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),this.#auth={PAPISID:PAPISID},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error(i18n("needLogin")),resolve(!1))})})}catch(error){return throwError_throwError(error,"Youtube.updateAuth"),!1}}#getInfo(link,type){return async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/)?.[1],context=(data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))?.[1]||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var channelId=data.responseText.match(/"channelId":"(.+?)"/)?.[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var videoId=data.responseText.match(//)?.[1],likeParams=data.responseText.match(/"likeParams":"(.*?)"/)?.[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}}(link,type)}async#toggleChannel({link,doTask=!0,verify=!1}){try{var{params,needLogin}=await this.#getInfo(link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=${apiKey}&prettyPrint=false`,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client?.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:request?.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===data?.status?doTask&&(/"subscribed":true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed":false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async#toggleLikeVideo({link,doTask=!0}){try{var{params,needLogin}=await this.#getInfo(link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===data?.status?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}async toggle({doTask=!0,channelLinks=[],videoLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}const social_SteamASF=class{#asfOptions;#botName="asf";#groupInfo;async init(){try{var asfCommandsUrl=new URL("/Api/Command/",globalOptions.ASF.AsfIpcUrl);this.#asfOptions={url:asfCommandsUrl.href,method:"POST",responseType:"json",headers:{accept:"application/json","Content-Type":"application/json",Host:asfCommandsUrl.host,Origin:asfCommandsUrl.origin,Referer:asfCommandsUrl.href,Authentication:globalOptions.ASF.AsfIpcPassword}},globalOptions.ASF.AsfBotname&&(this.#botName=globalOptions.ASF.AsfBotname);const logStatus=scripts_echoLog({text:i18n("initingASF")});var{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:'{"Command":"!stats"}'});return"Success"===result?!0===data?.response?.Success&&"OK"===data.response.Message&&data.response.Result?(logStatus.success(),!0):(data?.response?.Result||data?.response?.Message?logStatus.error(data?.response?.Result||data.response.Message):logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.init"),!1}}async joinGroup(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!JOINGROUP ${this.#botName} `+groupName})});return"Success"===result?200===data?.status&&["已加入","已申请","Joined","Applied","Присоединился","costs"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.joinGroup"),!1}}async leaveGroup(groupName){try{if(!this.#groupInfo&&!await this.#getGroupId())return!1;var groupId=await this.#groupInfo[groupName];if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!LEAVEGROUP ${this.#botName} `+groupId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.leaveGroup"),!1}}async#getGroupId(){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:"All"}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:"!GROUPLIST "+this.#botName})});return"Success"===result?200===data?.status&&data.response?.Result?.includes("|")?(this.#groupInfo=Object.fromEntries(data.response.Result.split("\n").map(id=>{var[,name,id]=id.trim().split("|");return name&&id?[name,id]:null}).filter(ele=>ele)),logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.getGroupID"),!1}}async addToWishlist(gameId){try{const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!ADDWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.addToWishlist"),!1}}async removeFromWishlist(gameId){try{const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REMOVEWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.removeFromWishlist"),!1}}async toggleFollowGame(gameId,doTask){try{const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWGAME ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.toggleFollowGame"),!1}}async toggleCurator(curatorId,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWCURATOR ${this.#botName} `+curatorId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async addLicense(id){try{const[type,ids]=id.split("-");if("appid"===type){const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} app/`+ids})});return"Success"===result?200===data?.status&&["AlreadyPurchased","OK"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{const idsArr=ids.split(","),logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} `+idsArr.map(id=>"sub/"+id).join(",")})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200===data?.status&&data.response?.Result){const resultLines=data.response.Result.split("\n");return idsArr.forEach(subid=>{const targetLine=resultLines.find(text=>text.includes(subid));targetLine&&["成功","Success","Успех"].find(text=>targetLine.includes(text))?scripts_echoLog({}).success(targetLine):scripts_echoLog({}).error(targetLine)}),!0}return logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1}}catch(error){return throwError_throwError(error,"SteamASF.addLicense"),!1}}async requestPlayTestAccess(id){try{const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REQUESTACCESS ${this.#botName} `+id})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}};const social_Steam=class extends discordAuth{tasks;whiteList;#cache={group:{},officialGroup:{},forum:{},workshop:{},curator:{},...GM_getValue("steamCache")};#auth={};#storeInitialized=!1;#communityInitialized=!1;#area="CN";#areaStatus="end";#ASF;constructor(){super();var defaultTasksTemplate={groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.steam||{}}}async init(type="all"){try{if(globalOptions.ASF.AsfEnabled&&globalOptions.ASF.AsfIpcUrl&&globalOptions.ASF.AsfIpcPassword)return this.#ASF=new social_SteamASF,!!await this.#ASF.init()&&(this.#storeInitialized=!0,this.#communityInitialized=!0);if("store"===type){if(this.#storeInitialized)return!0;let storeInitialized=await this.#updateStoreAuth();return(storeInitialized=storeInitialized||await this.#updateStoreAuthTab(),this.#storeInitialized=storeInitialized,this.#storeInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamStore")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}if("community"!==type)return this.#storeInitialized&&this.#communityInitialized?(scripts_echoLog({}).success(i18n("initSuccess","Steam")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1);{if(this.#communityInitialized)return!0;let communityInitialized=await this.#getUserLink();return(communityInitialized=communityInitialized||await this.#updateCommunityAuthTab(),this.#communityInitialized=communityInitialized,this.#communityInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamCommunity")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}}catch(error){return throwError_throwError(error,"Steam.init"),!1}}async#refreshToken(type="steamStore"){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n(type))}),formData=new FormData;formData.append("redir",`https://${host[type]}/`);var{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://"+host[type],Referer:`https://${host[type]}/`},data:formData});return"Success"===result?data?.response?.success?await this.#setStoreToken(data.response,type)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshToken"),!1}}async#setStoreToken(param,type){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("settingToken",i18n(type))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:`https://${host[type]}/login/settoken`,method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:host[type],Origin:"https://"+host[type]},data:formData});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async#updateStoreAuth(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200!==data?.status)return[301,302].includes(data?.status)?await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):(logStatus.error(result+`:${statusText}(${status})`),!1);if(!data.responseText.includes("data-miniprofile="))return await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1);var storeSessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(this.#auth.storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async#updateStoreAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))});return await new Promise(resolve=>{const newTab=window.open("https://store.steampowered.com/","mozillaWindow","pop=1;");GM_setValue("steamStoreAuth","update");const listenerId=GM_addValueChangeListener("steamStoreAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.storeSessionID=newValue.storeSessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateStoreAuthTab"),!1}}async#updateCommunityAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))});return await new Promise(resolve=>{const newTab=window.open("https://steamcommunity.com/my","mozillaWindow","pop=1;");GM_setValue("steamCommunityAuth","update");const listenerId=GM_addValueChangeListener("steamCommunityAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.steam64Id=newValue.steam64Id,this.#auth.userName=newValue.userName,this.#auth.communitySessionID=newValue.communitySessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuthTab"),!1}}async#getUserLink(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("gettingUserLink")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200===data?.status){if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}if(302===data?.status)return!await this.#refreshToken("steamCommunity")||retry?(logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1):(logStatus.warning(i18n("retry")),this.#getUserLink(!0));const location=data?.responseHeaders?.split("\n")?.find(header=>header.includes("location")?header.replace("loctation:","").trim():null);return 301===data?.status&&location?.includes("steamcommunity.com/id")?(logStatus.success(),await this.#updateCommunityAuth(data.finalUrl)):(301===data?.status&&location?.includes("https://steamcommunity.com/login/home")?logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0):logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#updateCommunityAuth(url){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#getAreaInfo(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{var cartConfigRaw=data.responseText.match(/data-cart_config="(.*?)"/)?.[1];const temp=document.createElement("div");temp.innerHTML=cartConfigRaw||"{}";var cartConfigStr=temp.textContent||temp.innerText;let cartConfig;try{cartConfig=JSON.parse(cartConfigStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}if(!cartConfig.rgUserCountryOptions)return logStatus.warning("Warning: Area cannot be changed"),{};var userInfoRaw=data.responseText.match(/data-userinfo="(.*?)"/)?.[1];const temp1=document.createElement("div");temp1.innerHTML=userInfoRaw||"{}";var userInfoStr=temp1.textContent||temp1.innerText;let userInfo;try{userInfo=JSON.parse(userInfoStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}var currentArea=userInfo.country_code,areas=Object.keys(cartConfig.rgUserCountryOptions).filter(area=>"help"!==area);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==this.#areaStatus&&(clearInterval(checker),resolve(!0))})}),this.#area===area||!area&&"CN"!==this.#area)return!0;this.#areaStatus="waiting";let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await this.#getAreaInfo();if(!currentArea||!areas)return!(this.#areaStatus="error");if("CN"!==currentArea)return this.#areaStatus="skip",scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return this.#areaStatus="noAnotherArea",scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/country/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:this.#auth.storeSessionID})});if("Success"!==result)return this.#areaStatus="error",logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==data?.status||"true"!==data.responseText)return this.#areaStatus="error",logStatus.error(`Error:${data?.statusText}(${data?.status})`),"CN";var currentArea=(await this.#getAreaInfo())["currentArea"];return currentArea===aimedArea?(this.#areaStatus="success",logStatus.success(),currentArea):(this.#areaStatus="error",logStatus.error("Error: change country filed"),"CN")}catch(error){return this.#areaStatus="error",throwError_throwError(error,"Steam.changeArea"),!1}}async#joinGroup(groupName){try{if(this.#ASF)return!!await this.#ASF.joinGroup(groupName)&&(this.tasks.groups=unique([...this.tasks.groups,groupName]),!0);const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async#leaveGroup(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(groupName);var groupId=await this.#getGroupId(groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===data?.status&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async#getGroupId(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var groupId=this.#cache.group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)?.[1];return groupId?(this.#setCache("group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#joinOfficialGroup(gameId){try{if(this.#ASF)return!!await this.#ASF.joinGroup(gameId)&&(this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]),!0);const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+this.#auth.communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId&&this.#setCache("officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async#leaveOfficialGroup(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(gameId);var groupId=await this.#getOfficialGroupId(gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===dataR?.status&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async#getOfficialGroupId(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var groupId=this.#cache.officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId?(this.#setCache("officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#addToWishlist(gameId){try{if(this.#ASF)return!!await this.#ASF.addToWishlist(gameId)&&(this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0);const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===dataR?.status?"CN"===this.#area&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#addToWishlist(gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async#removeFromWishlist(gameId){try{if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;if(this.#ASF)return await this.#ASF.removeFromWishlist(gameId);const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==dataR?.status)return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1;if("CN"===this.#area&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#removeFromWishlist(gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async#toggleFollowGame(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;if(this.#ASF)return!!await this.#ASF.toggleFollowGame(gameId,doTask)&&(doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0);const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:this.#auth.storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===data?.status&&"true"===data.responseText)return logStatus.success(),!0;var followed=await this.#isFollowedGame(gameId);return"CN"===this.#area&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#removeFromWishlist(gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async#isFollowedGame(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===data?.status&&("CN"===this.#area&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async#toggleForum(gameId,doTask=!0){try{if(!doTask&&this.whiteList.forums.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unsubscribeForum",id:gameId}),!0;const forumId=await this.#getForumId(gameId);if(!forumId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}subscribingForum`,text:gameId});var[id,feature]=forumId.split("_"),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/forum/${id}/General/${doTask?"":"un"}subscribe/${feature||"0"}/`,method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.communitySessionID})});return"Success"===result?(200!==data?.status||1!==data.response?.success&&29!==data.response?.success?logStatus.error(`Error:${data?.statusText}(${data?.status})`):(doTask&&(this.tasks.forums=unique([...this.tasks.forums,gameId])),logStatus.success()),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.toggleForum"),!0}}async#getForumId(gameId){try{const logStatus=scripts_echoLog({type:"gettingForumId",text:gameId});var forumId=this.#cache.forum[gameId];if(forumId)return logStatus.success(),forumId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/app/${gameId}/discussions/`,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const forumId=data.responseText?.match(/General_([\d]+(_[\d]+)?)/)?.[1];return forumId?(this.#setCache("forum",gameId,forumId),logStatus.success(),forumId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getForumId"),!1}}async#toggleFavoriteWorkshop(id,doTask=!0){try{if(!doTask&&this.whiteList.workshops.includes(id))return scripts_echoLog({type:"whiteList",text:"Steam.unfavoriteWorkshop",id:id}),!0;var appid=await this.#getWorkshopAppId(id);if(!appid)return!1;const logStatus=scripts_echoLog({type:doTask?"favoritingWorkshop":"unfavoritingWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/sharedfiles/${doTask?"":"un"}favorite`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,appid:appid,sessionid:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(doTask&&(this.tasks.workshops=unique([...this.tasks.workshops,id])),logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFavoriteWorkshop"),!1}}async#getWorkshopAppId(id){try{const logStatus=scripts_echoLog({type:"gettingWorkshopAppId",text:id});var appId=this.#cache.workshop[id];if(appId)return logStatus.success(),appId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/filedetails/?id="+id,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const appId=data.responseText.match(//)?.[1];return appId?(this.#setCache("workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async#voteUpWorkshop(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:this.#auth.communitySessionID})});return"Success"===result?(200===data?.status&&1===data.response?.success?logStatus.success():logStatus.error(`Error:${data?.statusText}(${data?.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async#toggleCurator(curatorId,doTask=!0){try{if(!doTask&&this.whiteList.curators.includes(curatorId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowCurator",id:curatorId}),!0;if(this.#ASF)return await this.#ASF.toggleCurator(curatorId,doTask);const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/curators/ajaxfollow",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({clanid:curatorId,sessionid:this.#auth.storeSessionID,follow:doTask}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response?.success?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(`+data?.response?.success||data?.status+")"),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async getCuratorId(path,name){try{const logStatus=scripts_echoLog({type:"gettingCuratorId",text:path+"/"+name});var curatorId=this.#cache.curator[path+"/"+name];if(curatorId)return logStatus.success(),curatorId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/${path}/`+name,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const curatorId=data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)?.[1];return curatorId?(this.#setCache("curator",path+"/"+name,curatorId),logStatus.success(),curatorId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getCuratorID"),!1}}async#toggleCuratorLike(link,doTask=!0){try{var[path,name]=link.split("/");if(!path||!name)return scripts_echoLog({text:i18n("errorLink",link)}),!1;var curatorId=await this.getCuratorId(path,name);return curatorId?await this.#toggleCurator(curatorId,doTask):!1}catch(error){return throwError_throwError(error,"Steam.toggleCuratorLike"),!1}}async#getAnnouncementParams(appId,viewId){try{const logStatus=scripts_echoLog({type:"gettingAnnouncementParams",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/events/ajaxgetpartnerevent?appid=${appId}&announcement_gid=${viewId}&lang_list=6_0&last_modified_time=0&origin=https:%2F%2Fstore.steampowered.com&for_edit=false`,method:"GET",responseType:"json",headers:{Host:"store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status||1!==data?.response?.success)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};var{clanid,gid}=data.response.event?.announcement_body||{};return clanid?(logStatus.success(),{clanId:clanid,gid:gid}):(logStatus.error(`Error:${data.statusText}(${data.status})`),{})}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),{}}}async#likeAnnouncement(id){try{var[appId,viewId]=id.split("/");if(!appId||!viewId)return scripts_echoLog({}).error(i18n("missParams")+"(id)"),!1;var{clanId,gid}=await this.#getAnnouncementParams(appId,viewId);if(!clanId)return!1;const logStatus=scripts_echoLog({type:"likingAnnouncement",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/updated/ajaxrateupdate/"+(gid||viewId),method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId},data:$.param({sessionid:this.#auth.storeSessionID,voteup:1,clanid:clanId,ajax:1}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),!1}}async#appid2subid(id){try{const logStatus=scripts_echoLog({type:"gettingSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+id,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#appid2subid(id):!1}var subid=data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];return subid?(logStatus.success(),subid):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.appid2subid"),!1}}async#getLicenses(){try{const logStatus=scripts_echoLog({text:i18n("gettingLicenses")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/dynamicstore/userdata/?t="+(new Date).getTime(),method:"GET",responseType:"json"});return"Success"===result?200===data?.status?(logStatus.success(),data.response?.rgOwnedPackages):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.getLicenses"),!1}}async#addLicense(id){try{if(this.#ASF)return await this.#ASF.addLicense(id);const[type,ids]=id.split("-");if("appid"===type){var subid=await this.#appid2subid(ids);if(!subid)return!1;const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids});if(!await this.#addFreeLicense(subid,logStatus))return!1;const{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+ids,method:"GET"});return"Success"===result?200===data?.status?data.responseText.includes("ds_owned_flag ds_flag")||data.responseText.includes('class="already_in_library"')?(logStatus.success(),!0):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{"CN"===this.#area&&(scripts_echoLog({}).success(i18n("tryChangeAreaNotice")),await this.#changeArea());const logStatusArr={};var idsArr=ids.split(",");for(const subid of idsArr){var logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:subid});if(!await this.#addFreeLicense(subid,logStatus))return!1;logStatusArr[subid]=logStatus}const licenses=await this.#getLicenses();if(!licenses)return!1;for(const subid of idsArr)licenses.includes(parseInt(subid,10))?logStatusArr[subid].success():logStatusArr[subid].error();return!0}}catch(error){return throwError_throwError(error,"Steam.addLicense"),!1}}async#addFreeLicense(id,logStatusPre){try{const logStatus=logStatusPre||scripts_echoLog({type:"addingFreeLicenseSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:this.#auth.storeSessionID,subid:id}),dataType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result?await this.#addFreeLicense(id):!1}return logStatus.success(),!0}catch(error){return throwError_throwError(error,"Steam.addFreeLicense"),!1}}async#requestPlayTestAccess(id){try{if(this.#ASF)return await this.#ASF.requestPlayTestAccess(id);const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+id,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+id},data:$.param({sessionid:this.#auth.storeSessionID}),dataType:"json"});return"Success"===result?200===data?.status&&1===data?.response?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}async toggle({doTask=!0,groupLinks=[],officialGroupLinks=[],wishlistLinks=[],followLinks=[],forumLinks=[],workshopLinks=[],workshopVoteLinks=[],curatorLinks=[],curatorLikeLinks=[],announcementLinks=[],licenseLinks=[],playtestLinks=[]}){try{if(0<[...groupLinks,...officialGroupLinks,...forumLinks,...workshopLinks,...workshopVoteLinks].length&&!this.#communityInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;if(0<[...wishlistLinks,...followLinks,...curatorLinks,...curatorLikeLinks,...announcementLinks,...licenseLinks,...playtestLinks].length&&!this.#storeInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.steam.groups||!doTask&&!globalOptions.undoTask.steam.groups)scripts_echoLog({type:"globalOptionsSkip",text:"steam.groups"});else{var realGroups=this.getRealParams("groups",groupLinks,doTask,link=>link.match(/groups\/(.+)\/?/)?.[1]);if(0link.match(/games\/(.+)\/?/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(doTask&&0link.match(/curator\/([\d]+)/)?.[1]),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,link=>link.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/)?.slice(1,3).join("/"));if(0(link.includes("store.steampowered.com")?link.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/):link.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))?.slice(1,3).join("/"));if(doTask&&0link.match(/app\/([\d]+)/)?.[1]);if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==this.#area&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await this.#changeArea("CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}#setCache(type,name,id){try{this.#cache[type][name]=id,GM_setValue("steamCache",this.#cache)}catch(error){throwError_throwError(error,"Steam.setCache")}}};const Giveawaysu=class{undoneTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};giveawayId;socialInitialized={discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0};initialized=!1;social={};static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{this.#checkLogin()||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await this.#checkLeftKey()||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!this.#getGiveawayId()&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async#classifyTask(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError_throwError(error,"getRedirectLink"),null}})(taskDes.attr("href")).then(taskLink=>taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.#uniqueTasks(this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}#checkLogin(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async#checkLeftKey(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(({value})=>{value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}#getGiveawayId(){var giveawayId=window.location.href.match(/\/view\/([\d]+)/)?.[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async#bind(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async#initSocial(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(this.#bind("discord",this.social.discord.init("do")))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(this.#bind("instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(this.#bind("reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(this.#bind("twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(this.#bind("vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(this.#bind("youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&tasks.steam?.[type]?.length||0).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(this.#bind("steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}#uniqueTasks(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async#toggleTask(){try{if(!this.initialized&&!this.init())return!1;if(!await this.#classifyTask())return!1;if(!await this.#initSocial())return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await this.#toggleTask()}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};discordAuth=__webpack_require__(225);if(window.STYLE=GM_addStyle(discordAuth.Z+GM_getResourceText("style")),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{var authToken;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(authToken=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientId:commonOptions?.headers?.["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"x.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${text?.replace("u_","")}]...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError_throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError_throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)});const defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};discordAuth=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError_throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,discordAuth);const languages={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",refreshingToken:"正在刷新%0凭证...",settingToken:"正在设置%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",debug:"输出调试日志,不要开启此选项!",receivePreview:"接收预览版更新",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",updateText:"%0 版本更新内容:",Active:"进行中",Ended:"已结束",Banned:"已封禁",Paused:"已暂停",notStart:"未开始",noRemoteData:"检测到远程无数据",errorRemoteDataFormat:"远程数据格式错误",updateHistory:'历史更新记录点此查看',AsfEnabled:'使用ASF做Steam相关任务(需ASFEnhance插件)',AsfIpcUrl:"ASF IPC 地址",AsfIpcPassword:"ASF IPC 密码",versionNotMatched:"脚本管理器版本过低,需TamperMonkey >= 5.2.0或TamperMonkey Beta >= 5.2.6196",groups:"组",officialGroups:"官方组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",licenses:"入库免费游戏",playtests:"请求访问权限",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",joiningSteamOfficialGroup:"正在加入Steam官方组",leavingSteamOfficialGroup:"正在退出Steam官方组",gettingSteamOfficialGroupId:"正在获取Steam官方组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",gettingCuratorId:"正在获取Steam鉴赏家Id",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",gettingSubid:"正在获取游戏subid",addingFreeLicense:"正在入库",missParams:"缺少参数",gettingLicenses:"正在获取Licenses...",requestingPlayTestAccess:"正在请求访问权限",tryChangeAreaNotice:"此功能无法检测游戏是否限区,因此会尝试换区后再入库,换区失败也不影响后续入库",gettingUserLink:"正在获取Steam用户社区链接...",retry:"重试",initingASF:"正在初始化ASF...",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",getDiscordAuthFailed:"获取Discord凭证失败,请检测Discord帐号是否已登录",discordImportantNotice:"重要提醒!!!",discordImportantNoticeText:"由于Discord网站后台更新,目前使用此脚本加组后可能会导致Discord帐号被强制退出,且需要两步验证才能正常登录,请谨慎使用!!!",continue:"继续",skipDiscordTask:"跳过Discord任务",continueAndDontRemindAgain:"继续且不再提醒",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",checkingTwitchIntegrity:"正在检查Twitch完整性...",twitterUser:"推特用户",retweets:"转推",gettingTwitterUserId:"正在获取推特用户Id",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",campaign:"检测到人机验证,请完成验证后重新验证任务!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',giveeClubVerifyNotice:"正在验证任务...",giveeClubVerifyFinished:"请等待验证完成后自行加入赠Key",doingKeyhubTask:"正在做Keyhub任务...",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告...",tasksNotCompleted:"任务未完成",confirmingTask:"正在跳过警告页面..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (banned/ended/paused/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.
    If you don't want to follow the official account, you can change it to your own account.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.
    If you don't want to follow the official channel, you can change it to your own channel.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed.
    standby: Standby source.
    auto: Try to update using github, jsdelivr, standby sources in turn.",saveGlobalOptions:"SaveSettings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",debug:"Output debug log, do not enable this option!",receivePreview:"Receive preview updates",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"TasksHistory",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"DataSync",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",updateText:"Updates in version %0:",Active:"Active",Ended:"Ended",Banned:"Banned",Paused:"Paused",notStart:"notStart",noRemoteData:"No data remotely",errorRemoteDataFormat:"Remote data has wrong format",updateHistory:'Click here to view the historical update record.',AsfEnabled:'Use ASF to do Steam related tasks (requires ASFEnhance plugin)',AsfIpcUrl:"ASF IPC URL",AsfIpcPassword:"ASF IPC Password",groups:"Group",officialGroups:"Official Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",licenses:"Add License",playtests:"Playtest Access",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",joiningSteamOfficialGroup:"Joining Steam Official Group",leavingSteamOfficialGroup:"Leaving Steam Official Group",gettingSteamOfficialGroupId:"Getting Steam Official Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",gettingCuratorId:"Getting Steam Curator Id",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",gettingSubid:"Getting subid",addingFreeLicense:"Adding free license",missParams:"Missing parameters",gettingLicenses:"Getting licenses...",requestingPlayTestAccess:"Requesting play test access",tryChangeAreaNotice:"This function cannot detect whether the game is limited, so it will try to change the area before entering the library. Failure to change the area will not affect the subsequent storage.",versionNotMatched:"The script manager version is too low, requiring TamperMonkey >= 5.2.0 or TamperMonkey Beta >= 5.2.6196",gettingUserLink:"Getting steam user community link...",retry:"Retry",initingASF:"Initing ASF...",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",getDiscordAuthFailed:"Failed to get Discord token, please check whether the Discord account is logged in",discordImportantNotice:"Important Reminder! ! !",discordImportantNoticeText:"Due to the background update of the Discord website, currently using this script to join a group may cause the Discord account to be forcibly logged out, and two-step verification is required to log in normally, please use it with caution! ! !",continue:"Continue",skipDiscordTask:"Skip",continueAndDontRemindAgain:"Continue without Reminders",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",checkingTwitchIntegrity:"Checking Twitch integrity...",twitterUser:"Twitter User",retweets:"Retweet",gettingTwitterUserId:"Getting Twitter User Id",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweetting",unretweetting:"Unretweetting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",campaign:"ReCAPTCHA detected, please complete it and re-verify the tasks!",gsNotice:'In order to avoid getting the "0000-0000-0000" key, the "Grab Key" button has been hidden, please close the script when obtaining the key!',giveeClubVerifyNotice:"Verifying task...",giveeClubVerifyFinished:"Wait for the verification to complete and join it by yourself",doingKeyhubTask:"Doing Keyhub Task...",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning...",tasksNotCompleted:"Tasks Not Completed",confirmingTask:"Confirming task..."}},language=["zh","en"].includes(globalOptions.other.language)?globalOptions.other.language:"en";const i18n=(key,...argvs)=>languages[language]?.[key]?languages[language][key].replace(/%([\d]+)/g,(match,index)=>argvs[parseInt(index,10)]):key;discordAuth=class{tasks;getRealParams(name,links,doTask,link2param){try{let realParams=[];return 0link2param(link)).filter(link=>link)]),!doTask&&0!!isConfirmed||!!isDenied&&(GM_setValue("dontRemindDiscordAgain",!0),!0)))return this.#initialized=!1,"skip";return GM_getValue("dontRemindDiscordAgain")||"do"===action&&!globalOptions.doTask.discord.servers||"undo"===action&&!globalOptions.undoTask.discord.servers?(this.#initialized=!1,"skip"):!!this.#initialized||(this.#auth.auth?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(GM_setValue("discordAuth",{auth:null}),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Discord")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Discord")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0))}catch(error){return throwError_throwError(error,"Discord.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Discord")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v6/users/@me",method:"HEAD",headers:{authorization:this.#auth.auth}});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Discord")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("discordAuth")?.auth;auth?(this.#auth={auth:auth},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error("Error: Update discord auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Discord.updateAuth"),!1}}async#joinServer(inviteId){try{const logStatus=scripts_echoLog({type:"joiningDiscordServer",text:inviteId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,method:"POST",dataType:"json",headers:{authorization:this.#auth.auth,origin:"https://discord.com",referer:"https://discord.com/invite/"+inviteId}});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;logStatus.success();var guild=String(data.response?.guild?.id);return guild&&(this.#setCache(inviteId,guild),this.tasks.servers=unique([...this.tasks.servers,inviteId])),!0}catch(error){return throwError_throwError(error,"Discord.joinServer"),!1}}async#leaveServer(inviteId){try{if(this.whiteList.servers.includes(inviteId))return scripts_echoLog({type:"whiteList",text:"Discord.leaveServer",id:inviteId}),!0;var guild=await this.#getGuild(inviteId);if(!guild)return!1;const logStatus=scripts_echoLog({type:"leavingDiscordServer",text:guild});var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/users/@me/guilds/"+guild,method:"DELETE",headers:{authorization:this.#auth.auth}});return"Success"===result&&204===data?.status?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Discord.leaveServer"),!1}}async#getGuild(inviteId){try{const logStatus=scripts_echoLog({type:"gettingDiscordGuild",text:inviteId});var guild=this.#cache[inviteId];if(guild)return logStatus.success(),guild;var{result,statusText,status,data}=await tools_httpRequest({url:"https://discord.com/api/v9/invites/"+inviteId,responseType:"json",method:"GET"});if("Success"!==result||200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;{const guild=data.response?.guild?.id;return guild?(logStatus.success(),this.#setCache(inviteId,guild),guild):(logStatus.error(result+`:${statusText}(${status})`),!1)}}catch(error){return throwError_throwError(error,"Discord.getGuild"),!1}}async toggle({doTask=!0,serverLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.discord.servers||!doTask&&!globalOptions.undoTask.discord.servers)scripts_echoLog({type:"globalOptionsSkip",text:"discord.servers"});else{var realServers=this.getRealParams("servers",serverLinks,doTask,link=>link.match(/invite\/(.+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Discord.toggleServers"),!1}}#setCache(inviteId,guild){try{this.#cache[inviteId]=guild,GM_setValue("discordCache",this.#cache)}catch(error){throwError_throwError(error,"Discord.setCache")}}};const social_Instagram=class extends discordAuth{tasks;whiteList;#cache=GM_getValue("instagramCache")||{};#auth={};#initialized=!1;constructor(){super();var defaultTasksTemplate={users:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.instagram||{}}}async init(){try{return this.#initialized?!0:await this.#getUserInfo()?(scripts_echoLog({}).success(i18n("initSuccess","Instagram")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Instagram")),!1)}catch(error){return throwError_throwError(error,"Instagram.init"),!1}}async#getUserInfo(name="instagram"){try{const logStatus=scripts_echoLog({type:"instagram"===name?"verifyingInsAuth":"gettingInsUserId",text:name});var userId=this.#cache[name];if(userId&&"instagram"!==name)return logStatus.success(),userId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/${name}/`,method:"GET"});if("Success"!==result)return!1;if(data?.finalUrl.includes("accounts/login"))return logStatus.error("Error:"+i18n("loginIns"),!0),!1;if(data?.finalUrl.includes("www.instagram.com/challenge"))return logStatus.error("Error:"+i18n("insBanned")),!1;if(200!==data?.status)return logStatus.error(result+`:${statusText}(${status})`),!1;var csrftoken=data.responseText.match(/"csrf_token":"(.+?)"/)?.[1],hash=data.responseText.match(/"rollout_hash":"(.+?)"/)?.[1];if("instagram"===name)return!(!csrftoken||!hash)&&(this.#auth={csrftoken:csrftoken,hash:hash},!0);var id=data.responseText.match(/"profilePage_([\d]+?)"/)?.[1];return id?(this.#setCache(name,id),logStatus.success(),id):(logStatus.error("Error: Get ins data error!"),!1)}catch(error){return throwError_throwError(error,"Instagram.getUserInfo"),!1}}async#followUser(name){try{var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"followingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/follow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"following"===data.response?.result?(logStatus.success(),this.tasks.users=unique([...this.tasks.users,name]),!0):(logStatus.error("Error:"+(data?.response?.feedback_message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.followUser"),!1}}async#unfollowUser(name){try{if(this.whiteList.users.includes(name))return scripts_echoLog({type:"whiteList",text:"Instagram.unfollowUser",id:name}),!0;var id=await this.#getUserInfo(name);if(!id)return!1;const logStatus=scripts_echoLog({type:"unfollowingIns",text:name});var{result,statusText,status,data}=await tools_httpRequest({url:`https://www.instagram.com/web/friendships/${id}/unfollow/`,method:"POST",dataType:"json",headers:{"x-csrftoken":this.#auth.csrftoken,origin:"https://www.instagram.com",referer:`https://www.instagram.com/${name}/`,"content-type":"application/x-www-form-urlencoded","sec-fetch-site":"same-origin","x-instagram-ajax":this.#auth.hash}});return"Success"===result?200===data?.status&&"ok"===data.response?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Instagram.unfollowUser"),!1}}async toggle({doTask=!0,userLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.instagram.users||!doTask&&!globalOptions.undoTask.instagram.users)scripts_echoLog({type:"globalOptionsSkip",text:"instagram.users"});else{var realUsers=this.getRealParams("users",userLinks,doTask,link=>link.match(/https:\/\/www\.instagram\.com\/(.+)?\//)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Instagram.toggleUsers"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("instagramCache",this.#cache)}catch(error){throwError_throwError(error,"Instagram.setCache")}}};const social_Reddit=class extends discordAuth{tasks;whiteList;#auth;#initialized=!1;constructor(){super();var defaultTasksTemplate={reddits:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.reddit||{}}}async init(){try{return this.#initialized?!0:await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Reddit")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Reddit")),!1)}catch(error){return throwError_throwError(error,"Reddit.init"),!1}}async#useBeta(){try{const logStatus=scripts_echoLog({text:i18n("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(resolve=>{const newTab=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{logStatus.success(),resolve(await this.#updateAuth(!0))}})}catch(error){return throwError_throwError(error,"Reddit.useBeta"),!1}}async#updateAuth(beta=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Reddit")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://www.reddit.com/",method:"GET",nochche:!0,headers:{"Cache-Control":"no-cache"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(data?.responseText.includes("www.reddit.com/login/"))return logStatus.error("Error:"+i18n("loginReddit"),!0),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.responseText.includes("redesign-beta-optin-btn")&&!beta)return await this.#useBeta();var accessToken=data.responseText.match(/"accessToken":"(.*?)","expires":"(.*?)"/)?.[1];return accessToken?(this.#auth={token:accessToken},logStatus.success(),!0):(logStatus.error('Error: Parameter "accessToken" not found!'),!1)}catch(error){return throwError_throwError(error,"Reddit.updateAuth"),!1}}async toggleTask({name,doTask=!0}){try{if(!doTask&&this.whiteList.reddits.includes(name))return scripts_echoLog({type:"whiteList",text:"Reddit.undoTask",id:name}),!0;let type=doTask?"joiningReddit":"leavingReddit";/^u_/.test(name)&&(type=doTask?"followingRedditUser":"unfollowingRedditUser");const logStatus=scripts_echoLog({type:type,text:name});var{result,statusText,status,data}=await tools_httpRequest({url:"https://oauth.reddit.com/api/subscribe?redditWebClient=desktop2x&app=desktop2x-client-production&raw_json=1&gilding_detail=1",method:"POST",headers:{authorization:"Bearer "+this.#auth.token,"content-type":"application/x-www-form-urlencoded"},data:$.param({action:doTask?"sub":"unsub",sr_name:name,api_type:"json"})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.reddits=unique([...this.tasks.reddits,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Reddit.toggleTask"),!1}}async toggle({doTask=!0,redditLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.reddit.reddits||!doTask&&!globalOptions.undoTask.reddit.reddits)scripts_echoLog({type:"globalOptionsSkip",text:"reddit.reddits"});else{var realReddits=this.getRealParams("reddits",redditLinks,doTask,userName=>{var name=userName.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/)?.[1],userName=userName.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/)?.[1];return userName?name||userName:name});if(0!0)}catch(error){return throwError_throwError(error,"Reddit.toggle"),!1}}};const social_Twitch=class extends discordAuth{tasks;whiteList;#auth=GM_getValue("twitchAuth")||{};#cache=GM_getValue("twitchCache")||{};#initialized=!1;#integrityToken;constructor(){super();var defaultTasksTemplate={channels:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.twitch||{}}}async init(){try{return this.#initialized?!0:this.#auth.authToken&&this.#auth.clientId&&this.#auth.clientVersion&&this.#auth.deviceId&&this.#auth.clientSessionId?await this.#verifyAuth(!0)?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(GM_setValue("twitchAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Twitch")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Twitch")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Twitch.init"),!1}}async#verifyAuth(isFirst){try{const logStatus=scripts_echoLog({text:i18n("verifyingAuth","Twitch")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===result?200===data?.status&&data.response?.[0]?.data?.currentUser?(await this.#integrity(isFirst),logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.verifyAuth"),!1}}async#integrity(isFirst=!0,ct=""){try{const logStatus=scripts_echoLog({text:i18n("checkingTwitchIntegrity")});if(isFirst&&(!this.#auth.authToken||!this.#auth.clientId||!this.#auth.clientVersion||!this.#auth.deviceId||!this.#auth.clientSessionId))return await this.#updateAuth(!1);var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/integrity",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"x-kpsdk-ct":ct}});return"Success"===result?!ct&&data?.responseHeaders?.["x-kpsdk-ct"]?await this.#integrity(isFirst,data.responseHeaders["x-kpsdk-ct"]):200===data?.status&&data.response?.token?(this.#integrityToken=data.response.token,logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.integrity"),!1}}async#updateAuth(isFirst=!0){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Twitch")});return await new Promise(resolve=>{const newTab=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});newTab.onclose=async()=>{var auth=GM_getValue("twitchAuth");auth?(this.#auth=auth,logStatus.success(),resolve(await this.#verifyAuth(isFirst))):(logStatus.error("Error: Update twitch auth failed!"),resolve(!1))}})}catch(error){return throwError_throwError(error,"Twitch.updateAuth"),!1}}async#toggleChannel({name,doTask=!0}){try{if(!doTask&&this.whiteList.channels.includes(name))return scripts_echoLog({type:"whiteList",text:"Twitch.unfollowChannel",id:name}),!0;var channelId=await this.#getChannelId(name);if(!channelId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingTwitchChannel`,text:name});var followData='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+channelId+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"800e7346bdf7e5278a3c1d3f21b2b56e2639928f86815677a7126b093b2fdd08"}}}]',unfollowData=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${channelId}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"f7dae976ebf41c755ae2d758546bfd176b4eeb856656098bb40e0a672ca0d880"}}}]',{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",anonymous:!0,headers:{Origin:"https://www.twitch.tv",Referer:"https://www.twitch.tv/",Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId,"Client-Version":this.#auth.clientVersion,"X-Device-Id":this.#auth.deviceId,"Client-Session-Id":this.#auth.clientSessionId,"Client-Integrity":this.#integrityToken},data:doTask?followData:unfollowData});return"Success"===result?200===data?.status&&data.response?.[0]&&!data.response[0].errors?(logStatus.success(),doTask&&(this.tasks.channels=unique([...this.tasks.channels,name])),!0):(logStatus.error("Error:"+(data?.response?.[0].errors?.[0]?.message||data?.statusText+`(${data?.status})`)),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Twitch.toggleChannel"),!1}}async#getChannelId(name){try{const logStatus=scripts_echoLog({type:"gettingTwitchChannelId",text:name});var channelId=this.#cache[name];if(channelId)return logStatus.success(),channelId;var{result,statusText,status,data}=await tools_httpRequest({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+this.#auth.authToken,"Client-Id":this.#auth.clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${name}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const channelId=data.response?.[0]?.data?.user?.id;return channelId?(this.#setCache(name,String(channelId)),logStatus.success(),channelId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Twitch.getChannelId"),!1}}async toggle({doTask=!0,channelLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.twitch.channels||!doTask&&!globalOptions.undoTask.twitch.channels)scripts_echoLog({type:"globalOptionsSkip",text:"twitch.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>link.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/)?.[2]);if(0!0)}catch(error){return throwError_throwError(error,"Twitch.toggle"),!1}}#setCache(name,id){try{this.#cache[name]=id,GM_setValue("twitchCache",this.#cache)}catch(error){throwError_throwError(error,"Twitch.setCache")}}};const social_Vk=class extends discordAuth{tasks;whiteList;#username="";#cache=GM_getValue("vkCache")||{};#initialized=!1;constructor(){super();var defaultTasksTemplate={names:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.vk||{}}}async init(){try{return this.#initialized?!0:await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Vk")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Vk")),!1)}catch(error){return throwError_throwError(error,"Vk.init"),!1}}async#verifyAuth(){try{const logStatus=scripts_echoLog({text:i18n("verifyAuth","Vk")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/im",method:"GET"});return"Success"===result?data?.finalUrl.includes("vk.com/login")?(logStatus.error("Error:"+i18n("loginVk"),!0),!1):200===data?.status?(this.#username=data.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/)?.[1]||"",logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.verifyAuth"),!1}}async#toggleGroup(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkGroup":"leavingVkGroup",text:name});if("enter"===dataParam.groupAct&&!doTask||"leave"===dataParam.groupAct&&doTask)return logStatus.success(),!0;const reqData={act:doTask?"enter":"leave",al:1,gid:dataParam.groupId,hash:dataParam.groupHash};doTask&&(reqData.context="_");var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_groups.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param(reqData)});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.toggleGroup"),!1}}async#togglePublic(name,dataParam,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"joiningVkPublic":"leavingVkPublic",text:name});if(dataParam.publicJoined&&doTask||!dataParam.publicJoined&&!doTask)return logStatus.success(),!0;var{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_public.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:doTask?"a_enter":"a_leave",al:1,pid:dataParam.publicPid,hash:dataParam.publicHash})});return"Success"===result?200===data?.status?(logStatus.success(),doTask&&(this.tasks.names=unique([...this.tasks.names,name])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.togglePublic"),!1}}async#sendWall(name){try{const logStatus=scripts_echoLog({type:"sendingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"publish_box",al:1,object:name})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var hash=data.responseText.match(/shHash:[\s]*'(.*?)'/)?.[1];if(hash){const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://vk.com/like.php",method:"POST",headers:{origin:"https://vk.com",referer:"https://vk.com/"+name,"content-type":"application/x-www-form-urlencoded"},data:$.param({Message:"",act:"a_do_publish",al:1,close_comments:0,friends_only:0,from:"box",hash:hash,list:"",mark_as_ads:0,mute_notifications:0,object:name,ret_data:1,to:0})});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200===dataR?.status){var jsonData=JSON.parse(dataR.responseText?.replace("\x3c!--","")||"{}");if(!0===jsonData?.payload?.[1]?.[1]?.share_my){logStatus.success();var postId=String(jsonData?.payload?.[1]?.[1]?.post_id),ownerId=String(jsonData?.payload?.[1]?.[1]?.owner_id);return postId&&ownerId&&this.#setCache(name,ownerId+"_"+postId),this.tasks.names=unique([...this.tasks.names,name]),!0}}return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1}return logStatus.error('Error: Get "hash" failed'),!1}catch(error){return throwError_throwError(error,"Vk.sendWall"),!1}}async#deleteWall(name,dataParams){try{const logStatus=scripts_echoLog({type:"deletingVkWall",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:"https://vk.com/al_wall.php?act=delete",method:"POST",headers:{origin:"https://vk.com",referer:`https://vk.com/${this.#username}?w=wall${this.#cache[name]}%2Fall`,"content-type":"application/x-www-form-urlencoded"},data:$.param({act:"delete",al:1,confirm:0,from:"wkview",hash:dataParams.wallHash,post:this.#cache[name]})});return"Success"===result?200===data?.status&&JSON.parse(data.responseText?.replace("\x3c!--","")||"{}")?.payload?.[1]?.[1]?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Vk.deleteWall"),!1}}async#getId(name,doTask){try{let url="https://vk.com/"+name;if(/^wall-/.test(name)){if(doTask)return{type:"sendWall"};if(!this.#cache[name])return{type:"unSupport"};url=`https://vk.com/${this.#username}?w=wall`+this.#cache[name]}const logStatus=scripts_echoLog({type:"gettingVkId",text:name}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;var[,groupAct,groupId,,groupHash]=data.responseText.match(/Groups.(enter|leave)\(.*?,.*?([\d]+?), ('|')(.*?)('|')/)||[],publicHash=data.responseText.match(/"enterHash":"(.*?)"/)?.[1],publicPid=data.responseText.match(/"public_id":([\d]+?),/)?.[1],publicJoined=!data.responseText.includes("Public.subscribe");if(groupAct&&groupId&&groupHash)return logStatus.success(),{groupAct:groupAct,groupId:groupId,groupHash:groupHash,type:"group"};if(publicHash&&publicPid)return logStatus.success(),{publicHash:publicHash,publicPid:publicPid,publicJoined:publicJoined,type:"public"};if(data.responseText.includes("wall.deletePost")&&!doTask){var wallHash=data.responseText.match(/wall\.deletePost\(this, '.*?', '(.*?)'\)/)?.[1];if(wallHash)return logStatus.success(),{type:"deleteWall",wallHash:wallHash}}else if(name.includes("wall")&&doTask)return logStatus.success(),{type:"sendWall"};return logStatus.error("Error: Parameters not found!"),!1}catch(error){return throwError_throwError(error,"Vk.getId"),!1}}async#toggleVk({name,doTask=!0}){try{if(!doTask&&this.whiteList.names.includes(name))return scripts_echoLog({type:"whiteList",text:"Vk.undoTask",id:name}),!0;var formatName=name.replace(/\/$/,""),data=await this.#getId(formatName,doTask);if(!data)return!1;switch(data.type){case"group":return await this.#toggleGroup(formatName,data,doTask);case"public":return await this.#togglePublic(formatName,data,doTask);case"sendWall":return!doTask||await this.#sendWall(formatName);case"deleteWall":return!!doTask||await this.#deleteWall(formatName,data);default:return!1}}catch(error){return throwError_throwError(error,"Vk.toggleVk"),!1}}async toggle({doTask=!0,nameLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.vk.names||!doTask&&!globalOptions.undoTask.vk.names)scripts_echoLog({type:"globalOptionsSkip",text:"vk.names"});else{var realNames=this.getRealParams("names",nameLinks,doTask,link=>link.match(/https:\/\/vk\.com\/([^/]+)/)?.[1]);if(0!0)}catch(error){return throwError_throwError(error,"Vk.toggle"),!1}}#setCache(name,postId){try{this.#cache[name]=postId,GM_setValue("vkCache",this.#cache)}catch(error){throwError_throwError(error,"Vk.setCache")}}};class Youtube extends discordAuth{tasks;whiteList;#auth=GM_getValue("youtubeAuth")||{};#initialized=!1;#verifyChannel="https://www.youtube.com/channel/"+globalOptions.other.youtubeVerifyChannel;constructor(){super();var defaultTasksTemplate={channels:[],likes:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.youtube||{}}}async init(){try{return this.#initialized?!0:this.#auth.PAPISID?await this.#verifyAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(GM_setValue("youtubeAuth",null),await this.#updateAuth()?(scripts_echoLog({}).success(i18n("initSuccess","Youtube")),this.#initialized=!0):(scripts_echoLog({}).error(i18n("initFailed","Youtube")),!1)):!!await this.#updateAuth()&&(this.#initialized=!0)}catch(error){return throwError_throwError(error,"Youtube.init"),!1}}async#verifyAuth(){try{return await this.#toggleChannel({link:this.#verifyChannel,doTask:!0,verify:!0})}catch(error){return throwError_throwError(error,"Youtube.verifyAuth"),!1}}async#updateAuth(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth","Youtube")});return await new Promise(resolve=>{GM_cookie.list({url:"https://www.youtube.com/@YouTube"},async(PAPISID,error)=>{error?(logStatus.error("Error: Update youtube auth failed!"),resolve(!1)):(PAPISID=PAPISID.find(cookie=>"__Secure-3PAPISID"===cookie.name)?.value)?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),this.#auth={PAPISID:PAPISID},logStatus.success(),resolve(await this.#verifyAuth())):(logStatus.error(i18n("needLogin")),resolve(!1))})})}catch(error){return throwError_throwError(error,"Youtube.updateAuth"),!1}}#getInfo(link,type){return async function(link,type){try{const logStatus=scripts_echoLog({text:i18n("gettingYtbToken")}),{result,statusText,status,data}=await tools_httpRequest({url:link,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{if(data.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return logStatus.error("Error:"+i18n("loginYtb"),!0),{needLogin:!0};var apiKey=data.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/)?.[1],context=(data.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||data.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))?.[1]||"{}";const{client,request}=JSON.parse(context);if(apiKey&&client&&request){if(client.hl="en","channel"===type){var channelId=data.responseText.match(/"channelId":"(.+?)"/)?.[1];return channelId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,channelId:channelId}}):(logStatus.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==type)return logStatus.error("Error: Unknown type"),{};var videoId=data.responseText.match(//)?.[1],likeParams=data.responseText.match(/"likeParams":"(.*?)"/)?.[1];return videoId?(logStatus.success(),{params:{apiKey:apiKey,client:client,request:request,videoId:videoId,likeParams:likeParams}}):(logStatus.error('Error: Get "videoId" failed!'),{})}return logStatus.error('Error: Parameter "apiKey" not found!'),{}}}catch(error){return throwError_throwError(error,"Youtube.getInfo"),{}}}(link,type)}async#toggleChannel({link,doTask=!0,verify=!1}){try{var{params,needLogin}=await this.#getInfo(link,"channel"),{apiKey,client,request,channelId}=params||{};if(needLogin)return scripts_echoLog({html:i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&channelId))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&!verify&&this.whiteList.channels.includes(channelId))return scripts_echoLog({type:"whiteList",text:"Youtube.unfollowChannel",id:channelId}),!0;const logStatus=verify?scripts_echoLog({text:i18n("verifyingAuth","Youtube")}):scripts_echoLog({type:doTask?"followingYtbChannel":"unfollowingYtbChannel",text:channelId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/subscription/${doTask?"":"un"}subscribe?key=${apiKey}&prettyPrint=false`,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+channelId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client?.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:client,request:{sessionId:request?.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[channelId],params:doTask?"EgIIAhgA":"CgIIAhgA"})});return"Success"===result?200===data?.status?doTask&&(/"subscribed":true/.test(data.responseText)||data.responseText.includes("The subscription already exists"))||!doTask&&/"subscribed":false/.test(data.responseText)?(logStatus.success(),doTask&&!verify&&(this.tasks.channels=unique([...this.tasks.channels,link])),!0):verify&&data.responseText.includes("You may not subscribe to yourself")?(logStatus.success(),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleChannel"),!1}}async#toggleLikeVideo({link,doTask=!0}){try{var{params,needLogin}=await this.#getInfo(link,"likeVideo"),{apiKey,client,request,videoId,likeParams}=params||{};if(needLogin)return scripts_echoLog({html:""+i18n("loginYtb")}),!1;if(!(apiKey&&client&&request&&videoId&&likeParams))return scripts_echoLog({text:'"getYtbToken" failed'}),!1;if(!doTask&&this.whiteList.likes.includes(videoId))return scripts_echoLog({type:"whiteList",text:"Youtube.unlikeVideo",id:videoId}),!0;const logStatus=scripts_echoLog({type:doTask?"likingYtbVideo":"unlikingYtbVideo",text:videoId});var nowTime=parseInt(String((new Date).getTime()/1e3),10);const likeVideoData={context:{client:client,request:{sessionId:request.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:videoId}};if(doTask){if(!likeParams)return logStatus.error("Empty likeParams"),!1;likeVideoData.params=likeParams}const{result,statusText,status,data}=await tools_httpRequest({url:`https://www.youtube.com/youtubei/v1/like/${doTask?"":"remove"}like?key=`+apiKey,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+videoId,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":client.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${nowTime}_`+sha1(`${nowTime} ${this.#auth.PAPISID} https://www.youtube.com`)},data:JSON.stringify(likeVideoData)});return"Success"===result?200===data?.status?doTask&&data.responseText.includes("Added to Liked videos")||!doTask&&(data.responseText.includes("Removed from Liked videos")||data.responseText.includes("Dislike removed"))?(logStatus.success(),doTask&&(this.tasks.likes=unique([...this.tasks.likes,link])),!0):(logStatus.error(i18n("tryUpdateYtbAuth"),!0),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Youtube.toggleLikeVideo"),!1}}async toggle({doTask=!0,channelLinks=[],videoLinks=[]}){try{if(!this.#initialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.youtube.channels||!doTask&&!globalOptions.undoTask.youtube.channels)scripts_echoLog({type:"globalOptionsSkip",text:"youtube.channels"});else{var realChannels=this.getRealParams("channels",channelLinks,doTask,link=>/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(link)?link.match(/url=(https:\/\/www\.youtube\.com\/.*)/)?.[1]:link);if(0!0)}catch(error){return throwError_throwError(error,"Youtube.toggle"),!1}}}const social_SteamASF=class{#asfOptions;#botName="asf";#groupInfo;async init(){try{var asfCommandsUrl=new URL("/Api/Command/",globalOptions.ASF.AsfIpcUrl);this.#asfOptions={url:asfCommandsUrl.href,method:"POST",responseType:"json",headers:{accept:"application/json","Content-Type":"application/json",Host:asfCommandsUrl.host,Origin:asfCommandsUrl.origin,Referer:asfCommandsUrl.href,Authentication:globalOptions.ASF.AsfIpcPassword}},globalOptions.ASF.AsfBotname&&(this.#botName=globalOptions.ASF.AsfBotname);const logStatus=scripts_echoLog({text:i18n("initingASF")});var{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:'{"Command":"!stats"}'});return"Success"===result?!0===data?.response?.Success&&"OK"===data.response.Message&&data.response.Result?(logStatus.success(),!0):(data?.response?.Result||data?.response?.Message?logStatus.error(data?.response?.Result||data.response.Message):logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.init"),!1}}async joinGroup(groupName){try{const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!JOINGROUP ${this.#botName} `+groupName})});return"Success"===result?200===data?.status&&["已加入","已申请","Joined","Applied","Присоединился","costs"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.joinGroup"),!1}}async leaveGroup(groupName){try{if(!this.#groupInfo&&!await this.#getGroupId())return!1;var groupId=await this.#groupInfo[groupName];if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!LEAVEGROUP ${this.#botName} `+groupId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.leaveGroup"),!1}}async#getGroupId(){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:"All"}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:"!GROUPLIST "+this.#botName})});return"Success"===result?200===data?.status&&data.response?.Result?.includes("|")?(this.#groupInfo=Object.fromEntries(data.response.Result.split("\n").map(id=>{var[,name,id]=id.trim().split("|");return name&&id?[name,id]:null}).filter(ele=>ele)),logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.getGroupID"),!1}}async addToWishlist(gameId){try{const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!ADDWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.addToWishlist"),!1}}async removeFromWishlist(gameId){try{const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REMOVEWISHLIST ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.removeFromWishlist"),!1}}async toggleFollowGame(gameId,doTask){try{const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWGAME ${this.#botName} `+gameId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"SteamASF.toggleFollowGame"),!1}}async toggleCurator(curatorId,doTask=!0){try{const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!${doTask?"":"UN"}FOLLOWCURATOR ${this.#botName} `+curatorId})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async addLicense(id){try{const[type,ids]=id.split("-");if("appid"===type){const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} app/`+ids})});return"Success"===result?200===data?.status&&["AlreadyPurchased","OK"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{const idsArr=ids.split(","),logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:ids}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!addlicense ${this.#botName} `+idsArr.map(id=>"sub/"+id).join(",")})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200===data?.status&&data.response?.Result){const resultLines=data.response.Result.split("\n");return idsArr.forEach(subid=>{const targetLine=resultLines.find(text=>text.includes(subid));targetLine&&["成功","Success","Успех"].find(text=>targetLine.includes(text))?scripts_echoLog({}).success(targetLine):scripts_echoLog({}).error(targetLine)}),!0}return logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1}}catch(error){return throwError_throwError(error,"SteamASF.addLicense"),!1}}async requestPlayTestAccess(id){try{const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id}),{result,statusText,status,data}=await tools_httpRequest({...this.#asfOptions,data:JSON.stringify({Command:`!REQUESTACCESS ${this.#botName} `+id})});return"Success"===result?200===data?.status&&["成功","Success","Успех"].find(text=>data.response?.Result?.includes(text))?(logStatus.success(),!0):(logStatus.error(`Error:${data?.response?.Result||data?.response?.Message||data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}};const social_Steam=class extends discordAuth{tasks;whiteList;#cache={group:{},officialGroup:{},forum:{},workshop:{},curator:{},...GM_getValue("steamCache")};#auth={};#storeInitialized=!1;#communityInitialized=!1;#area="CN";#areaStatus="end";#ASF;constructor(){super();var defaultTasksTemplate={groups:[],officialGroups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[],licenses:[],playtests:[]};this.tasks=defaultTasksTemplate,this.whiteList={...defaultTasksTemplate,...GM_getValue("whiteList")?.steam||{}}}async init(type="all"){try{if(globalOptions.ASF.AsfEnabled&&globalOptions.ASF.AsfIpcUrl&&globalOptions.ASF.AsfIpcPassword)return this.#ASF=new social_SteamASF,!!await this.#ASF.init()&&(this.#storeInitialized=!0,this.#communityInitialized=!0);if("store"===type){if(this.#storeInitialized)return!0;let storeInitialized=await this.#updateStoreAuth();return(storeInitialized=storeInitialized||await this.#updateStoreAuthTab(),this.#storeInitialized=storeInitialized,this.#storeInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamStore")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}if("community"!==type)return this.#storeInitialized&&this.#communityInitialized?(scripts_echoLog({}).success(i18n("initSuccess","Steam")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1);{if(this.#communityInitialized)return!0;let communityInitialized=await this.#getUserLink();return(communityInitialized=communityInitialized||await this.#updateCommunityAuthTab(),this.#communityInitialized=communityInitialized,this.#communityInitialized)?(scripts_echoLog({}).success(i18n("initSuccess","SteamCommunity")),!0):(scripts_echoLog({}).error(i18n("initFailed","Steam")),!1)}}catch(error){return throwError_throwError(error,"Steam.init"),!1}}async#refreshToken(type="steamStore"){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("refreshingToken",i18n(type))}),formData=new FormData;formData.append("redir",`https://${host[type]}/`);var{result,statusText,status,data}=await tools_httpRequest({url:"https://login.steampowered.com/jwt/ajaxrefresh",method:"POST",responseType:"json",headers:{Host:"login.steampowered.com",Origin:"https://"+host[type],Referer:`https://${host[type]}/`},data:formData});return"Success"===result?data?.response?.success?await this.#setStoreToken(data.response,type)?(logStatus.success(),!0):(logStatus.error("Error"),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.refreshToken"),!1}}async#setStoreToken(param,type){try{var host={steamStore:"store.steampowered.com",steamCommunity:"steamcommunity.com"};const logStatus=scripts_echoLog({text:i18n("settingToken",i18n(type))}),formData=new FormData;formData.append("steamID",param.steamID),formData.append("nonce",param.nonce),formData.append("redir",param.redir),formData.append("auth",param.auth);var{result,statusText,status,data}=await tools_httpRequest({url:`https://${host[type]}/login/settoken`,method:"POST",headers:{Accept:"application/json, text/plain, */*",Host:host[type],Origin:"https://"+host[type]},data:formData});return"Success"===result?200===data?.status?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.setStoreToken"),!1}}async#updateStoreAuth(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200!==data?.status)return[301,302].includes(data?.status)?await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):(logStatus.error(result+`:${statusText}(${status})`),!1);if(!data.responseText.includes("data-miniprofile="))return await this.#refreshToken("steamStore")?(logStatus.warning(i18n("retry")),retry?(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1):this.#updateStoreAuth(!0)):(logStatus.error("Error:"+i18n("needLoginSteamStore"),!0),!1);var storeSessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(this.#auth.storeSessionID=storeSessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateStoreAuth"),!1}}async#updateStoreAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamStore"))});return await new Promise(resolve=>{const newTab=window.open("https://store.steampowered.com/","mozillaWindow","pop=1;");GM_setValue("steamStoreAuth","update");const listenerId=GM_addValueChangeListener("steamStoreAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.storeSessionID=newValue.storeSessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateStoreAuthTab"),!1}}async#updateCommunityAuthTab(){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))});return await new Promise(resolve=>{const newTab=window.open("https://steamcommunity.com/my","mozillaWindow","pop=1;");GM_setValue("steamCommunityAuth","update");const listenerId=GM_addValueChangeListener("steamCommunityAuth",(key,oldValue,newValue,remote)=>(GM_removeValueChangeListener(listenerId),newTab?.close(),newValue&&JSON.stringify(newValue)!==JSON.stringify(oldValue)?(this.#auth.steam64Id=newValue.steam64Id,this.#auth.userName=newValue.userName,this.#auth.communitySessionID=newValue.communitySessionID,logStatus.success(),void resolve(!0)):(logStatus.error("Failed"),void resolve(!1))))})}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuthTab"),!1}}async#getUserLink(retry=!1){try{const logStatus=scripts_echoLog({text:i18n("gettingUserLink")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/my",method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"},fetch:!1,redirect:"manual"});if(200===data?.status){if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}if(302===data?.status)return!await this.#refreshToken("steamCommunity")||retry?(logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1):(logStatus.warning(i18n("retry")),this.#getUserLink(!0));const location=data?.responseHeaders?.split("\n")?.find(header=>header.includes("location")?header.replace("loctation:","").trim():null);return 301===data?.status&&location?.includes("steamcommunity.com/id")?(logStatus.success(),await this.#updateCommunityAuth(data.finalUrl)):(301===data?.status&&location?.includes("https://steamcommunity.com/login/home")?logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0):logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#updateCommunityAuth(url){try{const logStatus=scripts_echoLog({text:i18n("updatingAuth",i18n("steamCommunity"))}),{result,statusText,status,data}=await tools_httpRequest({url:url,method:"GET",headers:{Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9","Cache-Control":"max-age=0","Sec-Fetch-Dest":"document","Sec-Fetch-Mode":"navigate","Upgrade-Insecure-Requests":"1"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if(data.finalUrl.includes("https://steamcommunity.com/login/home"))return logStatus.error("Error:"+i18n("needLoginSteamCommunity"),!0),!1;var steam64Id=data.responseText.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=data.responseText.match(/g_sessionID = "(.+?)";/)?.[1],userName=data.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];return(steam64Id&&(this.#auth.steam64Id=steam64Id),userName&&(this.#auth.userName=userName),communitySessionID)?(this.#auth.communitySessionID=communitySessionID,logStatus.success(),!0):(logStatus.error('Error: Get "sessionID" failed'),!1)}catch(error){return throwError_throwError(error,"Steam.updateCommunityAuth"),!1}}async#getAreaInfo(){try{const logStatus=scripts_echoLog({text:i18n("gettingAreaInfo")}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};{var cartConfigRaw=data.responseText.match(/data-cart_config="(.*?)"/)?.[1];const temp=document.createElement("div");temp.innerHTML=cartConfigRaw||"{}";var cartConfigStr=temp.textContent||temp.innerText;let cartConfig;try{cartConfig=JSON.parse(cartConfigStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}if(!cartConfig.rgUserCountryOptions)return logStatus.warning("Warning: Area cannot be changed"),{};var userInfoRaw=data.responseText.match(/data-userinfo="(.*?)"/)?.[1];const temp1=document.createElement("div");temp1.innerHTML=userInfoRaw||"{}";var userInfoStr=temp1.textContent||temp1.innerText;let userInfo;try{userInfo=JSON.parse(userInfoStr)}catch(error){return logStatus.error("Error: get country info filed"),console.error(error),{}}var currentArea=userInfo.country_code,areas=Object.keys(cartConfig.rgUserCountryOptions).filter(area=>"help"!==area);return currentArea&&0{const checker=setInterval(()=>{"waiting"!==this.#areaStatus&&(clearInterval(checker),resolve(!0))})}),this.#area===area||!area&&"CN"!==this.#area)return!0;this.#areaStatus="waiting";let aimedArea=area;if(!aimedArea){const{currentArea,areas}=await this.#getAreaInfo();if(!currentArea||!areas)return!(this.#areaStatus="error");if("CN"!==currentArea)return this.#areaStatus="skip",scripts_echoLog({text:"notNeededChangeArea"}),"skip";var anotherArea=areas.filter(area=>area&&"CN"!==area);if(!anotherArea||0===anotherArea.length)return this.#areaStatus="noAnotherArea",scripts_echoLog({text:"noAnotherArea"}),!1;[aimedArea]=anotherArea}const logStatus=scripts_echoLog({text:i18n("changingArea",aimedArea)});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/country/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:aimedArea,sessionid:this.#auth.storeSessionID})});if("Success"!==result)return this.#areaStatus="error",logStatus.error(result+`:${statusText}(${status})`),"CN";if(200!==data?.status||"true"!==data.responseText)return this.#areaStatus="error",logStatus.error(`Error:${data?.statusText}(${data?.status})`),"CN";var currentArea=(await this.#getAreaInfo())["currentArea"];return currentArea===aimedArea?(this.#areaStatus="success",logStatus.success(),currentArea):(this.#areaStatus="error",logStatus.error("Error: change country filed"),"CN")}catch(error){return this.#areaStatus="error",throwError_throwError(error,"Steam.changeArea"),!1}}async#joinGroup(groupName){try{if(this.#ASF)return!!await this.#ASF.joinGroup(groupName)&&(this.tasks.groups=unique([...this.tasks.groups,groupName]),!0);const logStatus=scripts_echoLog({type:"joiningSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText.includes("grouppage_join_area")?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.success(),this.tasks.groups=unique([...this.tasks.groups,groupName]),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.joinGroup"),!1}}async#leaveGroup(groupName){try{if(this.whiteList.groups.includes(groupName))return scripts_echoLog({type:"whiteList",text:"Steam.leaveGroup",id:groupName}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(groupName);var groupId=await this.#getGroupId(groupName);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamGroup",text:groupName}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});return"Success"===result?200===data?.status&&data.finalUrl.includes("groups")&&0===$(data.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${groupName.toLowerCase()}']`).length?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.leaveGroup"),!1}}async#getGroupId(groupName){try{const logStatus=scripts_echoLog({type:"gettingSteamGroupId",text:groupName});var groupId=this.#cache.group[groupName];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/groups/"+groupName,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/OpenGroupChat\( '([0-9]+)'/)?.[1];return groupId?(this.#setCache("group",groupName,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#joinOfficialGroup(gameId){try{if(this.#ASF)return!!await this.#ASF.joinGroup(gameId)&&(this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]),!0);const logStatus=scripts_echoLog({type:"joiningSteamOfficialGroup",text:gameId}),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/games/${gameId}?action=join&sessionID=`+this.#auth.communitySessionID,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status||data.responseText.includes('id="publicGroupJoin"'))return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;logStatus.success(),this.tasks.officialGroups=unique([...this.tasks.officialGroups,gameId]);var groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId&&this.#setCache("officialGroup",gameId,groupId),!0}catch(error){return throwError_throwError(error,"Steam.joinOfficialGroup"),!1}}async#leaveOfficialGroup(gameId){try{if(this.whiteList.officialGroups.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.leaveOfficialGroup",id:gameId}),!0;if(this.#ASF)return await this.#ASF.leaveGroup(gameId);var groupId=await this.#getOfficialGroupId(gameId);if(!groupId)return!1;const logStatus=scripts_echoLog({type:"leavingSteamOfficialGroup",text:gameId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/id/${this.#auth.userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:this.#auth.communitySessionID,action:"leaveGroup",groupId:groupId})});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});return"Success"===resultR?200===dataR?.status&&dataR.responseText.includes('id="publicGroupJoin"')?(logStatus.success(),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}}catch(error){return throwError_throwError(error,"Steam.leaveOfficialGroup"),!1}}async#getOfficialGroupId(gameId){try{const logStatus=scripts_echoLog({type:"gettingSteamOfficialGroupId",text:gameId});var groupId=this.#cache.officialGroup[gameId];if(groupId)return logStatus.success(),groupId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/games/"+gameId,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const groupId=data.responseText.match(/steam:\/\/friends\/joinchat\/([0-9]+)/)?.[1];return groupId?(this.#setCache("officialGroup",gameId,groupId),logStatus.success(),groupId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getGroupID"),!1}}async#addToWishlist(gameId){try{if(this.#ASF)return!!await this.#ASF.addToWishlist(gameId)&&(this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0);const logStatus=scripts_echoLog({type:"addingToWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===resultR?200===dataR?.status?"CN"===this.#area&&dataR.responseText.includes('id="error_box"')?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#addToWishlist(gameId)):(!dataR.responseText.includes('class="queue_actions_ctn"')||!dataR.responseText.includes('class="already_in_library"'))&&(dataR.responseText.includes('class="queue_actions_ctn"')&&dataR.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!dataR.responseText.includes('class="queue_actions_ctn"'))?(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1):(logStatus.success(),this.tasks.wishlists=unique([...this.tasks.wishlists,gameId]),!0):(logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1):(logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1)}catch(error){return throwError_throwError(error,"Steam.addToWishlist"),!1}}async#removeFromWishlist(gameId){try{if(this.whiteList.wishlists.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.removeFromWishlist",id:gameId}),!0;if(this.#ASF)return await this.#ASF.removeFromWishlist(gameId);const logStatus=scripts_echoLog({type:"removingFromWishlist",text:gameId});var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.storeSessionID,appid:gameId}),dataType:"json"});if("Success"===result&&200===data?.status&&!0===data.response?.success)return logStatus.success(),!0;const{result:resultR,statusText:statusTextR,status:statusR,data:dataR}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});if("Success"!==resultR)return logStatus.error(resultR+`:${statusTextR}(${statusR})`),!1;if(200!==dataR?.status)return logStatus.error(`Error:${dataR?.statusText}(${dataR?.status})`),!1;if("CN"===this.#area&&dataR.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#removeFromWishlist(gameId):!1}return dataR.responseText.includes('class="queue_actions_ctn"')&&(dataR.responseText.includes("ds_owned_flag ds_flag")||dataR.responseText.includes("add_to_wishlist_area"))?(logStatus.success(),!0):(logStatus.error(`Error:${dataR.statusText}(${dataR.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.removeFromWishlist"),!1}}async#toggleFollowGame(gameId,doTask){try{if(!doTask&&this.whiteList.follows.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowGame",id:gameId}),!0;if(this.#ASF)return!!await this.#ASF.toggleFollowGame(gameId,doTask)&&(doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0);const logStatus=scripts_echoLog({type:`${doTask?"":"un"}followingGame`,text:gameId}),requestData={sessionid:this.#auth.storeSessionID,appid:gameId};doTask||(requestData.unfollow="1");var{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(requestData)});if("Success"===result&&200===data?.status&&"true"===data.responseText)return logStatus.success(),!0;var followed=await this.#isFollowedGame(gameId);return"CN"===this.#area&&"areaLocked"===followed?(logStatus.warning(i18n("changeAreaNotice")),!!await this.#changeArea()&&await this.#removeFromWishlist(gameId)):doTask===followed?(logStatus.success(),doTask&&(this.tasks.follows=unique([...this.tasks.follows,gameId])),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFollowGame"),!1}}async#isFollowedGame(gameId){try{const{result,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+gameId,method:"GET"});return"Success"===result?200===data?.status&&("CN"===this.#area&&data.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(data.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(error){return throwError_throwError(error,"Steam.isFollowedGame"),!1}}async#toggleForum(gameId,doTask=!0){try{if(!doTask&&this.whiteList.forums.includes(gameId))return scripts_echoLog({type:"whiteList",text:"Steam.unsubscribeForum",id:gameId}),!0;const forumId=await this.#getForumId(gameId);if(!forumId)return!1;const logStatus=scripts_echoLog({type:`${doTask?"":"un"}subscribingForum`,text:gameId});var[id,feature]=forumId.split("_"),{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/forum/${id}/General/${doTask?"":"un"}subscribe/${feature||"0"}/`,method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:this.#auth.communitySessionID})});return"Success"===result?(200!==data?.status||1!==data.response?.success&&29!==data.response?.success?logStatus.error(`Error:${data?.statusText}(${data?.status})`):(doTask&&(this.tasks.forums=unique([...this.tasks.forums,gameId])),logStatus.success()),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.toggleForum"),!0}}async#getForumId(gameId){try{const logStatus=scripts_echoLog({type:"gettingForumId",text:gameId});var forumId=this.#cache.forum[gameId];if(forumId)return logStatus.success(),forumId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/app/${gameId}/discussions/`,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const forumId=data.responseText?.match(/General_([\d]+(_[\d]+)?)/)?.[1];return forumId?(this.#setCache("forum",gameId,forumId),logStatus.success(),forumId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getForumId"),!1}}async#toggleFavoriteWorkshop(id,doTask=!0){try{if(!doTask&&this.whiteList.workshops.includes(id))return scripts_echoLog({type:"whiteList",text:"Steam.unfavoriteWorkshop",id:id}),!0;var appid=await this.#getWorkshopAppId(id);if(!appid)return!1;const logStatus=scripts_echoLog({type:doTask?"favoritingWorkshop":"unfavoritingWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:`https://steamcommunity.com/sharedfiles/${doTask?"":"un"}favorite`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,appid:appid,sessionid:this.#auth.communitySessionID})});return"Success"===result?200!==data?.status||data.responseText?(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(doTask&&(this.tasks.workshops=unique([...this.tasks.workshops,id])),logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleFavoriteWorkshop"),!1}}async#getWorkshopAppId(id){try{const logStatus=scripts_echoLog({type:"gettingWorkshopAppId",text:id});var appId=this.#cache.workshop[id];if(appId)return logStatus.success(),appId;const{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/filedetails/?id="+id,method:"GET"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const appId=data.responseText.match(//)?.[1];return appId?(this.#setCache("workshop",id,appId),logStatus.success(),appId):(logStatus.error("Error: getWorkshopAppId failed"),!1)}}catch(error){return throwError_throwError(error,"Steam.getWorkshopAppId"),!1}}async#voteUpWorkshop(id){try{const logStatus=scripts_echoLog({type:"votingUpWorkshop",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:id,sessionid:this.#auth.communitySessionID})});return"Success"===result?(200===data?.status&&1===data.response?.success?logStatus.success():logStatus.error(`Error:${data?.statusText}(${data?.status})`),!0):(logStatus.error(result+`:${statusText}(${status})`),!0)}catch(error){return throwError_throwError(error,"Steam.voteupWorkshop"),!0}}async#toggleCurator(curatorId,doTask=!0){try{if(!doTask&&this.whiteList.curators.includes(curatorId))return scripts_echoLog({type:"whiteList",text:"Steam.unfollowCurator",id:curatorId}),!0;if(this.#ASF)return await this.#ASF.toggleCurator(curatorId,doTask);const logStatus=scripts_echoLog({type:doTask?"followingCurator":"unfollowingCurator",text:curatorId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/curators/ajaxfollow",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({clanid:curatorId,sessionid:this.#auth.storeSessionID,follow:doTask}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response?.success?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(`+data?.response?.success||data?.status+")"),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.toggleCurator"),!1}}async getCuratorId(path,name){try{const logStatus=scripts_echoLog({type:"gettingCuratorId",text:path+"/"+name});var curatorId=this.#cache.curator[path+"/"+name];if(curatorId)return logStatus.success(),curatorId;const{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/${path}/`+name,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;{const curatorId=data.responseText.match(/g_pagingData.*?"clanid":([\d]+)/)?.[1];return curatorId?(this.#setCache("curator",path+"/"+name,curatorId),logStatus.success(),curatorId):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}}catch(error){return throwError_throwError(error,"Steam.getCuratorID"),!1}}async#toggleCuratorLike(link,doTask=!0){try{var[path,name]=link.split("/");if(!path||!name)return scripts_echoLog({text:i18n("errorLink",link)}),!1;var curatorId=await this.getCuratorId(path,name);return curatorId?await this.#toggleCurator(curatorId,doTask):!1}catch(error){return throwError_throwError(error,"Steam.toggleCuratorLike"),!1}}async#getAnnouncementParams(appId,viewId){try{const logStatus=scripts_echoLog({type:"gettingAnnouncementParams",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:`https://store.steampowered.com/events/ajaxgetpartnerevent?appid=${appId}&announcement_gid=${viewId}&lang_list=6_0&last_modified_time=0&origin=https:%2F%2Fstore.steampowered.com&for_edit=false`,method:"GET",responseType:"json",headers:{Host:"store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),{};if(200!==data?.status||1!==data?.response?.success)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),{};var{clanid,gid}=data.response.event?.announcement_body||{};return clanid?(logStatus.success(),{clanId:clanid,gid:gid}):(logStatus.error(`Error:${data.statusText}(${data.status})`),{})}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),{}}}async#likeAnnouncement(id){try{var[appId,viewId]=id.split("/");if(!appId||!viewId)return scripts_echoLog({}).error(i18n("missParams")+"(id)"),!1;var{clanId,gid}=await this.#getAnnouncementParams(appId,viewId);if(!clanId)return!1;const logStatus=scripts_echoLog({type:"likingAnnouncement",text:appId,id:viewId});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/updated/ajaxrateupdate/"+(gid||viewId),method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:`https://store.steampowered.com/news/app/${appId}/view/`+viewId},data:$.param({sessionid:this.#auth.storeSessionID,voteup:1,clanid:clanId,ajax:1}),dataType:"json"});return"Success"===result?200===data?.status&&1===data.response.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.likeAnnouncement"),!1}}async#appid2subid(id){try{const logStatus=scripts_echoLog({type:"gettingSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+id,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result&&"skip"!==result?await this.#appid2subid(id):!1}var subid=data.responseText.match(/name="subid" value="([\d]+?)"/)?.[1];return subid?(logStatus.success(),subid):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1)}catch(error){return throwError_throwError(error,"Steam.appid2subid"),!1}}async#getLicenses(){try{const logStatus=scripts_echoLog({text:i18n("gettingLicenses")});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/dynamicstore/userdata/?t="+(new Date).getTime(),method:"GET",responseType:"json"});return"Success"===result?200===data?.status?(logStatus.success(),data.response?.rgOwnedPackages):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.getLicenses"),!1}}async#addLicense(id){try{if(this.#ASF)return await this.#ASF.addLicense(id);const[type,ids]=id.split("-");if("appid"===type){var subid=await this.#appid2subid(ids);if(!subid)return!1;const logStatus=scripts_echoLog({type:"addingFreeLicense",text:ids});if(!await this.#addFreeLicense(subid,logStatus))return!1;const{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/app/"+ids,method:"GET"});return"Success"===result?200===data?.status?data.responseText.includes("ds_owned_flag ds_flag")||data.responseText.includes('class="already_in_library"')?(logStatus.success(),!0):(logStatus.error(`Error:${data.statusText}(${data.status})`),!1):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}if("subid"!==type)return!1;{"CN"===this.#area&&(scripts_echoLog({}).success(i18n("tryChangeAreaNotice")),await this.#changeArea());const logStatusArr={};var idsArr=ids.split(",");for(const subid of idsArr){var logStatus=scripts_echoLog({type:"addingFreeLicenseSubid",text:subid});if(!await this.#addFreeLicense(subid,logStatus))return!1;logStatusArr[subid]=logStatus}const licenses=await this.#getLicenses();if(!licenses)return!1;for(const subid of idsArr)licenses.includes(parseInt(subid,10))?logStatusArr[subid].success():logStatusArr[subid].error();return!0}}catch(error){return throwError_throwError(error,"Steam.addLicense"),!1}}async#addFreeLicense(id,logStatusPre){try{const logStatus=logStatusPre||scripts_echoLog({type:"addingFreeLicenseSubid",text:id}),{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/checkout/addfreelicense",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/account/licenses/"},data:$.param({action:"add_to_cart",sessionid:this.#auth.storeSessionID,subid:id}),dataType:"json"});if("Success"!==result)return logStatus.error(result+`:${statusText}(${status})`),!1;if(200!==data?.status)return logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1;if("CN"===this.#area&&data.responseText.includes('id="error_box"')){logStatus.warning(i18n("changeAreaNotice"));const result=await this.#changeArea();return result&&"CN"!==result?await this.#addFreeLicense(id):!1}return logStatus.success(),!0}catch(error){return throwError_throwError(error,"Steam.addFreeLicense"),!1}}async#requestPlayTestAccess(id){try{if(this.#ASF)return await this.#ASF.requestPlayTestAccess(id);const logStatus=scripts_echoLog({type:"requestingPlayTestAccess",text:id});var{result,statusText,status,data}=await tools_httpRequest({url:"https://store.steampowered.com/ajaxrequestplaytestaccess/"+id,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8",Host:"store.steampowered.com",Origin:"https://store.steampowered.com",Referer:"https://store.steampowered.com/app/"+id},data:$.param({sessionid:this.#auth.storeSessionID}),dataType:"json"});return"Success"===result?200===data?.status&&1===data?.response?.success?(logStatus.success(),!0):(logStatus.error(`Error:${data?.statusText}(${data?.status})`),!1):(logStatus.error(result+`:${statusText}(${status})`),!1)}catch(error){return throwError_throwError(error,"Steam.requestPlayTestAccess"),!1}}async toggle({doTask=!0,groupLinks=[],officialGroupLinks=[],wishlistLinks=[],followLinks=[],forumLinks=[],workshopLinks=[],workshopVoteLinks=[],curatorLinks=[],curatorLikeLinks=[],announcementLinks=[],licenseLinks=[],playtestLinks=[]}){try{if(0<[...groupLinks,...officialGroupLinks,...forumLinks,...workshopLinks,...workshopVoteLinks].length&&!this.#communityInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;if(0<[...wishlistLinks,...followLinks,...curatorLinks,...curatorLikeLinks,...announcementLinks,...licenseLinks,...playtestLinks].length&&!this.#storeInitialized)return scripts_echoLog({text:i18n("needInit")}),!1;const prom=[];if(doTask&&!globalOptions.doTask.steam.groups||!doTask&&!globalOptions.undoTask.steam.groups)scripts_echoLog({type:"globalOptionsSkip",text:"steam.groups"});else{var realGroups=this.getRealParams("groups",groupLinks,doTask,link=>link.match(/groups\/(.+)\/?/)?.[1]);if(0link.match(/games\/(.+)\/?/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/app\/([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(0link.match(/\?id=([\d]+)/)?.[1]);if(doTask&&0link.match(/curator\/([\d]+)/)?.[1]),realCuratorLikes=this.getRealParams("curatorLikes",curatorLikeLinks,doTask,link=>link.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/)?.slice(1,3).join("/"));if(0(link.includes("store.steampowered.com")?link.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/):link.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))?.slice(1,3).join("/"));if(doTask&&0link.match(/app\/([\d]+)/)?.[1]);if(doTask&&globalOptions.doTask.steam.playtests&&0("CN"!==this.#area&&(scripts_echoLog({}).warning(i18n("steamFinishNotice")),await this.#changeArea("CN")),!0))}catch(error){return throwError_throwError(error,"Steam.toggle"),!1}}#setCache(type,name,id){try{this.#cache[type][name]=id,GM_setValue("steamCache",this.#cache)}catch(error){throwError_throwError(error,"Steam.setCache")}}};const Giveawaysu=class{undoneTasks={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[],playtestLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]},twitter:{userLinks:[],retweetLinks:[]}};giveawayId;socialInitialized={discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steamStore:!1,steamCommunity:!1,twitter:!0};initialized=!1;social={};static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{this.#checkLogin()||scripts_echoLog({}).warning(i18n("checkLoginFailed")),await this.#checkLeftKey()||scripts_echoLog({}).warning(i18n("checkLeftKeyFailed"))}catch(error){throwError_throwError(error,"Giveawaysu.after")}}init(){try{const logStatus=scripts_echoLog({text:i18n("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),logStatus.warning(i18n("needLogin")),!1):!!this.#getGiveawayId()&&(this.initialized=!0,logStatus.success(),!0)}catch(error){return throwError_throwError(error,"Giveawaysu.init"),!1}}async#classifyTask(){try{const logStatus=scripts_echoLog({text:i18n("getTasksInfo")}),pro=[];var tasks=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const task of tasks)pro.push(new Promise(resolve=>{const td=$(task).find('td:not(".hidden")');var colorfulTask=td.eq(1).find('a:not([data-trigger="link"])'),colorlessTask=td.eq(2).find('a:not([data-trigger="link"])');const taskDes=0{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError_throwError(error,"getRedirectLink"),null}})(taskDes.attr("href")).then(taskLink=>taskLink?(taskIcon.includes("steam")&&/join/gi.test(taskName)?this.undoneTasks.steam.groupLinks.push(taskLink):/like.*announcement/gi.test(taskName)?this.undoneTasks.steam.announcementLinks.push(taskLink):/(follow|subscribe).*curator/gim.test(taskName)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(taskLink)?this.undoneTasks.steam.curatorLinks.push(taskLink):taskIcon.includes("steam")&&/follow|subscribe/gim.test(taskName)?this.undoneTasks.steam.curatorLikeLinks.push(taskLink):/subscribe.*steam.*forum/gim.test(taskName)?this.undoneTasks.steam.forumLinks.push(taskLink):taskIcon.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(taskLink)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):taskIcon.includes("plus")&&/request.*playtest/gim.test(taskName)?this.undoneTasks.steam.playtestLinks.push(taskLink):taskIcon.includes("discord")||/join.*discord/gim.test(taskName)?this.undoneTasks.discord.serverLinks.push(taskLink):taskIcon.includes("instagram")||/follow.*instagram/gim.test(taskName)?this.undoneTasks.instagram.userLinks.push(taskLink):taskIcon.includes("twitch")||/follow.*twitch.*channel/gim.test(taskName)?this.undoneTasks.twitch.channelLinks.push(taskLink):taskIcon.includes("reddit")||/subscribe.*subreddit/gim.test(taskName)||/follow.*reddit/gim.test(taskName)?this.undoneTasks.reddit.redditLinks.push(taskLink):/watch.*art/gim.test(taskName)?this.undoneTasks.steam.workshopVoteLinks.push(taskLink):/subscribe.*youtube.*channel/gim.test(taskName)?this.undoneTasks.youtube.channelLinks.push(taskLink):/(watch|like).*youtube.*video/gim.test(taskName)||(taskIcon.includes("youtube")||taskIcon.includes("thumbs-up"))&&/(watch|like).*video/gim.test(taskName)?this.undoneTasks.youtube.likeLinks.push(taskLink):taskIcon.includes("vk")||/join.*vk.*group/gim.test(taskName)?this.undoneTasks.vk.nameLinks.push(taskLink):/(on twitter)|(Follow.*on.*Facebook)/gim.test(taskName)||(/wishlist.*game|add.*wishlist/gim.test(taskName)&&this.undoneTasks.steam.wishlistLinks.push(taskLink),/follow.*button/gim.test(taskName)&&this.undoneTasks.steam.followLinks.push(taskLink)),void resolve(!0)):resolve(!1)).catch(error=>(throwError_throwError(error,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(pro),logStatus.success(),this.undoneTasks=this.#uniqueTasks(this.undoneTasks),!0}catch(error){return throwError_throwError(error,"Giveawaysu.classifyTask"),!1}}#checkLogin(){try{return globalOptions.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLogin"),!1}}async#checkLeftKey(){try{return globalOptions.other.checkLeftKey?(0<$(".giveaway-ended").length&&await external_Swal_default().fire({icon:"warning",title:i18n("notice"),text:i18n("noKeysLeft"),confirmButtonText:i18n("confirm"),cancelButtonText:i18n("cancel"),showCancelButton:!0}).then(({value})=>{value&&window.close()}),!0):!0}catch(error){return throwError_throwError(error,"Giveawaysu.checkLeftKey"),!1}}#getGiveawayId(){var giveawayId=window.location.href.match(/\/view\/([\d]+)/)?.[1];return giveawayId?(this.giveawayId=giveawayId,!0):(scripts_echoLog({text:i18n("getFailed","GiveawayId")}),!1)}async#bind(name,init){try{return{name:name,result:await init}}catch(error){return throwError_throwError(error,"GiveawaySu.bind"),{name:name,result:!1}}}async#initSocial(){try{const pro=[],tasks=this.undoneTasks;var steamLength,steamCommunityLength;return tasks.discord&&0[...total,...arr]).length&&!this.socialInitialized.discord&&(this.social.discord=new social_Discord,pro.push(this.#bind("discord",this.social.discord.init("do")))),tasks.instagram&&0[...total,...arr]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new social_Instagram,pro.push(this.#bind("instagram",this.social.instagram.init()))),tasks.reddit&&0[...total,...arr]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new social_Reddit,pro.push(this.#bind("reddit",this.social.reddit.init()))),tasks.twitch&&0[...total,...arr]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new social_Twitch,pro.push(this.#bind("twitch",this.social.twitch.init()))),tasks.vk&&0[...total,...arr]).length&&!this.socialInitialized.vk&&(this.social.vk=new social_Vk,pro.push(this.#bind("vk",this.social.vk.init()))),tasks.youtube&&0[...total,...arr]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Youtube,pro.push(this.#bind("youtube",this.social.youtube.init()))),!tasks.steam||0<(steamLength=Object.values(tasks.steam).reduce((total,arr)=>[...total,...arr]).length)&&(this.social.steam||(this.social.steam=new social_Steam),0["groupLinks","forumLinks","workshopLinks","workshopVoteLinks"].includes(type)&&tasks.steam?.[type]?.length||0).reduce((total,number)=>total+number,0))&&!this.socialInitialized.steamStore&&pro.push(this.#bind("steamStore",this.social.steam.init("store"))),0{let checked=!0;for(const data of result)data.result?this.socialInitialized[data.name]=data.result:checked=!1;return checked})}catch(error){return throwError_throwError(error,"GiveawaySu.initSocial"),!1}}#uniqueTasks(allTasks){const result={};for(var[social,types]of Object.entries(allTasks)){result[social]={};for(var[type,tasks]of Object.entries(types))result[social][type]=unique(tasks)}return result}async#toggleTask(){try{if(!this.initialized&&!this.init())return!1;if(!await this.#classifyTask())return!1;if(!await this.#initSocial())return!1;const pro=[];var tasks=this.undoneTasks;return"skip"!==this.socialInitialized.discord&&this.social.discord&&pro.push(this.social.discord.toggle({doTask:!0,...tasks.discord})),this.social.instagram&&pro.push(this.social.instagram.toggle({doTask:!0,...tasks.instagram})),this.social.reddit&&pro.push(this.social.reddit.toggle({doTask:!0,...tasks.reddit})),this.social.twitch&&pro.push(this.social.twitch.toggle({doTask:!0,...tasks.twitch})),this.social.vk&&pro.push(this.social.vk.toggle({doTask:!0,...tasks.vk})),this.social.youtube&&pro.push(this.social.youtube.toggle({doTask:!0,...tasks.youtube})),this.social.steam&&pro.push(this.social.steam.toggle({doTask:!0,...tasks.steam})),await Promise.all(pro),scripts_echoLog({}).success(i18n("allTasksComplete")),!0}catch(error){return throwError_throwError(error,"GiveawaySu.toggleTask"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$("#auto-task-info-div").remove(),$(window.STYLE).remove(),$("#getKey").off()}),await this.#toggleTask()}catch(error){return throwError_throwError(error,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var href;for(const task of $("#actions tr")){const $task=$(task);if("adjs"!==$task.attr("data-action-id")){const icon=$task.find("i.glyphicon-refresh"),button=icon.parent();"A"!==button.prop("tagName")?icon.hasClass("spin")||icon.hasClass("glyphicon-ok")||(button[0].click(),await delay(1e3)):(href=button.attr("href"),button.attr("href","javascript:void(0);").attr("target","_self")[0].click(),button.attr("href",href))}}}catch(error){throwError_throwError(error,"GiveawaySu.verifyTask")}}};discordAuth=__webpack_require__(82);if(window.STYLE=GM_addStyle(discordAuth.Z+GM_getResourceText("style")),"discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{var authToken;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(authToken=external_Cookies_namespaceObject.get("auth-token"),!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientId:commonOptions?.headers?.["Client-ID"]}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"x.com"===window.location.hostname&&"#auth"===window.location.hash){var PAPISID=external_Cookies_namespaceObject.get("ct0");const isLogin=!!external_Cookies_namespaceObject.get("twid");isLogin&&PAPISID?(GM_setValue("twitterAuth",{ct0:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}if("www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((PAPISID=external_Cookies_namespaceObject.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:PAPISID}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");if(0

    `),await website.after(),$("#auto-do-task").on("click",()=>{website.doTask()}),$("#auto-verify-task").on("click",()=>{website.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto Task GS特供脚本初始化完成!")}})}()}(); \ No newline at end of file diff --git a/page/dist/auto-task-v4.all.user.js b/page/dist/auto-task-v4.all.user.js index 713036e..b7460a8 100644 --- a/page/dist/auto-task-v4.all.user.js +++ b/page/dist/auto-task-v4.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4 // @namespace auto-task-v4 -// @version 4.4.7 +// @version 4.4.8 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -32,6 +32,8 @@ // @include *://*.reddit.com/* // @include *://twitter.com/settings/account?k* // @include *://x.com/settings/account* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @include https://auto-task-v4.hclonely.com/setting.html // @include https://auto-task-v4.hclonely.com/history.html @@ -428,22 +430,22 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); }); }); }, - 221: function(module, __webpack_exports__, __webpack_require__) { + 568: function(module, __webpack_exports__, __webpack_require__) { 'use strict'; __webpack_require__.d(__webpack_exports__, { Z: function() { return __WEBPACK_DEFAULT_EXPORT__; } }); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(398); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); - var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(494); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(999); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, '.colorful-button,#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn,body.auto-task-options .auto-task-form table button{position:relative;padding:5px 10px;text-align:center;color:#fff;text-decoration:none;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:30px;background-size:400%;text-transform:capitalize}.colorful-button:hover,#auto-task-buttons a.auto-task-website-btn:hover,.show-button-div a.auto-task-website-btn:hover,body.auto-task-options .auto-task-form table button:hover{transform:scale(1.05);box-shadow:0 6px 20px rgba(0,0,0,.3);cursor:pointer}.colorful-button:hover::before,#auto-task-buttons a.auto-task-website-btn:hover::before,.show-button-div a.auto-task-website-btn:hover::before,body.auto-task-options .auto-task-form table button:hover::before{filter:blur(10px);opacity:1}.colorful-button::before,#auto-task-buttons a.auto-task-website-btn::before,.show-button-div a.auto-task-website-btn::before,body.auto-task-options .auto-task-form table button::before{content:"";position:absolute;top:-5px;left:-5px;right:-5px;bottom:-5px;z-index:-1;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:40px;background-size:400%;opacity:-1}#auto-task-info{position:fixed;bottom:10px;right:10px;width:60%;max-width:500px;max-height:60%;overflow-y:auto;color:#000;background-color:#fff;padding-left:5px;z-index:999999999 !important;border:solid 2px #add8e6;border-radius:10px}#auto-task-info li{text-align:left}#auto-task-info li a.high-light{color:#00aeff;font-weight:bold}#auto-task-info .success{color:green}#auto-task-info .error{color:red}#auto-task-info .warning{color:blue}#auto-task-info .info{color:#ff0}#auto-task-info .update-text{color:green;border:solid 2px #8dcb69;margin:5px 10px 5px 20px;border-radius:10px;padding:5px 20px}.auto-task-keylol{display:inline-block;text-transform:capitalize;margin-left:10px;text-decoration:none !important;border:solid 1px;border-radius:5px;padding:0 2px}.auto-task-keylol[selected=selected]{background-color:blue !important;color:#fff !important}.auto-task-form table{font-family:verdana,arial,sans-serif;font-size:11px;color:#333;border-width:1px;border-color:#999;border-collapse:collapse;width:100%}.auto-task-form table thead td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;font-weight:bold;background-color:#fff}.auto-task-form table tbody tr{background-color:#d4e3e5}.auto-task-form table tbody tr:hover{background-color:#ff6 !important}.auto-task-form table tbody tr th{background-color:#c3dde0;border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;text-transform:capitalize}.auto-task-form table tbody tr td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9}.swal2-modal{width:70% !important;max-width:1000px !important}body.auto-task-options{padding-top:10px;text-align:center}body.auto-task-options .auto-task-form{width:80%;max-width:1000px;margin:0 auto;padding-bottom:20px}body.auto-task-options .auto-task-form table input.editOption{width:80%}body.auto-task-options .auto-task-form table #getTwitterUserId,body.auto-task-options .auto-task-form table #getYoutubeChannelId{margin-top:5px}body.auto-task-options .auto-task-form table button{z-index:1}body.auto-task-options .auto-task-form table input[type=text]{outline-style:none;border:1px solid #ccc;border-radius:3px;padding:5px 10px;font-size:14px}body.auto-task-options .auto-task-form table input[type=text]:focus{border-color:#66afe9;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}body.auto-task-options .auto-task-form table label{position:relative;width:160px;height:80px;cursor:pointer;transform:scale(0.25);margin:-25% 0;top:-30px;display:inline-block}body.auto-task-options .auto-task-form table label input{position:relative;z-index:1;appearance:none}body.auto-task-options .auto-task-form table label input:checked~span{background:#05be05;box-shadow:0 15px 25px #05be0566}body.auto-task-options .auto-task-form table label input:checked~span i{left:84px}body.auto-task-options .auto-task-form table label input:checked~span i::before{background:#05be05;box-shadow:35px 0 0 #05be05}body.auto-task-options .auto-task-form table label input:checked~span i::after{bottom:12px;height:15px;border-bottom-left-radius:15px;border-bottom-right-radius:15px;background:#05be05}body.auto-task-options .auto-task-form table label span{position:absolute;top:0;left:0;width:100%;height:100%;background:#fe0000;border-radius:80px;transition:.5s;box-shadow:0 15px 25px #fe000066}body.auto-task-options .auto-task-form table label span i{position:absolute;top:4px;left:4px;width:72px;height:72px;background:#fff;border-radius:50%}body.auto-task-options .auto-task-form table label span i::before{content:"";position:absolute;top:22px;left:12px;width:12px;height:12px;border-radius:50%;background:#fe0000;box-shadow:35px 0 0 #fe0000;transition:.5s}body.auto-task-options .auto-task-form table label span i::after{content:"";position:absolute;bottom:15px;left:calc(50% - 15px);width:30px;height:6px;border-radius:6px;background:#fe0000;transition:.5s}body.auto-task-history{font-size:15px;font-weight:400;line-height:1.5}body.auto-task-history .container a{color:#007bff;text-decoration:none;background-color:transparent}body.auto-task-history .container .card{width:80%;max-width:800px;border-radius:10px;background:#7676761a;border-top:1px solid #ffffff80;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:0 15px 25px #0000001a;margin:20px auto;position:relative;display:flex;flex-direction:column;word-wrap:break-word;-webkit-background-clip:border-box;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}body.auto-task-history .container .card .title{text-align:center;font-size:30px;font-weight:bold;margin:5px 0}body.auto-task-history .container .card .title a:hover{text-decoration:none;background:#93e1ff;border-radius:10px;padding:3px}body.auto-task-history .container .card ul{margin-bottom:25px}body.auto-task-history .container .card ul li{margin-bottom:5px;line-height:20px}body.auto-task-history .container .card ul a:hover{text-decoration:underline}body.auto-task-history .container .card .delete-task{right:10px;width:38px;height:35px;position:absolute;font-size:24px;cursor:pointer;border-radius:10px}body.auto-task-history .container .card .delete-task:hover{background:#fff}body.auto-task-history .container .card .time{right:5px;position:absolute;bottom:0;color:#e83e8c;font-family:\'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace\';font-size:15px}#auto-task-buttons,.show-button-div{position:fixed;top:30px;right:15px;width:124px;z-index:999999999 !important;transform:scale(0.85)}#auto-task-buttons p,.show-button-div p{line-height:30px;height:40px;text-align:center;margin:5px !important}#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn{width:105px;line-height:27px;font-size:20px;display:block}.show-button-div{width:20px}.auto-task-capitalize{text-transform:capitalize !important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{box-shadow:inset 0px 0px 4px 1px rgba(100,150,200,.5) !important}.swal2-checkbox-custom{align-items:center;justify-content:center;background:#fff;color:inherit;margin:1em auto}.swal2-checkbox-custom input{flex-shrink:0;margin:0 .4em}.giveaway-actions #getKey{display:none !important}.auto-task-giveaway-status{color:#fff;border-radius:10px;padding:0 5px;margin-left:5px}.auto-task-giveaway-status.active{background-color:#5cb85c}.auto-task-giveaway-status.not-active{background-color:#d9534f}', '' ]); const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___.toString(); }, - 1: function(module) { + 999: function(module) { 'use strict'; module.exports = function(cssWithMappingToString) { var list = []; @@ -521,7 +523,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); return list; }; }, - 398: function(module) { + 494: function(module) { 'use strict'; module.exports = function(i) { return i[1]; @@ -577,7 +579,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); const external_Swal_namespaceObject = Swal; var external_Swal_default = __webpack_require__.n(external_Swal_namespaceObject); const external_Cookies_namespaceObject = Cookies; - var auto_task = __webpack_require__(221); + var auto_task = __webpack_require__(568); var javascript_utils_umd_min = __webpack_require__(108); const httpRequest = async (options, times = 0) => { if (window.TRACE) { @@ -10700,8 +10702,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); }; const scripts_updateChecker = updateChecker; window.STYLE = GM_addStyle(auto_task.Z + `.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`); - window.DEBUG = !!globalOptions.other.debug; - window.TRACE = !!globalOptions.other.debug && typeof console.trace === 'function'; + window.DEBUG = !!globalOptions.other?.debug; + window.TRACE = !!globalOptions.other?.debug && typeof console.trace === 'function'; const loadScript = async () => { if (window.location.hostname === 'www.twitch.tv' && window.location.hash === '#auth') { const authToken = external_Cookies_namespaceObject.get('auth-token'); diff --git a/page/dist/auto-task-v4.compatibility.all.user.js b/page/dist/auto-task-v4.compatibility.all.user.js index 0e1d4c7..dd47687 100644 --- a/page/dist/auto-task-v4.compatibility.all.user.js +++ b/page/dist/auto-task-v4.compatibility.all.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4.compatibility // @namespace auto-task-v4.compatibility -// @version 4.4.7 +// @version 4.4.8 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -32,6 +32,8 @@ // @include *://*.reddit.com/* // @include *://twitter.com/settings/account?k* // @include *://x.com/settings/account* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @include https://auto-task-v4.hclonely.com/setting.html // @include https://auto-task-v4.hclonely.com/history.html @@ -121,7 +123,7 @@ var runtime=function(t){"use strict";var r,e=Object.prototype,n=e.hasOwnProperty console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); -!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date(){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ +!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date(){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ ${text?.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)}),getRedirectLink=async link=>{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError(error,"getRedirectLink"),null}},visitLink=async(link,options)=>{try{const logStatus=scripts_echoLog({type:"visitLink",text:link});return await tools_httpRequest({url:link,method:"GET",...options}).then(({result,statusText,status})=>"Success"===result?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1))}catch(error){return throwError(error,"visitLink"),!1}};const stringToColour=str=>{try{let hash=0;for(let i=0;i>8*i&255;colour+=("00"+value.toString(16)).slice(-2)}return colour}catch(error){return throwError(error,"stringToColour"),"#fff"}},defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};var website_Opquests=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,website_Opquests),saveData=()=>{try{const data={};$("#globalOptionsForm").serializeArray().map(value=>(data[value.name]=value.value,value)),$.makeArray($("#globalOptionsForm input")).map(element=>{const name=$(element).attr("name");var keys=name.split(".");return 3===keys.length?globalOptions[keys[0]][keys[1]][keys[2]]=!!data[name]&&("on"===data[name]||data[name]):2===keys.length&&(globalOptions[keys[0]][keys[1]]=!!data[name]&&("on"===data[name]||data[name])),element}),GM_setValue("globalOptions",globalOptions),external_Swal_default().fire({title:i18n("changeGlobalOptionsSuccess"),icon:"success"})}catch(error){throwError(error,"saveData")}},changeGlobalOptions=showType=>{try{let globalOptionsForm=`
    @@ -152,6 +154,6 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); ${i18n("scriptManager")}${GM_info.scriptHandler}${GM_info.version} ${i18n("script")}${GM_info.script.name}${GM_info.script.version}
    `;$("body").append(`

    ${i18n("environment")}

    `+environmentForm)}catch(error){throwError(error,"Setting.environment")}}},class extends loadScript{name="History";buttons=["doTask","undoTask","selectAll","selectNone","invertSelect","clearHistory"];static test(){return"auto-task-v4.hclonely.com"===window.location.host&&"/history.html"===window.location.pathname}before(){try{$("body").html('
    ').addClass("auto-task-history");const data=GM_listValues()||[];for(const item of data.map(value=>/^[\w]+?Tasks-/.test(value)?value:null).filter(value=>value))this.#addItem(item)}catch(error){throwError(error,"History.before")}}clearHistory(){try{const data=GM_listValues()||[];for(const item of data.map(value=>/^[\w]+?Tasks-/.test(value)?value:null).filter(value=>value))GM_deleteValue(item);external_Swal_default().fire({title:i18n("clearHistoryFinished"),icon:"success"})}catch(error){throwError(error,"History.after")}}#addItem(item){try{var tasksData=GM_getValue(item);if(!tasksData?.tasks)return;let html="",title="",link="";var social,types,[website,id]=item.split("-");switch(website){case"fawTasks":title=`Freeanywhere[${id}]`,link="https://freeanywhere.net/#/giveaway/"+id;break;case"gasTasks":title=`Giveawaysu[${id}]`,link="https://giveaway.su/giveaway/view/"+id;break;case"gcTasks":title=`GiveeClub[${id}]`,link="https://givee.club/event/"+id;break;case"gkTasks":title=`Givekey[${id}]`,link="https://givekey.ru/giveaway/"+id;break;case"gleamTasks":title=`Gleam[${id}]`,link="https://gleam.io"+id;break;case"khTasks":title=`keyhub[${id}]`,link="https://key-hub.eu/giveaway/"+id;break;case"prysTasks":title=`Prys[${id}]`,link="https://prys.revadike.com/giveaway/?id="+id;break;default:return}for([social,types]of Object.entries(tasksData.tasks))for(var[type,tasks]of Object.entries(types))for(const task of tasks)html+=`
  • ${social}.${i18n(type.replace("Link",""))}: ${55
  • `;$(".container").append(`
      ${html}
    ${i18n("lastChangeTime")}: ${dayjs_min(tasksData.time).format("YYYY-MM-DD HH:mm:ss")}
    `),$("span.delete-task").on("click",function(){var itemName=$(this).attr("data-name");itemName?(GM_deleteValue(itemName),$(`div.card[data-name="${itemName}"]`).remove(),external_Swal_default().fire({title:i18n("clearTaskFinished"),text:itemName,icon:"success"})):external_Swal_default().fire({title:i18n("clearTaskFailed"),icon:"error"})})}catch(error){throwError(error,"History.addItem")}}}];const options=function(website,options){try{let websiteOptionsForm=`
    - `;for(var[option,value]of Object.entries(options))websiteOptionsForm+=``;websiteOptionsForm+="
    ${i18n("option")}${i18n("value")}
    ${option}
    ",external_Swal_default().fire({title:i18n("websiteOptions"),html:websiteOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(({isConfirmed})=>{isConfirmed&&($("#websiteOptionsForm").serializeArray().map(value=>(options[value.name]=value.value,value)),GM_setValue(website+"Options",options),external_Swal_default().fire({title:i18n("changeWebsiteOptionsSuccess"),icon:"success"}))})}catch(error){throwError(error,"websiteOptions")}};var loadScript=keyboardJS,external_keyboardJS_default=__webpack_require__.n(loadScript);const checkUpdate=async(updateLink,auto)=>{try{var checkUrl=updateLink+"package.json?time="+(new Date).getTime(),{result,statusText,status,data}=await tools_httpRequest({url:checkUrl,responseType:"json",method:"GET",timeout:3e4});return"Success"===result?data?.response?.version?data.response:(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${data?.statusText}(${data?.status})]`),!1):(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${result}:${statusText}(${status})]`),!1)}catch(error){return throwError(error,"checkUpdate"),!1}};const scripts_updateChecker=async()=>{try{var currentVersion=GM_info.script.version,updateSource=globalOptions.other.autoUpdateSource.toLowerCase(),updateLinks={github:"https://github.com/HCLonely/auto-task-new/raw/main/",jsdelivr:"https://cdn.jsdelivr.net/gh/HCLonely/auto-task-v4@main/",standby:"https://auto-task-v4.hclonely.com/"};let version,updateLink="",packageData;["github","jsdelivr","standby"].includes(updateSource)?(updateLink=updateLinks[updateSource],packageData=await checkUpdate(updateLink,!1)):(updateLink=updateLinks.github,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.jsdelivr,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.standby,packageData=await checkUpdate(updateLink,!0)))),packageData?version=packageData.version||currentVersion:(version=currentVersion,scripts_echoLog({}).error(i18n("checkUpdateFailed"))),packageData&&((currentVersion,remoteVersion)=>{try{const[currentRealVersion]=currentVersion.split("-"),[remoteRealVersion,isPreview]=remoteVersion.split("-");if(isPreview&&!globalOptions.other.receivePreview)return!1;var[currentVersion1,currentVersion2,currentVersion3]=currentRealVersion.split(".").map(value=>parseInt(value,10)),[remoteVersion1,remoteVersion2,remoteVersion3]=remoteRealVersion.split(".").map(value=>parseInt(value,10));return currentVersion1${i18n("newVersionNotice",version,`${updateLink}dist/${GM_info.script.name}.user.js`)}`}),scripts_echoLog({html:`
  • ${i18n("updateText",version)}
    1. ${packageData.change?.map(change=>`
    2. ${change}
    3. `).join("")}
    4. ${i18n("updateHistory")}
    `}))}catch(error){throwError(error,"updateChecker")}};window.STYLE=GM_addStyle(discordAuth.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),window.DEBUG=!!globalOptions.other.debug,window.TRACE=!!globalOptions.other.debug&&"function"==typeof console.trace;loadScript=async()=>{if("www.twitch.tv"!==window.location.hostname||"#auth"!==window.location.hash){if("www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");return 0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var authToken=()=>{const $this=$("#toggle-log");"show"===$this.attr("data-status")?($("#auto-task-info").hide(),$this.attr("data-status","hide").text(i18n("showLog"))):($("#auto-task-info").show(),$this.attr("data-status","show").text(i18n("hideLog")))};if(external_keyboardJS_default().bind(globalOptions.hotKey.doTaskKey,()=>{website.doTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.undoTaskKey,()=>{website.undoTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.toggleLogKey,authToken),website?.after&&await website?.after(),website?.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(website.name+"-buttons");for(const button of website.buttons)if(website[button]){const btnElement=$(`

    ${i18n(button)}

    `);btnElement.find("a.auto-task-website-btn").on("click",()=>{website[button]()}),$("#auto-task-buttons").append(btnElement)}}const hideButtonElement=$(`

    + `;for(var[option,value]of Object.entries(options))websiteOptionsForm+=``;websiteOptionsForm+="
    ${i18n("option")}${i18n("value")}
    ${option}
    ",external_Swal_default().fire({title:i18n("websiteOptions"),html:websiteOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(({isConfirmed})=>{isConfirmed&&($("#websiteOptionsForm").serializeArray().map(value=>(options[value.name]=value.value,value)),GM_setValue(website+"Options",options),external_Swal_default().fire({title:i18n("changeWebsiteOptionsSuccess"),icon:"success"}))})}catch(error){throwError(error,"websiteOptions")}};var loadScript=keyboardJS,external_keyboardJS_default=__webpack_require__.n(loadScript);const checkUpdate=async(updateLink,auto)=>{try{var checkUrl=updateLink+"package.json?time="+(new Date).getTime(),{result,statusText,status,data}=await tools_httpRequest({url:checkUrl,responseType:"json",method:"GET",timeout:3e4});return"Success"===result?data?.response?.version?data.response:(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${data?.statusText}(${data?.status})]`),!1):(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${result}:${statusText}(${status})]`),!1)}catch(error){return throwError(error,"checkUpdate"),!1}};const scripts_updateChecker=async()=>{try{var currentVersion=GM_info.script.version,updateSource=globalOptions.other.autoUpdateSource.toLowerCase(),updateLinks={github:"https://github.com/HCLonely/auto-task-new/raw/main/",jsdelivr:"https://cdn.jsdelivr.net/gh/HCLonely/auto-task-v4@main/",standby:"https://auto-task-v4.hclonely.com/"};let version,updateLink="",packageData;["github","jsdelivr","standby"].includes(updateSource)?(updateLink=updateLinks[updateSource],packageData=await checkUpdate(updateLink,!1)):(updateLink=updateLinks.github,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.jsdelivr,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.standby,packageData=await checkUpdate(updateLink,!0)))),packageData?version=packageData.version||currentVersion:(version=currentVersion,scripts_echoLog({}).error(i18n("checkUpdateFailed"))),packageData&&((currentVersion,remoteVersion)=>{try{const[currentRealVersion]=currentVersion.split("-"),[remoteRealVersion,isPreview]=remoteVersion.split("-");if(isPreview&&!globalOptions.other.receivePreview)return!1;var[currentVersion1,currentVersion2,currentVersion3]=currentRealVersion.split(".").map(value=>parseInt(value,10)),[remoteVersion1,remoteVersion2,remoteVersion3]=remoteRealVersion.split(".").map(value=>parseInt(value,10));return currentVersion1${i18n("newVersionNotice",version,`${updateLink}dist/${GM_info.script.name}.user.js`)}`}),scripts_echoLog({html:`

  • ${i18n("updateText",version)}
    1. ${packageData.change?.map(change=>`
    2. ${change}
    3. `).join("")}
    4. ${i18n("updateHistory")}
    `}))}catch(error){throwError(error,"updateChecker")}};window.STYLE=GM_addStyle(discordAuth.Z+`.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4!important;grid-row:1/4!important;grid-template-columns:1fr 99fr 1fr;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:grid;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto) minmax(-webkit-min-content,auto);grid-template-rows:minmax(min-content,auto) minmax(min-content,auto) minmax(min-content,auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-bottom-start,.swal2-container.swal2-center-start,.swal2-container.swal2-top-start{grid-template-columns:minmax(0,1fr) auto auto}.swal2-container.swal2-bottom,.swal2-container.swal2-center,.swal2-container.swal2-top{grid-template-columns:auto minmax(0,1fr) auto}.swal2-container.swal2-bottom-end,.swal2-container.swal2-center-end,.swal2-container.swal2-top-end{grid-template-columns:auto auto minmax(0,1fr)}.swal2-container.swal2-top-start>.swal2-popup{align-self:start}.swal2-container.swal2-top>.swal2-popup{grid-column:2;align-self:start;justify-self:center}.swal2-container.swal2-top-end>.swal2-popup,.swal2-container.swal2-top-right>.swal2-popup{grid-column:3;align-self:start;justify-self:end}.swal2-container.swal2-center-left>.swal2-popup,.swal2-container.swal2-center-start>.swal2-popup{grid-row:2;align-self:center}.swal2-container.swal2-center>.swal2-popup{grid-column:2;grid-row:2;align-self:center;justify-self:center}.swal2-container.swal2-center-end>.swal2-popup,.swal2-container.swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;align-self:center;justify-self:end}.swal2-container.swal2-bottom-left>.swal2-popup,.swal2-container.swal2-bottom-start>.swal2-popup{grid-column:1;grid-row:3;align-self:end}.swal2-container.swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;justify-self:center;align-self:end}.swal2-container.swal2-bottom-end>.swal2-popup,.swal2-container.swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;align-self:end;justify-self:end}.swal2-container.swal2-grow-fullscreen>.swal2-popup,.swal2-container.swal2-grow-row>.swal2-popup{grid-column:1/4;width:100%}.swal2-container.swal2-grow-column>.swal2-popup,.swal2-container.swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}.swal2-container.swal2-no-transition{transition:none!important}.swal2-popup{display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0,100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-title{position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-loader{display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 transparent #2778c4 transparent}.swal2-styled{margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px transparent;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}.swal2-styled.swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}.swal2-styled.swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}.swal2-styled.swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}.swal2-styled.swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}.swal2-styled.swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}.swal2-styled:focus{outline:0}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto!important;height:.25em;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:2em auto 1em}.swal2-close{z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:0 0;color:#ccc;font-family:serif;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close:focus{outline:0;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}.swal2-close::-moz-focus-inner{border:0}.swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em 2em 3px}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px transparent;color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em 2em 3px;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-file{width:75%;margin-right:auto;margin-left:auto;background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{flex-shrink:0;margin:0 .4em}.swal2-input-label{display:flex;justify-content:center;margin:1em auto 0}.swal2-validation-message{align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:.25em solid transparent;border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-warning.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .5s;animation:swal2-animate-i-mark .5s}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-info.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-i-mark .8s;animation:swal2-animate-i-mark .8s}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-question.swal2-icon-show .swal2-icon-content{-webkit-animation:swal2-animate-question-mark .8s;animation:swal2-animate-question-mark .8s}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@-webkit-keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@-webkit-keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{background-color:transparent!important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:transparent;pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}`),window.DEBUG=!!globalOptions.other?.debug,window.TRACE=!!globalOptions.other?.debug&&"function"==typeof console.trace;loadScript=async()=>{if("www.twitch.tv"!==window.location.hostname||"#auth"!==window.location.hash){if("www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");return 0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var authToken=()=>{const $this=$("#toggle-log");"show"===$this.attr("data-status")?($("#auto-task-info").hide(),$this.attr("data-status","hide").text(i18n("showLog"))):($("#auto-task-info").show(),$this.attr("data-status","show").text(i18n("hideLog")))};if(external_keyboardJS_default().bind(globalOptions.hotKey.doTaskKey,()=>{website.doTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.undoTaskKey,()=>{website.undoTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.toggleLogKey,authToken),website?.after&&await website?.after(),website?.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(website.name+"-buttons");for(const button of website.buttons)if(website[button]){const btnElement=$(`

    ${i18n(button)}

    `);btnElement.find("a.auto-task-website-btn").on("click",()=>{website[button]()}),$("#auto-task-buttons").append(btnElement)}}const hideButtonElement=$(`

    ${i18n("hideButton")}

    `);hideButtonElement.find("a.auto-task-website-btn").on("click",()=>{$("#auto-task-buttons").hide(),$("div.show-button-div").show()});const toggleLogElement=$(`

    ${globalOptions.other.defaultShowLog?i18n("hideLog"):i18n("showLog")}

    `);toggleLogElement.find("a.auto-task-website-btn").on("click",authToken),$("#auto-task-buttons").append(hideButtonElement).append(toggleLogElement),website?.options&&GM_registerMenuCommand(i18n("changeWebsiteOptions"),()=>{options(website.name,website.options)}),"Setting"!==website.name&&(GM_registerMenuCommand(i18n("changeGlobalOptions"),()=>{changeGlobalOptions("swal")}),GM_registerMenuCommand(i18n("settingPage"),()=>{window.open("https://auto-task-v4.hclonely.com/setting.html","_blank")})),console.log("%c%s","color:#1bbe1a","Auto-Task[Load]: 脚本加载完成");var[v1,authToken]=GM_info.version.split(".");5<=parseInt(v1,10)&&2<=parseInt(authToken,10)||scripts_echoLog({}).error(i18n("versionNotMatched")),GM_getValue("notice")||(external_Swal_default().fire({title:i18n("swalNotice"),icon:"warning"}).then(()=>{window.open(i18n("noticeLink"),"_blank"),GM_setValue("notice",(new Date).getTime())}),scripts_echoLog({html:`
  • ${i18n("echoNotice",i18n("noticeLink"))}
  • `}).font?.find("a").on("click",()=>{GM_setValue("notice",(new Date).getTime())})),scripts_updateChecker()}else console.log("%c%s","color:#ff0000","Auto-Task[Warning]: 脚本停止加载,当前网站不支持!")}else{authToken=external_Cookies_namespaceObject.get("auth-token");!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientVersion:__twilightBuildID,clientId:commonOptions?.headers?.["Client-ID"],deviceId:commonOptions?.headers?.["Device-ID"],clientSessionId:window.localStorage.local_storage_app_session_id.replace(/"/g,"")}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}};if("discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{if(0!==$("[data-miniprofile]").length){window.onbeforeunload=function(event){return GM_setValue("steamStoreAuth",null),null};var storeSessionID=document.body.innerHTML.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(GM_setValue("steamStoreAuth",{storeSessionID:storeSessionID}),!0):void 0}}):window.opener&&"steamcommunity.com"===window.location.host&&window.location.pathname.includes("/id/")?$(()=>{window.onbeforeunload=function(event){return GM_setValue("steamCommunityAuth",null),null};var steam64Id=document.body.innerHTML.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=document.body.innerHTML.match(/g_sessionID = "(.+?)";/)?.[1],userName=document.body.innerHTML.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];const data={};if(steam64Id&&(data.steam64Id=steam64Id),userName&&(data.userName=userName),communitySessionID)return data.communitySessionID=communitySessionID,GM_setValue("steamCommunityAuth",data),!0}):("key-hub.eu"===window.location.hostname&&(unsafeWindow.keyhubtracker=1,unsafeWindow.gaData={}),$(loadScript))}()}(); \ No newline at end of file diff --git a/page/dist/auto-task-v4.compatibility.user.js b/page/dist/auto-task-v4.compatibility.user.js index 86f6017..6f2c2b7 100644 --- a/page/dist/auto-task-v4.compatibility.user.js +++ b/page/dist/auto-task-v4.compatibility.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4.compatibility // @namespace auto-task-v4.compatibility -// @version 4.4.7 +// @version 4.4.8 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -32,6 +32,8 @@ // @include *://*.reddit.com/* // @include *://twitter.com/settings/account?k* // @include *://x.com/settings/account* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @include https://auto-task-v4.hclonely.com/setting.html // @include https://auto-task-v4.hclonely.com/history.html @@ -102,7 +104,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); -!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date(){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ +!function(){var __webpack_modules__={108:function(__unused_webpack_module,exports){!function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var n,o=1,t=arguments.length;o[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===n?void 0:n.groups)&&void 0!==o?o:{},s=i.name,a=i.version,c={},f=0,u=Object.entries(this.browserNameMap);f(.*)=.+)/.exec(decodeURIComponent(e)))||void 0===e?void 0:e.groups;if(!e)return{};for(var n=e.params.split("&"),t={},o=0;o=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date(){window.TRACE&&console.trace("%cAuto-Task[Debug]:","color:blue");try{var result=await new Promise(resolve=>{options.dataType&&(options.responseType=options.dataType);var requestObj={timeout:3e4,ontimeout(data){resolve({result:"Error",statusText:"Timeout",status:601,data:data,options:options})},onabort(data){resolve({result:"Error",statusText:"Aborted",status:602,data:data,options:options})},onerror(data){resolve({result:"Error",statusText:"Error",status:603,data:data,options:options})},onload(data){if("json"===options.responseType&&data?.response&&"object"!=typeof data.response)try{data.response=JSON.parse(data.responseText)}catch(error){}resolve({result:"Success",statusText:"Load",status:600,data:data,options:options})},...options};GM_xmlhttpRequest(requestObj)});return window.DEBUG&&console.log("%cAuto-Task[httpRequest]:","color:blue",JSON.stringify(result)),600!==result.status&×<2?await httpRequest(options,times+1):result}catch(error){return console.log("%cAuto-Task[httpRequest]:","color:red",JSON.stringify({errorMsg:error,options:options})),throwError(error,"httpRequest"),{result:"JsError",statusText:"Error",status:604,error:error,options:options}}},tools_httpRequest=httpRequest;const scripts_echoLog=({type,text,html,id})=>{const emptyStatus={success:()=>emptyStatus,error:()=>emptyStatus,warning:()=>emptyStatus,info:()=>emptyStatus,view:()=>emptyStatus};try{let ele;if(type)switch(type){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"joiningSteamOfficialGroup":case"leavingSteamOfficialGroup":case"gettingSteamOfficialGroupId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingCurator":case"unfollowingCurator":case"gettingCuratorId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":case"gettingSubid":case"addingFreeLicense":case"requestingPlayTestAccess":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"addingFreeLicenseSubid":ele=$(`
  • ${i18n("addingFreeLicense")}[${text}]...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":ele=$(`
  • ${i18n(type)}[ ${text}]...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":ele=$(`
  • ${i18n(type)}[ ${id}]...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"leavingDiscordServer":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"updateDiscordAuth":ele=$(`
  • ${i18n("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"retweetting":case"unretweetting":ele=$(`
  • ${i18n(type)}${text}...
  • `);break;case"joiningReddit":case"leavingReddit":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":ele=$(`
  • ${i18n(type)}[ ${text?.replace("u_","")}]...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":ele=$(`
  • ${i18n(type)}[${text}]...
  • `);break;case"visitingLink":ele=$(`
  • ${i18n("visitingLink")}[${text}]...
  • `);break;case"verifyingInsAuth":case"text":ele=$(`
  • ${i18n(text)}
  • `);break;case"html":ele=$(text||html);break;case"whiteList":ele=$(`
  • ${i18n("skipTask")}[${text}(${id})](${i18n("whiteList")})
  • `);break;case"globalOptionsSkip":ele=$(`
  • ${i18n("skipTaskOption")}${text}
  • `);break;default:ele=$(`
  • ${i18n("unKnown")}:${type}(${text})...
  • `)}else ele=text?$(`
  • ${i18n(text)}
  • `):html?$(html):$("
  • ");return ele.addClass("card-text"),$("#auto-task-info").append(ele),ele[0]?.scrollIntoView(),{font:ele.find("font"),success(text="Success",html=!1){return this.font?.attr("class","").addClass("success"),html?this.font?.html(text):this.font?.text(text),this},error(text="Error",html=!1){return this.font?.attr("class","").addClass("error"),html?this.font?.html(text):this.font?.text(text),this},warning(text="Warning",html=!1){return this.font?.attr("class","").addClass("warning"),html?this.font?.html(text):this.font?.text(text),this},info(text="Info",html=!1){return this.font?.attr("class","").addClass("info"),html?this.font?.html(text):this.font?.text(text),this},view(){return this.font?.[0].scrollIntoView(),this}}}catch(error){return throwError(error,"echoLog"),emptyStatus}},unique=array=>{try{return[...new Set(array)]}catch(error){return throwError(error,"unique"),[]}},delay=(time=1e3)=>new Promise(resolve=>{setTimeout(()=>{resolve(!0)},time)}),getRedirectLink=async link=>{try{if(!link)return null;const redirectLinksCache=GM_getValue("redirectLinks")||{};return redirectLinksCache[link]&&redirectLinksCache[link],await tools_httpRequest({url:link,method:"GET"}).then(({data})=>data?.finalUrl?(redirectLinksCache[link]=data.finalUrl,GM_setValue("redirectLinks",redirectLinksCache),data.finalUrl):null)}catch(error){return throwError(error,"getRedirectLink"),null}},visitLink=async(link,options)=>{try{const logStatus=scripts_echoLog({type:"visitLink",text:link});return await tools_httpRequest({url:link,method:"GET",...options}).then(({result,statusText,status})=>"Success"===result?(logStatus.success(),!0):(logStatus.error(result+`:${statusText}(${status})`),!1))}catch(error){return throwError(error,"visitLink"),!1}};const stringToColour=str=>{try{let hash=0;for(let i=0;i>8*i&255;colour+=("00"+value.toString(16)).slice(-2)}return colour}catch(error){return throwError(error,"stringToColour"),"#fff"}},defaultGlobalOptions={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0,licenses:!0,playtests:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,officialGroups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},ASF:{AsfEnabled:!1,AsfIpcUrl:"",AsfIpcPassword:"",AsfBotname:"asf"},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsdelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0,debug:!1,receivePreview:!0}};var website_Opquests=GM_getValue("globalOptions")||{};const assignObject=(obj1,obj2)=>{try{const newObj={};for(var[key,value]of Object.entries(obj1))"[object Object]"===Object.prototype.toString.call(value)&&"[object Object]"===Object.prototype.toString.call(obj2[key])?newObj[key]=assignObject(value,obj2[key]):newObj[key]=obj2[key]??value;return newObj}catch(error){return throwError(error,"assignObject"),defaultGlobalOptions}},globalOptions=assignObject(defaultGlobalOptions,website_Opquests),saveData=()=>{try{const data={};$("#globalOptionsForm").serializeArray().map(value=>(data[value.name]=value.value,value)),$.makeArray($("#globalOptionsForm input")).map(element=>{const name=$(element).attr("name");var keys=name.split(".");return 3===keys.length?globalOptions[keys[0]][keys[1]][keys[2]]=!!data[name]&&("on"===data[name]||data[name]):2===keys.length&&(globalOptions[keys[0]][keys[1]]=!!data[name]&&("on"===data[name]||data[name])),element}),GM_setValue("globalOptions",globalOptions),external_Swal_default().fire({title:i18n("changeGlobalOptionsSuccess"),icon:"success"})}catch(error){throwError(error,"saveData")}},changeGlobalOptions=showType=>{try{let globalOptionsForm=`
    @@ -133,6 +135,6 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); ${i18n("scriptManager")}${GM_info.scriptHandler}${GM_info.version} ${i18n("script")}${GM_info.script.name}${GM_info.script.version}
    `;$("body").append(`

    ${i18n("environment")}

    `+environmentForm)}catch(error){throwError(error,"Setting.environment")}}},class extends loadScript{name="History";buttons=["doTask","undoTask","selectAll","selectNone","invertSelect","clearHistory"];static test(){return"auto-task-v4.hclonely.com"===window.location.host&&"/history.html"===window.location.pathname}before(){try{$("body").html('
    ').addClass("auto-task-history");const data=GM_listValues()||[];for(const item of data.map(value=>/^[\w]+?Tasks-/.test(value)?value:null).filter(value=>value))this.#addItem(item)}catch(error){throwError(error,"History.before")}}clearHistory(){try{const data=GM_listValues()||[];for(const item of data.map(value=>/^[\w]+?Tasks-/.test(value)?value:null).filter(value=>value))GM_deleteValue(item);external_Swal_default().fire({title:i18n("clearHistoryFinished"),icon:"success"})}catch(error){throwError(error,"History.after")}}#addItem(item){try{var tasksData=GM_getValue(item);if(!tasksData?.tasks)return;let html="",title="",link="";var social,types,[website,id]=item.split("-");switch(website){case"fawTasks":title=`Freeanywhere[${id}]`,link="https://freeanywhere.net/#/giveaway/"+id;break;case"gasTasks":title=`Giveawaysu[${id}]`,link="https://giveaway.su/giveaway/view/"+id;break;case"gcTasks":title=`GiveeClub[${id}]`,link="https://givee.club/event/"+id;break;case"gkTasks":title=`Givekey[${id}]`,link="https://givekey.ru/giveaway/"+id;break;case"gleamTasks":title=`Gleam[${id}]`,link="https://gleam.io"+id;break;case"khTasks":title=`keyhub[${id}]`,link="https://key-hub.eu/giveaway/"+id;break;case"prysTasks":title=`Prys[${id}]`,link="https://prys.revadike.com/giveaway/?id="+id;break;default:return}for([social,types]of Object.entries(tasksData.tasks))for(var[type,tasks]of Object.entries(types))for(const task of tasks)html+=`
  • ${social}.${i18n(type.replace("Link",""))}: ${55
  • `;$(".container").append(`
      ${html}
    ${i18n("lastChangeTime")}: ${dayjs_min(tasksData.time).format("YYYY-MM-DD HH:mm:ss")}
    `),$("span.delete-task").on("click",function(){var itemName=$(this).attr("data-name");itemName?(GM_deleteValue(itemName),$(`div.card[data-name="${itemName}"]`).remove(),external_Swal_default().fire({title:i18n("clearTaskFinished"),text:itemName,icon:"success"})):external_Swal_default().fire({title:i18n("clearTaskFailed"),icon:"error"})})}catch(error){throwError(error,"History.addItem")}}}];const options=function(website,options){try{let websiteOptionsForm=`
    - `;for(var[option,value]of Object.entries(options))websiteOptionsForm+=``;websiteOptionsForm+="
    ${i18n("option")}${i18n("value")}
    ${option}
    ",external_Swal_default().fire({title:i18n("websiteOptions"),html:websiteOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(({isConfirmed})=>{isConfirmed&&($("#websiteOptionsForm").serializeArray().map(value=>(options[value.name]=value.value,value)),GM_setValue(website+"Options",options),external_Swal_default().fire({title:i18n("changeWebsiteOptionsSuccess"),icon:"success"}))})}catch(error){throwError(error,"websiteOptions")}};var loadScript=keyboardJS,external_keyboardJS_default=__webpack_require__.n(loadScript);const checkUpdate=async(updateLink,auto)=>{try{var checkUrl=updateLink+"package.json?time="+(new Date).getTime(),{result,statusText,status,data}=await tools_httpRequest({url:checkUrl,responseType:"json",method:"GET",timeout:3e4});return"Success"===result?data?.response?.version?data.response:(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${data?.statusText}(${data?.status})]`),!1):(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${result}:${statusText}(${status})]`),!1)}catch(error){return throwError(error,"checkUpdate"),!1}};const scripts_updateChecker=async()=>{try{var currentVersion=GM_info.script.version,updateSource=globalOptions.other.autoUpdateSource.toLowerCase(),updateLinks={github:"https://github.com/HCLonely/auto-task-new/raw/main/",jsdelivr:"https://cdn.jsdelivr.net/gh/HCLonely/auto-task-v4@main/",standby:"https://auto-task-v4.hclonely.com/"};let version,updateLink="",packageData;["github","jsdelivr","standby"].includes(updateSource)?(updateLink=updateLinks[updateSource],packageData=await checkUpdate(updateLink,!1)):(updateLink=updateLinks.github,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.jsdelivr,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.standby,packageData=await checkUpdate(updateLink,!0)))),packageData?version=packageData.version||currentVersion:(version=currentVersion,scripts_echoLog({}).error(i18n("checkUpdateFailed"))),packageData&&((currentVersion,remoteVersion)=>{try{const[currentRealVersion]=currentVersion.split("-"),[remoteRealVersion,isPreview]=remoteVersion.split("-");if(isPreview&&!globalOptions.other.receivePreview)return!1;var[currentVersion1,currentVersion2,currentVersion3]=currentRealVersion.split(".").map(value=>parseInt(value,10)),[remoteVersion1,remoteVersion2,remoteVersion3]=remoteRealVersion.split(".").map(value=>parseInt(value,10));return currentVersion1${i18n("newVersionNotice",version,`${updateLink}dist/${GM_info.script.name}.user.js`)}`}),scripts_echoLog({html:`
  • ${i18n("updateText",version)}
    1. ${packageData.change?.map(change=>`
    2. ${change}
    3. `).join("")}
    4. ${i18n("updateHistory")}
    `}))}catch(error){throwError(error,"updateChecker")}};window.STYLE=GM_addStyle(discordAuth.Z+GM_getResourceText("style")),window.DEBUG=!!globalOptions.other.debug,window.TRACE=!!globalOptions.other.debug&&"function"==typeof console.trace;loadScript=async()=>{if("www.twitch.tv"!==window.location.hostname||"#auth"!==window.location.hash){if("www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");return 0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var authToken=()=>{const $this=$("#toggle-log");"show"===$this.attr("data-status")?($("#auto-task-info").hide(),$this.attr("data-status","hide").text(i18n("showLog"))):($("#auto-task-info").show(),$this.attr("data-status","show").text(i18n("hideLog")))};if(external_keyboardJS_default().bind(globalOptions.hotKey.doTaskKey,()=>{website.doTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.undoTaskKey,()=>{website.undoTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.toggleLogKey,authToken),website?.after&&await website?.after(),website?.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(website.name+"-buttons");for(const button of website.buttons)if(website[button]){const btnElement=$(`

    ${i18n(button)}

    `);btnElement.find("a.auto-task-website-btn").on("click",()=>{website[button]()}),$("#auto-task-buttons").append(btnElement)}}const hideButtonElement=$(`

    + `;for(var[option,value]of Object.entries(options))websiteOptionsForm+=``;websiteOptionsForm+="
    ${i18n("option")}${i18n("value")}
    ${option}
    ",external_Swal_default().fire({title:i18n("websiteOptions"),html:websiteOptionsForm,showConfirmButton:!0,confirmButtonText:i18n("save"),showCancelButton:!0,cancelButtonText:i18n("close")}).then(({isConfirmed})=>{isConfirmed&&($("#websiteOptionsForm").serializeArray().map(value=>(options[value.name]=value.value,value)),GM_setValue(website+"Options",options),external_Swal_default().fire({title:i18n("changeWebsiteOptionsSuccess"),icon:"success"}))})}catch(error){throwError(error,"websiteOptions")}};var loadScript=keyboardJS,external_keyboardJS_default=__webpack_require__.n(loadScript);const checkUpdate=async(updateLink,auto)=>{try{var checkUrl=updateLink+"package.json?time="+(new Date).getTime(),{result,statusText,status,data}=await tools_httpRequest({url:checkUrl,responseType:"json",method:"GET",timeout:3e4});return"Success"===result?data?.response?.version?data.response:(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${data?.statusText}(${data?.status})]`),!1):(auto||scripts_echoLog({}).error(i18n("checkUpdateFailed")+`[${result}:${statusText}(${status})]`),!1)}catch(error){return throwError(error,"checkUpdate"),!1}};const scripts_updateChecker=async()=>{try{var currentVersion=GM_info.script.version,updateSource=globalOptions.other.autoUpdateSource.toLowerCase(),updateLinks={github:"https://github.com/HCLonely/auto-task-new/raw/main/",jsdelivr:"https://cdn.jsdelivr.net/gh/HCLonely/auto-task-v4@main/",standby:"https://auto-task-v4.hclonely.com/"};let version,updateLink="",packageData;["github","jsdelivr","standby"].includes(updateSource)?(updateLink=updateLinks[updateSource],packageData=await checkUpdate(updateLink,!1)):(updateLink=updateLinks.github,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.jsdelivr,packageData=await checkUpdate(updateLink,!0),packageData||(updateLink=updateLinks.standby,packageData=await checkUpdate(updateLink,!0)))),packageData?version=packageData.version||currentVersion:(version=currentVersion,scripts_echoLog({}).error(i18n("checkUpdateFailed"))),packageData&&((currentVersion,remoteVersion)=>{try{const[currentRealVersion]=currentVersion.split("-"),[remoteRealVersion,isPreview]=remoteVersion.split("-");if(isPreview&&!globalOptions.other.receivePreview)return!1;var[currentVersion1,currentVersion2,currentVersion3]=currentRealVersion.split(".").map(value=>parseInt(value,10)),[remoteVersion1,remoteVersion2,remoteVersion3]=remoteRealVersion.split(".").map(value=>parseInt(value,10));return currentVersion1${i18n("newVersionNotice",version,`${updateLink}dist/${GM_info.script.name}.user.js`)}`}),scripts_echoLog({html:`

  • ${i18n("updateText",version)}
    1. ${packageData.change?.map(change=>`
    2. ${change}
    3. `).join("")}
    4. ${i18n("updateHistory")}
    `}))}catch(error){throwError(error,"updateChecker")}};window.STYLE=GM_addStyle(discordAuth.Z+GM_getResourceText("style")),window.DEBUG=!!globalOptions.other?.debug,window.TRACE=!!globalOptions.other?.debug&&"function"==typeof console.trace;loadScript=async()=>{if("www.twitch.tv"!==window.location.hostname||"#auth"!==window.location.hash){if("www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const betaButton=$("#redesign-beta-optin-btn");return 0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var authToken=()=>{const $this=$("#toggle-log");"show"===$this.attr("data-status")?($("#auto-task-info").hide(),$this.attr("data-status","hide").text(i18n("showLog"))):($("#auto-task-info").show(),$this.attr("data-status","show").text(i18n("hideLog")))};if(external_keyboardJS_default().bind(globalOptions.hotKey.doTaskKey,()=>{website.doTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.undoTaskKey,()=>{website.undoTask&&website.doTask()}),external_keyboardJS_default().bind(globalOptions.hotKey.toggleLogKey,authToken),website?.after&&await website?.after(),website?.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(website.name+"-buttons");for(const button of website.buttons)if(website[button]){const btnElement=$(`

    ${i18n(button)}

    `);btnElement.find("a.auto-task-website-btn").on("click",()=>{website[button]()}),$("#auto-task-buttons").append(btnElement)}}const hideButtonElement=$(`

    ${i18n("hideButton")}

    `);hideButtonElement.find("a.auto-task-website-btn").on("click",()=>{$("#auto-task-buttons").hide(),$("div.show-button-div").show()});const toggleLogElement=$(`

    ${globalOptions.other.defaultShowLog?i18n("hideLog"):i18n("showLog")}

    `);toggleLogElement.find("a.auto-task-website-btn").on("click",authToken),$("#auto-task-buttons").append(hideButtonElement).append(toggleLogElement),website?.options&&GM_registerMenuCommand(i18n("changeWebsiteOptions"),()=>{options(website.name,website.options)}),"Setting"!==website.name&&(GM_registerMenuCommand(i18n("changeGlobalOptions"),()=>{changeGlobalOptions("swal")}),GM_registerMenuCommand(i18n("settingPage"),()=>{window.open("https://auto-task-v4.hclonely.com/setting.html","_blank")})),console.log("%c%s","color:#1bbe1a","Auto-Task[Load]: 脚本加载完成");var[v1,authToken]=GM_info.version.split(".");5<=parseInt(v1,10)&&2<=parseInt(authToken,10)||scripts_echoLog({}).error(i18n("versionNotMatched")),GM_getValue("notice")||(external_Swal_default().fire({title:i18n("swalNotice"),icon:"warning"}).then(()=>{window.open(i18n("noticeLink"),"_blank"),GM_setValue("notice",(new Date).getTime())}),scripts_echoLog({html:`
  • ${i18n("echoNotice",i18n("noticeLink"))}
  • `}).font?.find("a").on("click",()=>{GM_setValue("notice",(new Date).getTime())})),scripts_updateChecker()}else console.log("%c%s","color:#ff0000","Auto-Task[Warning]: 脚本停止加载,当前网站不支持!")}else{authToken=external_Cookies_namespaceObject.get("auth-token");!!external_Cookies_namespaceObject.get("login")?(GM_setValue("twitchAuth",{authToken:authToken,clientVersion:__twilightBuildID,clientId:commonOptions?.headers?.["Client-ID"],deviceId:commonOptions?.headers?.["Device-ID"],clientSessionId:window.localStorage.local_storage_app_session_id.replace(/"/g,"")}),window.close(),external_Swal_default().fire("",i18n("closePageNotice"))):external_Swal_default().fire("",i18n("needLogin"))}};if("discord.com"===window.location.hostname){const LocalStorage=window.localStorage;if("#auth"===window.location.hash){window.localStorage.removeItem=()=>!0;discordAuth=LocalStorage?.getItem("token")?.replace(/^"|"$/g,"");discordAuth&&0{if(0!==$("[data-miniprofile]").length){window.onbeforeunload=function(event){return GM_setValue("steamStoreAuth",null),null};var storeSessionID=document.body.innerHTML.match(/g_sessionID = "(.+?)";/)?.[1];return storeSessionID?(GM_setValue("steamStoreAuth",{storeSessionID:storeSessionID}),!0):void 0}}):window.opener&&"steamcommunity.com"===window.location.host&&window.location.pathname.includes("/id/")?$(()=>{window.onbeforeunload=function(event){return GM_setValue("steamCommunityAuth",null),null};var steam64Id=document.body.innerHTML.match(/g_steamID = "(.+?)";/)?.[1],communitySessionID=document.body.innerHTML.match(/g_sessionID = "(.+?)";/)?.[1],userName=document.body.innerHTML.match(/steamcommunity.com\/id\/(.+?)\/friends\//)?.[1];const data={};if(steam64Id&&(data.steam64Id=steam64Id),userName&&(data.userName=userName),communitySessionID)return data.communitySessionID=communitySessionID,GM_setValue("steamCommunityAuth",data),!0}):("key-hub.eu"===window.location.hostname&&(unsafeWindow.keyhubtracker=1,unsafeWindow.gaData={}),$(loadScript))}()}(); \ No newline at end of file diff --git a/page/dist/auto-task-v4.user.js b/page/dist/auto-task-v4.user.js index 473b52d..c7b2975 100644 --- a/page/dist/auto-task-v4.user.js +++ b/page/dist/auto-task-v4.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4 // @namespace auto-task-v4 -// @version 4.4.7 +// @version 4.4.8 // @description 自动完成 Freeanywhere,Giveawaysu,GiveeClub,Givekey,Gleam,Indiedb,keyhub,OpiumPulses,Opquests,SweepWidget 等网站的任务。 // @description:en Automatically complete the tasks of FreeAnyWhere, GiveawaySu, GiveeClub, Givekey, Gleam, Indiedb, keyhub, OpiumPulses, Opquests, SweepWidget websites. // @author HCLonely @@ -32,6 +32,8 @@ // @include *://*.reddit.com/* // @include *://twitter.com/settings/account?k* // @include *://x.com/settings/account* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @include https://auto-task-v4.hclonely.com/setting.html // @include https://auto-task-v4.hclonely.com/history.html @@ -409,22 +411,22 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); }); }); }, - 221: function(module, __webpack_exports__, __webpack_require__) { + 568: function(module, __webpack_exports__, __webpack_require__) { 'use strict'; __webpack_require__.d(__webpack_exports__, { Z: function() { return __WEBPACK_DEFAULT_EXPORT__; } }); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(398); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1); - var _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); - var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_css_loader_6_5_1_webpack_5_60_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(494); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(999); + var _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = __webpack_require__.n(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__); + var ___CSS_LOADER_EXPORT___ = _node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()(_node_modules_pnpm_css_loader_6_5_1_webpack_5_76_0_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()); ___CSS_LOADER_EXPORT___.push([ module.id, '.colorful-button,#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn,body.auto-task-options .auto-task-form table button{position:relative;padding:5px 10px;text-align:center;color:#fff;text-decoration:none;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:30px;background-size:400%;text-transform:capitalize}.colorful-button:hover,#auto-task-buttons a.auto-task-website-btn:hover,.show-button-div a.auto-task-website-btn:hover,body.auto-task-options .auto-task-form table button:hover{transform:scale(1.05);box-shadow:0 6px 20px rgba(0,0,0,.3);cursor:pointer}.colorful-button:hover::before,#auto-task-buttons a.auto-task-website-btn:hover::before,.show-button-div a.auto-task-website-btn:hover::before,body.auto-task-options .auto-task-form table button:hover::before{filter:blur(10px);opacity:1}.colorful-button::before,#auto-task-buttons a.auto-task-website-btn::before,.show-button-div a.auto-task-website-btn::before,body.auto-task-options .auto-task-form table button::before{content:"";position:absolute;top:-5px;left:-5px;right:-5px;bottom:-5px;z-index:-1;background:linear-gradient(90deg, #03a9f4, #f441a5, #ffeb3b, #03a9f4);border-radius:40px;background-size:400%;opacity:-1}#auto-task-info{position:fixed;bottom:10px;right:10px;width:60%;max-width:500px;max-height:60%;overflow-y:auto;color:#000;background-color:#fff;padding-left:5px;z-index:999999999 !important;border:solid 2px #add8e6;border-radius:10px}#auto-task-info li{text-align:left}#auto-task-info li a.high-light{color:#00aeff;font-weight:bold}#auto-task-info .success{color:green}#auto-task-info .error{color:red}#auto-task-info .warning{color:blue}#auto-task-info .info{color:#ff0}#auto-task-info .update-text{color:green;border:solid 2px #8dcb69;margin:5px 10px 5px 20px;border-radius:10px;padding:5px 20px}.auto-task-keylol{display:inline-block;text-transform:capitalize;margin-left:10px;text-decoration:none !important;border:solid 1px;border-radius:5px;padding:0 2px}.auto-task-keylol[selected=selected]{background-color:blue !important;color:#fff !important}.auto-task-form table{font-family:verdana,arial,sans-serif;font-size:11px;color:#333;border-width:1px;border-color:#999;border-collapse:collapse;width:100%}.auto-task-form table thead td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;font-weight:bold;background-color:#fff}.auto-task-form table tbody tr{background-color:#d4e3e5}.auto-task-form table tbody tr:hover{background-color:#ff6 !important}.auto-task-form table tbody tr th{background-color:#c3dde0;border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9;text-transform:capitalize}.auto-task-form table tbody tr td{border-width:1px;padding:8px;border-style:solid;border-color:#a9c6c9}.swal2-modal{width:70% !important;max-width:1000px !important}body.auto-task-options{padding-top:10px;text-align:center}body.auto-task-options .auto-task-form{width:80%;max-width:1000px;margin:0 auto;padding-bottom:20px}body.auto-task-options .auto-task-form table input.editOption{width:80%}body.auto-task-options .auto-task-form table #getTwitterUserId,body.auto-task-options .auto-task-form table #getYoutubeChannelId{margin-top:5px}body.auto-task-options .auto-task-form table button{z-index:1}body.auto-task-options .auto-task-form table input[type=text]{outline-style:none;border:1px solid #ccc;border-radius:3px;padding:5px 10px;font-size:14px}body.auto-task-options .auto-task-form table input[type=text]:focus{border-color:#66afe9;outline:0;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}body.auto-task-options .auto-task-form table label{position:relative;width:160px;height:80px;cursor:pointer;transform:scale(0.25);margin:-25% 0;top:-30px;display:inline-block}body.auto-task-options .auto-task-form table label input{position:relative;z-index:1;appearance:none}body.auto-task-options .auto-task-form table label input:checked~span{background:#05be05;box-shadow:0 15px 25px #05be0566}body.auto-task-options .auto-task-form table label input:checked~span i{left:84px}body.auto-task-options .auto-task-form table label input:checked~span i::before{background:#05be05;box-shadow:35px 0 0 #05be05}body.auto-task-options .auto-task-form table label input:checked~span i::after{bottom:12px;height:15px;border-bottom-left-radius:15px;border-bottom-right-radius:15px;background:#05be05}body.auto-task-options .auto-task-form table label span{position:absolute;top:0;left:0;width:100%;height:100%;background:#fe0000;border-radius:80px;transition:.5s;box-shadow:0 15px 25px #fe000066}body.auto-task-options .auto-task-form table label span i{position:absolute;top:4px;left:4px;width:72px;height:72px;background:#fff;border-radius:50%}body.auto-task-options .auto-task-form table label span i::before{content:"";position:absolute;top:22px;left:12px;width:12px;height:12px;border-radius:50%;background:#fe0000;box-shadow:35px 0 0 #fe0000;transition:.5s}body.auto-task-options .auto-task-form table label span i::after{content:"";position:absolute;bottom:15px;left:calc(50% - 15px);width:30px;height:6px;border-radius:6px;background:#fe0000;transition:.5s}body.auto-task-history{font-size:15px;font-weight:400;line-height:1.5}body.auto-task-history .container a{color:#007bff;text-decoration:none;background-color:transparent}body.auto-task-history .container .card{width:80%;max-width:800px;border-radius:10px;background:#7676761a;border-top:1px solid #ffffff80;-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);box-shadow:0 15px 25px #0000001a;margin:20px auto;position:relative;display:flex;flex-direction:column;word-wrap:break-word;-webkit-background-clip:border-box;background-clip:border-box;border:1px solid rgba(0,0,0,.125);border-radius:.25rem}body.auto-task-history .container .card .title{text-align:center;font-size:30px;font-weight:bold;margin:5px 0}body.auto-task-history .container .card .title a:hover{text-decoration:none;background:#93e1ff;border-radius:10px;padding:3px}body.auto-task-history .container .card ul{margin-bottom:25px}body.auto-task-history .container .card ul li{margin-bottom:5px;line-height:20px}body.auto-task-history .container .card ul a:hover{text-decoration:underline}body.auto-task-history .container .card .delete-task{right:10px;width:38px;height:35px;position:absolute;font-size:24px;cursor:pointer;border-radius:10px}body.auto-task-history .container .card .delete-task:hover{background:#fff}body.auto-task-history .container .card .time{right:5px;position:absolute;bottom:0;color:#e83e8c;font-family:\'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace\';font-size:15px}#auto-task-buttons,.show-button-div{position:fixed;top:30px;right:15px;width:124px;z-index:999999999 !important;transform:scale(0.85)}#auto-task-buttons p,.show-button-div p{line-height:30px;height:40px;text-align:center;margin:5px !important}#auto-task-buttons a.auto-task-website-btn,.show-button-div a.auto-task-website-btn{width:105px;line-height:27px;font-size:20px;display:block}.show-button-div{width:20px}.auto-task-capitalize{text-transform:capitalize !important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{box-shadow:inset 0px 0px 4px 1px rgba(100,150,200,.5) !important}.swal2-checkbox-custom{align-items:center;justify-content:center;background:#fff;color:inherit;margin:1em auto}.swal2-checkbox-custom input{flex-shrink:0;margin:0 .4em}.giveaway-actions #getKey{display:none !important}.auto-task-giveaway-status{color:#fff;border-radius:10px;padding:0 5px;margin-left:5px}.auto-task-giveaway-status.active{background-color:#5cb85c}.auto-task-giveaway-status.not-active{background-color:#d9534f}', '' ]); const __WEBPACK_DEFAULT_EXPORT__ = ___CSS_LOADER_EXPORT___.toString(); }, - 1: function(module) { + 999: function(module) { 'use strict'; module.exports = function(cssWithMappingToString) { var list = []; @@ -502,7 +504,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); return list; }; }, - 398: function(module) { + 494: function(module) { 'use strict'; module.exports = function(i) { return i[1]; @@ -558,7 +560,7 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); const external_Swal_namespaceObject = Swal; var external_Swal_default = __webpack_require__.n(external_Swal_namespaceObject); const external_Cookies_namespaceObject = Cookies; - var auto_task = __webpack_require__(221); + var auto_task = __webpack_require__(568); var javascript_utils_umd_min = __webpack_require__(108); const httpRequest = async (options, times = 0) => { if (window.TRACE) { @@ -10681,8 +10683,8 @@ console.log('%c%s', 'color:blue', 'Auto-Task[Load]: 脚本开始加载'); }; const scripts_updateChecker = updateChecker; window.STYLE = GM_addStyle(auto_task.Z + GM_getResourceText('style')); - window.DEBUG = !!globalOptions.other.debug; - window.TRACE = !!globalOptions.other.debug && typeof console.trace === 'function'; + window.DEBUG = !!globalOptions.other?.debug; + window.TRACE = !!globalOptions.other?.debug && typeof console.trace === 'function'; const loadScript = async () => { if (window.location.hostname === 'www.twitch.tv' && window.location.hash === '#auth') { const authToken = external_Cookies_namespaceObject.get('auth-token'); diff --git a/page/package.json b/page/package.json index e064735..fefe694 100644 --- a/page/package.json +++ b/page/package.json @@ -1,8 +1,8 @@ { "name": "auto-task-v4", - "version": "4.4.7", + "version": "4.4.8", "change": [ - "优化:Freeanywhere获取没有剩余Key时的提示(#27)" + "修复:更新Steam社区凭证报错(#26)" ], "description": "赠Key站自动任务脚本", "main": "package.json", diff --git a/src/for_giveawaysu/header.js b/src/for_giveawaysu/header.js index 5d8f538..5d1a368 100644 --- a/src/for_giveawaysu/header.js +++ b/src/for_giveawaysu/header.js @@ -18,6 +18,8 @@ // @include *://www.twitch.tv/* // @include *://www.youtube.com/* // @include *://*.reddit.com/* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @grant GM_addStyle // @grant GM_setValue diff --git a/src/header.js b/src/header.js index db00cd1..c759fd6 100644 --- a/src/header.js +++ b/src/header.js @@ -32,6 +32,8 @@ // @include *://*.reddit.com/* // @include *://twitter.com/settings/account?k* // @include *://x.com/settings/account* +// @include *://steamcommunity.com/id/* +// @include *://store.steampowered.com/* // @include https://auto-task-v4.hclonely.com/setting.html // @include https://auto-task-v4.hclonely.com/history.html