diff --git a/.vscode/settings.json b/.vscode/settings.json index 10c2c6d..e2005cb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -52,8 +52,10 @@ "cSpell.words": [ "hclonely", "keyboardjs", + "OSSAR", "topbottpm", "uglifyjs", + "unretweet", "vloot", "xuanmo" ] diff --git a/dist/auto-task-v4-for-giveawaysu.user.js b/dist/auto-task-v4-for-giveawaysu.user.js index c1fdfe5..270b074 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.1.7-Beta +// @version 4.1.8-Beta // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -98,4 +98,4 @@ ${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")} `+s.stack)}async function i(s){var t=1{s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return _(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const I=i;function C(){let e=0{setTimeout(()=>{t(!0)},e)})}const V=t=>{let{type:e,text:s,html:i,id:n}=t;const o={success:()=>o,error:()=>o,warning:()=>o,info:()=>o,view:()=>o};try{var a;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":t=$(`
  • ${E(e)}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${E(e)} ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${E(e)} ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${E(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${E(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${E("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${E(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${E(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${E(e)} - ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(a=t[0])&&void 0!==a&&a.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return _(t,"unique"),[]}},l=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await I({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return _(t,"getRedirectLink"),null}};const r={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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},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}};t=GM_getValue("globalOptions")||{};const u=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=u(i,e[s]):n[s]=e[s]??i;return n}catch(t){return _(t,"assignObject"),r}},A=u(r,t);const c={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凭证...",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:"默认显示日志",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 版本更新内容:",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",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",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",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",twitterUser:"推特用户",retweets:"转推",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:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},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.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.",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",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:"Data synchronization",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:",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",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",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",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",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",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",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweeting",unretweetting:"Unretweeting",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!",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!',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..."}},d=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};t=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(p(this,k,{auth:t}),s.success(),e(await w(this,T,U).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}async function D(t){try{const l=V({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:f(this,k).auth}});if("Success"!==i||200!==(null==a?void 0:a.status))return l.error(i+`:${n}(${o})`),!1;l.success();var r=String(null===(e=a.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(w(this,W,N).call(this,t,r),this.tasks.servers=L([...this.tasks.servers,t])),!0}catch(t){return _(t,"Discord.joinServer"),!1}}async function j(t){try{if(this.whiteList.servers.includes(t))return V({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await w(this,P,F).call(this,t);if(!e)return!1;const a=V({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:o}=await I({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:f(this,k).auth}});return"Success"===s&&204===(null==o?void 0:o.status)?(a.success(),!0):(a.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Discord.leaveServer"),!1}}async function F(t){try{const n=V({type:"gettingDiscordGuild",text:t});var e=f(this,y)[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==o||200!==(null===l||void 0===l?void 0:l.status))return n.error(o+`:${a}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),w(this,W,N).call(this,t,i),i):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Discord.getGuild"),!1}}function N(t,e){try{f(this,y)[t]=e,GM_setValue("discordCache",f(this,y))}catch(t){_(t,"Discord.setCache")}}const M=class extends t{constructor(){var t;super(...arguments),e(this,W),e(this,P),e(this,G),e(this,x),e(this,S),e(this,T),g(this,"tasks",{...m}),g(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{...m}),s(this,k,{writable:!0,value:GM_getValue("discordAuth")||{}}),s(this,y,{writable:!0,value:GM_getValue("discordCache")||{}}),s(this,b,{writable:!0,value:!1})}async init(){try{return f(this,b)?!0:f(this,k).auth?await w(this,T,U).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(GM_setValue("discordAuth",{auth:null}),await w(this,S,O).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(V({}).error(E("initFailed","Discord")),!1)):!!await w(this,S,O).call(this)&&(p(this,b,!0),!0)}catch(t){return _(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!f(this,b))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)V({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Discord.toggleServers"),!1}}};function R(t,e){K(t,e),e.add(t)}function Y(t,e,s){K(t,e),e.set(t,s)}function K(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function z(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function B(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,J(t,e,"set"),s),s}function H(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function q(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,J(t,e,"get"))}function J(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const X={users:[]};var Q=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakSet,st=new WeakSet,it=new WeakSet,nt=new WeakSet;async function ot(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Instagram.toggleUsers"),!1}}};function ct(t,e){ht(t,e),e.add(t)}function dt(t,e,s){ht(t,e),e.set(t,s)}function ht(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function pt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,vt(t,e,"set"),s),s}function wt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ft(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,vt(t,e,"get"))}function vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const mt={reddits:[]};var kt=new WeakMap,yt=new WeakMap,bt=new WeakSet,Tt=new WeakSet;async function St(){try{const s=V({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await wt(this,Tt,xt).call(this,!0))}})}catch(t){return _(t,"Reddit.useBeta"),!1}}async function xt(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return _(t,"Reddit.toggle"),!1}}};function It(t,e){Gt(t,e),e.add(t)}function Lt(t,e,s){Gt(t,e),e.set(t,s)}function Gt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _t(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ct(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Et(t,e,"set"),s),s}function Vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function At(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Et(t,e,"get"))}function Et(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Pt={channels:[]};var Wt=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Dt=new WeakSet,jt=new WeakSet,Ft=new WeakSet,Nt=new WeakSet,Mt=new WeakSet;async function Rt(){try{const r=V({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==a?void 0:a.status)&&null!==(t=a.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(r.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Twitch.verifyAuth"),!1}}async function Yt(){try{const s=V({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Ct(this,Wt,t),s.success(),e(await Vt(this,Dt,Rt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return _(t,"Twitch.updateAuth"),!1}}async function Kt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return V({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Vt(this,Nt,zt).call(this,e);if(!s)return!1;const u=V({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:o,statusText:a,status:r,data:l}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken},data:t?i:n});return"Success"===o?200===(null==l?void 0:l.status)?(u.success(),t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Twitch.toggleChannel"),!1}}async function zt(t){try{const d=V({type:"gettingTwitchChannelId",text:t});var e=At(this,Ut)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:o}=await I({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==o?void 0:o.status))return d.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1;var a,r,l,u,c=String(null===(a=o.response)||void 0===a||null===(r=a[0])||void 0===r||null===(l=r.data)||void 0===l||null===(u=l.user)||void 0===u?void 0:u.id);return c?(Vt(this,Mt,Bt).call(this,t,c),d.success(),c):(d.error(`Error:${o.statusText}(${o.status})`),!1)}catch(t){return _(t,"Twitch.getChannelId"),!1}}function Bt(t,e){try{At(this,Ut)[t]=e,GM_setValue("twitchCache",At(this,Ut))}catch(t){_(t,"Twitch.setCache")}}const Ht=class extends t{constructor(){var t;super(...arguments),It(this,Mt),It(this,Nt),It(this,Ft),It(this,jt),It(this,Dt),_t(this,"tasks",{...Pt}),_t(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Pt}),Lt(this,Wt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Lt(this,Ut,{writable:!0,value:GM_getValue("twitchCache")||{}}),Lt(this,Ot,{writable:!0,value:!1})}async init(){try{return At(this,Ot)?!0:At(this,Wt).authToken?await Vt(this,Dt,Rt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(GM_setValue("twitchAuth",null),await Vt(this,jt,Yt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(V({}).error(E("initFailed","Twitch")),!1)):!!await Vt(this,jt,Yt).call(this)&&(Ct(this,Ot,!0),!0)}catch(t){return _(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!At(this,Ot))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)V({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return _(t,"Twitch.toggle"),!1}}};function qt(t,e){Xt(t,e),e.add(t)}function Jt(t,e,s){Xt(t,e),e.set(t,s)}function Xt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Zt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,se(t,e,"set"),s),s}function te(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,se(t,e,"get"))}function se(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ie={names:[]};var ne=new WeakMap,oe=new WeakMap,ae=new WeakMap,re=new WeakSet,le=new WeakSet,ue=new WeakSet,ce=new WeakSet,de=new WeakSet,he=new WeakSet,ge=new WeakSet,pe=new WeakSet;async function we(){try{const e=V({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==o&&void 0!==o&&o.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===o||void 0===o?void 0:o.status)?(Zt(this,ne,(null===(t=o.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Vk.verifyAuth"),!1}}async function fe(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Vk.toggle"),!1}}};function xe(t,e){Ie(t,e),e.add(t)}function $e(t,e,s){Ie(t,e),e.set(t,s)}function Ie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ge(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ve(t,e,"set"),s),s}function _e(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ce(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ve(t,e,"get"))}function Ve(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ae={channels:[],likes:[]},Ee=async function(t,e){try{const h=V({text:E("gettingYtbToken")}),{result:g,statusText:p,status:w,data:f}=await I({url:t,method:"GET"});if("Success"!==g)return h.error(g+`:${p}(${w})`),{};if(200!==(null===f||void 0===f?void 0:f.status))return h.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),{};{var s,i;if(f.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=f.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],o=(null===(i=f.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||f.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:v,request:m}=JSON.parse(o);if(n&&v&&m){if(v.hl="en","channel"===e){var a,r=null===(a=f.responseText.match(//))||void 0===a?void 0:a[1];return r?(h.success(),{params:{apiKey:n,client:v,request:m,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,u,c=null===(l=f.responseText.match(//))||void 0===l?void 0:l[1],d=null===(u=f.responseText.match(/"likeParams":"(.*?)"/))||void 0===u?void 0:u[1];return c?(h.success(),{params:{apiKey:n,client:v,request:m,videoId:c,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return _(t,"Youtube.getInfo"),{}}};var Pe=new WeakMap,We=new WeakMap,Ue=new WeakMap,Oe=new WeakSet,De=new WeakSet,je=new WeakSet,Fe=new WeakSet,Ne=new WeakSet;class Me extends t{constructor(){var t;super(...arguments),xe(this,Ne),xe(this,Fe),xe(this,je),xe(this,De),xe(this,Oe),Le(this,"tasks",{...Ae}),Le(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...Ae}),$e(this,Pe,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),$e(this,We,{writable:!0,value:!1}),$e(this,Ue,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return Ce(this,We)?!0:Ce(this,Pe).PAPISID?await _e(this,Oe,Re).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(GM_setValue("youtubeAuth",null),await _e(this,De,Ye).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(V({}).error(E("initFailed","Youtube")),!1)):!!await _e(this,De,Ye).call(this)&&(Ge(this,We,!0),!0)}catch(t){return _(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!Ce(this,We))return V({text:E("needInit")}),!1;const o=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)V({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return _(t,"Youtube.toggle"),!1}}}async function Re(){try{return await _e(this,Fe,ze).call(this,{link:Ce(this,Ue),doTask:!0,verify:!0})}catch(t){return _(t,"Youtube.verifyAuth"),!1}}async function Ye(){try{const s=V({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(Ge(this,Pe,t),s.success(),_e(this,Oe,Re).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}function Ke(t,e){return Ee(t,e)}async function ze(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await _e(this,je,Ke).call(this,e,"channel"),{apiKey:o,client:a,request:r,channelId:l}=i||{};if(n)return V({html:E("loginYtb")}),!1;if(!(o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return V({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const c=t?V({text:E("verifyingAuth","Youtube")}):V({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var u=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:g,data:p}=await I({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+o,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==a?void 0:a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:a,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===p||void 0===p?void 0:p.status)?s&&(/"subscribed": true/.test(p.responseText)||p.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(p.responseText)?(c.success(),s&&!t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===p||void 0===p?void 0:p.statusText}(${null===p||void 0===p?void 0:p.status})`),!1):(c.error(d+`:${h}(${g})`),!1)}catch(t){return _(t,"Youtube.toggleChannel"),!1}}async function Be(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await _e(this,je,Ke).call(this,e,"likeVideo"),{apiKey:n,client:o,request:a,videoId:r,likeParams:l}=s||{};if(i)return V({html:""+E("loginYtb")}),!1;if(!(n&&o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return V({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const c=V({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var u=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:o,request:{sessionId:a.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return c.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:g,status:p,data:w}=await I({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(c.success(),t&&(this.tasks.likes=L([...this.tasks.likes,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(c.error(h+`:${g}(${p})`),!1)}catch(t){return _(t,"Youtube.toggleLikeVideo"),!1}}function He(t,e){Je(t,e),e.add(t)}function qe(t,e,s){Je(t,e),e.set(t,s)}function Je(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xe(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,es(t,e,"set"),s),s}function Ze(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ts(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,es(t,e,"get"))}function es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ss={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var is=new WeakMap,ns=new WeakMap,os=new WeakMap,as=new WeakMap,rs=new WeakSet,ls=new WeakSet,us=new WeakSet,cs=new WeakSet,ds=new WeakSet,hs=new WeakSet,gs=new WeakSet,ps=new WeakSet,ws=new WeakSet,fs=new WeakSet,vs=new WeakSet,ms=new WeakSet,ks=new WeakSet,ys=new WeakSet,bs=new WeakSet,Ts=new WeakSet,Ss=new WeakSet,xs=new WeakSet,$s=new WeakSet,Is=new WeakSet,Ls=new WeakSet;async function Gs(){try{const s=V({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${o})`),!1;if(200!==(null===a||void 0===a?void 0:a.status))return s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1;var t;if(a.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=a.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(ts(this,ns).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateStoreAuth"),!1}}async function _s(){try{const a=V({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:u,data:c}=await I({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return a.error(r+`:${l}(${u})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;var t,e,s;if(c.responseText.includes('href="https://steamcommunity.com/login/home/'))return a.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=c.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=c.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],o=null===(s=c.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(ts(this,ns).steam64Id=i),o&&(ts(this,ns).userName=o),n)?(ts(this,ns).communitySessionID=n,a.success(),!0):(a.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateCommunityAuth"),!1}}async function Cs(){try{const i=V({text:E("gettingAreaInfo")}),{result:n,statusText:o,status:a,data:r}=await I({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${o}(${a})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return V({text:"noAnotherArea"}),!1;[t]=s}const l=V({text:E("changingArea",t)});var{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:ts(this,ns).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${o})`),"CN";if(200!==(null==a?void 0:a.status)||"true"!==a.responseText)return l.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),"CN";var r=(await Ze(this,us,Cs).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return _(t,"Steam.changeArea"),!1}}async function As(t){try{const e=V({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:ts(this,ns).communitySessionID})});return"Success"===s?200!==(null===o||void 0===o?void 0:o.status)||o.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.success(),this.tasks.groups=L([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Steam.joinGroup"),!1}}async function Es(t){try{if(this.whiteList.groups.includes(t))return V({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Ze(this,gs,Ps).call(this,t);if(!e)return!1;const s=V({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:o,data:a}=await I({url:`https://steamcommunity.com/id/${ts(this,ns).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:ts(this,ns).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===a||void 0===a?void 0:a.status)&&a.finalUrl.includes("groups")&&0===$(a.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(s.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Steam.leaveGroup"),!1}}async function Ps(t){try{const n=V({type:"gettingSteamGroupId",text:t});var e=ts(this,is).group[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==o)return n.error(o+`:${a}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,Hs).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return _(t,"Steam.getGroupID"),!1}}async function Ws(t){try{var e;const n=V({type:"addingToWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===o?200===(null===l||void 0===l?void 0:l.status)?"CN"===ts(this,as)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ps,Ws).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Steam.addToWishlist"),!1}}async function Us(t){try{var e;if(this.whiteList.wishlists.includes(t))return V({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const o=V({type:"removingFromWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return o.success(),!0;const{result:a,statusText:r,status:l,data:u}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==a)return o.error(a+`:${r}(${l})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;if("CN"===ts(this,as)&&u.responseText.includes('id="error_box"')){o.warning(E("changeAreaNotice"));var n=await Ze(this,cs,Vs).call(this);return n&&"CN"!==n&&"skip"!==n?await Ze(this,ws,Us).call(this,t):!1}return u.responseText.includes('class="queue_actions_ctn"')&&(u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes("add_to_wishlist_area"))?(o.success(),!0):(o.error(`Error:${u.statusText}(${u.status})`),!1)}catch(t){return _(t,"Steam.removeFromWishlist"),!1}}async function Os(t,e){try{if(!e&&this.whiteList.follows.includes(t))return V({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const o=V({type:`${e?"":"un"}followingGame`,text:t}),a={sessionid:ts(this,ns).storeSessionID,appid:t};e||(a.unfollow="1");var{result:s,data:i}=await I({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(a)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return o.success(),!0;var n=await Ze(this,vs,Ds).call(this,t);return"CN"===ts(this,as)&&"areaLocked"===n?(o.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ws,Us).call(this,t)):e===n?(o.success(),e&&(this.tasks.follows=L([...this.tasks.follows,t])),!0):(o.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return _(t,"Steam.toggleFollowGame"),!1}}async function Ds(t){try{const{result:e,data:s}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===ts(this,as)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return _(t,"Steam.isFollowedGame"),!1}}async function js(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,Hs).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return _(t,"Steam.getWorkshopAppId"),!1}}async function Rs(t){try{const a=V({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:ts(this,ns).communitySessionID})});return"Success"===s?(200===(null==o?void 0:o.status)&&1===(null===(e=o.response)||void 0===e?void 0:e.success)?a.success():a.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!0):(a.error(s+`:${i}(${n})`),!0)}catch(t){return _(t,"Steam.voteupWorkshop"),!0}}async function Ys(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),v=this.getRealParams("curatorLikes",u,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==ts(this,as)&&(V({}).warning(E("steamFinishNotice")),await Ze(this,cs,Vs).call(this,"CN")),!0))}catch(t){return _(t,"Steam.toggle"),!1}}};function Js(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Xs(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Zs={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var ti,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet,oi=new WeakSet,ai=new WeakSet,ri=new WeakSet,li=new WeakSet;async function ui(){try{const e=V({text:E("getTasksInfo")}),s=[];var t=$("#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 r of t)s.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(o.includes("steam")&&/join/gi.test(a)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(a)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(a)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):o.includes("steam")&&/follow|subscribe/gim.test(a)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(a)?this.undoneTasks.steam.forumLinks.push(t):o.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):o.includes("discord")||/join.*discord/gim.test(a)?this.undoneTasks.discord.serverLinks.push(t):o.includes("instagram")||/follow.*instagram/gim.test(a)?this.undoneTasks.instagram.userLinks.push(t):o.includes("twitch")||/follow.*twitch.*channel/gim.test(a)?this.undoneTasks.twitch.channelLinks.push(t):o.includes("reddit")||/subscribe.*subreddit/gim.test(a)||/follow.*reddit/gim.test(a)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(a)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(a)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(a)||(o.includes("youtube")||o.includes("thumbs-up"))&&/(watch|like).*video/gim.test(a)?this.undoneTasks.youtube.likeLinks.push(t):o.includes("vk")||/join.*vk.*group/gim.test(a)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(a)||(/wishlist.*game|add.*wishlist/gim.test(a)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(a)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(_(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(s),e.success(),this.undoneTasks=Qs(this,ri,wi).call(this,this.undoneTasks),!0}catch(t){return _(t,"Giveawaysu.classifyTask"),!1}}function ci(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return _(t,"Giveawaysu.checkLogin"),!1}}async function di(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await o().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return _(t,"Giveawaysu.checkLeftKey"),!1}}function hi(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(V({text:E("getFailed","GiveawayId")}),!1)}async function gi(e,t){try{return{name:e,result:await t}}catch(t){return _(t,"GiveawaySu.bind"),{name:e,result:!1}}}async function pi(){try{const e=[];var t=this.undoneTasks;return t.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new M,e.push(Qs(this,oi,gi).call(this,"discord",this.social.discord.init()))),t.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new ut,e.push(Qs(this,oi,gi).call(this,"instagram",this.social.instagram.init()))),t.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new $t,e.push(Qs(this,oi,gi).call(this,"reddit",this.social.reddit.init()))),t.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new Ht,e.push(Qs(this,oi,gi).call(this,"twitch",this.social.twitch.init()))),t.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new Se,e.push(Qs(this,oi,gi).call(this,"vk",this.social.vk.init()))),t.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Me,e.push(Qs(this,oi,gi).call(this,"youtube",this.social.youtube.init()))),t.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new qs,e.push(Qs(this,oi,gi).call(this,"steam",this.social.steam.init()))),await Promise.all(e).then(t=>{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return _(t,"GiveawaySu.initSocial"),!1}}function wi(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,o]of Object.entries(i))e[s][n]=L(o)}return e}async function fi(){try{if(!this.initialized&&!this.init())return!1;if(!await Qs(this,ei,ui).call(this))return!1;if(!await Qs(this,ai,pi).call(this))return!1;const e=[];var t=this.undoneTasks;return this.social.discord&&e.push(this.social.discord.toggle({doTask:!0,...t.discord})),this.social.instagram&&e.push(this.social.instagram.toggle({doTask:!0,...t.instagram})),this.social.reddit&&e.push(this.social.reddit.toggle({doTask:!0,...t.reddit})),this.social.twitch&&e.push(this.social.twitch.toggle({doTask:!0,...t.twitch})),this.social.vk&&e.push(this.social.vk.toggle({doTask:!0,...t.vk})),this.social.youtube&&e.push(this.social.youtube.toggle({doTask:!0,...t.youtube})),this.social.steam&&e.push(this.social.steam.toggle({doTask:!0,...t.steam})),await Promise.all(e),V({}).success(E("allTasksComplete")),!0}catch(t){return _(t,"GiveawaySu.toggleTask"),!1}}const vi=class{constructor(){Js(this,li),Js(this,ri),Js(this,ai),Js(this,oi),Js(this,ni),Js(this,ii),Js(this,si),Js(this,ei),Xs(this,"undoneTasks",Zs),Xs(this,"giveawayId",void 0),Xs(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steam:!1}),Xs(this,"initialized",!1),Xs(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Qs(this,si,ci).call(this)||V({}).warning(E("checkLoginFailed")),await Qs(this,ii,di).call(this)||V({}).warning(E("checkLeftKeyFailed"))}catch(t){_(t,"Giveawaysu.after")}}init(){try{const t=V({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Qs(this,ni,hi).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return _(t,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$('#auto-task-info-div,style:contains(".swal2-popup.swal2-toast")').remove(),$("#getKey").off()}),await Qs(this,li,fi).call(this)}catch(t){return _(t,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var t;for(const e of $("#actions tr")){const s=$(e);if("adjs"!==s.attr("data-action-id")){const i=s.find("i.glyphicon-refresh"),n=i.parent();"A"!==n.prop("tagName")?i.hasClass("spin")||i.hasClass("glyphicon-ok")||(n[0].click(),await C(1e3)):(t=n.attr("href"),n.attr("href","javascript:void(0);").attr("target","_self")[0].click(),n.attr("href",t))}}}catch(t){_(t,"GiveawaySu.verifyTask")}}};"discord.com"===window.location.hostname&&(ti=null===(t=window.localStorage)||void 0===t||null===(ti=t.getItem("token"))||void 0===ti?void 0:ti.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:ti}),ti&&"#auth"===window.location.hash&&(window.close(),o().fire("",E("closePageNotice"))));$(async()=>{var t,e,s;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(t=a.get("auth-token"),!!a.get("login")?(GM_setValue("twitchAuth",{authToken:t,clientId:null===(t=commonOptions)||void 0===t||null===(e=t.headers)||void 0===e?void 0:e["Client-ID"]}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(s=a.get("ct0"),!!a.get("twid")&&s?(GM_setValue("twitterAuth",{ct0:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((s=a.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const i=$("#redesign-beta-optin-btn");if(0

    `),await n.after(),$("#auto-do-task").on("click",()=>{n.doTask()}),$("#auto-verify-task").on("click",()=>{n.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto TaskGS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${null===s||void 0===s?void 0:s.replace("u_","")}...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(a=t[0])&&void 0!==a&&a.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return _(t,"unique"),[]}},l=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await I({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return _(t,"getRedirectLink"),null}};const r={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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},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}};t=GM_getValue("globalOptions")||{};const u=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=u(i,e[s]):n[s]=e[s]??i;return n}catch(t){return _(t,"assignObject"),r}},A=u(r,t);const c={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凭证...",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:"默认显示日志",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 版本更新内容:",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",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",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",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",twitterUser:"推特用户",retweets:"转推",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:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},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",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:"Data synchronization",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:",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",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",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",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",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",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",twitterUser:"Twitter User",retweets:"Retweet",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!",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!',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..."}},d=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};t=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(p(this,k,{auth:t}),s.success(),e(await w(this,T,U).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}async function D(t){try{const l=V({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:f(this,k).auth}});if("Success"!==i||200!==(null==a?void 0:a.status))return l.error(i+`:${n}(${o})`),!1;l.success();var r=String(null===(e=a.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(w(this,W,N).call(this,t,r),this.tasks.servers=L([...this.tasks.servers,t])),!0}catch(t){return _(t,"Discord.joinServer"),!1}}async function j(t){try{if(this.whiteList.servers.includes(t))return V({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await w(this,P,F).call(this,t);if(!e)return!1;const a=V({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:o}=await I({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:f(this,k).auth}});return"Success"===s&&204===(null==o?void 0:o.status)?(a.success(),!0):(a.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Discord.leaveServer"),!1}}async function F(t){try{const n=V({type:"gettingDiscordGuild",text:t});var e=f(this,y)[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==o||200!==(null===l||void 0===l?void 0:l.status))return n.error(o+`:${a}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),w(this,W,N).call(this,t,i),i):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Discord.getGuild"),!1}}function N(t,e){try{f(this,y)[t]=e,GM_setValue("discordCache",f(this,y))}catch(t){_(t,"Discord.setCache")}}const M=class extends t{constructor(){var t;super(...arguments),e(this,W),e(this,P),e(this,G),e(this,x),e(this,S),e(this,T),g(this,"tasks",{...m}),g(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{...m}),s(this,k,{writable:!0,value:GM_getValue("discordAuth")||{}}),s(this,y,{writable:!0,value:GM_getValue("discordCache")||{}}),s(this,b,{writable:!0,value:!1})}async init(){try{return f(this,b)?!0:f(this,k).auth?await w(this,T,U).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(GM_setValue("discordAuth",{auth:null}),await w(this,S,O).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(V({}).error(E("initFailed","Discord")),!1)):!!await w(this,S,O).call(this)&&(p(this,b,!0),!0)}catch(t){return _(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!f(this,b))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)V({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Discord.toggleServers"),!1}}};function R(t,e){K(t,e),e.add(t)}function Y(t,e,s){K(t,e),e.set(t,s)}function K(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function z(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function B(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,J(t,e,"set"),s),s}function H(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function q(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,J(t,e,"get"))}function J(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const X={users:[]};var Q=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakSet,st=new WeakSet,it=new WeakSet,nt=new WeakSet;async function ot(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Instagram.toggleUsers"),!1}}};function ct(t,e){ht(t,e),e.add(t)}function dt(t,e,s){ht(t,e),e.set(t,s)}function ht(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function pt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,vt(t,e,"set"),s),s}function wt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ft(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,vt(t,e,"get"))}function vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const mt={reddits:[]};var kt=new WeakMap,yt=new WeakMap,bt=new WeakSet,Tt=new WeakSet;async function St(){try{const s=V({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await wt(this,Tt,xt).call(this,!0))}})}catch(t){return _(t,"Reddit.useBeta"),!1}}async function xt(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return _(t,"Reddit.toggle"),!1}}};function It(t,e){Gt(t,e),e.add(t)}function Lt(t,e,s){Gt(t,e),e.set(t,s)}function Gt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _t(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ct(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Et(t,e,"set"),s),s}function Vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function At(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Et(t,e,"get"))}function Et(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Pt={channels:[]};var Wt=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Dt=new WeakSet,jt=new WeakSet,Ft=new WeakSet,Nt=new WeakSet,Mt=new WeakSet;async function Rt(){try{const r=V({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==a?void 0:a.status)&&null!==(t=a.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(r.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Twitch.verifyAuth"),!1}}async function Yt(){try{const s=V({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Ct(this,Wt,t),s.success(),e(await Vt(this,Dt,Rt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return _(t,"Twitch.updateAuth"),!1}}async function Kt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return V({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Vt(this,Nt,zt).call(this,e);if(!s)return!1;const u=V({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:o,statusText:a,status:r,data:l}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken},data:t?i:n});return"Success"===o?200===(null==l?void 0:l.status)?(u.success(),t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Twitch.toggleChannel"),!1}}async function zt(t){try{const d=V({type:"gettingTwitchChannelId",text:t});var e=At(this,Ut)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:o}=await I({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==o?void 0:o.status))return d.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1;var a,r,l,u,c=String(null===(a=o.response)||void 0===a||null===(r=a[0])||void 0===r||null===(l=r.data)||void 0===l||null===(u=l.user)||void 0===u?void 0:u.id);return c?(Vt(this,Mt,Bt).call(this,t,c),d.success(),c):(d.error(`Error:${o.statusText}(${o.status})`),!1)}catch(t){return _(t,"Twitch.getChannelId"),!1}}function Bt(t,e){try{At(this,Ut)[t]=e,GM_setValue("twitchCache",At(this,Ut))}catch(t){_(t,"Twitch.setCache")}}const Ht=class extends t{constructor(){var t;super(...arguments),It(this,Mt),It(this,Nt),It(this,Ft),It(this,jt),It(this,Dt),_t(this,"tasks",{...Pt}),_t(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Pt}),Lt(this,Wt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Lt(this,Ut,{writable:!0,value:GM_getValue("twitchCache")||{}}),Lt(this,Ot,{writable:!0,value:!1})}async init(){try{return At(this,Ot)?!0:At(this,Wt).authToken?await Vt(this,Dt,Rt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(GM_setValue("twitchAuth",null),await Vt(this,jt,Yt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(V({}).error(E("initFailed","Twitch")),!1)):!!await Vt(this,jt,Yt).call(this)&&(Ct(this,Ot,!0),!0)}catch(t){return _(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!At(this,Ot))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)V({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return _(t,"Twitch.toggle"),!1}}};function qt(t,e){Xt(t,e),e.add(t)}function Jt(t,e,s){Xt(t,e),e.set(t,s)}function Xt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Zt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,se(t,e,"set"),s),s}function te(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,se(t,e,"get"))}function se(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ie={names:[]};var ne=new WeakMap,oe=new WeakMap,ae=new WeakMap,re=new WeakSet,le=new WeakSet,ue=new WeakSet,ce=new WeakSet,de=new WeakSet,he=new WeakSet,ge=new WeakSet,pe=new WeakSet;async function we(){try{const e=V({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==o&&void 0!==o&&o.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===o||void 0===o?void 0:o.status)?(Zt(this,ne,(null===(t=o.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Vk.verifyAuth"),!1}}async function fe(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Vk.toggle"),!1}}};function xe(t,e){Ie(t,e),e.add(t)}function $e(t,e,s){Ie(t,e),e.set(t,s)}function Ie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ge(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ve(t,e,"set"),s),s}function _e(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ce(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ve(t,e,"get"))}function Ve(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ae={channels:[],likes:[]},Ee=async function(t,e){try{const h=V({text:E("gettingYtbToken")}),{result:g,statusText:p,status:w,data:f}=await I({url:t,method:"GET"});if("Success"!==g)return h.error(g+`:${p}(${w})`),{};if(200!==(null===f||void 0===f?void 0:f.status))return h.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),{};{var s,i;if(f.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=f.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],o=(null===(i=f.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||f.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:v,request:m}=JSON.parse(o);if(n&&v&&m){if(v.hl="en","channel"===e){var a,r=null===(a=f.responseText.match(//))||void 0===a?void 0:a[1];return r?(h.success(),{params:{apiKey:n,client:v,request:m,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,u,c=null===(l=f.responseText.match(//))||void 0===l?void 0:l[1],d=null===(u=f.responseText.match(/"likeParams":"(.*?)"/))||void 0===u?void 0:u[1];return c?(h.success(),{params:{apiKey:n,client:v,request:m,videoId:c,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return _(t,"Youtube.getInfo"),{}}};var Pe=new WeakMap,We=new WeakMap,Ue=new WeakMap,Oe=new WeakSet,De=new WeakSet,je=new WeakSet,Fe=new WeakSet,Ne=new WeakSet;class Me extends t{constructor(){var t;super(...arguments),xe(this,Ne),xe(this,Fe),xe(this,je),xe(this,De),xe(this,Oe),Le(this,"tasks",{...Ae}),Le(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...Ae}),$e(this,Pe,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),$e(this,We,{writable:!0,value:!1}),$e(this,Ue,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return Ce(this,We)?!0:Ce(this,Pe).PAPISID?await _e(this,Oe,Re).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(GM_setValue("youtubeAuth",null),await _e(this,De,Ye).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(V({}).error(E("initFailed","Youtube")),!1)):!!await _e(this,De,Ye).call(this)&&(Ge(this,We,!0),!0)}catch(t){return _(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!Ce(this,We))return V({text:E("needInit")}),!1;const o=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)V({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return _(t,"Youtube.toggle"),!1}}}async function Re(){try{return await _e(this,Fe,ze).call(this,{link:Ce(this,Ue),doTask:!0,verify:!0})}catch(t){return _(t,"Youtube.verifyAuth"),!1}}async function Ye(){try{const s=V({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(Ge(this,Pe,t),s.success(),_e(this,Oe,Re).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}function Ke(t,e){return Ee(t,e)}async function ze(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await _e(this,je,Ke).call(this,e,"channel"),{apiKey:o,client:a,request:r,channelId:l}=i||{};if(n)return V({html:E("loginYtb")}),!1;if(!(o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return V({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const c=t?V({text:E("verifyingAuth","Youtube")}):V({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var u=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:g,data:p}=await I({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+o,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==a?void 0:a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:a,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===p||void 0===p?void 0:p.status)?s&&(/"subscribed": true/.test(p.responseText)||p.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(p.responseText)?(c.success(),s&&!t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):t&&p.responseText.includes("You may not subscribe to yourself")?(c.success(),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===p||void 0===p?void 0:p.statusText}(${null===p||void 0===p?void 0:p.status})`),!1):(c.error(d+`:${h}(${g})`),!1)}catch(t){return _(t,"Youtube.toggleChannel"),!1}}async function Be(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await _e(this,je,Ke).call(this,e,"likeVideo"),{apiKey:n,client:o,request:a,videoId:r,likeParams:l}=s||{};if(i)return V({html:""+E("loginYtb")}),!1;if(!(n&&o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return V({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const c=V({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var u=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:o,request:{sessionId:a.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return c.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:g,status:p,data:w}=await I({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(c.success(),t&&(this.tasks.likes=L([...this.tasks.likes,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(c.error(h+`:${g}(${p})`),!1)}catch(t){return _(t,"Youtube.toggleLikeVideo"),!1}}function He(t,e){Je(t,e),e.add(t)}function qe(t,e,s){Je(t,e),e.set(t,s)}function Je(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xe(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,es(t,e,"set"),s),s}function Ze(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ts(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,es(t,e,"get"))}function es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ss={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var is=new WeakMap,ns=new WeakMap,os=new WeakMap,as=new WeakMap,rs=new WeakSet,ls=new WeakSet,us=new WeakSet,cs=new WeakSet,ds=new WeakSet,hs=new WeakSet,gs=new WeakSet,ps=new WeakSet,ws=new WeakSet,fs=new WeakSet,vs=new WeakSet,ms=new WeakSet,ks=new WeakSet,ys=new WeakSet,bs=new WeakSet,Ts=new WeakSet,Ss=new WeakSet,xs=new WeakSet,$s=new WeakSet,Is=new WeakSet,Ls=new WeakSet;async function Gs(){try{const s=V({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${o})`),!1;if(200!==(null===a||void 0===a?void 0:a.status))return s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1;var t;if(a.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=a.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(ts(this,ns).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateStoreAuth"),!1}}async function _s(){try{const a=V({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:u,data:c}=await I({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return a.error(r+`:${l}(${u})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;var t,e,s;if(c.responseText.includes('href="https://steamcommunity.com/login/home/'))return a.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=c.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=c.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],o=null===(s=c.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(ts(this,ns).steam64Id=i),o&&(ts(this,ns).userName=o),n)?(ts(this,ns).communitySessionID=n,a.success(),!0):(a.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateCommunityAuth"),!1}}async function Cs(){try{const i=V({text:E("gettingAreaInfo")}),{result:n,statusText:o,status:a,data:r}=await I({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${o}(${a})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return V({text:"noAnotherArea"}),!1;[t]=s}const l=V({text:E("changingArea",t)});var{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:ts(this,ns).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${o})`),"CN";if(200!==(null==a?void 0:a.status)||"true"!==a.responseText)return l.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),"CN";var r=(await Ze(this,us,Cs).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return _(t,"Steam.changeArea"),!1}}async function As(t){try{const e=V({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:ts(this,ns).communitySessionID})});return"Success"===s?200!==(null===o||void 0===o?void 0:o.status)||o.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.success(),this.tasks.groups=L([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Steam.joinGroup"),!1}}async function Es(t){try{if(this.whiteList.groups.includes(t))return V({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Ze(this,gs,Ps).call(this,t);if(!e)return!1;const s=V({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:o,data:a}=await I({url:`https://steamcommunity.com/id/${ts(this,ns).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:ts(this,ns).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===a||void 0===a?void 0:a.status)&&a.finalUrl.includes("groups")&&0===$(a.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(s.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Steam.leaveGroup"),!1}}async function Ps(t){try{const n=V({type:"gettingSteamGroupId",text:t});var e=ts(this,is).group[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==o)return n.error(o+`:${a}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,Hs).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return _(t,"Steam.getGroupID"),!1}}async function Ws(t){try{var e;const n=V({type:"addingToWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===o?200===(null===l||void 0===l?void 0:l.status)?"CN"===ts(this,as)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ps,Ws).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Steam.addToWishlist"),!1}}async function Us(t){try{var e;if(this.whiteList.wishlists.includes(t))return V({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const o=V({type:"removingFromWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return o.success(),!0;const{result:a,statusText:r,status:l,data:u}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==a)return o.error(a+`:${r}(${l})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;if("CN"===ts(this,as)&&u.responseText.includes('id="error_box"')){o.warning(E("changeAreaNotice"));var n=await Ze(this,cs,Vs).call(this);return n&&"CN"!==n&&"skip"!==n?await Ze(this,ws,Us).call(this,t):!1}return u.responseText.includes('class="queue_actions_ctn"')&&(u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes("add_to_wishlist_area"))?(o.success(),!0):(o.error(`Error:${u.statusText}(${u.status})`),!1)}catch(t){return _(t,"Steam.removeFromWishlist"),!1}}async function Os(t,e){try{if(!e&&this.whiteList.follows.includes(t))return V({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const o=V({type:`${e?"":"un"}followingGame`,text:t}),a={sessionid:ts(this,ns).storeSessionID,appid:t};e||(a.unfollow="1");var{result:s,data:i}=await I({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(a)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return o.success(),!0;var n=await Ze(this,vs,Ds).call(this,t);return"CN"===ts(this,as)&&"areaLocked"===n?(o.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ws,Us).call(this,t)):e===n?(o.success(),e&&(this.tasks.follows=L([...this.tasks.follows,t])),!0):(o.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return _(t,"Steam.toggleFollowGame"),!1}}async function Ds(t){try{const{result:e,data:s}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===ts(this,as)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return _(t,"Steam.isFollowedGame"),!1}}async function js(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,Hs).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return _(t,"Steam.getWorkshopAppId"),!1}}async function Rs(t){try{const a=V({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:ts(this,ns).communitySessionID})});return"Success"===s?(200===(null==o?void 0:o.status)&&1===(null===(e=o.response)||void 0===e?void 0:e.success)?a.success():a.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!0):(a.error(s+`:${i}(${n})`),!0)}catch(t){return _(t,"Steam.voteupWorkshop"),!0}}async function Ys(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),v=this.getRealParams("curatorLikes",u,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==ts(this,as)&&(V({}).warning(E("steamFinishNotice")),await Ze(this,cs,Vs).call(this,"CN")),!0))}catch(t){return _(t,"Steam.toggle"),!1}}};function Js(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Xs(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Zs={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var ti,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet,oi=new WeakSet,ai=new WeakSet,ri=new WeakSet,li=new WeakSet;async function ui(){try{const e=V({text:E("getTasksInfo")}),s=[];var t=$("#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 r of t)s.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(o.includes("steam")&&/join/gi.test(a)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(a)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(a)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):o.includes("steam")&&/follow|subscribe/gim.test(a)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(a)?this.undoneTasks.steam.forumLinks.push(t):o.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):o.includes("discord")||/join.*discord/gim.test(a)?this.undoneTasks.discord.serverLinks.push(t):o.includes("instagram")||/follow.*instagram/gim.test(a)?this.undoneTasks.instagram.userLinks.push(t):o.includes("twitch")||/follow.*twitch.*channel/gim.test(a)?this.undoneTasks.twitch.channelLinks.push(t):o.includes("reddit")||/subscribe.*subreddit/gim.test(a)||/follow.*reddit/gim.test(a)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(a)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(a)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(a)||(o.includes("youtube")||o.includes("thumbs-up"))&&/(watch|like).*video/gim.test(a)?this.undoneTasks.youtube.likeLinks.push(t):o.includes("vk")||/join.*vk.*group/gim.test(a)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(a)||(/wishlist.*game|add.*wishlist/gim.test(a)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(a)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(_(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(s),e.success(),this.undoneTasks=Qs(this,ri,wi).call(this,this.undoneTasks),!0}catch(t){return _(t,"Giveawaysu.classifyTask"),!1}}function ci(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return _(t,"Giveawaysu.checkLogin"),!1}}async function di(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await o().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return _(t,"Giveawaysu.checkLeftKey"),!1}}function hi(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(V({text:E("getFailed","GiveawayId")}),!1)}async function gi(e,t){try{return{name:e,result:await t}}catch(t){return _(t,"GiveawaySu.bind"),{name:e,result:!1}}}async function pi(){try{const e=[];var t=this.undoneTasks;return t.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new M,e.push(Qs(this,oi,gi).call(this,"discord",this.social.discord.init()))),t.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new ut,e.push(Qs(this,oi,gi).call(this,"instagram",this.social.instagram.init()))),t.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new $t,e.push(Qs(this,oi,gi).call(this,"reddit",this.social.reddit.init()))),t.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new Ht,e.push(Qs(this,oi,gi).call(this,"twitch",this.social.twitch.init()))),t.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new Se,e.push(Qs(this,oi,gi).call(this,"vk",this.social.vk.init()))),t.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Me,e.push(Qs(this,oi,gi).call(this,"youtube",this.social.youtube.init()))),t.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new qs,e.push(Qs(this,oi,gi).call(this,"steam",this.social.steam.init()))),await Promise.all(e).then(t=>{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return _(t,"GiveawaySu.initSocial"),!1}}function wi(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,o]of Object.entries(i))e[s][n]=L(o)}return e}async function fi(){try{if(!this.initialized&&!this.init())return!1;if(!await Qs(this,ei,ui).call(this))return!1;if(!await Qs(this,ai,pi).call(this))return!1;const e=[];var t=this.undoneTasks;return this.social.discord&&e.push(this.social.discord.toggle({doTask:!0,...t.discord})),this.social.instagram&&e.push(this.social.instagram.toggle({doTask:!0,...t.instagram})),this.social.reddit&&e.push(this.social.reddit.toggle({doTask:!0,...t.reddit})),this.social.twitch&&e.push(this.social.twitch.toggle({doTask:!0,...t.twitch})),this.social.vk&&e.push(this.social.vk.toggle({doTask:!0,...t.vk})),this.social.youtube&&e.push(this.social.youtube.toggle({doTask:!0,...t.youtube})),this.social.steam&&e.push(this.social.steam.toggle({doTask:!0,...t.steam})),await Promise.all(e),V({}).success(E("allTasksComplete")),!0}catch(t){return _(t,"GiveawaySu.toggleTask"),!1}}const vi=class{constructor(){Js(this,li),Js(this,ri),Js(this,ai),Js(this,oi),Js(this,ni),Js(this,ii),Js(this,si),Js(this,ei),Xs(this,"undoneTasks",Zs),Xs(this,"giveawayId",void 0),Xs(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steam:!1}),Xs(this,"initialized",!1),Xs(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Qs(this,si,ci).call(this)||V({}).warning(E("checkLoginFailed")),await Qs(this,ii,di).call(this)||V({}).warning(E("checkLeftKeyFailed"))}catch(t){_(t,"Giveawaysu.after")}}init(){try{const t=V({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Qs(this,ni,hi).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return _(t,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$('#auto-task-info-div,style:contains(".swal2-popup.swal2-toast")').remove(),$("#getKey").off()}),await Qs(this,li,fi).call(this)}catch(t){return _(t,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var t;for(const e of $("#actions tr")){const s=$(e);if("adjs"!==s.attr("data-action-id")){const i=s.find("i.glyphicon-refresh"),n=i.parent();"A"!==n.prop("tagName")?i.hasClass("spin")||i.hasClass("glyphicon-ok")||(n[0].click(),await C(1e3)):(t=n.attr("href"),n.attr("href","javascript:void(0);").attr("target","_self")[0].click(),n.attr("href",t))}}}catch(t){_(t,"GiveawaySu.verifyTask")}}};"discord.com"===window.location.hostname&&(ti=null===(t=window.localStorage)||void 0===t||null===(ti=t.getItem("token"))||void 0===ti?void 0:ti.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:ti}),ti&&"#auth"===window.location.hash&&(window.close(),o().fire("",E("closePageNotice"))));$(async()=>{var t,e,s;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(t=a.get("auth-token"),!!a.get("login")?(GM_setValue("twitchAuth",{authToken:t,clientId:null===(t=commonOptions)||void 0===t||null===(e=t.headers)||void 0===e?void 0:e["Client-ID"]}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(s=a.get("ct0"),!!a.get("twid")&&s?(GM_setValue("twitterAuth",{ct0:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((s=a.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const i=$("#redesign-beta-optin-btn");if(0

    `),await n.after(),$("#auto-do-task").on("click",()=>{n.doTask()}),$("#auto-verify-task").on("click",()=>{n.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto TaskGS特供脚本初始化完成!")}})}()}(); \ 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 0a3d70d..74e1d68 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.1.7-Beta +// @version 4.1.8-Beta // @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 @@ -92,8 +92,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); !function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},o=a.name,r=a.version,l={},c=0,u=Object.entries(this.browserNameMap);c(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s=e?t:""+Array(e+1-i.length).join(s)+t},e={s:a,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),i=Math.floor(s/60),n=s%60;return(e<=0?"+":"-")+a(i,2,"0")+":"+a(n,2,"0")},m:function t(e,s){if(e.date(){s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return O(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const L=i;function G(){let e=0{setTimeout(()=>{t(!0)},e)})}const C=t=>{let{type:e,text:s,html:i,id:n}=t;const a={success:()=>a,error:()=>a,warning:()=>a,info:()=>a,view:()=>a};try{var o;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":t=$(`
  • ${E(e)}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${E(e)} ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${E(e)} ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${E(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${E(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${E("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${E(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${E(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${E(e)} - ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return O(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return O(t,"getRedirectLink"),null}},a=async(t,e)=>{try{const i=C({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return O(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return O(t,"stringToColour"),"#fff"}},o={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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},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}};var e=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return O(t,"assignObject"),o}},A=r(o,e),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?A[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(A[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",A),p().fire({title:E("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){O(t,"saveData")}},w=e=>{try{let t=`
    - `;for(const[o,r]of Object.entries(A))for(var[s,i]of Object.entries(r))if(["other","position","hotKey"].includes(o))"boolean"==typeof i?t+=`${0===Object.keys(r).indexOf(s)?``:""}`:t+=`${0===Object.keys(r).indexOf(s)?``:""}`;else for(var[n,a]of Object.entries(i))t+=`${0===Object.keys(r).indexOf(s)?``:""}`;t+="
    ${E("type")}${E("option")}${E("value")}
    ${E(o)}${E(s)}
    ${E(o)}${E(s)}
    ${E(o)}${s}.${E(n)}
    ","swal"===e?p().fire({title:E("globalOptions"),html:t,showConfirmButton:!0,confirmButtonText:E("save"),showCancelButton:!0,cancelButtonText:E("close")}).then(t=>{t=t.isConfirmed;t&&c()}):$("body").append(`

    ${E("globalOptions")}

    `+t)}catch(t){O(t,"changeGlobalOptions")}};const d={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凭证...",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:"默认显示日志",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 版本更新内容:",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",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",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",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",twitterUser:"推特用户",retweets:"转推",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:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},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.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.",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",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:"Data synchronization",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:",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",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",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",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",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",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",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweeting",unretweetting:"Unretweeting",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!",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!',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..."}},g=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};function O(s,i){p().fire({title:E("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:E("toGithub"),showDenyButton:!0,denyButtonText:E("toKeylol"),cancelButtonText:E("close")}).then(t=>{var{isDenied:e,isConfirmed:t}=t;t?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("脚本报错: "+i)}&labels=bug&body=`+encodeURIComponent(`错误链接: [${window.location.href}](${window.location.href}) + ${null===s||void 0===s?void 0:s.replace("u_","")}...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return O(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return O(t,"getRedirectLink"),null}},a=async(t,e)=>{try{const i=C({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return O(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return O(t,"stringToColour"),"#fff"}},o={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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},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}};var e=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return O(t,"assignObject"),o}},A=r(o,e),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?A[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(A[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",A),p().fire({title:E("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){O(t,"saveData")}},w=e=>{try{let t=`
    + `;for(const[o,r]of Object.entries(A))for(var[s,i]of Object.entries(r))if(["other","position","hotKey"].includes(o))"boolean"==typeof i?t+=`${0===Object.keys(r).indexOf(s)?``:""}`:t+=`${0===Object.keys(r).indexOf(s)?``:""}`;else for(var[n,a]of Object.entries(i))t+=`${0===Object.keys(r).indexOf(s)?``:""}`;t+="
    ${E("type")}${E("option")}${E("value")}
    ${E(o)}${E(s)}
    ${E(o)}${E(s)}
    ${E(o)}${s}.${E(n)}
    ","swal"===e?p().fire({title:E("globalOptions"),html:t,showConfirmButton:!0,confirmButtonText:E("save"),showCancelButton:!0,cancelButtonText:E("close")}).then(t=>{t=t.isConfirmed;t&&c()}):$("body").append(`

    ${E("globalOptions")}

    `+t)}catch(t){O(t,"changeGlobalOptions")}};const d={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凭证...",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:"默认显示日志",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 版本更新内容:",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",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",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",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",twitterUser:"推特用户",retweets:"转推",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:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},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",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:"Data synchronization",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:",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",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",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",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",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",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",twitterUser:"Twitter User",retweets:"Retweet",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!",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!',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..."}},g=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};function O(s,i){p().fire({title:E("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:E("toGithub"),showDenyButton:!0,denyButtonText:E("toKeylol"),cancelButtonText:E("close")}).then(t=>{var{isDenied:e,isConfirmed:t}=t;t?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("脚本报错: "+i)}&labels=bug&body=`+encodeURIComponent(`错误链接: [${window.location.href}](${window.location.href}) 环境: \`\`\` @@ -125,7 +125,7 @@ ${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")} 执行日志: [code]${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")}[/code]`,GM_setClipboard(e),p().fire({title:E("copySuccess"),icon:"success",confirmButtonText:E("ok")}).then(()=>{window.open("https://keylol.com/forum.php?mod=post&action=reply&fid=319&tid=777450","_blank")}))}),console.log("%c%s","color:white;background:red",i+` -`+s.stack)}var s=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(b(this,j,{auth:t}),s.success(),e(await T(this,V,z).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return O(t,"Discord.updateAuth"),!1}}async function B(t){try{const l=C({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:x(this,j).auth}});if("Success"!==i||200!==(null==o?void 0:o.status))return l.error(i+`:${n}(${a})`),!1;l.success();var r=String(null===(e=o.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(T(this,N,H).call(this,t,r),this.tasks.servers=_([...this.tasks.servers,t])),!0}catch(t){return O(t,"Discord.joinServer"),!1}}async function Y(t){try{if(this.whiteList.servers.includes(t))return C({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await T(this,U,R).call(this,t);if(!e)return!1;const o=C({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:a}=await L({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:x(this,j).auth}});return"Success"===s&&204===(null==a?void 0:a.status)?(o.success(),!0):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Discord.leaveServer"),!1}}async function R(t){try{const n=C({type:"gettingDiscordGuild",text:t});var e=x(this,W)[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==a||200!==(null===l||void 0===l?void 0:l.status))return n.error(a+`:${o}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),T(this,N,H).call(this,t,i),i):(n.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Discord.getGuild"),!1}}function H(t,e){try{x(this,W)[t]=e,GM_setValue("discordCache",x(this,W))}catch(t){O(t,"Discord.setCache")}}const q=class extends s{constructor(){var t;super(...arguments),m(this,N),m(this,U),m(this,F),m(this,D),m(this,M),m(this,V),y(this,"tasks",{...I}),y(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{...I}),v(this,j,{writable:!0,value:GM_getValue("discordAuth")||{}}),v(this,W,{writable:!0,value:GM_getValue("discordCache")||{}}),v(this,P,{writable:!0,value:!1})}async init(){try{return x(this,P)?!0:x(this,j).auth?await T(this,V,z).call(this)?(C({}).success(E("initSuccess","Discord")),b(this,P,!0),!0):(GM_setValue("discordAuth",{auth:null}),await T(this,M,K).call(this)?(C({}).success(E("initSuccess","Discord")),b(this,P,!0),!0):(C({}).error(E("initFailed","Discord")),!1)):!!await T(this,M,K).call(this)&&(b(this,P,!0),!0)}catch(t){return O(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!x(this,P))return C({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)C({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Discord.toggleServers"),!1}}};function J(t,e){Z(t,e),e.add(t)}function X(t,e,s){Z(t,e),e.set(t,s)}function Z(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Q(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function tt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,it(t,e,"set"),s),s}function et(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function st(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,it(t,e,"get"))}function it(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const nt={users:[]};var at=new WeakMap,ot=new WeakMap,rt=new WeakMap,lt=new WeakSet,ct=new WeakSet,ut=new WeakSet,dt=new WeakSet;async function ht(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Instagram.toggleUsers"),!1}}};function mt(t,e){kt(t,e),e.add(t)}function vt(t,e,s){kt(t,e),e.set(t,s)}function kt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function bt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,xt(t,e,"set"),s),s}function Tt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function $t(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,xt(t,e,"get"))}function xt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const St={reddits:[]};var Lt=new WeakMap,_t=new WeakMap,It=new WeakSet,Gt=new WeakSet;async function Ct(){try{const s=C({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await Tt(this,Gt,At).call(this,!0))}})}catch(t){return O(t,"Reddit.useBeta"),!1}}async function At(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return O(t,"Reddit.toggle"),!1}}};function Ot(t,e){Wt(t,e),e.add(t)}function jt(t,e,s){Wt(t,e),e.set(t,s)}function Wt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Vt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ft(t,e,"set"),s),s}function Mt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Dt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ft(t,e,"get"))}function Ft(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ut={channels:[]};var Nt=new WeakMap,zt=new WeakMap,Kt=new WeakMap,Bt=new WeakSet,Yt=new WeakSet,Rt=new WeakSet,Ht=new WeakSet,qt=new WeakSet;async function Jt(){try{const r=C({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Dt(this,Nt).authToken,"Client-Id":Dt(this,Nt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==o?void 0:o.status)&&null!==(t=o.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1):(r.error(i+`:${n}(${a})`),!1)}catch(t){return O(t,"Twitch.verifyAuth"),!1}}async function Xt(){try{const s=C({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Vt(this,Nt,t),s.success(),e(await Mt(this,Bt,Jt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return O(t,"Twitch.updateAuth"),!1}}async function Zt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return C({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Mt(this,Ht,Qt).call(this,e);if(!s)return!1;const c=C({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:a,statusText:o,status:r,data:l}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Dt(this,Nt).authToken},data:t?i:n});return"Success"===a?200===(null==l?void 0:l.status)?(c.success(),t&&(this.tasks.channels=_([...this.tasks.channels,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Twitch.toggleChannel"),!1}}async function Qt(t){try{const d=C({type:"gettingTwitchChannelId",text:t});var e=Dt(this,zt)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:a}=await L({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Dt(this,Nt).authToken,"Client-Id":Dt(this,Nt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==a?void 0:a.status))return d.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1;var o,r,l,c,u=String(null===(o=a.response)||void 0===o||null===(r=o[0])||void 0===r||null===(l=r.data)||void 0===l||null===(c=l.user)||void 0===c?void 0:c.id);return u?(Mt(this,qt,te).call(this,t,u),d.success(),u):(d.error(`Error:${a.statusText}(${a.status})`),!1)}catch(t){return O(t,"Twitch.getChannelId"),!1}}function te(t,e){try{Dt(this,zt)[t]=e,GM_setValue("twitchCache",Dt(this,zt))}catch(t){O(t,"Twitch.setCache")}}const ee=class extends s{constructor(){var t;super(...arguments),Ot(this,qt),Ot(this,Ht),Ot(this,Rt),Ot(this,Yt),Ot(this,Bt),Pt(this,"tasks",{...Ut}),Pt(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Ut}),jt(this,Nt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),jt(this,zt,{writable:!0,value:GM_getValue("twitchCache")||{}}),jt(this,Kt,{writable:!0,value:!1})}async init(){try{return Dt(this,Kt)?!0:Dt(this,Nt).authToken?await Mt(this,Bt,Jt).call(this)?(C({}).success(E("initSuccess","Twitch")),Vt(this,Kt,!0),!0):(GM_setValue("twitchAuth",null),await Mt(this,Yt,Xt).call(this)?(C({}).success(E("initSuccess","Twitch")),Vt(this,Kt,!0),!0):(C({}).error(E("initFailed","Twitch")),!1)):!!await Mt(this,Yt,Xt).call(this)&&(Vt(this,Kt,!0),!0)}catch(t){return O(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Dt(this,Kt))return C({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)C({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return O(t,"Twitch.toggle"),!1}}};function se(t,e){ne(t,e),e.add(t)}function ie(t,e,s){ne(t,e),e.set(t,s)}function ne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ae(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function oe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ce(t,e,"set"),s),s}function re(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function le(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ce(t,e,"get"))}function ce(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ue={users:[],retweets:[],likes:[]};var de=new WeakMap,he=new WeakMap,pe=new WeakMap,fe=new WeakMap,we=new WeakSet,ge=new WeakSet,me=new WeakSet,ve=new WeakSet,ke=new WeakSet;async function ye(){try{return await re(this,me,Te).call(this,{name:"verify",doTask:!0,verify:!0})}catch(t){return O(t,"Twitter.verifyAuth"),!1}}async function be(){try{const s=C({text:E("updatingAuth","Twitter")});return await new Promise(e=>{const t=GM_openInTab("https://twitter.com/settings/account?k#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitterAuth");t?(oe(this,he,t),s.success(),e(await re(this,we,ye).call(this))):(s.error("Error: Update twitter auth failed!"),e(!1))}})}catch(t){return O(t,"Twitter.updateToken"),!1}}async function Te(t){var{name:e,doTask:s=!0,verify:t=!1}=t;try{if(!s&&!t&&this.whiteList.users.includes(e))return C({type:"whiteList",text:"Twitter.unfollowUser",id:e}),!0;var i=t?le(this,de):await this.userName2id(e);if(!i)return!1;const d=t?C({text:E("verifyingAuth","Twitter")}):C({type:`${s?"":"un"}followingTwitterUser`,text:e});var n,a,o,{result:r,statusText:l,status:c,data:u}=await L({url:`https://api.twitter.com/1.1/friendships/${s?"create":"destroy"}.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},responseType:"json",data:$.param({include_profile_interstitial_type:1,include_blocking:1,include_blocked_by:1,include_followed_by:1,include_want_retweets:1,include_mute_edge:1,include_can_dm:1,include_can_media_tag:1,skip_status:1,id:i})});return"Success"===r?200===(null==u?void 0:u.status)?(d.success(),s&&!t&&(this.tasks.users=_([...this.tasks.users,e])),!0):t&&403===(null==u?void 0:u.status)&&158===(null===(n=u.response)||void 0===n||null===(a=n.errors)||void 0===a||null===(o=a[0])||void 0===o?void 0:o.code)?(d.success(),!0):(d.error(`Error:${null==u?void 0:u.statusText}(${null==u?void 0:u.status})`),!1):(d.error(r+`:${l}(${c})`),!1)}catch(t){return O(t,"Twitter.toggleUser"),!1}}async function $e(t){var{retweetId:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.retweets.includes(e))return C({type:"whiteList",text:"Twitter.unretweet",id:e}),!0;const c=C({type:`${t?"":"un"}retweetting`,text:e});var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:`https://api.twitter.com/1.1/statuses/${t?"":"un"}retweet.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},data:$.param({tweet_mode:"extended",id:e}),responseType:"json"});return"Success"===a?200===(null==l?void 0:l.status)||403===(null==l?void 0:l.status)&&327===(null===(s=l.response)||void 0===s||null===(i=s.errors)||void 0===i||null===(n=i[0])||void 0===n?void 0:n.code)?(c.success(),t&&(this.tasks.retweets=_([...this.tasks.retweets,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Twitter.toggleRetweet"),!1}}function xe(t,e){try{le(this,pe)[t]=e,GM_setValue("twitterCache",le(this,pe))}catch(t){O(t,"Twitter.setCache")}}const Se=class extends s{constructor(){var t;super(...arguments),se(this,ke),se(this,ve),se(this,me),se(this,ge),se(this,we),ae(this,"tasks",{...ue}),ae(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitter)||{...ue}),ie(this,de,{writable:!0,value:A.other.twitterVerifyId}),ie(this,he,{writable:!0,value:GM_getValue("twitterAuth")||{}}),ie(this,pe,{writable:!0,value:GM_getValue("twitterCache")||{}}),ie(this,fe,{writable:!0,value:!1})}async init(){try{return le(this,fe)?!0:le(this,he).ct0?await re(this,we,ye).call(this)?(C({}).success(E("initSuccess","Twitter")),oe(this,fe,!0),!0):(GM_setValue("twitterAuth",null),await re(this,ge,be).call(this)?(C({}).success(E("initSuccess","Twitter")),oe(this,fe,!0),!0):(C({}).error(E("initFailed","Twitter")),!1)):!!await re(this,ge,be).call(this)&&(oe(this,fe,!0),!0)}catch(t){return O(t,"Twitter.init"),!1}}async userName2id(t){try{const u=C({type:"gettingTwitterUserId",text:t});var e=le(this,pe)[t];if(e)return u.success(),e;var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:"https://api.twitter.com/graphql/-xfUfZsnR_zqjFd-IfrN5A/UserByScreenName"+`?variables=%7B%22screen_name%22%3A%22${t}%22%2C%22withHighlightedLabel%22%3Atrue%7D`,method:"GET",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","content-type":"application/json"},responseType:"json",anonymous:!0});if("Success"!==a)return u.error(a+`:${o}(${r})`),!1;if(200!==(null==l?void 0:l.status))return u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1;{let e=l.response||("object"==typeof l.responseText?l.responseText:null);if(!e)try{e=JSON.parse(l.responseText)}catch(t){e=null}var c=String(null===(s=e)||void 0===s||null===(i=s.data)||void 0===i||null===(n=i.user)||void 0===n?void 0:n.rest_id);return c?(re(this,ke,xe).call(this,t,c),u.success(),c):(u.error(`Error:${l.statusText}(${l.status})`),!1)}}catch(t){return O(t,"Twitter.getUserId"),!1}}async toggle(t){var{doTask:e=!0,userLinks:s=[],retweetLinks:t=[]}=t;try{if(!le(this,fe))return C({text:E("needInit")}),!1;const a=[];if(e&&!A.doTask.twitter.users||!e&&!A.undoTask.twitter.users)C({type:"globalOptionsSkip",text:"twitter.users"});else{var i=this.getRealParams("users",s,e,t=>{return null===(t=t.match(/https:\/\/twitter\.com\/(.+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/https:\/\/twitter\.com\/.*?\/status\/([\d]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Twitter.toggle"),!1}}};function Le(t,e){Ie(t,e),e.add(t)}function _e(t,e,s){Ie(t,e),e.set(t,s)}function Ie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ge(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ce(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Oe(t,e,"set"),s),s}function Ae(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Oe(t,e,"get"))}function Oe(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const je={names:[]};var We=new WeakMap,Pe=new WeakMap,Ve=new WeakMap,Me=new WeakSet,De=new WeakSet,Fe=new WeakSet,Ue=new WeakSet,Ne=new WeakSet,ze=new WeakSet,Ke=new WeakSet,Be=new WeakSet;async function Ye(){try{const e=C({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==a&&void 0!==a&&a.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===a||void 0===a?void 0:a.status)?(Ce(this,We,(null===(t=a.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Vk.verifyAuth"),!1}}async function Re(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Vk.toggle"),!1}}};function es(t,e){is(t,e),e.add(t)}function ss(t,e,s){is(t,e),e.set(t,s)}function is(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ns(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function as(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ls(t,e,"set"),s),s}function os(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function rs(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ls(t,e,"get"))}function ls(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const cs={channels:[],likes:[]},us=async function(t,e){try{const h=C({text:E("gettingYtbToken")}),{result:p,statusText:f,status:w,data:g}=await L({url:t,method:"GET"});if("Success"!==p)return h.error(p+`:${f}(${w})`),{};if(200!==(null===g||void 0===g?void 0:g.status))return h.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`),{};{var s,i;if(g.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=g.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],a=(null===(i=g.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||g.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:m,request:v}=JSON.parse(a);if(n&&m&&v){if(m.hl="en","channel"===e){var o,r=null===(o=g.responseText.match(//))||void 0===o?void 0:o[1];return r?(h.success(),{params:{apiKey:n,client:m,request:v,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,c,u=null===(l=g.responseText.match(//))||void 0===l?void 0:l[1],d=null===(c=g.responseText.match(/"likeParams":"(.*?)"/))||void 0===c?void 0:c[1];return u?(h.success(),{params:{apiKey:n,client:m,request:v,videoId:u,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return O(t,"Youtube.getInfo"),{}}};var ds=new WeakMap,hs=new WeakMap,ps=new WeakMap,fs=new WeakSet,ws=new WeakSet,gs=new WeakSet,ms=new WeakSet,vs=new WeakSet;class ks extends s{constructor(){var t;super(...arguments),es(this,vs),es(this,ms),es(this,gs),es(this,ws),es(this,fs),ns(this,"tasks",{...cs}),ns(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...cs}),ss(this,ds,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),ss(this,hs,{writable:!0,value:!1}),ss(this,ps,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return rs(this,hs)?!0:rs(this,ds).PAPISID?await os(this,fs,ys).call(this)?(C({}).success(E("initSuccess","Youtube")),as(this,hs,!0),!0):(GM_setValue("youtubeAuth",null),await os(this,ws,bs).call(this)?(C({}).success(E("initSuccess","Youtube")),as(this,hs,!0),!0):(C({}).error(E("initFailed","Youtube")),!1)):!!await os(this,ws,bs).call(this)&&(as(this,hs,!0),!0)}catch(t){return O(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!rs(this,hs))return C({text:E("needInit")}),!1;const a=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)C({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return O(t,"Youtube.toggle"),!1}}}async function ys(){try{return await os(this,ms,$s).call(this,{link:rs(this,ps),doTask:!0,verify:!0})}catch(t){return O(t,"Youtube.verifyAuth"),!1}}async function bs(){try{const s=C({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(as(this,ds,t),s.success(),os(this,fs,ys).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return O(t,"Discord.updateAuth"),!1}}function Ts(t,e){return us(t,e)}async function $s(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await os(this,gs,Ts).call(this,e,"channel"),{apiKey:a,client:o,request:r,channelId:l}=i||{};if(n)return C({html:E("loginYtb")}),!1;if(!(a&&o&&r&&l))return C({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return C({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const u=t?C({text:E("verifyingAuth","Youtube")}):C({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var c=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:p,data:f}=await L({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+a,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==o?void 0:o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:o,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===f||void 0===f?void 0:f.status)?s&&(/"subscribed": true/.test(f.responseText)||f.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(f.responseText)?(u.success(),s&&!t&&(this.tasks.channels=_([...this.tasks.channels,e])),!0):(u.error(E("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),!1):(u.error(d+`:${h}(${p})`),!1)}catch(t){return O(t,"Youtube.toggleChannel"),!1}}async function xs(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await os(this,gs,Ts).call(this,e,"likeVideo"),{apiKey:n,client:a,request:o,videoId:r,likeParams:l}=s||{};if(i)return C({html:""+E("loginYtb")}),!1;if(!(n&&a&&o&&r&&l))return C({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return C({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const u=C({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var c=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:a,request:{sessionId:o.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return u.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:p,status:f,data:w}=await L({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(u.success(),t&&(this.tasks.likes=_([...this.tasks.likes,e])),!0):(u.error(E("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(u.error(h+`:${p}(${f})`),!1)}catch(t){return O(t,"Youtube.toggleLikeVideo"),!1}}function Ss(t,e){_s(t,e),e.add(t)}function Ls(t,e,s){_s(t,e),e.set(t,s)}function _s(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Is(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Gs(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Es(t,e,"set"),s),s}function Cs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function As(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Es(t,e,"get"))}function Es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Os={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var js=new WeakMap,Ws=new WeakMap,Ps=new WeakMap,Vs=new WeakMap,Ms=new WeakSet,Ds=new WeakSet,Fs=new WeakSet,Us=new WeakSet,Ns=new WeakSet,zs=new WeakSet,Ks=new WeakSet,Bs=new WeakSet,Ys=new WeakSet,Rs=new WeakSet,Hs=new WeakSet,qs=new WeakSet,Js=new WeakSet,Xs=new WeakSet,Zs=new WeakSet,Qs=new WeakSet,ti=new WeakSet,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet;async function ai(){try{const s=C({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${a})`),!1;if(200!==(null===o||void 0===o?void 0:o.status))return s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1;var t;if(o.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=o.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(As(this,Ws).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return O(t,"Steam.updateStoreAuth"),!1}}async function oi(){try{const o=C({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:c,data:u}=await L({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return o.error(r+`:${l}(${c})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;var t,e,s;if(u.responseText.includes('href="https://steamcommunity.com/login/home/'))return o.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=u.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=u.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],a=null===(s=u.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(As(this,Ws).steam64Id=i),a&&(As(this,Ws).userName=a),n)?(As(this,Ws).communitySessionID=n,o.success(),!0):(o.error('Error: Get "sessionID" failed'),!1)}catch(t){return O(t,"Steam.updateCommunityAuth"),!1}}async function ri(){try{const i=C({text:E("gettingAreaInfo")}),{result:n,statusText:a,status:o,data:r}=await L({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${a}(${o})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return C({text:"noAnotherArea"}),!1;[t]=s}const l=C({text:E("changingArea",t)});var{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:As(this,Ws).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${a})`),"CN";if(200!==(null==o?void 0:o.status)||"true"!==o.responseText)return l.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),"CN";var r=(await Cs(this,Fs,ri).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return O(t,"Steam.changeArea"),!1}}async function ci(t){try{const e=C({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:As(this,Ws).communitySessionID})});return"Success"===s?200!==(null===a||void 0===a?void 0:a.status)||a.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.success(),this.tasks.groups=_([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Steam.joinGroup"),!1}}async function ui(t){try{if(this.whiteList.groups.includes(t))return C({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Cs(this,Ks,di).call(this,t);if(!e)return!1;const s=C({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:a,data:o}=await L({url:`https://steamcommunity.com/id/${As(this,Ws).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:As(this,Ws).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===o||void 0===o?void 0:o.status)&&o.finalUrl.includes("groups")&&0===$(o.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(s.error(i+`:${n}(${a})`),!1)}catch(t){return O(t,"Steam.leaveGroup"),!1}}async function di(t){try{const n=C({type:"gettingSteamGroupId",text:t});var e=As(this,js).group[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==a)return n.error(a+`:${o}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Cs(this,ni,Si).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return O(t,"Steam.getGroupID"),!1}}async function hi(t){try{var e;const n=C({type:"addingToWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:As(this,Ws).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=_([...this.tasks.wishlists,t]),!0;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===a?200===(null===l||void 0===l?void 0:l.status)?"CN"===As(this,Vs)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Cs(this,Us,li).call(this)&&await Cs(this,Bs,hi).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=_([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Steam.addToWishlist"),!1}}async function pi(t){try{var e;if(this.whiteList.wishlists.includes(t))return C({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const a=C({type:"removingFromWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:As(this,Ws).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return a.success(),!0;const{result:o,statusText:r,status:l,data:c}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==o)return a.error(o+`:${r}(${l})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;if("CN"===As(this,Vs)&&c.responseText.includes('id="error_box"')){a.warning(E("changeAreaNotice"));var n=await Cs(this,Us,li).call(this);return n&&"CN"!==n&&"skip"!==n?await Cs(this,Ys,pi).call(this,t):!1}return c.responseText.includes('class="queue_actions_ctn"')&&(c.responseText.includes("ds_owned_flag ds_flag")||c.responseText.includes("add_to_wishlist_area"))?(a.success(),!0):(a.error(`Error:${c.statusText}(${c.status})`),!1)}catch(t){return O(t,"Steam.removeFromWishlist"),!1}}async function fi(t,e){try{if(!e&&this.whiteList.follows.includes(t))return C({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const a=C({type:`${e?"":"un"}followingGame`,text:t}),o={sessionid:As(this,Ws).storeSessionID,appid:t};e||(o.unfollow="1");var{result:s,data:i}=await L({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(o)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return a.success(),!0;var n=await Cs(this,Hs,wi).call(this,t);return"CN"===As(this,Vs)&&"areaLocked"===n?(a.warning(E("changeAreaNotice")),!!await Cs(this,Us,li).call(this)&&await Cs(this,Ys,pi).call(this,t)):e===n?(a.success(),e&&(this.tasks.follows=_([...this.tasks.follows,t])),!0):(a.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return O(t,"Steam.toggleFollowGame"),!1}}async function wi(t){try{const{result:e,data:s}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===As(this,Vs)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return O(t,"Steam.isFollowedGame"),!1}}async function gi(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Cs(this,ni,Si).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return O(t,"Steam.getWorkshopAppId"),!1}}async function yi(t){try{const o=C({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:As(this,Ws).communitySessionID})});return"Success"===s?(200===(null==a?void 0:a.status)&&1===(null===(e=a.response)||void 0===e?void 0:e.success)?o.success():o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!0):(o.error(s+`:${i}(${n})`),!0)}catch(t){return O(t,"Steam.voteupWorkshop"),!0}}async function bi(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),m=this.getRealParams("curatorLikes",c,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==As(this,Vs)&&(C({}).warning(E("steamFinishNotice")),await Cs(this,Us,li).call(this,"CN")),!0))}catch(t){return O(t,"Steam.toggle"),!1}}};function _i(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Ii(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Gi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Ci=new WeakSet;async function Ai(e,t){try{return{name:e,result:await t}}catch(t){return O(t,"Website.bind"),{name:e,result:!1}}}var Ei=class{constructor(){_i(this,Ci),Ii(this,"undoneTasks",void 0),Ii(this,"socialTasks",void 0),Ii(this,"giveawayId",void 0),Ii(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,twitter:!1,vk:!1,youtube:!1,steam:!1}),Ii(this,"initialized",!1),Ii(this,"social",{})}async initSocial(t){try{const s=[];var e="do"===t?this.undoneTasks:this.socialTasks;return e.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new q,s.push(Gi(this,Ci,Ai).call(this,"discord",this.social.discord.init()))),e.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new gt,s.push(Gi(this,Ci,Ai).call(this,"instagram",this.social.instagram.init()))),e.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new Et,s.push(Gi(this,Ci,Ai).call(this,"reddit",this.social.reddit.init()))),e.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new ee,s.push(Gi(this,Ci,Ai).call(this,"twitch",this.social.twitch.init()))),e.twitter&&0[...t,...e]).length&&!this.socialInitialized.twitter&&(this.social.twitter=new Se,s.push(Gi(this,Ci,Ai).call(this,"twitter",this.social.twitter.init()))),e.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new ts,s.push(Gi(this,Ci,Ai).call(this,"vk",this.social.vk.init()))),e.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new ks,s.push(Gi(this,Ci,Ai).call(this,"youtube",this.social.youtube.init()))),e.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new Li,s.push(Gi(this,Ci,Ai).call(this,"steam",this.social.steam.init()))),e.links&&0{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return O(t,"Website.initSocial"),!1}}uniqueTasks(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,a]of Object.entries(i))e[s][n]=_(a)}return e}async toggleTask(t){try{if(!this.initialized&&!this.init())return!1;if(!await this.classifyTask(t))return!1;if(!await this.initSocial(t))return!1;const i=[];var e="do"===t,s=e?this.undoneTasks:this.socialTasks;if(this.social.discord&&i.push(this.social.discord.toggle({doTask:e,...s.discord})),this.social.instagram&&i.push(this.social.instagram.toggle({doTask:e,...s.instagram})),this.social.reddit&&i.push(this.social.reddit.toggle({doTask:e,...s.reddit})),this.social.twitch&&i.push(this.social.twitch.toggle({doTask:e,...s.twitch})),this.social.twitter&&i.push(this.social.twitter.toggle({doTask:e,...s.twitter})),this.social.vk&&i.push(this.social.vk.toggle({doTask:e,...s.vk})),this.social.youtube&&i.push(this.social.youtube.toggle({doTask:e,...s.youtube})),this.social.steam&&i.push(this.social.steam.toggle({doTask:e,...s.steam})),this.social.visitLink&&s.links&&e)for(const n of s.links)i.push(this.social.visitLink(n));return e&&s.extra&&this.extraDoTask&&0[...t,...e]).length&&i.push(this.extraDoTask(s.extra)),await Promise.all(i),C({}).success(E("allTasksComplete")),!0}catch(t){return O(t,"Website.toggleTask"),!1}}async doTask(){try{return await this.toggleTask("do")}catch(t){return O(t,"Website.doTask"),!1}}async undoTask(){try{return await this.toggleTask("undo")}catch(t){return O(t,"Website.undoTask"),!1}}};function Oi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ji(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Wi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Pi={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],followLinks:[]},vk:{nameLinks:[]}};var Vi=new WeakSet,Mi=new WeakSet;function Di(){try{var t,e=null===(t=window.location.href.match(/\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){O(t,"FreeAnyWhere.getGiveawayId")}}async function Fi(t){try{const o=C({html:`
  • ${E("verifyingTask")}${t.title.trim()}...
  • `});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/challenge-status/${t.id}/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.status?(o.success(),!0):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Freeanywhere.verify"),!1}}var Ui=class extends Ei{constructor(){super(...arguments),Oi(this,Mi),Oi(this,Vi),ji(this,"name","FreeAnyWhere"),ji(this,"tasks",[]),ji(this,"socialTasks",{...Pi}),ji(this,"undoneTasks",{...Pi}),ji(this,"buttons",["doTask","undoTask","verifyTask","getKey"])}static test(){return"freeanywhere.net"===window.location.host}init(){try{const s=C({text:E("initing")});if(0<$('a[href="#/login"]').length)return window.open("/#/login","_self"),s.warning(E("needLogin")),!1;if(window.location.href.includes("/login"))return s.warning(E("needLogin")),!1;if(!/^https?:\/\/freeanywhere\.net\/#\/giveaway\/[\d]+/.test(window.location.href)){var t,e=null===(t=window.location.href.match(/https?:\/\/freeanywhere\.net\/.*?#\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];if(!e)return s.error(E("getFailed","Id")),!1;window.location.href="https://freeanywhere.net/#/giveaway/"+e}return Wi(this,Vi,Di).call(this)?(this.initialized=!0,s.success(),!0):!1}catch(t){return O(t,"Freeanywhere.init"),!1}}async classifyTask(t){try{const u=C({text:E("getTasksInfo")});var e;"undo"===t&&(this.socialTasks=(null===(e=GM_getValue("fawTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||{...Pi});var{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/?format=json`,method:"GET",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")},responseType:"json"});if("Success"!==s)return u.error(s+`:${i}(${n})`),!1;var o,r=null==a||null===(o=a.response)||void 0===o?void 0:o.challenges;if(r){"verify"===t&&(this.tasks=[]);for(const d of r){var l=d.challenge,c=d.challenge_provider;const h={id:d.id,title:d.title};if("verify"!==t||d.is_success)switch(c){case"steam":switch(h.social="steam",l){case"WL":"undo"===t&&this.socialTasks.steam.wishlistLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.wishlistLinks.push(d.link);break;case"JTG":"undo"===t&&this.socialTasks.steam.groupLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.groupLinks.push(d.link);break;case"STC":"undo"===t&&this.socialTasks.steam.curatorLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.curatorLinks.push(d.link);break;case"GF":"undo"===t&&this.socialTasks.steam.followLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.followLinks.push(d.link)}break;case"vk-oauth2":"undo"===t&&this.socialTasks.vk.nameLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.vk.nameLinks.push(d.link);break;case"website":break;default:C({}).warning(E("unKnownTaskType")+": "+c)}else this.tasks.push(h)}return u.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("fawTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}return u.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),console.error(a),!1}catch(t){return O(t,"Freeanywhere.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;const t=[];for(const e of this.tasks)t.push(Wi(this,Mi,Fi).call(this,e)),await G(1e3);return await Promise.all(t),C({}).success(E("allTasksComplete")),!!await this.getKey(!0)}catch(t){return O(t,"Freeanywhere.verifyTask"),!1}}async getKey(t){try{if(!t&&!this.initialized&&!this.init())return!1;const o=C({text:E("gettingKey")});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/reward/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.reward?(o.success(),C({}).success(a.response.reward),a.response.reward):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"FreeAnyWhere.getGiveawayId"),!1}}};function Ni(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function zi(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ki(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Bi={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var Yi=new WeakSet,Ri=new WeakSet,Hi=new WeakSet;class qi extends Ei{constructor(){super(...arguments),Ni(this,Hi),Ni(this,Ri),Ni(this,Yi),zi(this,"name","GiveawaySu"),zi(this,"socialTasks",Bi),zi(this,"undoneTasks",Bi),zi(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Ki(this,Yi,Ji).call(this)||C({}).warning(E("checkLoginFailed")),await Ki(this,Ri,Xi).call(this)||C({}).warning(E("checkLeftKeyFailed")),C({}).warning(E("gsNotice"))}catch(t){O(t,"Giveawaysu.after")}}init(){try{const t=C({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Ki(this,Hi,Zi).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Giveawaysu.init"),!1}}async classifyTask(t){try{const i=C({text:E("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gasTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||Bi,!0;const n=[];var s=$("#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 r of s)n.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(a.includes("steam")&&/join/gi.test(o)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(o)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(o)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):a.includes("steam")&&/follow|subscribe/gim.test(o)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(o)?this.undoneTasks.steam.forumLinks.push(t):a.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):a.includes("discord")||/join.*discord/gim.test(o)?this.undoneTasks.discord.serverLinks.push(t):a.includes("instagram")||/follow.*instagram/gim.test(o)?this.undoneTasks.instagram.userLinks.push(t):a.includes("twitch")||/follow.*twitch.*channel/gim.test(o)?this.undoneTasks.twitch.channelLinks.push(t):a.includes("reddit")||/subscribe.*subreddit/gim.test(o)||/follow.*reddit/gim.test(o)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(o)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(o)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(o)||(a.includes("youtube")||a.includes("thumbs-up"))&&/(watch|like).*video/gim.test(o)?this.undoneTasks.youtube.likeLinks.push(t):a.includes("vk")||/join.*vk.*group/gim.test(o)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(o)||(/wishlist.*game|add.*wishlist/gim.test(o)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(o)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(O(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(n),i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gasTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Giveawaysu.classifyTask"),!1}}}function Ji(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return O(t,"Giveawaysu.checkLogin"),!1}}async function Xi(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Giveawaysu.checkLeftKey"),!1}}function Zi(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}function Qi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function tn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function en(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var sn=new WeakSet,nn=new WeakSet,an=new WeakSet,on=new WeakSet;async function rn(){try{if(0<$("a.buttonenter:contains(Register to join)").length)return C({}).error(E("needLogin")),!1;const c=$("a.buttonenter.buttongiveaway");if(/join giveaway/gim.test(c.text())){const u=C({text:E("joiningGiveaway")+"..."});var t,e,s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:c.attr("href"),method:"POST",data:"ajax=t",dataType:"json",headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8",accept:"application/json, text/javascript, */*; q=0.01",origin:window.location.origin}});return"Success"===a?200===(null==l?void 0:l.status)?null!==(t=l.response)&&void 0!==t&&t.success?(c.addClass("buttonentered").text("Success - Giveaway joined"),$("#giveawaysjoined").slideDown(),$("#giveawaysrecommend").slideDown(),u.success("Success"+(null!==(i=l.response)&&void 0!==i&&i.text?":"+(null===(n=l.response)||void 0===n?void 0:n.text):"")),!0):(u.error("Error"+(null!==(e=l.response)&&void 0!==e&&e.text?":"+(null===(s=l.response)||void 0===s?void 0:s.text):"")),!1):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(a+`:${o}(${r})`),!1)}return/success/gim.test($("a.buttonenter.buttongiveaway").text())?!0:(C({}).warning(E("needJoinGiveaway")),!1)}catch(t){return O(t,"Indiedb.init"),!1}}async function ln(){try{const e=$("script").map((t,e)=>{var s,i,n,a,o;return/\$\(document\)/gim.test(e.innerHTML)?[null===(s=e.innerHTML.match(/"\/[\d]+"/gim))||void 0===s||null===(i=s[0])||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0],null===(e=e.innerHTML.match(/"\/newsletter\/ajax\/subscribeprofile\/optin\/[\d]+"/gim))||void 0===e||null===(a=e[0])||void 0===a||null===(o=a.match(/[\d]+/))||void 0===o?void 0:o[0]]:null});if(2!==e.length)return C({}).error(E("getFailed","TaskId")),!1;{const s=[];for(const t of $("#giveawaysjoined a[class*=promo]")){const n=$(t);if(!n.hasClass("buttonentered")){const a=C({text:`${E("doing")}:${n.parents("p").text()}...`});if(/facebookpromo|twitterpromo|visitpromo/gim.test(t.className)){let t="";t=n.hasClass("facebookpromo")?"facebookpromo":n.hasClass("twitterpromo")?"twitterpromo":"visitpromo",s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(`/giveaways/ajax/${t}/`+e[0]),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.addClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}else n.hasClass("emailoptinpromo")?s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath("/newsletter/ajax/subscribeprofile/optin/"+e[1]),timeout:6e4,dataType:"json",data:{ajax:"t",emailsystoggle:4},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):n.hasClass("watchingpromo")?s.push(new Promise(i=>{var t;const e=(t=>{try{const i={};return t?t.includes("?")&&t.split("?")[1].replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)):window.location.search.replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)),i}catch(t){return O(t,"getUrlQuery"),{}}})(n.attr("href"));e.ajax="t",$.ajax({type:"POST",url:urlPath(null===(t=n.attr("href"))||void 0===t?void 0:t.split(/[?#]/)[0]),timeout:6e4,dataType:"json",data:e,error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):/the-challenge-of-adblock/gim.test(n.attr("href"))?a.error("Error:"+E("unKnownTaskType")):s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(n.attr("href")),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}}return await Promise.all(s),C({}).success(E("allTasksComplete")),!0}}catch(t){return O(t,"Indiedb.classifyTask"),!1}}function cn(){try{return A.other.checkLogin?(0<$("a.buttonenter:contains(Register to join)").length&&window.open("/members/login","_self"),!0):!0}catch(t){return O(t,"Indiedb.checkLogin"),!1}}async function un(){try{return A.other.checkLeftKey?(0<$('a.buttonenter:contains("next time")').length&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayEnded"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Indiedb.checkLeftKey"),!1}}var dn=class{constructor(){Qi(this,on),Qi(this,an),Qi(this,nn),Qi(this,sn),tn(this,"name","Indiedb"),tn(this,"buttons",["doTask"])}static test(){return"www.indiedb.com"===window.location.host}async after(){try{en(this,an,cn).call(this)||C({}).warning(E("checkLoginFailed")),await en(this,on,un).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"Indiedb.after")}}async doTask(){try{return await en(this,sn,rn).call(this)?await en(this,nn,ln).call(this):!1}catch(t){return O(t,"Indiedb.doTask"),!1}}};function hn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function pn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function fn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const wn={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[]},discord:{serverLinks:[]},links:[]};var gn=new WeakSet,mn=new WeakSet,vn=new WeakSet;function kn(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){return O(t,"Keyhub.getGiveawayId"),!1}}async function yn(){try{return A.other.checkLeftKey?("0"===$("#keysleft").text().trim()&&await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Keyhub.checkLeftKey"),!1}}function bn(){try{return A.other.checkLogin?(0<$('a[href*="/connect/steam"]').length&&window.open("/connect/steam","_self"),!0):!0}catch(t){return O(t,"Keyhub.checkLogin"),!1}}var Tn=class extends Ei{constructor(){super(...arguments),hn(this,vn),hn(this,mn),hn(this,gn),pn(this,"name","Keyhub"),pn(this,"socialTasks",{...wn}),pn(this,"undoneTasks",{...wn}),pn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"key-hub.eu"===window.location.host}async after(){try{fn(this,vn,bn).call(this)||C({}).warning(E("checkLoginFailed")),await fn(this,mn,yn).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"Keyhub.after")}}init(){try{const t=C({text:E("initing")});return 0<$('a[href*="/connect/steam"]').length?(window.open("/connect/steam","_self"),t.warning(E("needLogin")),!1):!!fn(this,gn,kn).call(this)&&($("#VPNoverlay").hide(),$("#mainArticleSection").show(),this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Keyhub.init"),!1}}async classifyTask(e){try{const i=C({text:E("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("khTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||{...wn});for(const n of $(".task a")){let t=$(n).attr("href");var s=$(n).text().trim();t&&((/\/away\?data=/.test(t)||/steamcommunity\.com\/gid\//.test(t))&&(t=await u(t)||t),/https?:\/\/key-hub\.eu\/connect\/discord/.test(t)?window.open(t,"_blank"):/steamcommunity\.com\/groups\//.test(t)?("undo"===e&&this.socialTasks.steam.groupLinks.push(t),"do"===e&&this.undoneTasks.steam.groupLinks.push(t)):/store\.steampowered\.com\/app\//.test(t)&&/wishlist/gim.test(s)?("undo"===e&&this.socialTasks.steam.wishlistLinks.push(t),"do"===e&&this.undoneTasks.steam.wishlistLinks.push(t)):/store\.steampowered\.com\/curator\//.test(t)?("undo"===e&&this.socialTasks.steam.curatorLinks.push(t),"do"===e&&this.undoneTasks.steam.curatorLinks.push(t)):/^https?:\/\/discord\.com\/invite\//.test(t)?("undo"===e&&this.socialTasks.discord.serverLinks.push(t),"do"===e&&this.undoneTasks.discord.serverLinks.push(t)):C({}).warning(`${E("unKnownTaskType")}: ${s}(${t})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("khTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Keyhub.classifyTask"),!1}}verifyTask(){try{C({html:`
  • ${E("verifyingTask")}...
  • `}),$.get(window.location.href,t=>{VerifyTasks(t.match(/onclick="javascript:VerifyTasks\('(.*?)'\)"/)[1])})}catch(t){O(t,"keyhub.verifyTask")}}};function $n(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function xn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Sn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Ln={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[]},vk:{nameLinks:[]},discord:{serverLinks:[]}};var _n=new WeakSet,In=new WeakSet,Gn=new WeakSet;async function Cn(t){try{const s=C({html:`
  • ${E("verifyingTask")}${t}...
  • `});return await new Promise(e=>{$.ajax({url:"https://givekey.ru/giveaway/task",method:"POST",data:`id=${t}&user_id=`+this.userId,dataType:"json",headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},success:t=>{t.btn&&$(`button[data-id=${this.userId}]`).html(t.btn),"ok"===t.status?($(".task_check_"+t.id).html(``),s.success(),e(!0)):"end"===t.status?(s.success(),C({}).success(t.key),e(!0)):(s.error("Error:"+t.msg),e(!1))},error:t=>{s.error(`Error:${t.statusText}(${t.status})`),e(!1)}})})}catch(t){return O(t,"Givekey.verify"),!1}}function An(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"Givekey.getGiveawayId"),!1}}async function En(){try{return A.other.checkLeftKey?($("#keys_count").text()||await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Givekey.checkLeftKey"),!1}}var On=class extends Ei{constructor(){super(...arguments),$n(this,Gn),$n(this,In),$n(this,_n),xn(this,"name","Givekey"),xn(this,"tasks",[]),xn(this,"socialTasks",{...Ln}),xn(this,"undoneTasks",{...Ln}),xn(this,"userId",void 0),xn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"givekey.ru"===window.location.host}async after(){try{await new Promise(t=>{const e=setInterval(()=>{0<$("#navbarDropdown").length&&(clearInterval(e),t(!0))})}),await Sn(this,Gn,En).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){return O(t,"Givekey.after"),!1}}init(){try{const e=C({text:E("initing")});if(0<$('a[href*="/auth/steam"]').length)return window.open("/auth/steam","_self"),e.warning(E("needLogin")),!1;if(!Sn(this,In,An).call(this))return!1;var t=$('meta[name="user-id"]').attr("content");return t?(this.userId=t,this.initialized=!0,e.success(),!0):(e.error(E("getFailed",E("userId"))),!1)}catch(t){return O(t,"Givekey.init"),!1}}async classifyTask(e){try{const a=C({text:E("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("gkTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||Ln);for(const o of $('.card-body:has("button") .row')){const r=$(o);var s=/Complete/i.test(r.find("button").text().trim());if(!s||"undo"===e){const l=r.find("#task_check");var i=l.attr("data-id");if(i&&this.tasks.push(i),"verify"!==e){let t=r.find("a").attr("href")||null;var n=r.find("a").text().trim();const c=r.find("i");t&&n&&(/^https?:\/\/givekey\.ru\/giveaway\/[\d]+\/execution_task/.test(t)&&(t=await u(t)),t&&(/^https?:\/\/vk\.com\//.test(t)?(this.socialTasks.vk.nameLinks.push(t),"do"!==e||s||this.undoneTasks.vk.nameLinks.push(t)):/^https?:\/\/steamcommunity\.com\/groups/.test(t)?(this.socialTasks.steam.groupLinks.push(t),"do"!==e||s||this.undoneTasks.steam.groupLinks.push(t)):/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?(this.socialTasks.steam.wishlistLinks.push(t),"do"!==e||s||this.undoneTasks.steam.wishlistLinks.push(t)):/Subscribe/gi.test(n)&&c.hasClass("fa-steam-square")?/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?(this.socialTasks.steam.curatorLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLinks.push(t)):(this.socialTasks.steam.curatorLikeLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLikeLinks.push(t)):/^https?:\/\/twitter\.com\//.test(t)&&/Subscribe/gi.test(n)?(this.socialTasks.twitter.userLinks.push(t),"do"!==e||s||this.undoneTasks.twitter.userLinks.push(t)):c.hasClass("fa-discord")?(this.socialTasks.discord.serverLinks.push(t),"do"!==e||s||this.undoneTasks.discord.serverLinks.push(t)):C({}).warning(`${E("unKnownTaskType")}: ${n}(${t})`)))}}}return a.success(),this.tasks=_(this.tasks),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("gkTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Givekey.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;C({}).warning(E("giveKeyNoticeBefore"));var e=this.tasks.length;for(let t=0;t${E("giveKeyNoticeAfter")}`}),!0}catch(t){return O(t,"Givekey.verifyTask"),!1}}};function jn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Wn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Pn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Vn=new WeakSet,Mn=new WeakSet,Dn=new WeakSet;function Fn(){try{return A.other.checkLogin?(0<$('a[href*="/account/auth"]').length&&window.open($('a[href*="/account/auth"]').attr("href"),"_self"),!0):!0}catch(t){return O(t,"GiveeClub.checkLogin"),!1}}function Un(){var t=null===(t=window.location.href.match(/\/event\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}async function Nn(){try{return A.other.checkLeftKey?(0<$(".event-ended").length&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayEnded"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Giveawaysu.checkLeftKey"),!1}}var zn=class extends qi{constructor(){super(...arguments),jn(this,Dn),jn(this,Mn),jn(this,Vn),Wn(this,"name","GiveeClub"),Wn(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/givee\.club\/.*?\/event\/[\d]+/.test(window.location.href)}async after(){try{Pn(this,Vn,Fn).call(this)||C({}).warning(E("checkLoginFailed")),await Pn(this,Dn,Nn).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"GiveeClub.after")}}init(){try{const t=C({text:E("initing")});return Pn(this,Vn,Fn).call(this)?!!Pn(this,Mn,Un).call(this)&&(this.initialized=!0,t.success(),!0):(t.warning(E("needLogin")),!1)}catch(t){return O(t,"GiveeClub.init"),!1}}async classifyTask(t){try{const s=C({text:E("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gcTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||Bi,!0;const i=[];for(const n of $(".event-actions tr"))i.push(new Promise(e=>{const t=$(n).find(".event-action-label a"),s=$(n).find(".event-action-icon i").attr("class")||"",i=t.text().trim();if(s.includes("ban")||/AdBlock/i.test(i)||s.includes("envelope"))return e(!0);u(t.attr("href")).then(t=>t?(/^https?:\/\/steamcommunity\.com\/groups/.test(t)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(i)?this.undoneTasks.steam.announcementLinks.push(t):s.includes("plus")&&/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?this.undoneTasks.steam.wishlistLinks.push(t):/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):s.includes("steam")&&/follow|subscribe/gim.test(i)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(i)?this.undoneTasks.steam.forumLinks.push(t):s.includes("discord")?this.undoneTasks.discord.serverLinks.push(t):s.includes("instagram")?this.undoneTasks.instagram.userLinks.push(t):s.includes("twitch")?this.undoneTasks.twitch.channelLinks.push(t):s.includes("reddit")?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(i)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(i)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(i)||(s.includes("youtube")||s.includes("thumbs-up"))&&/(watch|like).*video/gim.test(i)?this.undoneTasks.youtube.likeLinks.push(t):s.includes("vk")||/join.*vk.*group/gim.test(i)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(i)||/follow.*button/gim.test(i)&&this.undoneTasks.steam.followLinks.push(t),void e(!0)):e(!1)).catch(t=>(O(t,"GiveeClub.classifyTask->getRedirectLink"),!1))}));return await Promise.all(i),s.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gcTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"GiveeClub.classifyTask"),!1}}};function Kn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Bn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Yn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Rn={maxPoint:"99999999"};var Hn=new WeakSet,qn=new WeakSet;async function Jn(t){try{for(const u of $(`.giveaways-page-item:contains('${t}'):not(:contains('ENTERED'))`)){var e,s,i,n,a,o,r,l=parseInt((null===(e=$(u).find(".giveaways-page-item-header-points").text().match(/[\d]+/gim))||void 0===e?void 0:e[0])||"999999",10),c=$(u).find(".giveaways-page-item-footer-name").text().trim();if("points"===t&&l>this.myPoints)C({}).warning(E("noPoints")+": "+c);else if("points"!==t||l){if(!("points"===t&&l>this.maxPoints)){const d=C({text:`${E("joiningLottery")}${c}...`}),h=$(u).find("a.giveaways-page-item-img-btn-enter:contains('enter')");if(null===h||void 0===h||null===(s=h.attr("onclick"))||void 0===s||!s.includes("checkUser")||(a=null===(i=h.attr("onclick"))||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0])&&checkUser(a),h.attr("href")){const{result:p,statusText:f,status:w,data:g}=await L({url:h.attr("href"),method:"GET"});"Success"===p?null!==g&&void 0!==g&&g.responseText&&/You've entered this giveaway/gim.test(g.responseText)?(d.success(),r=null===(o=g.responseText.match(/Points:[\s]*?([\d]+)/))||void 0===o?void 0:o[1],"points"===t&&r&&(this.myPoints=parseInt(r,10))):d.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`):d.error(p+`:${f}(${w})`)}else d.error('Error: No "href".')}}else C({}).warning(E("getNeedPointsFailed")+": "+c)}C({text:"-----END-----"})}catch(t){O(t,"OpiumPulses.toggleTask")}}function Xn(){try{return A.other.checkLogin?(1<$('a[href*="/site/login"]').length&&window.open("/site/login","_self"),!0):!0}catch(t){return O(t,"OpiumPulses.checkLogin"),!1}}var Zn=class{constructor(){Kn(this,qn),Kn(this,Hn),Bn(this,"name","OpiumPulses"),Bn(this,"options",{...Rn,...GM_getValue("OpiumPulsesOptions")}),Bn(this,"maxPoints",99999999),Bn(this,"myPoints",0),Bn(this,"buttons",["doFreeTask","doPointTask"])}static test(){return"www.opiumpulses.com"===window.location.host}async after(){try{Yn(this,qn,Xn).call(this)||C({}).warning(E("checkLoginFailed")),this.maxPoints=parseInt(this.options.maxPoint,10)}catch(t){O(t,"OpiumPulses.after")}}async doFreeTask(){try{Yn(this,Hn,Jn).call(this,"FREE")}catch(t){O(t,"OpiumPulses.doFreeTask")}}async doPointTask(){try{var t;this.myPoints=parseInt((null===(t=$(".page-header__nav-func-user-nav-items.points-items").text().match(/[\d]+/gim))||void 0===t?void 0:t[0])||"0",10),Yn(this,Hn,Jn).call(this,"points")}catch(t){O(t,"OpiumPulses.doPointTask")}}init(){return!0}classifyTask(){return!0}};function Qn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ta(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ea(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const sa={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},twitter:{userLinks:[],retweetLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var ia=new WeakSet;function na(t,e,s,i){try{$(t).after('${s.replace("Links","")}`)}catch(t){O(t,"keylol.addBtn")}}var aa=class extends Ei{constructor(){super(...arguments),Qn(this,ia),ta(this,"name","Keylol"),ta(this,"socialTasks",{...sa}),ta(this,"undoneTasks",{...sa}),ta(this,"buttons",["doTask","undoTask","selectAll","selectNone","invertSelect"])}static test(){var t;return"keylol.com"===window.location.host&&!(null===(t=$(".subforum_left_title_left_up a").eq(3).attr("href"))||void 0===t||!t.includes("319"))}init(){return!0}after(){try{var t="Keylol"===this.name?'#postlist>div[id^="post_"]:first':"div.container";const k=$(t);var e=k.find('a[href*="discord.com"]'),s=k.find('a[href*="reddit.com"]'),i=k.find('a[href*="instagram.com"]'),n=k.find('a[href*="twitter.com"]'),a=k.find('a[href*="twitch.tv"]'),o=k.find('a[href*="vk.com"]'),r=k.find('a[href*="store.steampowered.com"]'),l=k.find('a[href*="steamcommunity.com"]'),c=k.find('a[href*="youtube.com"]');if(0{e.getAttribute("selected")?e.removeAttribute("selected"):e.setAttribute("selected","selected")})}catch(t){O(t,"Keylol.invertSelect")}}};function oa(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ra(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function la(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const ca={steam:{groupLinks:[],wishlistLinks:[],followLinks:[],curatorLikeLinks:[]}};var ua=new WeakSet,da=new WeakSet;function ha(){try{var t,e=null===(t=window.location.href.match(/quests\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){return O(t,"Opquests.getGiveawayId"),!1}}function pa(){try{return A.other.checkLogin?(0<$('a[href*="/auth/redirect"]').length&&window.open("/auth/redirect","_self"),!0):!0}catch(t){return O(t,"Opquests.checkLogin"),!1}}t=class extends Ei{constructor(){super(...arguments),oa(this,da),oa(this,ua),ra(this,"name","Opquests"),ra(this,"undoneTasks",{...ca}),ra(this,"buttons",["doTask"])}static test(){return"opquests.com"===window.location.host}async after(){try{la(this,da,pa).call(this)||C({}).warning(E("checkLoginFailed"))}catch(t){O(t,"Opquests.after")}}init(){try{const t=C({text:E("initing")});return 0<$('a[href*="/auth/redirect"]').length?(window.open("/auth/redirect","_self"),t.warning(E("needLogin")),!1):!!la(this,ua,ha).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Opquests.init"),!1}}async classifyTask(t){try{if("undo"===t)return C({text:E("cannotUndo")}),!1;const i=C({text:E("getTasksInfo")});for(const n of $('.w-full:contains("Validate") .items-center')){var e=$(n).find('a:contains("Open")').attr("href"),s=$(n).find("div").eq(1).text().trim();e&&(/steamcommunity\.com\/groups\//.test(e)?this.undoneTasks.steam.groupLinks.push(e):/store\.steampowered\.com\/app\//.test(e)?/wishlist/gim.test(s)?this.undoneTasks.steam.wishlistLinks.push(e):/follow/gim.test(s)&&this.undoneTasks.steam.followLinks.push(e):/store\.steampowered\.com\/(publisher|developer)\//.test(e)&&/follow/gim.test(s)?this.undoneTasks.steam.curatorLikeLinks.push(e):C({}).warning(E("unKnownTaskType")+`: ${s}(${e})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),!0}catch(t){return O(t,"Opquests.classifyTask"),!1}}};function fa(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function wa(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ga(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const ma={steam:{groupLinks:[],wishlistLinks:[],followLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[],retweetLinks:[]},twitch:{channelLinks:[]},discord:{serverLinks:[]},youtube:{channelLinks:[]},extra:{gleam:[]}},va={vlootUsername:"",gameroundUsername:""};var ka=new WeakSet,ya=new WeakSet,ba=new WeakSet,Ta=new WeakSet,$a=new WeakSet;async function xa(){try{return await new Promise(t=>{const e=setInterval(()=>{0===$(".entry-content .entry-method i.fa-sync").length&&(clearInterval(e),t(!0))},500)})}catch(t){return O(t,"Gleam.checkSync"),!1}}async function Sa(e){try{const s=C({text:E("doingGleamTask")});return await new Promise(t=>{GM_openInTab(e+"?8b07d23f4bfa65f9",{active:!0,insert:!0,setParent:!0}).onclose=()=>{s.success(),t(!0)}})}catch(t){return O(t,"Gleam.doGleamTask"),!1}}function La(){try{var t=window.location.pathname;return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"Gleam.getGiveawayId"),!1}}async function _a(t){try{const i=C({text:E("gettingGleamLink")}),{result:n,statusText:a,status:o,data:r}=await L({url:t,method:"GET"});if("Success"!==n)return i.error(n+`:${a}(${o})`),!1;if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),!1;var e,s=null===(e=r.responseText.match(/href="(https:\/\/gleam\.io\/.*?\/.+?)"/))||void 0===e?void 0:e[1];return s?(i.success(),s):(i.error("Error:"+E("getLinkFailed")),!1)}catch(t){return O(t,"Gleam.getGleamLink"),!1}}async function Ia(){try{var e,s,i,n;if(!A.other.checkLeftKey)return!0;var a=null===(e=$("div.popup-blocks-container").attr("ng-init"))||void 0===e||null===(s=e.match(/initCampaign\(([\w\W]+?)\)$/))||void 0===s?void 0:s[1];if(!a)return!1;var o,r,l,c,{campaign:u,incentive:d}=JSON.parse(a),h=null===(i=$("div.campaign.reward").attr("ng-init"))||void 0===i||null===(n=i.match(/initContestant\(([\w\W]+?)\);/))||void 0===n?void 0:n[1];let t=!1;return h&&null!==(o=JSON.parse(h).contestant)&&void 0!==o&&null!==(r=o.claims)&&void 0!==r&&null!==(l=r.incentives)&&void 0!==l&&null!==(c=l[d.id])&&void 0!==c&&c.length&&(t=!0),(u.banned||u.finished&&!t||u.paused||(new Date).getTime()<1e3*u.starts_at)&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayNotWork"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0}catch(t){return O(t,"Gleam.checkLeftKey"),!1}}e=class extends Ei{constructor(){super(...arguments),fa(this,$a),fa(this,Ta),fa(this,ba),fa(this,ya),fa(this,ka),wa(this,"name","Gleam"),wa(this,"undoneTasks",{...ma}),wa(this,"socialTasks",{...ma}),wa(this,"options",{...va,...GM_getValue("GleamOptions")}),wa(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"gleam.io"===window.location.host}async after(){try{if(window.location.search.includes("8b07d23f4bfa65f9")){const s=setInterval(()=>{0<$(".entry-content .entry-method i.fa-check").length&&(clearInterval(s),window.close())});for(const i of $(".entry-content .entry-method")){const n=$(i).find(".user-links"),a=$(i).find(".expandable");var t=a.find("a.btn,a:contains(Continue),button:contains(Continue)");if(0!0)}catch(t){return O(t,"Gleam.extraDoTask"),!1}}async verifyTask(){try{C({text:E("verifyingTask")+"..."});for(const t of $(".entry-content .entry-method")){const e=$(t);if(0!==e.find("i.fa-question").length){const s=e.find(".user-links");s[0].click(),await G(500),await ga(this,ka,xa).call(this);for(const i of e.find(".expandable").find("span:contains(Continue),button:contains(Continue)"))i.click(),await G(500),await ga(this,ka,xa).call(this)}}C({text:E("verifiedGleamTasks")})}catch(t){return O(t,"Gleam.verifyTask"),!1}}};function Ga(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Ca(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Aa(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Ea={username:"",email:""};var Oa=new WeakSet,ja=new WeakSet,Wa=new WeakSet,Pa=new WeakSet;function Va(){try{return 0<$("#twitter_login_button").length&&$("#twitter_login_button")[0].click(),!0}catch(t){return O(t,"SweepWidget.checkLogin"),!1}}function Ma(){try{var t,e=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"SweepWidget.getGiveawayId"),!1}}async function Da(){try{return new Promise(t=>{const e=setInterval(()=>{0<$("#unlock_rewards_main_wrapper").length&&(clearInterval(e),t(!0))})})}catch(t){return O(t,"SweepWidget.checkEnter"),!1}}async function Fa(s){try{return new Promise(t=>{const e=setInterval(()=>{(0div.sw_entry")){const a=$(n);if(!(0 +`+s.stack)}var s=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(b(this,j,{auth:t}),s.success(),e(await T(this,V,z).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return O(t,"Discord.updateAuth"),!1}}async function B(t){try{const l=C({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:x(this,j).auth}});if("Success"!==i||200!==(null==o?void 0:o.status))return l.error(i+`:${n}(${a})`),!1;l.success();var r=String(null===(e=o.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(T(this,N,H).call(this,t,r),this.tasks.servers=I([...this.tasks.servers,t])),!0}catch(t){return O(t,"Discord.joinServer"),!1}}async function Y(t){try{if(this.whiteList.servers.includes(t))return C({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await T(this,U,R).call(this,t);if(!e)return!1;const o=C({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:a}=await L({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:x(this,j).auth}});return"Success"===s&&204===(null==a?void 0:a.status)?(o.success(),!0):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Discord.leaveServer"),!1}}async function R(t){try{const n=C({type:"gettingDiscordGuild",text:t});var e=x(this,W)[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==a||200!==(null===l||void 0===l?void 0:l.status))return n.error(a+`:${o}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),T(this,N,H).call(this,t,i),i):(n.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Discord.getGuild"),!1}}function H(t,e){try{x(this,W)[t]=e,GM_setValue("discordCache",x(this,W))}catch(t){O(t,"Discord.setCache")}}const q=class extends s{constructor(){var t;super(...arguments),m(this,N),m(this,U),m(this,F),m(this,M),m(this,D),m(this,V),y(this,"tasks",{..._}),y(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{..._}),v(this,j,{writable:!0,value:GM_getValue("discordAuth")||{}}),v(this,W,{writable:!0,value:GM_getValue("discordCache")||{}}),v(this,P,{writable:!0,value:!1})}async init(){try{return x(this,P)?!0:x(this,j).auth?await T(this,V,z).call(this)?(C({}).success(E("initSuccess","Discord")),b(this,P,!0),!0):(GM_setValue("discordAuth",{auth:null}),await T(this,D,K).call(this)?(C({}).success(E("initSuccess","Discord")),b(this,P,!0),!0):(C({}).error(E("initFailed","Discord")),!1)):!!await T(this,D,K).call(this)&&(b(this,P,!0),!0)}catch(t){return O(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!x(this,P))return C({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)C({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Discord.toggleServers"),!1}}};function J(t,e){Z(t,e),e.add(t)}function X(t,e,s){Z(t,e),e.set(t,s)}function Z(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Q(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function tt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,it(t,e,"set"),s),s}function et(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function st(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,it(t,e,"get"))}function it(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const nt={users:[]};var at=new WeakMap,ot=new WeakMap,rt=new WeakMap,lt=new WeakSet,ct=new WeakSet,ut=new WeakSet,dt=new WeakSet;async function ht(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Instagram.toggleUsers"),!1}}};function mt(t,e){kt(t,e),e.add(t)}function vt(t,e,s){kt(t,e),e.set(t,s)}function kt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function bt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,xt(t,e,"set"),s),s}function Tt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function $t(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,xt(t,e,"get"))}function xt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const St={reddits:[]};var Lt=new WeakMap,It=new WeakMap,_t=new WeakSet,Gt=new WeakSet;async function Ct(){try{const s=C({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await Tt(this,Gt,At).call(this,!0))}})}catch(t){return O(t,"Reddit.useBeta"),!1}}async function At(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return O(t,"Reddit.toggle"),!1}}};function Ot(t,e){Wt(t,e),e.add(t)}function jt(t,e,s){Wt(t,e),e.set(t,s)}function Wt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Vt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ft(t,e,"set"),s),s}function Dt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Mt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ft(t,e,"get"))}function Ft(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ut={channels:[]};var Nt=new WeakMap,zt=new WeakMap,Kt=new WeakMap,Bt=new WeakSet,Yt=new WeakSet,Rt=new WeakSet,Ht=new WeakSet,qt=new WeakSet;async function Jt(){try{const r=C({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Mt(this,Nt).authToken,"Client-Id":Mt(this,Nt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==o?void 0:o.status)&&null!==(t=o.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1):(r.error(i+`:${n}(${a})`),!1)}catch(t){return O(t,"Twitch.verifyAuth"),!1}}async function Xt(){try{const s=C({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Vt(this,Nt,t),s.success(),e(await Dt(this,Bt,Jt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return O(t,"Twitch.updateAuth"),!1}}async function Zt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return C({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Dt(this,Ht,Qt).call(this,e);if(!s)return!1;const c=C({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:a,statusText:o,status:r,data:l}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Mt(this,Nt).authToken},data:t?i:n});return"Success"===a?200===(null==l?void 0:l.status)?(c.success(),t&&(this.tasks.channels=I([...this.tasks.channels,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Twitch.toggleChannel"),!1}}async function Qt(t){try{const d=C({type:"gettingTwitchChannelId",text:t});var e=Mt(this,zt)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:a}=await L({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Mt(this,Nt).authToken,"Client-Id":Mt(this,Nt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==a?void 0:a.status))return d.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1;var o,r,l,c,u=String(null===(o=a.response)||void 0===o||null===(r=o[0])||void 0===r||null===(l=r.data)||void 0===l||null===(c=l.user)||void 0===c?void 0:c.id);return u?(Dt(this,qt,te).call(this,t,u),d.success(),u):(d.error(`Error:${a.statusText}(${a.status})`),!1)}catch(t){return O(t,"Twitch.getChannelId"),!1}}function te(t,e){try{Mt(this,zt)[t]=e,GM_setValue("twitchCache",Mt(this,zt))}catch(t){O(t,"Twitch.setCache")}}const ee=class extends s{constructor(){var t;super(...arguments),Ot(this,qt),Ot(this,Ht),Ot(this,Rt),Ot(this,Yt),Ot(this,Bt),Pt(this,"tasks",{...Ut}),Pt(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Ut}),jt(this,Nt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),jt(this,zt,{writable:!0,value:GM_getValue("twitchCache")||{}}),jt(this,Kt,{writable:!0,value:!1})}async init(){try{return Mt(this,Kt)?!0:Mt(this,Nt).authToken?await Dt(this,Bt,Jt).call(this)?(C({}).success(E("initSuccess","Twitch")),Vt(this,Kt,!0),!0):(GM_setValue("twitchAuth",null),await Dt(this,Yt,Xt).call(this)?(C({}).success(E("initSuccess","Twitch")),Vt(this,Kt,!0),!0):(C({}).error(E("initFailed","Twitch")),!1)):!!await Dt(this,Yt,Xt).call(this)&&(Vt(this,Kt,!0),!0)}catch(t){return O(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Mt(this,Kt))return C({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)C({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return O(t,"Twitch.toggle"),!1}}};function se(t,e){ne(t,e),e.add(t)}function ie(t,e,s){ne(t,e),e.set(t,s)}function ne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ae(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function oe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ce(t,e,"set"),s),s}function re(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function le(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ce(t,e,"get"))}function ce(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ue={users:[],retweets:[],likes:[]};var de=new WeakMap,he=new WeakMap,pe=new WeakMap,fe=new WeakMap,we=new WeakSet,ge=new WeakSet,me=new WeakSet,ve=new WeakSet,ke=new WeakSet;async function ye(){try{return await re(this,me,Te).call(this,{name:"verify",doTask:!0,verify:!0})}catch(t){return O(t,"Twitter.verifyAuth"),!1}}async function be(){try{const s=C({text:E("updatingAuth","Twitter")});return await new Promise(e=>{const t=GM_openInTab("https://twitter.com/settings/account?k#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitterAuth");t?(oe(this,he,t),s.success(),e(await re(this,we,ye).call(this))):(s.error("Error: Update twitter auth failed!"),e(!1))}})}catch(t){return O(t,"Twitter.updateToken"),!1}}async function Te(t){var{name:e,doTask:s=!0,verify:t=!1}=t;try{if(!s&&!t&&this.whiteList.users.includes(e))return C({type:"whiteList",text:"Twitter.unfollowUser",id:e}),!0;var i=t?le(this,de):await this.userName2id(e);if(!i)return!1;const d=t?C({text:E("verifyingAuth","Twitter")}):C({type:`${s?"":"un"}followingTwitterUser`,text:e});var n,a,o,{result:r,statusText:l,status:c,data:u}=await L({url:`https://api.twitter.com/1.1/friendships/${s?"create":"destroy"}.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},responseType:"json",data:$.param({include_profile_interstitial_type:1,include_blocking:1,include_blocked_by:1,include_followed_by:1,include_want_retweets:1,include_mute_edge:1,include_can_dm:1,include_can_media_tag:1,skip_status:1,id:i})});return"Success"===r?200===(null==u?void 0:u.status)?(d.success(),s&&!t&&(this.tasks.users=I([...this.tasks.users,e])),!0):t&&403===(null==u?void 0:u.status)&&158===(null===(n=u.response)||void 0===n||null===(a=n.errors)||void 0===a||null===(o=a[0])||void 0===o?void 0:o.code)?(d.success(),!0):(d.error(`Error:${null==u?void 0:u.statusText}(${null==u?void 0:u.status})`),!1):(d.error(r+`:${l}(${c})`),!1)}catch(t){return O(t,"Twitter.toggleUser"),!1}}async function $e(t){var{retweetId:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.retweets.includes(e))return C({type:"whiteList",text:"Twitter.unretweet",id:e}),!0;const c=C({type:`${t?"":"un"}retweetting`,text:e});var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:`https://api.twitter.com/1.1/statuses/${t?"":"un"}retweet.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},data:$.param({tweet_mode:"extended",id:e}),responseType:"json"});return"Success"===a?200===(null==l?void 0:l.status)||403===(null==l?void 0:l.status)&&327===(null===(s=l.response)||void 0===s||null===(i=s.errors)||void 0===i||null===(n=i[0])||void 0===n?void 0:n.code)?(c.success(),t&&(this.tasks.retweets=I([...this.tasks.retweets,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Twitter.toggleRetweet"),!1}}function xe(t,e){try{le(this,pe)[t]=e,GM_setValue("twitterCache",le(this,pe))}catch(t){O(t,"Twitter.setCache")}}const Se=class extends s{constructor(){var t;super(...arguments),se(this,ke),se(this,ve),se(this,me),se(this,ge),se(this,we),ae(this,"tasks",{...ue}),ae(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitter)||{...ue}),ie(this,de,{writable:!0,value:A.other.twitterVerifyId}),ie(this,he,{writable:!0,value:GM_getValue("twitterAuth")||{}}),ie(this,pe,{writable:!0,value:GM_getValue("twitterCache")||{}}),ie(this,fe,{writable:!0,value:!1})}async init(){try{return le(this,fe)?!0:le(this,he).ct0?await re(this,we,ye).call(this)?(C({}).success(E("initSuccess","Twitter")),oe(this,fe,!0),!0):(GM_setValue("twitterAuth",null),await re(this,ge,be).call(this)?(C({}).success(E("initSuccess","Twitter")),oe(this,fe,!0),!0):(C({}).error(E("initFailed","Twitter")),!1)):!!await re(this,ge,be).call(this)&&(oe(this,fe,!0),!0)}catch(t){return O(t,"Twitter.init"),!1}}async userName2id(t){try{const u=C({type:"gettingTwitterUserId",text:t});var e=le(this,pe)[t];if(e)return u.success(),e;var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:"https://api.twitter.com/graphql/-xfUfZsnR_zqjFd-IfrN5A/UserByScreenName"+`?variables=%7B%22screen_name%22%3A%22${t}%22%2C%22withHighlightedLabel%22%3Atrue%7D`,method:"GET",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","content-type":"application/json"},responseType:"json",anonymous:!0});if("Success"!==a)return u.error(a+`:${o}(${r})`),!1;if(200!==(null==l?void 0:l.status))return u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1;{let e=l.response||("object"==typeof l.responseText?l.responseText:null);if(!e)try{e=JSON.parse(l.responseText)}catch(t){e=null}var c=String(null===(s=e)||void 0===s||null===(i=s.data)||void 0===i||null===(n=i.user)||void 0===n?void 0:n.rest_id);return c?(re(this,ke,xe).call(this,t,c),u.success(),c):(u.error(`Error:${l.statusText}(${l.status})`),!1)}}catch(t){return O(t,"Twitter.getUserId"),!1}}async toggle(t){var{doTask:e=!0,userLinks:s=[],retweetLinks:t=[]}=t;try{if(!le(this,fe))return C({text:E("needInit")}),!1;const a=[];if(e&&!A.doTask.twitter.users||!e&&!A.undoTask.twitter.users)C({type:"globalOptionsSkip",text:"twitter.users"});else{var i=this.getRealParams("users",s,e,t=>{return null===(t=t.match(/https:\/\/twitter\.com\/(.+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/https:\/\/twitter\.com\/.*?\/status\/([\d]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Twitter.toggle"),!1}}};function Le(t,e){_e(t,e),e.add(t)}function Ie(t,e,s){_e(t,e),e.set(t,s)}function _e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ge(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ce(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Oe(t,e,"set"),s),s}function Ae(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Oe(t,e,"get"))}function Oe(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const je={names:[]};var We=new WeakMap,Pe=new WeakMap,Ve=new WeakMap,De=new WeakSet,Me=new WeakSet,Fe=new WeakSet,Ue=new WeakSet,Ne=new WeakSet,ze=new WeakSet,Ke=new WeakSet,Be=new WeakSet;async function Ye(){try{const e=C({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==a&&void 0!==a&&a.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===a||void 0===a?void 0:a.status)?(Ce(this,We,(null===(t=a.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Vk.verifyAuth"),!1}}async function Re(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Vk.toggle"),!1}}};function es(t,e){is(t,e),e.add(t)}function ss(t,e,s){is(t,e),e.set(t,s)}function is(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ns(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function as(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ls(t,e,"set"),s),s}function os(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function rs(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ls(t,e,"get"))}function ls(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const cs={channels:[],likes:[]},us=async function(t,e){try{const h=C({text:E("gettingYtbToken")}),{result:p,statusText:f,status:w,data:g}=await L({url:t,method:"GET"});if("Success"!==p)return h.error(p+`:${f}(${w})`),{};if(200!==(null===g||void 0===g?void 0:g.status))return h.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`),{};{var s,i;if(g.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=g.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],a=(null===(i=g.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||g.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:m,request:v}=JSON.parse(a);if(n&&m&&v){if(m.hl="en","channel"===e){var o,r=null===(o=g.responseText.match(//))||void 0===o?void 0:o[1];return r?(h.success(),{params:{apiKey:n,client:m,request:v,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,c,u=null===(l=g.responseText.match(//))||void 0===l?void 0:l[1],d=null===(c=g.responseText.match(/"likeParams":"(.*?)"/))||void 0===c?void 0:c[1];return u?(h.success(),{params:{apiKey:n,client:m,request:v,videoId:u,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return O(t,"Youtube.getInfo"),{}}};var ds=new WeakMap,hs=new WeakMap,ps=new WeakMap,fs=new WeakSet,ws=new WeakSet,gs=new WeakSet,ms=new WeakSet,vs=new WeakSet;class ks extends s{constructor(){var t;super(...arguments),es(this,vs),es(this,ms),es(this,gs),es(this,ws),es(this,fs),ns(this,"tasks",{...cs}),ns(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...cs}),ss(this,ds,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),ss(this,hs,{writable:!0,value:!1}),ss(this,ps,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return rs(this,hs)?!0:rs(this,ds).PAPISID?await os(this,fs,ys).call(this)?(C({}).success(E("initSuccess","Youtube")),as(this,hs,!0),!0):(GM_setValue("youtubeAuth",null),await os(this,ws,bs).call(this)?(C({}).success(E("initSuccess","Youtube")),as(this,hs,!0),!0):(C({}).error(E("initFailed","Youtube")),!1)):!!await os(this,ws,bs).call(this)&&(as(this,hs,!0),!0)}catch(t){return O(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!rs(this,hs))return C({text:E("needInit")}),!1;const a=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)C({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return O(t,"Youtube.toggle"),!1}}}async function ys(){try{return await os(this,ms,$s).call(this,{link:rs(this,ps),doTask:!0,verify:!0})}catch(t){return O(t,"Youtube.verifyAuth"),!1}}async function bs(){try{const s=C({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(as(this,ds,t),s.success(),os(this,fs,ys).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return O(t,"Discord.updateAuth"),!1}}function Ts(t,e){return us(t,e)}async function $s(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await os(this,gs,Ts).call(this,e,"channel"),{apiKey:a,client:o,request:r,channelId:l}=i||{};if(n)return C({html:E("loginYtb")}),!1;if(!(a&&o&&r&&l))return C({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return C({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const u=t?C({text:E("verifyingAuth","Youtube")}):C({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var c=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:p,data:f}=await L({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+a,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==o?void 0:o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:o,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===f||void 0===f?void 0:f.status)?s&&(/"subscribed": true/.test(f.responseText)||f.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(f.responseText)?(u.success(),s&&!t&&(this.tasks.channels=I([...this.tasks.channels,e])),!0):t&&f.responseText.includes("You may not subscribe to yourself")?(u.success(),!0):(u.error(E("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),!1):(u.error(d+`:${h}(${p})`),!1)}catch(t){return O(t,"Youtube.toggleChannel"),!1}}async function xs(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await os(this,gs,Ts).call(this,e,"likeVideo"),{apiKey:n,client:a,request:o,videoId:r,likeParams:l}=s||{};if(i)return C({html:""+E("loginYtb")}),!1;if(!(n&&a&&o&&r&&l))return C({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return C({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const u=C({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var c=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:a,request:{sessionId:o.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return u.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:p,status:f,data:w}=await L({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(u.success(),t&&(this.tasks.likes=I([...this.tasks.likes,e])),!0):(u.error(E("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(u.error(h+`:${p}(${f})`),!1)}catch(t){return O(t,"Youtube.toggleLikeVideo"),!1}}function Ss(t,e){Is(t,e),e.add(t)}function Ls(t,e,s){Is(t,e),e.set(t,s)}function Is(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _s(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Gs(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Es(t,e,"set"),s),s}function Cs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function As(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Es(t,e,"get"))}function Es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Os={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var js=new WeakMap,Ws=new WeakMap,Ps=new WeakMap,Vs=new WeakMap,Ds=new WeakSet,Ms=new WeakSet,Fs=new WeakSet,Us=new WeakSet,Ns=new WeakSet,zs=new WeakSet,Ks=new WeakSet,Bs=new WeakSet,Ys=new WeakSet,Rs=new WeakSet,Hs=new WeakSet,qs=new WeakSet,Js=new WeakSet,Xs=new WeakSet,Zs=new WeakSet,Qs=new WeakSet,ti=new WeakSet,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet;async function ai(){try{const s=C({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${a})`),!1;if(200!==(null===o||void 0===o?void 0:o.status))return s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1;var t;if(o.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=o.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(As(this,Ws).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return O(t,"Steam.updateStoreAuth"),!1}}async function oi(){try{const o=C({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:c,data:u}=await L({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return o.error(r+`:${l}(${c})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;var t,e,s;if(u.responseText.includes('href="https://steamcommunity.com/login/home/'))return o.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=u.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=u.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],a=null===(s=u.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(As(this,Ws).steam64Id=i),a&&(As(this,Ws).userName=a),n)?(As(this,Ws).communitySessionID=n,o.success(),!0):(o.error('Error: Get "sessionID" failed'),!1)}catch(t){return O(t,"Steam.updateCommunityAuth"),!1}}async function ri(){try{const i=C({text:E("gettingAreaInfo")}),{result:n,statusText:a,status:o,data:r}=await L({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${a}(${o})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return C({text:"noAnotherArea"}),!1;[t]=s}const l=C({text:E("changingArea",t)});var{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:As(this,Ws).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${a})`),"CN";if(200!==(null==o?void 0:o.status)||"true"!==o.responseText)return l.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),"CN";var r=(await Cs(this,Fs,ri).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return O(t,"Steam.changeArea"),!1}}async function ci(t){try{const e=C({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:As(this,Ws).communitySessionID})});return"Success"===s?200!==(null===a||void 0===a?void 0:a.status)||a.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.success(),this.tasks.groups=I([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Steam.joinGroup"),!1}}async function ui(t){try{if(this.whiteList.groups.includes(t))return C({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Cs(this,Ks,di).call(this,t);if(!e)return!1;const s=C({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:a,data:o}=await L({url:`https://steamcommunity.com/id/${As(this,Ws).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:As(this,Ws).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===o||void 0===o?void 0:o.status)&&o.finalUrl.includes("groups")&&0===$(o.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(s.error(i+`:${n}(${a})`),!1)}catch(t){return O(t,"Steam.leaveGroup"),!1}}async function di(t){try{const n=C({type:"gettingSteamGroupId",text:t});var e=As(this,js).group[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==a)return n.error(a+`:${o}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Cs(this,ni,Si).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return O(t,"Steam.getGroupID"),!1}}async function hi(t){try{var e;const n=C({type:"addingToWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:As(this,Ws).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=I([...this.tasks.wishlists,t]),!0;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===a?200===(null===l||void 0===l?void 0:l.status)?"CN"===As(this,Vs)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Cs(this,Us,li).call(this)&&await Cs(this,Bs,hi).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=I([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Steam.addToWishlist"),!1}}async function pi(t){try{var e;if(this.whiteList.wishlists.includes(t))return C({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const a=C({type:"removingFromWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:As(this,Ws).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return a.success(),!0;const{result:o,statusText:r,status:l,data:c}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==o)return a.error(o+`:${r}(${l})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;if("CN"===As(this,Vs)&&c.responseText.includes('id="error_box"')){a.warning(E("changeAreaNotice"));var n=await Cs(this,Us,li).call(this);return n&&"CN"!==n&&"skip"!==n?await Cs(this,Ys,pi).call(this,t):!1}return c.responseText.includes('class="queue_actions_ctn"')&&(c.responseText.includes("ds_owned_flag ds_flag")||c.responseText.includes("add_to_wishlist_area"))?(a.success(),!0):(a.error(`Error:${c.statusText}(${c.status})`),!1)}catch(t){return O(t,"Steam.removeFromWishlist"),!1}}async function fi(t,e){try{if(!e&&this.whiteList.follows.includes(t))return C({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const a=C({type:`${e?"":"un"}followingGame`,text:t}),o={sessionid:As(this,Ws).storeSessionID,appid:t};e||(o.unfollow="1");var{result:s,data:i}=await L({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(o)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return a.success(),!0;var n=await Cs(this,Hs,wi).call(this,t);return"CN"===As(this,Vs)&&"areaLocked"===n?(a.warning(E("changeAreaNotice")),!!await Cs(this,Us,li).call(this)&&await Cs(this,Ys,pi).call(this,t)):e===n?(a.success(),e&&(this.tasks.follows=I([...this.tasks.follows,t])),!0):(a.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return O(t,"Steam.toggleFollowGame"),!1}}async function wi(t){try{const{result:e,data:s}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===As(this,Vs)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return O(t,"Steam.isFollowedGame"),!1}}async function gi(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Cs(this,ni,Si).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return O(t,"Steam.getWorkshopAppId"),!1}}async function yi(t){try{const o=C({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:As(this,Ws).communitySessionID})});return"Success"===s?(200===(null==a?void 0:a.status)&&1===(null===(e=a.response)||void 0===e?void 0:e.success)?o.success():o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!0):(o.error(s+`:${i}(${n})`),!0)}catch(t){return O(t,"Steam.voteupWorkshop"),!0}}async function bi(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),m=this.getRealParams("curatorLikes",c,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==As(this,Vs)&&(C({}).warning(E("steamFinishNotice")),await Cs(this,Us,li).call(this,"CN")),!0))}catch(t){return O(t,"Steam.toggle"),!1}}};function Ii(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function _i(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Gi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Ci=new WeakSet;async function Ai(e,t){try{return{name:e,result:await t}}catch(t){return O(t,"Website.bind"),{name:e,result:!1}}}var Ei=class{constructor(){Ii(this,Ci),_i(this,"undoneTasks",void 0),_i(this,"socialTasks",void 0),_i(this,"giveawayId",void 0),_i(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,twitter:!1,vk:!1,youtube:!1,steam:!1}),_i(this,"initialized",!1),_i(this,"social",{})}async initSocial(t){try{const s=[];var e="do"===t?this.undoneTasks:this.socialTasks;return e.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new q,s.push(Gi(this,Ci,Ai).call(this,"discord",this.social.discord.init()))),e.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new gt,s.push(Gi(this,Ci,Ai).call(this,"instagram",this.social.instagram.init()))),e.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new Et,s.push(Gi(this,Ci,Ai).call(this,"reddit",this.social.reddit.init()))),e.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new ee,s.push(Gi(this,Ci,Ai).call(this,"twitch",this.social.twitch.init()))),e.twitter&&0[...t,...e]).length&&!this.socialInitialized.twitter&&(this.social.twitter=new Se,s.push(Gi(this,Ci,Ai).call(this,"twitter",this.social.twitter.init()))),e.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new ts,s.push(Gi(this,Ci,Ai).call(this,"vk",this.social.vk.init()))),e.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new ks,s.push(Gi(this,Ci,Ai).call(this,"youtube",this.social.youtube.init()))),e.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new Li,s.push(Gi(this,Ci,Ai).call(this,"steam",this.social.steam.init()))),e.links&&0{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return O(t,"Website.initSocial"),!1}}uniqueTasks(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,a]of Object.entries(i))e[s][n]=I(a)}return e}async toggleTask(t){try{if(!this.initialized&&!this.init())return!1;if(!await this.classifyTask(t))return!1;if(!await this.initSocial(t))return!1;const i=[];var e="do"===t,s=e?this.undoneTasks:this.socialTasks;if(this.social.discord&&i.push(this.social.discord.toggle({doTask:e,...s.discord})),this.social.instagram&&i.push(this.social.instagram.toggle({doTask:e,...s.instagram})),this.social.reddit&&i.push(this.social.reddit.toggle({doTask:e,...s.reddit})),this.social.twitch&&i.push(this.social.twitch.toggle({doTask:e,...s.twitch})),this.social.twitter&&i.push(this.social.twitter.toggle({doTask:e,...s.twitter})),this.social.vk&&i.push(this.social.vk.toggle({doTask:e,...s.vk})),this.social.youtube&&i.push(this.social.youtube.toggle({doTask:e,...s.youtube})),this.social.steam&&i.push(this.social.steam.toggle({doTask:e,...s.steam})),this.social.visitLink&&s.links&&e)for(const n of s.links)i.push(this.social.visitLink(n));return e&&s.extra&&this.extraDoTask&&0[...t,...e]).length&&i.push(this.extraDoTask(s.extra)),await Promise.all(i),C({}).success(E("allTasksComplete")),!0}catch(t){return O(t,"Website.toggleTask"),!1}}async doTask(){try{return await this.toggleTask("do")}catch(t){return O(t,"Website.doTask"),!1}}async undoTask(){try{return await this.toggleTask("undo")}catch(t){return O(t,"Website.undoTask"),!1}}};function Oi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ji(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Wi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Pi={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],followLinks:[]},vk:{nameLinks:[]}};var Vi=new WeakSet,Di=new WeakSet;function Mi(){try{var t,e=null===(t=window.location.href.match(/\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){O(t,"FreeAnyWhere.getGiveawayId")}}async function Fi(t){try{const o=C({html:`
  • ${E("verifyingTask")}${t.title.trim()}...
  • `});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/challenge-status/${t.id}/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.status?(o.success(),!0):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Freeanywhere.verify"),!1}}var Ui=class extends Ei{constructor(){super(...arguments),Oi(this,Di),Oi(this,Vi),ji(this,"name","FreeAnyWhere"),ji(this,"tasks",[]),ji(this,"socialTasks",{...Pi}),ji(this,"undoneTasks",{...Pi}),ji(this,"buttons",["doTask","undoTask","verifyTask","getKey"])}static test(){return"freeanywhere.net"===window.location.host}init(){try{const s=C({text:E("initing")});if(0<$('a[href="#/login"]').length)return window.open("/#/login","_self"),s.warning(E("needLogin")),!1;if(window.location.href.includes("/login"))return s.warning(E("needLogin")),!1;if(!/^https?:\/\/freeanywhere\.net\/#\/giveaway\/[\d]+/.test(window.location.href)){var t,e=null===(t=window.location.href.match(/https?:\/\/freeanywhere\.net\/.*?#\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];if(!e)return s.error(E("getFailed","Id")),!1;window.location.href="https://freeanywhere.net/#/giveaway/"+e}return Wi(this,Vi,Mi).call(this)?(this.initialized=!0,s.success(),!0):!1}catch(t){return O(t,"Freeanywhere.init"),!1}}async classifyTask(t){try{const u=C({text:E("getTasksInfo")});var e;"undo"===t&&(this.socialTasks=(null===(e=GM_getValue("fawTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||{...Pi});var{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/?format=json`,method:"GET",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")},responseType:"json"});if("Success"!==s)return u.error(s+`:${i}(${n})`),!1;var o,r=null==a||null===(o=a.response)||void 0===o?void 0:o.challenges;if(r){"verify"===t&&(this.tasks=[]);for(const d of r){var l=d.challenge,c=d.challenge_provider;const h={id:d.id,title:d.title};if("verify"!==t||d.is_success)switch(c){case"steam":switch(h.social="steam",l){case"WL":"undo"===t&&this.socialTasks.steam.wishlistLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.wishlistLinks.push(d.link);break;case"JTG":"undo"===t&&this.socialTasks.steam.groupLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.groupLinks.push(d.link);break;case"STC":"undo"===t&&this.socialTasks.steam.curatorLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.curatorLinks.push(d.link);break;case"GF":"undo"===t&&this.socialTasks.steam.followLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.followLinks.push(d.link)}break;case"vk-oauth2":"undo"===t&&this.socialTasks.vk.nameLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.vk.nameLinks.push(d.link);break;case"website":break;default:C({}).warning(E("unKnownTaskType")+": "+c)}else this.tasks.push(h)}return u.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("fawTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}return u.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),console.error(a),!1}catch(t){return O(t,"Freeanywhere.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;const t=[];for(const e of this.tasks)t.push(Wi(this,Di,Fi).call(this,e)),await G(1e3);return await Promise.all(t),C({}).success(E("allTasksComplete")),!!await this.getKey(!0)}catch(t){return O(t,"Freeanywhere.verifyTask"),!1}}async getKey(t){try{if(!t&&!this.initialized&&!this.init())return!1;const o=C({text:E("gettingKey")});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/reward/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.reward?(o.success(),C({}).success(a.response.reward),a.response.reward):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"FreeAnyWhere.getGiveawayId"),!1}}};function Ni(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function zi(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ki(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Bi={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var Yi=new WeakSet,Ri=new WeakSet,Hi=new WeakSet;class qi extends Ei{constructor(){super(...arguments),Ni(this,Hi),Ni(this,Ri),Ni(this,Yi),zi(this,"name","GiveawaySu"),zi(this,"socialTasks",Bi),zi(this,"undoneTasks",Bi),zi(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Ki(this,Yi,Ji).call(this)||C({}).warning(E("checkLoginFailed")),await Ki(this,Ri,Xi).call(this)||C({}).warning(E("checkLeftKeyFailed")),C({}).warning(E("gsNotice"))}catch(t){O(t,"Giveawaysu.after")}}init(){try{const t=C({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Ki(this,Hi,Zi).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Giveawaysu.init"),!1}}async classifyTask(t){try{const i=C({text:E("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gasTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||Bi,!0;const n=[];var s=$("#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 r of s)n.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(a.includes("steam")&&/join/gi.test(o)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(o)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(o)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):a.includes("steam")&&/follow|subscribe/gim.test(o)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(o)?this.undoneTasks.steam.forumLinks.push(t):a.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):a.includes("discord")||/join.*discord/gim.test(o)?this.undoneTasks.discord.serverLinks.push(t):a.includes("instagram")||/follow.*instagram/gim.test(o)?this.undoneTasks.instagram.userLinks.push(t):a.includes("twitch")||/follow.*twitch.*channel/gim.test(o)?this.undoneTasks.twitch.channelLinks.push(t):a.includes("reddit")||/subscribe.*subreddit/gim.test(o)||/follow.*reddit/gim.test(o)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(o)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(o)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(o)||(a.includes("youtube")||a.includes("thumbs-up"))&&/(watch|like).*video/gim.test(o)?this.undoneTasks.youtube.likeLinks.push(t):a.includes("vk")||/join.*vk.*group/gim.test(o)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(o)||(/wishlist.*game|add.*wishlist/gim.test(o)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(o)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(O(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(n),i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gasTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Giveawaysu.classifyTask"),!1}}}function Ji(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return O(t,"Giveawaysu.checkLogin"),!1}}async function Xi(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Giveawaysu.checkLeftKey"),!1}}function Zi(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}function Qi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function tn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function en(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var sn=new WeakSet,nn=new WeakSet,an=new WeakSet,on=new WeakSet;async function rn(){try{if(0<$("a.buttonenter:contains(Register to join)").length)return C({}).error(E("needLogin")),!1;const c=$("a.buttonenter.buttongiveaway");if(/join giveaway/gim.test(c.text())){const u=C({text:E("joiningGiveaway")+"..."});var t,e,s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:c.attr("href"),method:"POST",data:"ajax=t",dataType:"json",headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8",accept:"application/json, text/javascript, */*; q=0.01",origin:window.location.origin}});return"Success"===a?200===(null==l?void 0:l.status)?null!==(t=l.response)&&void 0!==t&&t.success?(c.addClass("buttonentered").text("Success - Giveaway joined"),$("#giveawaysjoined").slideDown(),$("#giveawaysrecommend").slideDown(),u.success("Success"+(null!==(i=l.response)&&void 0!==i&&i.text?":"+(null===(n=l.response)||void 0===n?void 0:n.text):"")),!0):(u.error("Error"+(null!==(e=l.response)&&void 0!==e&&e.text?":"+(null===(s=l.response)||void 0===s?void 0:s.text):"")),!1):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(a+`:${o}(${r})`),!1)}return/success/gim.test($("a.buttonenter.buttongiveaway").text())?!0:(C({}).warning(E("needJoinGiveaway")),!1)}catch(t){return O(t,"Indiedb.init"),!1}}async function ln(){try{const e=$("script").map((t,e)=>{var s,i,n,a,o;return/\$\(document\)/gim.test(e.innerHTML)?[null===(s=e.innerHTML.match(/"\/[\d]+"/gim))||void 0===s||null===(i=s[0])||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0],null===(e=e.innerHTML.match(/"\/newsletter\/ajax\/subscribeprofile\/optin\/[\d]+"/gim))||void 0===e||null===(a=e[0])||void 0===a||null===(o=a.match(/[\d]+/))||void 0===o?void 0:o[0]]:null});if(2!==e.length)return C({}).error(E("getFailed","TaskId")),!1;{const s=[];for(const t of $("#giveawaysjoined a[class*=promo]")){const n=$(t);if(!n.hasClass("buttonentered")){const a=C({text:`${E("doing")}:${n.parents("p").text()}...`});if(/facebookpromo|twitterpromo|visitpromo/gim.test(t.className)){let t="";t=n.hasClass("facebookpromo")?"facebookpromo":n.hasClass("twitterpromo")?"twitterpromo":"visitpromo",s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(`/giveaways/ajax/${t}/`+e[0]),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.addClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}else n.hasClass("emailoptinpromo")?s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath("/newsletter/ajax/subscribeprofile/optin/"+e[1]),timeout:6e4,dataType:"json",data:{ajax:"t",emailsystoggle:4},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):n.hasClass("watchingpromo")?s.push(new Promise(i=>{var t;const e=(t=>{try{const i={};return t?t.includes("?")&&t.split("?")[1].replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)):window.location.search.replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)),i}catch(t){return O(t,"getUrlQuery"),{}}})(n.attr("href"));e.ajax="t",$.ajax({type:"POST",url:urlPath(null===(t=n.attr("href"))||void 0===t?void 0:t.split(/[?#]/)[0]),timeout:6e4,dataType:"json",data:e,error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):/the-challenge-of-adblock/gim.test(n.attr("href"))?a.error("Error:"+E("unKnownTaskType")):s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(n.attr("href")),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}}return await Promise.all(s),C({}).success(E("allTasksComplete")),!0}}catch(t){return O(t,"Indiedb.classifyTask"),!1}}function cn(){try{return A.other.checkLogin?(0<$("a.buttonenter:contains(Register to join)").length&&window.open("/members/login","_self"),!0):!0}catch(t){return O(t,"Indiedb.checkLogin"),!1}}async function un(){try{return A.other.checkLeftKey?(0<$('a.buttonenter:contains("next time")').length&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayEnded"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Indiedb.checkLeftKey"),!1}}var dn=class{constructor(){Qi(this,on),Qi(this,an),Qi(this,nn),Qi(this,sn),tn(this,"name","Indiedb"),tn(this,"buttons",["doTask"])}static test(){return"www.indiedb.com"===window.location.host}async after(){try{en(this,an,cn).call(this)||C({}).warning(E("checkLoginFailed")),await en(this,on,un).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"Indiedb.after")}}async doTask(){try{return await en(this,sn,rn).call(this)?await en(this,nn,ln).call(this):!1}catch(t){return O(t,"Indiedb.doTask"),!1}}};function hn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function pn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function fn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const wn={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[]},discord:{serverLinks:[]},links:[]};var gn=new WeakSet,mn=new WeakSet,vn=new WeakSet;function kn(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){return O(t,"Keyhub.getGiveawayId"),!1}}async function yn(){try{return A.other.checkLeftKey?("0"===$("#keysleft").text().trim()&&await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Keyhub.checkLeftKey"),!1}}function bn(){try{return A.other.checkLogin?(0<$('a[href*="/connect/steam"]').length&&window.open("/connect/steam","_self"),!0):!0}catch(t){return O(t,"Keyhub.checkLogin"),!1}}var Tn=class extends Ei{constructor(){super(...arguments),hn(this,vn),hn(this,mn),hn(this,gn),pn(this,"name","Keyhub"),pn(this,"socialTasks",{...wn}),pn(this,"undoneTasks",{...wn}),pn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"key-hub.eu"===window.location.host}async after(){try{fn(this,vn,bn).call(this)||C({}).warning(E("checkLoginFailed")),await fn(this,mn,yn).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"Keyhub.after")}}init(){try{const t=C({text:E("initing")});return 0<$('a[href*="/connect/steam"]').length?(window.open("/connect/steam","_self"),t.warning(E("needLogin")),!1):!!fn(this,gn,kn).call(this)&&($("#VPNoverlay").hide(),$("#mainArticleSection").show(),this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Keyhub.init"),!1}}async classifyTask(e){try{const i=C({text:E("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("khTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||{...wn});for(const n of $(".task a")){let t=$(n).attr("href");var s=$(n).text().trim();t&&((/\/away\?data=/.test(t)||/steamcommunity\.com\/gid\//.test(t))&&(t=await u(t)||t),/https?:\/\/key-hub\.eu\/connect\/discord/.test(t)?window.open(t,"_blank"):/steamcommunity\.com\/groups\//.test(t)?("undo"===e&&this.socialTasks.steam.groupLinks.push(t),"do"===e&&this.undoneTasks.steam.groupLinks.push(t)):/store\.steampowered\.com\/app\//.test(t)&&/wishlist/gim.test(s)?("undo"===e&&this.socialTasks.steam.wishlistLinks.push(t),"do"===e&&this.undoneTasks.steam.wishlistLinks.push(t)):/store\.steampowered\.com\/curator\//.test(t)?("undo"===e&&this.socialTasks.steam.curatorLinks.push(t),"do"===e&&this.undoneTasks.steam.curatorLinks.push(t)):/^https?:\/\/discord\.com\/invite\//.test(t)?("undo"===e&&this.socialTasks.discord.serverLinks.push(t),"do"===e&&this.undoneTasks.discord.serverLinks.push(t)):C({}).warning(`${E("unKnownTaskType")}: ${s}(${t})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("khTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Keyhub.classifyTask"),!1}}verifyTask(){try{C({html:`
  • ${E("verifyingTask")}...
  • `}),$.get(window.location.href,t=>{VerifyTasks(t.match(/onclick="javascript:VerifyTasks\('(.*?)'\)"/)[1])})}catch(t){O(t,"keyhub.verifyTask")}}};function $n(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function xn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Sn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Ln={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[]},vk:{nameLinks:[]},discord:{serverLinks:[]}};var In=new WeakSet,_n=new WeakSet,Gn=new WeakSet;async function Cn(t){try{const s=C({html:`
  • ${E("verifyingTask")}${t}...
  • `});return await new Promise(e=>{$.ajax({url:"https://givekey.ru/giveaway/task",method:"POST",data:`id=${t}&user_id=`+this.userId,dataType:"json",headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},success:t=>{t.btn&&$(`button[data-id=${this.userId}]`).html(t.btn),"ok"===t.status?($(".task_check_"+t.id).html(``),s.success(),e(!0)):"end"===t.status?(s.success(),C({}).success(t.key),e(!0)):(s.error("Error:"+t.msg),e(!1))},error:t=>{s.error(`Error:${t.statusText}(${t.status})`),e(!1)}})})}catch(t){return O(t,"Givekey.verify"),!1}}function An(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"Givekey.getGiveawayId"),!1}}async function En(){try{return A.other.checkLeftKey?($("#keys_count").text()||await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Givekey.checkLeftKey"),!1}}var On=class extends Ei{constructor(){super(...arguments),$n(this,Gn),$n(this,_n),$n(this,In),xn(this,"name","Givekey"),xn(this,"tasks",[]),xn(this,"socialTasks",{...Ln}),xn(this,"undoneTasks",{...Ln}),xn(this,"userId",void 0),xn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"givekey.ru"===window.location.host}async after(){try{await new Promise(t=>{const e=setInterval(()=>{0<$("#navbarDropdown").length&&(clearInterval(e),t(!0))})}),await Sn(this,Gn,En).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){return O(t,"Givekey.after"),!1}}init(){try{const e=C({text:E("initing")});if(0<$('a[href*="/auth/steam"]').length)return window.open("/auth/steam","_self"),e.warning(E("needLogin")),!1;if(!Sn(this,_n,An).call(this))return!1;var t=$('meta[name="user-id"]').attr("content");return t?(this.userId=t,this.initialized=!0,e.success(),!0):(e.error(E("getFailed",E("userId"))),!1)}catch(t){return O(t,"Givekey.init"),!1}}async classifyTask(e){try{const a=C({text:E("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("gkTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||Ln);for(const o of $('.card-body:has("button") .row')){const r=$(o);var s=/Complete/i.test(r.find("button").text().trim());if(!s||"undo"===e){const l=r.find("#task_check");var i=l.attr("data-id");if(i&&this.tasks.push(i),"verify"!==e){let t=r.find("a").attr("href")||null;var n=r.find("a").text().trim();const c=r.find("i");t&&n&&(/^https?:\/\/givekey\.ru\/giveaway\/[\d]+\/execution_task/.test(t)&&(t=await u(t)),t&&(/^https?:\/\/vk\.com\//.test(t)?(this.socialTasks.vk.nameLinks.push(t),"do"!==e||s||this.undoneTasks.vk.nameLinks.push(t)):/^https?:\/\/steamcommunity\.com\/groups/.test(t)?(this.socialTasks.steam.groupLinks.push(t),"do"!==e||s||this.undoneTasks.steam.groupLinks.push(t)):/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?(this.socialTasks.steam.wishlistLinks.push(t),"do"!==e||s||this.undoneTasks.steam.wishlistLinks.push(t)):/Subscribe/gi.test(n)&&c.hasClass("fa-steam-square")?/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?(this.socialTasks.steam.curatorLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLinks.push(t)):(this.socialTasks.steam.curatorLikeLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLikeLinks.push(t)):/^https?:\/\/twitter\.com\//.test(t)&&/Subscribe/gi.test(n)?(this.socialTasks.twitter.userLinks.push(t),"do"!==e||s||this.undoneTasks.twitter.userLinks.push(t)):c.hasClass("fa-discord")?(this.socialTasks.discord.serverLinks.push(t),"do"!==e||s||this.undoneTasks.discord.serverLinks.push(t)):C({}).warning(`${E("unKnownTaskType")}: ${n}(${t})`)))}}}return a.success(),this.tasks=I(this.tasks),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("gkTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Givekey.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;C({}).warning(E("giveKeyNoticeBefore"));var e=this.tasks.length;for(let t=0;t${E("giveKeyNoticeAfter")}`}),!0}catch(t){return O(t,"Givekey.verifyTask"),!1}}};function jn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Wn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Pn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Vn=new WeakSet,Dn=new WeakSet,Mn=new WeakSet;function Fn(){try{return A.other.checkLogin?(0<$('a[href*="/account/auth"]').length&&window.open($('a[href*="/account/auth"]').attr("href"),"_self"),!0):!0}catch(t){return O(t,"GiveeClub.checkLogin"),!1}}function Un(){var t=null===(t=window.location.href.match(/\/event\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}async function Nn(){try{return A.other.checkLeftKey?(0<$(".event-ended").length&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayEnded"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Giveawaysu.checkLeftKey"),!1}}var zn=class extends qi{constructor(){super(...arguments),jn(this,Mn),jn(this,Dn),jn(this,Vn),Wn(this,"name","GiveeClub"),Wn(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/givee\.club\/.*?\/event\/[\d]+/.test(window.location.href)}async after(){try{Pn(this,Vn,Fn).call(this)||C({}).warning(E("checkLoginFailed")),await Pn(this,Mn,Nn).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"GiveeClub.after")}}init(){try{const t=C({text:E("initing")});return Pn(this,Vn,Fn).call(this)?!!Pn(this,Dn,Un).call(this)&&(this.initialized=!0,t.success(),!0):(t.warning(E("needLogin")),!1)}catch(t){return O(t,"GiveeClub.init"),!1}}async classifyTask(t){try{const s=C({text:E("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gcTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||Bi,!0;const i=[];for(const n of $(".event-actions tr"))i.push(new Promise(e=>{const t=$(n).find(".event-action-label a"),s=$(n).find(".event-action-icon i").attr("class")||"",i=t.text().trim();if(s.includes("ban")||/AdBlock/i.test(i)||s.includes("envelope"))return e(!0);u(t.attr("href")).then(t=>t?(/^https?:\/\/steamcommunity\.com\/groups/.test(t)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(i)?this.undoneTasks.steam.announcementLinks.push(t):s.includes("plus")&&/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?this.undoneTasks.steam.wishlistLinks.push(t):/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):s.includes("steam")&&/follow|subscribe/gim.test(i)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(i)?this.undoneTasks.steam.forumLinks.push(t):s.includes("discord")?this.undoneTasks.discord.serverLinks.push(t):s.includes("instagram")?this.undoneTasks.instagram.userLinks.push(t):s.includes("twitch")?this.undoneTasks.twitch.channelLinks.push(t):s.includes("reddit")?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(i)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(i)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(i)||(s.includes("youtube")||s.includes("thumbs-up"))&&/(watch|like).*video/gim.test(i)?this.undoneTasks.youtube.likeLinks.push(t):s.includes("vk")||/join.*vk.*group/gim.test(i)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(i)||/follow.*button/gim.test(i)&&this.undoneTasks.steam.followLinks.push(t),void e(!0)):e(!1)).catch(t=>(O(t,"GiveeClub.classifyTask->getRedirectLink"),!1))}));return await Promise.all(i),s.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gcTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"GiveeClub.classifyTask"),!1}}};function Kn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Bn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Yn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Rn={maxPoint:"99999999"};var Hn=new WeakSet,qn=new WeakSet;async function Jn(t){try{for(const u of $(`.giveaways-page-item:contains('${t}'):not(:contains('ENTERED'))`)){var e,s,i,n,a,o,r,l=parseInt((null===(e=$(u).find(".giveaways-page-item-header-points").text().match(/[\d]+/gim))||void 0===e?void 0:e[0])||"999999",10),c=$(u).find(".giveaways-page-item-footer-name").text().trim();if("points"===t&&l>this.myPoints)C({}).warning(E("noPoints")+": "+c);else if("points"!==t||l){if(!("points"===t&&l>this.maxPoints)){const d=C({text:`${E("joiningLottery")}${c}...`}),h=$(u).find("a.giveaways-page-item-img-btn-enter:contains('enter')");if(null===h||void 0===h||null===(s=h.attr("onclick"))||void 0===s||!s.includes("checkUser")||(a=null===(i=h.attr("onclick"))||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0])&&checkUser(a),h.attr("href")){const{result:p,statusText:f,status:w,data:g}=await L({url:h.attr("href"),method:"GET"});"Success"===p?null!==g&&void 0!==g&&g.responseText&&/You've entered this giveaway/gim.test(g.responseText)?(d.success(),r=null===(o=g.responseText.match(/Points:[\s]*?([\d]+)/))||void 0===o?void 0:o[1],"points"===t&&r&&(this.myPoints=parseInt(r,10))):d.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`):d.error(p+`:${f}(${w})`)}else d.error('Error: No "href".')}}else C({}).warning(E("getNeedPointsFailed")+": "+c)}C({text:"-----END-----"})}catch(t){O(t,"OpiumPulses.toggleTask")}}function Xn(){try{return A.other.checkLogin?(1<$('a[href*="/site/login"]').length&&window.open("/site/login","_self"),!0):!0}catch(t){return O(t,"OpiumPulses.checkLogin"),!1}}var Zn=class{constructor(){Kn(this,qn),Kn(this,Hn),Bn(this,"name","OpiumPulses"),Bn(this,"options",{...Rn,...GM_getValue("OpiumPulsesOptions")}),Bn(this,"maxPoints",99999999),Bn(this,"myPoints",0),Bn(this,"buttons",["doFreeTask","doPointTask"])}static test(){return"www.opiumpulses.com"===window.location.host}async after(){try{Yn(this,qn,Xn).call(this)||C({}).warning(E("checkLoginFailed")),this.maxPoints=parseInt(this.options.maxPoint,10)}catch(t){O(t,"OpiumPulses.after")}}async doFreeTask(){try{Yn(this,Hn,Jn).call(this,"FREE")}catch(t){O(t,"OpiumPulses.doFreeTask")}}async doPointTask(){try{var t;this.myPoints=parseInt((null===(t=$(".page-header__nav-func-user-nav-items.points-items").text().match(/[\d]+/gim))||void 0===t?void 0:t[0])||"0",10),Yn(this,Hn,Jn).call(this,"points")}catch(t){O(t,"OpiumPulses.doPointTask")}}init(){return!0}classifyTask(){return!0}};function Qn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ta(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ea(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const sa={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},twitter:{userLinks:[],retweetLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var ia=new WeakSet;function na(t,e,s,i){try{$(t).after('${s.replace("Links","")}`)}catch(t){O(t,"keylol.addBtn")}}var aa=class extends Ei{constructor(){super(...arguments),Qn(this,ia),ta(this,"name","Keylol"),ta(this,"socialTasks",{...sa}),ta(this,"undoneTasks",{...sa}),ta(this,"buttons",["doTask","undoTask","selectAll","selectNone","invertSelect"])}static test(){var t;return"keylol.com"===window.location.host&&!(null===(t=$(".subforum_left_title_left_up a").eq(3).attr("href"))||void 0===t||!t.includes("319"))}init(){return!0}after(){try{var t="Keylol"===this.name?'#postlist>div[id^="post_"]:first':"div.container";const k=$(t);var e=k.find('a[href*="discord.com"]'),s=k.find('a[href*="reddit.com"]'),i=k.find('a[href*="instagram.com"]'),n=k.find('a[href*="twitter.com"]'),a=k.find('a[href*="twitch.tv"]'),o=k.find('a[href*="vk.com"]'),r=k.find('a[href*="store.steampowered.com"]'),l=k.find('a[href*="steamcommunity.com"]'),c=k.find('a[href*="youtube.com"]');if(0{e.getAttribute("selected")?e.removeAttribute("selected"):e.setAttribute("selected","selected")})}catch(t){O(t,"Keylol.invertSelect")}}};function oa(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ra(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function la(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const ca={steam:{groupLinks:[],wishlistLinks:[],followLinks:[],curatorLikeLinks:[]}};var ua=new WeakSet,da=new WeakSet;function ha(){try{var t,e=null===(t=window.location.href.match(/quests\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){return O(t,"Opquests.getGiveawayId"),!1}}function pa(){try{return A.other.checkLogin?(0<$('a[href*="/auth/redirect"]').length&&window.open("/auth/redirect","_self"),!0):!0}catch(t){return O(t,"Opquests.checkLogin"),!1}}t=class extends Ei{constructor(){super(...arguments),oa(this,da),oa(this,ua),ra(this,"name","Opquests"),ra(this,"undoneTasks",{...ca}),ra(this,"buttons",["doTask"])}static test(){return"opquests.com"===window.location.host}async after(){try{la(this,da,pa).call(this)||C({}).warning(E("checkLoginFailed"))}catch(t){O(t,"Opquests.after")}}init(){try{const t=C({text:E("initing")});return 0<$('a[href*="/auth/redirect"]').length?(window.open("/auth/redirect","_self"),t.warning(E("needLogin")),!1):!!la(this,ua,ha).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Opquests.init"),!1}}async classifyTask(t){try{if("undo"===t)return C({text:E("cannotUndo")}),!1;const i=C({text:E("getTasksInfo")});for(const n of $('.w-full:contains("Validate") .items-center')){var e=$(n).find('a:contains("Open")').attr("href"),s=$(n).find("div").eq(1).text().trim();e&&(/steamcommunity\.com\/groups\//.test(e)?this.undoneTasks.steam.groupLinks.push(e):/store\.steampowered\.com\/app\//.test(e)?/wishlist/gim.test(s)?this.undoneTasks.steam.wishlistLinks.push(e):/follow/gim.test(s)&&this.undoneTasks.steam.followLinks.push(e):/store\.steampowered\.com\/(publisher|developer)\//.test(e)&&/follow/gim.test(s)?this.undoneTasks.steam.curatorLikeLinks.push(e):C({}).warning(E("unKnownTaskType")+`: ${s}(${e})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),!0}catch(t){return O(t,"Opquests.classifyTask"),!1}}};function fa(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function wa(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ga(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const ma={steam:{groupLinks:[],wishlistLinks:[],followLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[],retweetLinks:[]},twitch:{channelLinks:[]},discord:{serverLinks:[]},youtube:{channelLinks:[]},extra:{gleam:[]}},va={vlootUsername:"",gameroundUsername:""};var ka=new WeakSet,ya=new WeakSet,ba=new WeakSet,Ta=new WeakSet,$a=new WeakSet;async function xa(){try{return await new Promise(t=>{const e=setInterval(()=>{0===$(".entry-content .entry-method i.fa-sync").length&&(clearInterval(e),t(!0))},500)})}catch(t){return O(t,"Gleam.checkSync"),!1}}async function Sa(e){try{const s=C({text:E("doingGleamTask")});return await new Promise(t=>{GM_openInTab(e+"?8b07d23f4bfa65f9",{active:!0,insert:!0,setParent:!0}).onclose=()=>{s.success(),t(!0)}})}catch(t){return O(t,"Gleam.doGleamTask"),!1}}function La(){try{var t=window.location.pathname;return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"Gleam.getGiveawayId"),!1}}async function Ia(t){try{const i=C({text:E("gettingGleamLink")}),{result:n,statusText:a,status:o,data:r}=await L({url:t,method:"GET"});if("Success"!==n)return i.error(n+`:${a}(${o})`),!1;if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),!1;var e,s=null===(e=r.responseText.match(/href="(https:\/\/gleam\.io\/.*?\/.+?)"/))||void 0===e?void 0:e[1];return s?(i.success(),s):(i.error("Error:"+E("getLinkFailed")),!1)}catch(t){return O(t,"Gleam.getGleamLink"),!1}}async function _a(){try{var e,s,i,n;if(!A.other.checkLeftKey)return!0;var a=null===(e=$("div.popup-blocks-container").attr("ng-init"))||void 0===e||null===(s=e.match(/initCampaign\(([\w\W]+?)\)$/))||void 0===s?void 0:s[1];if(!a)return!1;var o,r,l,c,{campaign:u,incentive:d}=JSON.parse(a),h=null===(i=$("div.campaign.reward").attr("ng-init"))||void 0===i||null===(n=i.match(/initContestant\(([\w\W]+?)\);/))||void 0===n?void 0:n[1];let t=!1;return h&&null!==(o=JSON.parse(h).contestant)&&void 0!==o&&null!==(r=o.claims)&&void 0!==r&&null!==(l=r.incentives)&&void 0!==l&&null!==(c=l[d.id])&&void 0!==c&&c.length&&(t=!0),(u.banned||u.finished&&!t||u.paused||(new Date).getTime()<1e3*u.starts_at)&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayNotWork"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0}catch(t){return O(t,"Gleam.checkLeftKey"),!1}}e=class extends Ei{constructor(){super(...arguments),fa(this,$a),fa(this,Ta),fa(this,ba),fa(this,ya),fa(this,ka),wa(this,"name","Gleam"),wa(this,"undoneTasks",{...ma}),wa(this,"socialTasks",{...ma}),wa(this,"options",{...va,...GM_getValue("GleamOptions")}),wa(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"gleam.io"===window.location.host}async after(){try{if(window.location.search.includes("8b07d23f4bfa65f9")){const s=setInterval(()=>{0<$(".entry-content .entry-method i.fa-check").length&&(clearInterval(s),window.close())});for(const i of $(".entry-content .entry-method")){const n=$(i).find(".user-links"),a=$(i).find(".expandable");var t=a.find("a.btn,a:contains(Continue),button:contains(Continue)");if(0!0)}catch(t){return O(t,"Gleam.extraDoTask"),!1}}async verifyTask(){try{C({text:E("verifyingTask")+"..."});for(const t of $(".entry-content .entry-method")){const e=$(t);if(0!==e.find("i.fa-question").length){const s=e.find(".user-links");s[0].click(),await G(500),await ga(this,ka,xa).call(this);for(const i of e.find(".expandable").find("span:contains(Continue),button:contains(Continue)"))i.click(),await G(500),await ga(this,ka,xa).call(this)}}C({text:E("verifiedGleamTasks")})}catch(t){return O(t,"Gleam.verifyTask"),!1}}};function Ga(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Ca(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Aa(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Ea={username:"",email:""};var Oa=new WeakSet,ja=new WeakSet,Wa=new WeakSet,Pa=new WeakSet;function Va(){try{return 0<$("#twitter_login_button").length&&$("#twitter_login_button")[0].click(),!0}catch(t){return O(t,"SweepWidget.checkLogin"),!1}}function Da(){try{var t,e=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"SweepWidget.getGiveawayId"),!1}}async function Ma(){try{return new Promise(t=>{const e=setInterval(()=>{0<$("#unlock_rewards_main_wrapper").length&&(clearInterval(e),t(!0))})})}catch(t){return O(t,"SweepWidget.checkEnter"),!1}}async function Fa(s){try{return new Promise(t=>{const e=setInterval(()=>{(0div.sw_entry")){const a=$(n);if(!(0 `;for(const[i,n]of Object.entries(r))t+=Object.keys(n).map((t,e)=>{var s;return null!==(s=za[i])&&void 0!==s&&s.includes(t)?"":`${0===e?``:""}`}).join("");t+="
    ${E("website")}${E("type")}${E("edit")}
    ${i}${E(t)}
    ","swal"===o?p().fire({title:E("whiteListOptions"),html:t,showConfirmButton:!1,showCloseButton:!0}):$("body").append(`

    ${E("whiteList")}

    `+t),$(".editWhiteList").on("click",function(){var t;const e=$(this).attr("data-value");if(e){const[n,a]=e.split(".");null!==r&&void 0!==r&&null!==(t=r[n])&&void 0!==t&&t[a]?(p().fire({title:E("changeWhiteListOption",e),input:"textarea",html:`

    在下方填写白名单,每行一个

    `,inputValue:r[n][a].join("\n"),showConfirmButton:!0,confirmButtonText:E("save"),showCancelButton:!0,cancelButtonText:E("close"),showDenyButton:!0,denyButtonText:E("return")}).then(t=>{let{isDenied:e,isConfirmed:s,value:i}=t;e?"swal"===o&&Ua(o):s&&(r[n][a]=i.split("\n"),GM_setValue("whiteList",r),p().fire({title:E("changeWhiteListSuccess"),icon:"success"}))}),$("#link2id").on("click",async function(){var t=$(this).attr("data-type");$("#socialLink").val(await async function(e){var s,i,n,a,o,r,l,c,u,d,h,p,f,w,g,m;try{const y=$("#socialLink").val();let t="";switch(e){case"discord.servers":t=(null===(s=y.match(/invite\/(.+)/))||void 0===s?void 0:s[1])||"";break;case"instagram.users":t=(null===(i=y.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===i?void 0:i[1])||"";break;case"twitch.channels":t=(null===(n=y.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===n?void 0:n[2])||"";break;case"twitter.users":t=(null===(a=y.match(/https:\/\/twitter\.com\/(.+)/))||void 0===a?void 0:a[1])||"";break;case"twitter.retweets":t=(null===(o=y.match(/https:\/\/twitter\.com\/.*?\/status\/([\d]+)/))||void 0===o?void 0:o[1])||"";break;case"vk.names":t=(null===(r=y.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===r?void 0:r[1])||"";break;case"youtube.channels":t=(null===(l=await us(y,"channel"))||void 0===l||null===(c=l.params)||void 0===c?void 0:c.channelId)||"";break;case"youtube.likes":t=(null===(u=await us(y,"likeVideo"))||void 0===u||null===(d=u.params)||void 0===d?void 0:d.videoId)||"";break;case"reddit.reddits":t=(null===(h=y.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===h?void 0:h[1])||(null===(p=y.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===p?void 0:p[1])||"";break;case"steam.groups":t=(null===(f=y.match(/groups\/(.+)\/?/))||void 0===f?void 0:f[1])||"";break;case"steam.wishlists":case"steam.follows":case"steam.forums":t=(null===(w=y.match(/app\/([\d]+)/))||void 0===w?void 0:w[1])||"";break;case"steam.workshops":t=(null===(g=y.match(/\?id=([\d]+)/))||void 0===g?void 0:g[1])||"";break;case"steam.curators":if(y.includes("curator"))t=(null===(m=y.match(/curator\/([\d]+)/))||void 0===m?void 0:m[1])||"";else{var v,k=null===(v=y.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===v?void 0:v.slice(1,3);if(!k||2!==k.length)break;const b=new Li;await b.init()&&(t=await b.getCuratorId(k[0],k[1])||"")}}return t}catch(t){return O(t,"link2id"),E("getFailed","id")}}(t))})):C({}).warning(E("whiteListNotFound",e))}})}catch(t){O(t,"whiteListOptions")}}const Na={discord:{servers:[]},instagram:{users:[]},twitch:{channels:[]},twitter:{users:[],retweets:[],likes:[]},vk:{names:[]},youtube:{channels:[],likes:[]},reddit:{reddits:[]},steam:{groups:[],wishlists:[],follows:[],forums:[],workshops:[],curators:[],workshopVotes:[],curatorLikes:[],announcements:[]}},za={steam:["workshopVotes","curatorLikes","announcements"],twitter:["likes"]},Ka=Ua,Ba=async(t,e,s)=>{try{const u=C({text:E("gettingData")});var i,n,a,{result:o,statusText:r,status:l,data:c}=await L({url:"https://api.github.com/gists/"+e,headers:{Accept:"application/vnd.github.v3+json",Authorization:"token "+t},responseType:"json",method:"GET",timeout:3e4});return"Success"===o?200===(null==c?void 0:c.status)?(u.success(),JSON.parse((null===(i=c.response)||void 0===i||null===(n=i.files)||void 0===n||null===(a=n[s])||void 0===a?void 0:a.content)||null)):(u.error(`Error:${null==c?void 0:c.statusText}(${null==c?void 0:c.status})`),!1):(u.error(o+`:${r}(${l})`),!1)}catch(t){return O(t,"getGistData"),!1}},Ya=()=>{try{var{TOKEN:t,GIST_ID:e,FILE_NAME:s,SYNC_HISTORY:i}=GM_getValue("gistOptions")||{TOKEN:"",GIST_ID:"",FILE_NAME:"",SYNC_HISTORY:!0};p().fire({title:E("gistOptions"),html:`

    Github Token

    `+`

    Gist ID

    `+`

    ${E("fileName")}

    `+'

    `+`

    `),$("#getTwitterUserId").on("click",()=>{Ja(this,Xa,Qa).call(this,"twitterUser")}),$('input[name="other.youtubeVerifyChannel"]').after(``),$("#getYoutubeChannelId").on("click",()=>{Ja(this,Xa,Qa).call(this,"youtubeChannel")}),$('input[name^="position"]').on("input",function(){var t="rightleft",e="topbottpm";switch($(this).attr("name").replace("position.","")){case"buttonSideX":case"buttonSideY":case"buttonDistance":{const l=$('input[name="position.buttonDistance"]').val();var s=$('input[name="position.buttonSideX"]').val(),i=$('input[name="position.buttonSideY"]').val();if(!["right","left"].includes(s))break;if(!["top","bottom"].includes(i))break;if(!/^[\d]+?,[\d]+$/.test(l))break;var n=l.split(",");$("#auto-task-buttons").css(s,n[0]+"px").css(i,n[1]+"px").css(t.replace(s,""),"").css(e.replace(i,""),"");break}case"showButtonSideX":case"showButtonSideY":case"showButtonDistance":{const c=$('input[name="position.showButtonDistance"]').val();var a=$('input[name="position.showButtonSideX"]').val(),o=$('input[name="position.showButtonSideY"]').val();if(!["right","left"].includes(a))break;if(!["top","bottom"].includes(o))break;if(!/^[\d]+?,[\d]+$/.test(c))break;var r=c.split(",");$("div.show-button-div").css(a,r[0]+"px").css(o,r[1]+"px").css(t.replace(a,""),"").css(e.replace(o,""),"");break}case"logSideX":case"logSideY":case"logDistance":{const u=$('input[name="position.logDistance"]').val();r=$('input[name="position.logSideX"]').val(),a=$('input[name="position.logSideY"]').val();if(!["right","left"].includes(r))break;if(!["top","bottom"].includes(a))break;if(!/^[\d]+?,[\d]+$/.test(u))break;o=u.split(",");$("#auto-task-info").css(r,o[0]+"px").css(a,o[1]+"px").css(t.replace(r,""),"").css(e.replace(a,""),"");break}}}),$('input[name^="hotKey"]').attr("readonly","readonly").off("keydown").on("keydown",function(t){let e="";t.altKey?e+="alt + ":t.ctrlKey?e+="ctrl + ":t.shiftKey&&(e+="shift + "),$(this).val(e+(1===t.key.length?t.key.toLowerCase():""))})}catch(t){O(t,"Setting.after")}}saveGlobalOptions(){c()}},eo=po(698);function so(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function io(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var no=new WeakSet;function ao(i){try{var n=GM_getValue(i);if(null==n||!n.tasks)return;let t="",e="",s="";var a,o,[r,l]=i.split("-");switch(r){case"fawTasks":e=`Freeanywhere[${l}]`,s="https://freeanywhere.net/#/giveaway/"+l;break;case"gasTasks":e=`Giveawaysu[${l}]`,s="https://giveaway.su/giveaway/view/"+l;break;case"gcTasks":e=`GiveeClub[${l}]`,s="https://givee.club/event/"+l;break;case"gkTasks":e=`Givekey[${l}]`,s="https://givekey.ru/giveaway/"+l;break;case"gleamTasks":e=`Gleam[${l}]`,s="https://gleam.io"+l;break;case"khTasks":e=`keyhub[${l}]`,s="https://key-hub.eu/giveaway/"+l;break;case"prysTasks":e=`Prys[${l}]`,s="https://prys.revadike.com/giveaway/?id="+l;break;default:return}for([a,o]of Object.entries(n.tasks))for(var[c,u]of Object.entries(o))for(const d of u)t+=`

  • ${a}.${E(c.replace("Link",""))}: ${55
  • `;$(".container").append(`
      ${t}
    ${E("lastChangeTime")}: ${eo(n.time).format("YYYY-MM-DD HH:mm:ss")}
    `),$("span.delete-task").on("click",function(){var t=$(this).attr("data-name");t?(GM_deleteValue(t),p().fire({title:E("clearTaskFinished"),text:t,icon:"success"})):p().fire({title:E("clearTaskFailed"),icon:"error"})})}catch(t){O(t,"History.addItem")}}const oo=[Ui,qi,dn,Tn,On,zn,Zn,aa,t,e,s,Ei,class extends aa{constructor(){super(...arguments),so(this,no),io(this,"name","History"),io(this,"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 t=GM_listValues()||[];for(const e of t.map(t=>/^[\w]+?Tasks-/.test(t)?t:null).filter(t=>t))!function(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}(this,no,ao).call(this,e)}catch(t){O(t,"History.before")}}clearHistory(){try{const t=GM_listValues()||[];for(const e of t.map(t=>/^[\w]+?Tasks-/.test(t)?t:null).filter(t=>t))GM_deleteValue(e);p().fire({title:E("clearHistoryFinished"),icon:"success"})}catch(t){O(t,"History.after")}}}];const ro=function(e,s){let t=`
    +
    `;$("body").append(`

    ${E("environment")}

    `+e)}catch(t){O(t,"Setting.environment")}}var Ei=class{constructor(){Ha(this,Za),Ha(this,Xa),qa(this,"name","Setting"),qa(this,"buttons",["saveGlobalOptions","syncData","tasksHistory"]),qa(this,"syncData",Ra)}tasksHistory(){window.open("https://auto-task-v4.hclonely.com/history.html","_blank")}static test(){return"auto-task-v4.hclonely.com"===window.location.host&&"/setting.html"===window.location.pathname}before(){$("body").html("").addClass("auto-task-options")}after(){try{Ja(this,Za,to).call(this),w("page"),Ka("page"),$('input[name="other.twitterVerifyId"]').after(``),$("#getTwitterUserId").on("click",()=>{Ja(this,Xa,Qa).call(this,"twitterUser")}),$('input[name="other.youtubeVerifyChannel"]').after(``),$("#getYoutubeChannelId").on("click",()=>{Ja(this,Xa,Qa).call(this,"youtubeChannel")}),$('input[name^="position"]').on("input",function(){var t="rightleft",e="topbottpm";switch($(this).attr("name").replace("position.","")){case"buttonSideX":case"buttonSideY":case"buttonDistance":{const l=$('input[name="position.buttonDistance"]').val();var s=$('input[name="position.buttonSideX"]').val(),i=$('input[name="position.buttonSideY"]').val();if(!["right","left"].includes(s))break;if(!["top","bottom"].includes(i))break;if(!/^[\d]+?,[\d]+$/.test(l))break;var n=l.split(",");$("#auto-task-buttons").css(s,n[0]+"px").css(i,n[1]+"px").css(t.replace(s,""),"").css(e.replace(i,""),"");break}case"showButtonSideX":case"showButtonSideY":case"showButtonDistance":{const c=$('input[name="position.showButtonDistance"]').val();var a=$('input[name="position.showButtonSideX"]').val(),o=$('input[name="position.showButtonSideY"]').val();if(!["right","left"].includes(a))break;if(!["top","bottom"].includes(o))break;if(!/^[\d]+?,[\d]+$/.test(c))break;var r=c.split(",");$("div.show-button-div").css(a,r[0]+"px").css(o,r[1]+"px").css(t.replace(a,""),"").css(e.replace(o,""),"");break}case"logSideX":case"logSideY":case"logDistance":{const u=$('input[name="position.logDistance"]').val();r=$('input[name="position.logSideX"]').val(),a=$('input[name="position.logSideY"]').val();if(!["right","left"].includes(r))break;if(!["top","bottom"].includes(a))break;if(!/^[\d]+?,[\d]+$/.test(u))break;o=u.split(",");$("#auto-task-info").css(r,o[0]+"px").css(a,o[1]+"px").css(t.replace(r,""),"").css(e.replace(a,""),"");break}}}),$('input[name^="hotKey"]').attr("readonly","readonly").off("keydown").on("keydown",function(t){let e="";t.altKey?e+="alt + ":t.ctrlKey?e+="ctrl + ":t.shiftKey&&(e+="shift + "),$(this).val(e+(1===t.key.length?t.key.toLowerCase():""))})}catch(t){O(t,"Setting.after")}}saveGlobalOptions(){c()}},eo=po(698);function so(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function io(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var no=new WeakSet;function ao(i){try{var n=GM_getValue(i);if(null==n||!n.tasks)return;let t="",e="",s="";var a,o,[r,l]=i.split("-");switch(r){case"fawTasks":e=`Freeanywhere[${l}]`,s="https://freeanywhere.net/#/giveaway/"+l;break;case"gasTasks":e=`Giveawaysu[${l}]`,s="https://giveaway.su/giveaway/view/"+l;break;case"gcTasks":e=`GiveeClub[${l}]`,s="https://givee.club/event/"+l;break;case"gkTasks":e=`Givekey[${l}]`,s="https://givekey.ru/giveaway/"+l;break;case"gleamTasks":e=`Gleam[${l}]`,s="https://gleam.io"+l;break;case"khTasks":e=`keyhub[${l}]`,s="https://key-hub.eu/giveaway/"+l;break;case"prysTasks":e=`Prys[${l}]`,s="https://prys.revadike.com/giveaway/?id="+l;break;default:return}for([a,o]of Object.entries(n.tasks))for(var[c,u]of Object.entries(o))for(const d of u)t+=`
  • ${a}.${E(c.replace("Link",""))}: ${55
  • `;$(".container").append(`
      ${t}
    ${E("lastChangeTime")}: ${eo(n.time).format("YYYY-MM-DD HH:mm:ss")}
    `),$("span.delete-task").on("click",function(){var t=$(this).attr("data-name");t?(GM_deleteValue(t),p().fire({title:E("clearTaskFinished"),text:t,icon:"success"})):p().fire({title:E("clearTaskFailed"),icon:"error"})})}catch(t){O(t,"History.addItem")}}const oo=[Ui,qi,dn,Tn,On,zn,Zn,aa,t,e,s,Ei,class extends aa{constructor(){super(...arguments),so(this,no),io(this,"name","History"),io(this,"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 t=GM_listValues()||[];for(const e of t.map(t=>/^[\w]+?Tasks-/.test(t)?t:null).filter(t=>t))!function(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}(this,no,ao).call(this,e)}catch(t){O(t,"History.before")}}clearHistory(){try{const t=GM_listValues()||[];for(const e of t.map(t=>/^[\w]+?Tasks-/.test(t)?t:null).filter(t=>t))GM_deleteValue(e);p().fire({title:E("clearHistoryFinished"),icon:"success"})}catch(t){O(t,"History.after")}}}];const ro=function(e,s){let t=`
    `;for(var[i,n]of Object.entries(s))t+=``;t+="
    ${E("option")}${E("value")}
    ${i}
    ",p().fire({title:E("websiteOptions"),html:t,showConfirmButton:!0,confirmButtonText:E("save"),showCancelButton:!0,cancelButtonText:E("close")}).then(t=>{t=t.isConfirmed;t&&($("#websiteOptionsForm").serializeArray().map(t=>(s[t.name]=t.value,t)),GM_setValue(e+"Options",s),p().fire({title:E("changeWebsiteOptionsSuccess"),icon:"success"}))})};var aa=keyboardJS,lo=po.n(aa);const co=async(t,e)=>{try{var s,i=t+"package.json?time="+(new Date).getTime(),{result:n,statusText:a,status:o,data:r}=await L({url:i,responseType:"json",method:"GET",timeout:3e4});return"Success"===n?null!=r&&null!==(s=r.response)&&void 0!==s&&s.version?r.response:(e||C({}).error(`${E("checkUpdateFailed")}[${null==r?void 0:r.statusText}(${null==r?void 0:r.status})]`),!1):(e||C({}).error(E("checkUpdateFailed")+`[${n}:${a}(${o})]`),!1)}catch(t){return O(t,"checkUpdate"),!1}};const uo=async()=>{try{var i,n=GM_info.script.version,a=A.other.autoUpdateSource.toLowerCase(),o={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 t,e="",s;["github","jsdelivr","standby"].includes(a)?(e=o[a],s=await co(e,!1)):(e=o.github,s=await co(e,!0),s||(e=o.jsdelivr,s=await co(e,!0),s||(e=o.standby,s=await co(e,!0)))),s?t=s.version||n:(t=n,C({}).error(E("checkUpdateFailed"))),s&&((t,e)=>{try{const[l]=t.split("-"),[c]=e.split("-");var[s,i,n]=l.split(".").map(t=>parseInt(t,10)),[a,o,r]=c.split(".").map(t=>parseInt(t,10));return s${E("newVersionNotice",t,`${e}dist/${GM_info.script.name}.user.js`)}`}),C({html:`
  • ${E("updateText",t)}
    1. ${null===(i=s.change)||void 0===i?void 0:i.map(t=>`
    2. ${t}
    3. `).join("")}
    `}))}catch(t){O(t,"updateChecker")}};"discord.com"===window.location.hostname&&(ho=null===(aa=window.localStorage)||void 0===aa||null===(ho=aa.getItem("token"))||void 0===ho?void 0:ho.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:ho}),ho&&"#auth"===window.location.hash&&(window.close(),p().fire("",E("closePageNotice"))));var ho=async()=>{var t,e,s,i;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(s=f.get("auth-token"),!!f.get("login")?(GM_setValue("twitchAuth",{authToken:s,clientId:null===(s=commonOptions)||void 0===s||null===(i=s.headers)||void 0===i?void 0:i["Client-ID"]}),window.close(),p().fire("",E("closePageNotice"))):p().fire("",E("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(i=f.get("ct0"),!!f.get("twid")&&i?(GM_setValue("twitterAuth",{ct0:i}),window.close(),p().fire("",E("closePageNotice"))):p().fire("",E("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((a=f.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:a}),window.close(),p().fire("",E("closePageNotice"))):p().fire("",E("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const o=$("#redesign-beta-optin-btn");if(0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var a=()=>{const t=$("#toggle-log");"show"===t.attr("data-status")?($("#auto-task-info").hide(),t.attr("data-status","hide").text(E("showLog"))):($("#auto-task-info").show(),t.attr("data-status","show").text(E("hideLog")))};if(lo().bind(A.hotKey.doTaskKey,()=>{n.doTask&&n.doTask()}),lo().bind(A.hotKey.undoTaskKey,()=>{n.undoTask&&n.doTask()}),lo().bind(A.hotKey.toggleLogKey,a),null!==(t=n)&&void 0!==t&&t.after&&await(null===(e=n)||void 0===e?void 0:e.after()),null!==(e=n)&&void 0!==e&&e.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(n.name+"-buttons");for(const u of n.buttons)if(n[u]){const d=$(`

    ${E(u)}

    `);d.find("a.auto-task-website-btn").on("click",()=>{n[u]()}),$("#auto-task-buttons").append(d)}}const l=$(`

    ${E("hideButton")}

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

    - ${A.other.defaultShowLog?E("hideLog"):E("showLog")}

    `);c.find("a.auto-task-website-btn").on("click",a),$("#auto-task-buttons").append(l).append(c),null!==(a=n)&&void 0!==a&&a.options&&GM_registerMenuCommand(E("changeWebsiteOptions"),()=>{ro(n.name,n.options)}),"Setting"!==n.name&&(GM_registerMenuCommand(E("whiteList"),()=>{Ka("swal")}),GM_registerMenuCommand(E("changeGlobalOptions"),()=>{w("swal")}),GM_registerMenuCommand(E("tasksHistory"),()=>{window.open("https://auto-task-v4.hclonely.com/history.html","_blank")}),GM_registerMenuCommand(E("syncData"),Ra),GM_registerMenuCommand(E("settingPage"),()=>{window.open("https://auto-task-v4.hclonely.com/setting.html","_blank")})),GM_addStyle(h.Z),console.log("%c%s","color:#1bbe1a","Auto Task脚本初始化完成!"),GM_getValue("notice")||(p().fire({title:E("swalNotice"),icon:"warning"}).then(()=>{window.open(E("noticeLink"),"_blank"),GM_setValue("notice",(new Date).getTime())}),null!==(a=C({html:`
  • ${E("echoNotice",E("noticeLink"))}
  • `}).font)&&void 0!==a&&a.find("a").on("click",()=>{GM_setValue("notice",(new Date).getTime())})),uo()}else console.log("%c%s","color:#ff0000","Auto Task脚本停止加载:当前网站不支持!")};"opquests.com"===window.location.hostname?ho():$(ho)}()}(); \ No newline at end of file + ${A.other.defaultShowLog?E("hideLog"):E("showLog")}

    `);c.find("a.auto-task-website-btn").on("click",a),$("#auto-task-buttons").append(l).append(c),null!==(a=n)&&void 0!==a&&a.options&&GM_registerMenuCommand(E("changeWebsiteOptions"),()=>{ro(n.name,n.options)}),"Setting"!==n.name&&(GM_registerMenuCommand(E("changeGlobalOptions"),()=>{w("swal")}),GM_registerMenuCommand(E("settingPage"),()=>{window.open("https://auto-task-v4.hclonely.com/setting.html","_blank")})),GM_addStyle(h.Z),console.log("%c%s","color:#1bbe1a","Auto Task脚本初始化完成!"),GM_getValue("notice")||(p().fire({title:E("swalNotice"),icon:"warning"}).then(()=>{window.open(E("noticeLink"),"_blank"),GM_setValue("notice",(new Date).getTime())}),null!==(a=C({html:`
  • ${E("echoNotice",E("noticeLink"))}
  • `}).font)&&void 0!==a&&a.find("a").on("click",()=>{GM_setValue("notice",(new Date).getTime())})),uo()}else console.log("%c%s","color:#ff0000","Auto Task脚本停止加载:当前网站不支持!")};"opquests.com"===window.location.hostname?ho():$(ho)}()}(); \ No newline at end of file diff --git a/dist/auto-task-v4.user.js b/dist/auto-task-v4.user.js index bbe55e8..bcc7a04 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.1.7-Beta +// @version 4.1.8-Beta // @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 @@ -1193,8 +1193,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); globalOptions: '全局设置', checkLogin: '登录检测
    需要登录的网站自动登录,部分本网站支持', checkLeftKey: '剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持', - twitterVerifyId: '通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214', - youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q', + twitterVerifyId: '通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号', + youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道', autoUpdateSource: '更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新', saveGlobalOptions: '保存全局设置', settingPage: '设置页面', @@ -1429,8 +1429,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); 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.', - youtubeVerifyChannel: 'Verify YouTube token by trying to subscribe to the channel.
    ' + 'The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.', + 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', @@ -1564,8 +1564,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); retweets: 'Retweet', followingTwitterUser: 'Following Twitter User', unfollowingTwitterUser: 'Unfollowing Twitter User', - retweetting: 'Retweeting', - unretweetting: 'Unretweeting', + retweetting: 'Retweetting', + unretweetting: 'Unretweetting', names: 'Group/Public/Wall', loginVk: 'Please log in to Vk', gettingVkId: 'Getting Vk task Id', @@ -4459,6 +4459,10 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ } return true; } + if (verify && data.responseText.includes('You may not subscribe to yourself')) { + logStatus.success(); + return true; + } logStatus.error(i18n('tryUpdateYtbAuth'), true); return false; } @@ -5540,7 +5544,7 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ if (!doTask && this.whiteList.forums.includes(gameId)) { scripts_echoLog({ type: 'whiteList', - text: 'Steam.unsubscribForum', + text: 'Steam.unsubscribeForum', id: gameId }); return true; @@ -8130,8 +8134,8 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ } after() { try { - const selecter = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container'; - const mainPost = $(selecter); + const selector = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container'; + const mainPost = $(selector); const discordLinks = mainPost.find('a[href*="discord.com"]'); const redditLinks = mainPost.find('a[href*="reddit.com"]'); const insLinks = mainPost.find('a[href*="instagram.com"]'); @@ -9597,7 +9601,7 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ Setting_classPrivateMethodInitSpec(this, Setting_getId); Setting_defineProperty(this, 'name', 'Setting'); Setting_defineProperty(this, 'buttons', [ 'saveGlobalOptions', 'syncData', 'tasksHistory' ]); - Setting_defineProperty(this, 'dataSync', dataSync); + Setting_defineProperty(this, 'syncData', dataSync); } tasksHistory() { window.open('https://auto-task-v4.hclonely.com/history.html', '_blank'); @@ -10181,16 +10185,9 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ }); } if (website.name !== 'Setting') { - GM_registerMenuCommand(i18n('whiteList'), () => { - whiteList('swal'); - }); GM_registerMenuCommand(i18n('changeGlobalOptions'), () => { changeGlobalOptions('swal'); }); - GM_registerMenuCommand(i18n('tasksHistory'), () => { - window.open('https://auto-task-v4.hclonely.com/history.html', '_blank'); - }); - GM_registerMenuCommand(i18n('syncData'), dataSync); GM_registerMenuCommand(i18n('settingPage'), () => { window.open('https://auto-task-v4.hclonely.com/setting.html', '_blank'); }); diff --git a/package.json b/package.json index ef33d6b..c35f7bc 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,10 @@ { "name": "auto-task-new", - "version": "4.1.7-Beta", + "version": "4.1.8-Beta", "change": [ - "Gleam任务识别优化,自动填写表单优化" + "油管、推特验证机制优化", + "白名单、任务历史、数据同步功能移动到设置页面", + "其他优化" ], "description": "赠Key站自动任务脚本", "main": "package.json", @@ -10,7 +12,7 @@ "test": "eslint", "tsc": "tsc", "gs": "webpack --config webpack.giveawaysu.config.js", - "pack": "webpack --config webpack.config.js", + "dev": "webpack --config webpack.config.js", "build": "webpack --config webpack.config.js && webpack --config webpack.compatibility.config.js && webpack --config webpack.giveawaysu.config.js && node copy.js" }, "author": "HCLonely ", diff --git a/page/dist/auto-task-v4-for-giveawaysu.user.js b/page/dist/auto-task-v4-for-giveawaysu.user.js index c1fdfe5..270b074 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.1.7-Beta +// @version 4.1.8-Beta // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -98,4 +98,4 @@ ${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")} `+s.stack)}async function i(s){var t=1{s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return _(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const I=i;function C(){let e=0{setTimeout(()=>{t(!0)},e)})}const V=t=>{let{type:e,text:s,html:i,id:n}=t;const o={success:()=>o,error:()=>o,warning:()=>o,info:()=>o,view:()=>o};try{var a;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":t=$(`
  • ${E(e)}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${E(e)} ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${E(e)} ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${E(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${E(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${E("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${E(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${E(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${E(e)} - ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(a=t[0])&&void 0!==a&&a.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return _(t,"unique"),[]}},l=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await I({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return _(t,"getRedirectLink"),null}};const r={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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},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}};t=GM_getValue("globalOptions")||{};const u=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=u(i,e[s]):n[s]=e[s]??i;return n}catch(t){return _(t,"assignObject"),r}},A=u(r,t);const c={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凭证...",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:"默认显示日志",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 版本更新内容:",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",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",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",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",twitterUser:"推特用户",retweets:"转推",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:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},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.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.",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",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:"Data synchronization",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:",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",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",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",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",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",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",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweeting",unretweetting:"Unretweeting",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!",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!',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..."}},d=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};t=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(p(this,k,{auth:t}),s.success(),e(await w(this,T,U).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}async function D(t){try{const l=V({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:f(this,k).auth}});if("Success"!==i||200!==(null==a?void 0:a.status))return l.error(i+`:${n}(${o})`),!1;l.success();var r=String(null===(e=a.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(w(this,W,N).call(this,t,r),this.tasks.servers=L([...this.tasks.servers,t])),!0}catch(t){return _(t,"Discord.joinServer"),!1}}async function j(t){try{if(this.whiteList.servers.includes(t))return V({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await w(this,P,F).call(this,t);if(!e)return!1;const a=V({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:o}=await I({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:f(this,k).auth}});return"Success"===s&&204===(null==o?void 0:o.status)?(a.success(),!0):(a.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Discord.leaveServer"),!1}}async function F(t){try{const n=V({type:"gettingDiscordGuild",text:t});var e=f(this,y)[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==o||200!==(null===l||void 0===l?void 0:l.status))return n.error(o+`:${a}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),w(this,W,N).call(this,t,i),i):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Discord.getGuild"),!1}}function N(t,e){try{f(this,y)[t]=e,GM_setValue("discordCache",f(this,y))}catch(t){_(t,"Discord.setCache")}}const M=class extends t{constructor(){var t;super(...arguments),e(this,W),e(this,P),e(this,G),e(this,x),e(this,S),e(this,T),g(this,"tasks",{...m}),g(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{...m}),s(this,k,{writable:!0,value:GM_getValue("discordAuth")||{}}),s(this,y,{writable:!0,value:GM_getValue("discordCache")||{}}),s(this,b,{writable:!0,value:!1})}async init(){try{return f(this,b)?!0:f(this,k).auth?await w(this,T,U).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(GM_setValue("discordAuth",{auth:null}),await w(this,S,O).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(V({}).error(E("initFailed","Discord")),!1)):!!await w(this,S,O).call(this)&&(p(this,b,!0),!0)}catch(t){return _(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!f(this,b))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)V({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Discord.toggleServers"),!1}}};function R(t,e){K(t,e),e.add(t)}function Y(t,e,s){K(t,e),e.set(t,s)}function K(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function z(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function B(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,J(t,e,"set"),s),s}function H(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function q(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,J(t,e,"get"))}function J(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const X={users:[]};var Q=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakSet,st=new WeakSet,it=new WeakSet,nt=new WeakSet;async function ot(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Instagram.toggleUsers"),!1}}};function ct(t,e){ht(t,e),e.add(t)}function dt(t,e,s){ht(t,e),e.set(t,s)}function ht(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function pt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,vt(t,e,"set"),s),s}function wt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ft(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,vt(t,e,"get"))}function vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const mt={reddits:[]};var kt=new WeakMap,yt=new WeakMap,bt=new WeakSet,Tt=new WeakSet;async function St(){try{const s=V({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await wt(this,Tt,xt).call(this,!0))}})}catch(t){return _(t,"Reddit.useBeta"),!1}}async function xt(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return _(t,"Reddit.toggle"),!1}}};function It(t,e){Gt(t,e),e.add(t)}function Lt(t,e,s){Gt(t,e),e.set(t,s)}function Gt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _t(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ct(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Et(t,e,"set"),s),s}function Vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function At(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Et(t,e,"get"))}function Et(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Pt={channels:[]};var Wt=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Dt=new WeakSet,jt=new WeakSet,Ft=new WeakSet,Nt=new WeakSet,Mt=new WeakSet;async function Rt(){try{const r=V({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==a?void 0:a.status)&&null!==(t=a.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(r.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Twitch.verifyAuth"),!1}}async function Yt(){try{const s=V({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Ct(this,Wt,t),s.success(),e(await Vt(this,Dt,Rt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return _(t,"Twitch.updateAuth"),!1}}async function Kt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return V({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Vt(this,Nt,zt).call(this,e);if(!s)return!1;const u=V({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:o,statusText:a,status:r,data:l}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken},data:t?i:n});return"Success"===o?200===(null==l?void 0:l.status)?(u.success(),t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Twitch.toggleChannel"),!1}}async function zt(t){try{const d=V({type:"gettingTwitchChannelId",text:t});var e=At(this,Ut)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:o}=await I({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==o?void 0:o.status))return d.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1;var a,r,l,u,c=String(null===(a=o.response)||void 0===a||null===(r=a[0])||void 0===r||null===(l=r.data)||void 0===l||null===(u=l.user)||void 0===u?void 0:u.id);return c?(Vt(this,Mt,Bt).call(this,t,c),d.success(),c):(d.error(`Error:${o.statusText}(${o.status})`),!1)}catch(t){return _(t,"Twitch.getChannelId"),!1}}function Bt(t,e){try{At(this,Ut)[t]=e,GM_setValue("twitchCache",At(this,Ut))}catch(t){_(t,"Twitch.setCache")}}const Ht=class extends t{constructor(){var t;super(...arguments),It(this,Mt),It(this,Nt),It(this,Ft),It(this,jt),It(this,Dt),_t(this,"tasks",{...Pt}),_t(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Pt}),Lt(this,Wt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Lt(this,Ut,{writable:!0,value:GM_getValue("twitchCache")||{}}),Lt(this,Ot,{writable:!0,value:!1})}async init(){try{return At(this,Ot)?!0:At(this,Wt).authToken?await Vt(this,Dt,Rt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(GM_setValue("twitchAuth",null),await Vt(this,jt,Yt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(V({}).error(E("initFailed","Twitch")),!1)):!!await Vt(this,jt,Yt).call(this)&&(Ct(this,Ot,!0),!0)}catch(t){return _(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!At(this,Ot))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)V({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return _(t,"Twitch.toggle"),!1}}};function qt(t,e){Xt(t,e),e.add(t)}function Jt(t,e,s){Xt(t,e),e.set(t,s)}function Xt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Zt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,se(t,e,"set"),s),s}function te(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,se(t,e,"get"))}function se(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ie={names:[]};var ne=new WeakMap,oe=new WeakMap,ae=new WeakMap,re=new WeakSet,le=new WeakSet,ue=new WeakSet,ce=new WeakSet,de=new WeakSet,he=new WeakSet,ge=new WeakSet,pe=new WeakSet;async function we(){try{const e=V({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==o&&void 0!==o&&o.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===o||void 0===o?void 0:o.status)?(Zt(this,ne,(null===(t=o.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Vk.verifyAuth"),!1}}async function fe(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Vk.toggle"),!1}}};function xe(t,e){Ie(t,e),e.add(t)}function $e(t,e,s){Ie(t,e),e.set(t,s)}function Ie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ge(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ve(t,e,"set"),s),s}function _e(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ce(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ve(t,e,"get"))}function Ve(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ae={channels:[],likes:[]},Ee=async function(t,e){try{const h=V({text:E("gettingYtbToken")}),{result:g,statusText:p,status:w,data:f}=await I({url:t,method:"GET"});if("Success"!==g)return h.error(g+`:${p}(${w})`),{};if(200!==(null===f||void 0===f?void 0:f.status))return h.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),{};{var s,i;if(f.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=f.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],o=(null===(i=f.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||f.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:v,request:m}=JSON.parse(o);if(n&&v&&m){if(v.hl="en","channel"===e){var a,r=null===(a=f.responseText.match(//))||void 0===a?void 0:a[1];return r?(h.success(),{params:{apiKey:n,client:v,request:m,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,u,c=null===(l=f.responseText.match(//))||void 0===l?void 0:l[1],d=null===(u=f.responseText.match(/"likeParams":"(.*?)"/))||void 0===u?void 0:u[1];return c?(h.success(),{params:{apiKey:n,client:v,request:m,videoId:c,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return _(t,"Youtube.getInfo"),{}}};var Pe=new WeakMap,We=new WeakMap,Ue=new WeakMap,Oe=new WeakSet,De=new WeakSet,je=new WeakSet,Fe=new WeakSet,Ne=new WeakSet;class Me extends t{constructor(){var t;super(...arguments),xe(this,Ne),xe(this,Fe),xe(this,je),xe(this,De),xe(this,Oe),Le(this,"tasks",{...Ae}),Le(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...Ae}),$e(this,Pe,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),$e(this,We,{writable:!0,value:!1}),$e(this,Ue,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return Ce(this,We)?!0:Ce(this,Pe).PAPISID?await _e(this,Oe,Re).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(GM_setValue("youtubeAuth",null),await _e(this,De,Ye).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(V({}).error(E("initFailed","Youtube")),!1)):!!await _e(this,De,Ye).call(this)&&(Ge(this,We,!0),!0)}catch(t){return _(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!Ce(this,We))return V({text:E("needInit")}),!1;const o=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)V({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return _(t,"Youtube.toggle"),!1}}}async function Re(){try{return await _e(this,Fe,ze).call(this,{link:Ce(this,Ue),doTask:!0,verify:!0})}catch(t){return _(t,"Youtube.verifyAuth"),!1}}async function Ye(){try{const s=V({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(Ge(this,Pe,t),s.success(),_e(this,Oe,Re).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}function Ke(t,e){return Ee(t,e)}async function ze(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await _e(this,je,Ke).call(this,e,"channel"),{apiKey:o,client:a,request:r,channelId:l}=i||{};if(n)return V({html:E("loginYtb")}),!1;if(!(o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return V({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const c=t?V({text:E("verifyingAuth","Youtube")}):V({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var u=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:g,data:p}=await I({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+o,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==a?void 0:a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:a,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===p||void 0===p?void 0:p.status)?s&&(/"subscribed": true/.test(p.responseText)||p.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(p.responseText)?(c.success(),s&&!t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===p||void 0===p?void 0:p.statusText}(${null===p||void 0===p?void 0:p.status})`),!1):(c.error(d+`:${h}(${g})`),!1)}catch(t){return _(t,"Youtube.toggleChannel"),!1}}async function Be(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await _e(this,je,Ke).call(this,e,"likeVideo"),{apiKey:n,client:o,request:a,videoId:r,likeParams:l}=s||{};if(i)return V({html:""+E("loginYtb")}),!1;if(!(n&&o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return V({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const c=V({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var u=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:o,request:{sessionId:a.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return c.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:g,status:p,data:w}=await I({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(c.success(),t&&(this.tasks.likes=L([...this.tasks.likes,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(c.error(h+`:${g}(${p})`),!1)}catch(t){return _(t,"Youtube.toggleLikeVideo"),!1}}function He(t,e){Je(t,e),e.add(t)}function qe(t,e,s){Je(t,e),e.set(t,s)}function Je(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xe(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,es(t,e,"set"),s),s}function Ze(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ts(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,es(t,e,"get"))}function es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ss={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var is=new WeakMap,ns=new WeakMap,os=new WeakMap,as=new WeakMap,rs=new WeakSet,ls=new WeakSet,us=new WeakSet,cs=new WeakSet,ds=new WeakSet,hs=new WeakSet,gs=new WeakSet,ps=new WeakSet,ws=new WeakSet,fs=new WeakSet,vs=new WeakSet,ms=new WeakSet,ks=new WeakSet,ys=new WeakSet,bs=new WeakSet,Ts=new WeakSet,Ss=new WeakSet,xs=new WeakSet,$s=new WeakSet,Is=new WeakSet,Ls=new WeakSet;async function Gs(){try{const s=V({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${o})`),!1;if(200!==(null===a||void 0===a?void 0:a.status))return s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1;var t;if(a.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=a.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(ts(this,ns).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateStoreAuth"),!1}}async function _s(){try{const a=V({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:u,data:c}=await I({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return a.error(r+`:${l}(${u})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;var t,e,s;if(c.responseText.includes('href="https://steamcommunity.com/login/home/'))return a.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=c.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=c.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],o=null===(s=c.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(ts(this,ns).steam64Id=i),o&&(ts(this,ns).userName=o),n)?(ts(this,ns).communitySessionID=n,a.success(),!0):(a.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateCommunityAuth"),!1}}async function Cs(){try{const i=V({text:E("gettingAreaInfo")}),{result:n,statusText:o,status:a,data:r}=await I({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${o}(${a})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return V({text:"noAnotherArea"}),!1;[t]=s}const l=V({text:E("changingArea",t)});var{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:ts(this,ns).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${o})`),"CN";if(200!==(null==a?void 0:a.status)||"true"!==a.responseText)return l.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),"CN";var r=(await Ze(this,us,Cs).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return _(t,"Steam.changeArea"),!1}}async function As(t){try{const e=V({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:ts(this,ns).communitySessionID})});return"Success"===s?200!==(null===o||void 0===o?void 0:o.status)||o.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.success(),this.tasks.groups=L([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Steam.joinGroup"),!1}}async function Es(t){try{if(this.whiteList.groups.includes(t))return V({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Ze(this,gs,Ps).call(this,t);if(!e)return!1;const s=V({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:o,data:a}=await I({url:`https://steamcommunity.com/id/${ts(this,ns).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:ts(this,ns).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===a||void 0===a?void 0:a.status)&&a.finalUrl.includes("groups")&&0===$(a.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(s.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Steam.leaveGroup"),!1}}async function Ps(t){try{const n=V({type:"gettingSteamGroupId",text:t});var e=ts(this,is).group[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==o)return n.error(o+`:${a}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,Hs).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return _(t,"Steam.getGroupID"),!1}}async function Ws(t){try{var e;const n=V({type:"addingToWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===o?200===(null===l||void 0===l?void 0:l.status)?"CN"===ts(this,as)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ps,Ws).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Steam.addToWishlist"),!1}}async function Us(t){try{var e;if(this.whiteList.wishlists.includes(t))return V({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const o=V({type:"removingFromWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return o.success(),!0;const{result:a,statusText:r,status:l,data:u}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==a)return o.error(a+`:${r}(${l})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;if("CN"===ts(this,as)&&u.responseText.includes('id="error_box"')){o.warning(E("changeAreaNotice"));var n=await Ze(this,cs,Vs).call(this);return n&&"CN"!==n&&"skip"!==n?await Ze(this,ws,Us).call(this,t):!1}return u.responseText.includes('class="queue_actions_ctn"')&&(u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes("add_to_wishlist_area"))?(o.success(),!0):(o.error(`Error:${u.statusText}(${u.status})`),!1)}catch(t){return _(t,"Steam.removeFromWishlist"),!1}}async function Os(t,e){try{if(!e&&this.whiteList.follows.includes(t))return V({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const o=V({type:`${e?"":"un"}followingGame`,text:t}),a={sessionid:ts(this,ns).storeSessionID,appid:t};e||(a.unfollow="1");var{result:s,data:i}=await I({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(a)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return o.success(),!0;var n=await Ze(this,vs,Ds).call(this,t);return"CN"===ts(this,as)&&"areaLocked"===n?(o.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ws,Us).call(this,t)):e===n?(o.success(),e&&(this.tasks.follows=L([...this.tasks.follows,t])),!0):(o.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return _(t,"Steam.toggleFollowGame"),!1}}async function Ds(t){try{const{result:e,data:s}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===ts(this,as)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return _(t,"Steam.isFollowedGame"),!1}}async function js(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,Hs).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return _(t,"Steam.getWorkshopAppId"),!1}}async function Rs(t){try{const a=V({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:ts(this,ns).communitySessionID})});return"Success"===s?(200===(null==o?void 0:o.status)&&1===(null===(e=o.response)||void 0===e?void 0:e.success)?a.success():a.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!0):(a.error(s+`:${i}(${n})`),!0)}catch(t){return _(t,"Steam.voteupWorkshop"),!0}}async function Ys(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),v=this.getRealParams("curatorLikes",u,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==ts(this,as)&&(V({}).warning(E("steamFinishNotice")),await Ze(this,cs,Vs).call(this,"CN")),!0))}catch(t){return _(t,"Steam.toggle"),!1}}};function Js(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Xs(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Zs={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var ti,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet,oi=new WeakSet,ai=new WeakSet,ri=new WeakSet,li=new WeakSet;async function ui(){try{const e=V({text:E("getTasksInfo")}),s=[];var t=$("#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 r of t)s.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(o.includes("steam")&&/join/gi.test(a)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(a)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(a)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):o.includes("steam")&&/follow|subscribe/gim.test(a)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(a)?this.undoneTasks.steam.forumLinks.push(t):o.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):o.includes("discord")||/join.*discord/gim.test(a)?this.undoneTasks.discord.serverLinks.push(t):o.includes("instagram")||/follow.*instagram/gim.test(a)?this.undoneTasks.instagram.userLinks.push(t):o.includes("twitch")||/follow.*twitch.*channel/gim.test(a)?this.undoneTasks.twitch.channelLinks.push(t):o.includes("reddit")||/subscribe.*subreddit/gim.test(a)||/follow.*reddit/gim.test(a)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(a)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(a)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(a)||(o.includes("youtube")||o.includes("thumbs-up"))&&/(watch|like).*video/gim.test(a)?this.undoneTasks.youtube.likeLinks.push(t):o.includes("vk")||/join.*vk.*group/gim.test(a)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(a)||(/wishlist.*game|add.*wishlist/gim.test(a)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(a)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(_(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(s),e.success(),this.undoneTasks=Qs(this,ri,wi).call(this,this.undoneTasks),!0}catch(t){return _(t,"Giveawaysu.classifyTask"),!1}}function ci(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return _(t,"Giveawaysu.checkLogin"),!1}}async function di(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await o().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return _(t,"Giveawaysu.checkLeftKey"),!1}}function hi(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(V({text:E("getFailed","GiveawayId")}),!1)}async function gi(e,t){try{return{name:e,result:await t}}catch(t){return _(t,"GiveawaySu.bind"),{name:e,result:!1}}}async function pi(){try{const e=[];var t=this.undoneTasks;return t.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new M,e.push(Qs(this,oi,gi).call(this,"discord",this.social.discord.init()))),t.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new ut,e.push(Qs(this,oi,gi).call(this,"instagram",this.social.instagram.init()))),t.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new $t,e.push(Qs(this,oi,gi).call(this,"reddit",this.social.reddit.init()))),t.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new Ht,e.push(Qs(this,oi,gi).call(this,"twitch",this.social.twitch.init()))),t.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new Se,e.push(Qs(this,oi,gi).call(this,"vk",this.social.vk.init()))),t.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Me,e.push(Qs(this,oi,gi).call(this,"youtube",this.social.youtube.init()))),t.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new qs,e.push(Qs(this,oi,gi).call(this,"steam",this.social.steam.init()))),await Promise.all(e).then(t=>{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return _(t,"GiveawaySu.initSocial"),!1}}function wi(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,o]of Object.entries(i))e[s][n]=L(o)}return e}async function fi(){try{if(!this.initialized&&!this.init())return!1;if(!await Qs(this,ei,ui).call(this))return!1;if(!await Qs(this,ai,pi).call(this))return!1;const e=[];var t=this.undoneTasks;return this.social.discord&&e.push(this.social.discord.toggle({doTask:!0,...t.discord})),this.social.instagram&&e.push(this.social.instagram.toggle({doTask:!0,...t.instagram})),this.social.reddit&&e.push(this.social.reddit.toggle({doTask:!0,...t.reddit})),this.social.twitch&&e.push(this.social.twitch.toggle({doTask:!0,...t.twitch})),this.social.vk&&e.push(this.social.vk.toggle({doTask:!0,...t.vk})),this.social.youtube&&e.push(this.social.youtube.toggle({doTask:!0,...t.youtube})),this.social.steam&&e.push(this.social.steam.toggle({doTask:!0,...t.steam})),await Promise.all(e),V({}).success(E("allTasksComplete")),!0}catch(t){return _(t,"GiveawaySu.toggleTask"),!1}}const vi=class{constructor(){Js(this,li),Js(this,ri),Js(this,ai),Js(this,oi),Js(this,ni),Js(this,ii),Js(this,si),Js(this,ei),Xs(this,"undoneTasks",Zs),Xs(this,"giveawayId",void 0),Xs(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steam:!1}),Xs(this,"initialized",!1),Xs(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Qs(this,si,ci).call(this)||V({}).warning(E("checkLoginFailed")),await Qs(this,ii,di).call(this)||V({}).warning(E("checkLeftKeyFailed"))}catch(t){_(t,"Giveawaysu.after")}}init(){try{const t=V({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Qs(this,ni,hi).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return _(t,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$('#auto-task-info-div,style:contains(".swal2-popup.swal2-toast")').remove(),$("#getKey").off()}),await Qs(this,li,fi).call(this)}catch(t){return _(t,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var t;for(const e of $("#actions tr")){const s=$(e);if("adjs"!==s.attr("data-action-id")){const i=s.find("i.glyphicon-refresh"),n=i.parent();"A"!==n.prop("tagName")?i.hasClass("spin")||i.hasClass("glyphicon-ok")||(n[0].click(),await C(1e3)):(t=n.attr("href"),n.attr("href","javascript:void(0);").attr("target","_self")[0].click(),n.attr("href",t))}}}catch(t){_(t,"GiveawaySu.verifyTask")}}};"discord.com"===window.location.hostname&&(ti=null===(t=window.localStorage)||void 0===t||null===(ti=t.getItem("token"))||void 0===ti?void 0:ti.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:ti}),ti&&"#auth"===window.location.hash&&(window.close(),o().fire("",E("closePageNotice"))));$(async()=>{var t,e,s;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(t=a.get("auth-token"),!!a.get("login")?(GM_setValue("twitchAuth",{authToken:t,clientId:null===(t=commonOptions)||void 0===t||null===(e=t.headers)||void 0===e?void 0:e["Client-ID"]}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(s=a.get("ct0"),!!a.get("twid")&&s?(GM_setValue("twitterAuth",{ct0:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((s=a.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const i=$("#redesign-beta-optin-btn");if(0

    `),await n.after(),$("#auto-do-task").on("click",()=>{n.doTask()}),$("#auto-verify-task").on("click",()=>{n.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto TaskGS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${null===s||void 0===s?void 0:s.replace("u_","")}...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(a=t[0])&&void 0!==a&&a.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return _(t,"unique"),[]}},l=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await I({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return _(t,"getRedirectLink"),null}};const r={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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},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}};t=GM_getValue("globalOptions")||{};const u=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=u(i,e[s]):n[s]=e[s]??i;return n}catch(t){return _(t,"assignObject"),r}},A=u(r,t);const c={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凭证...",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:"默认显示日志",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 版本更新内容:",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",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",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",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",twitterUser:"推特用户",retweets:"转推",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:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},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",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:"Data synchronization",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:",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",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",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",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",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",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",twitterUser:"Twitter User",retweets:"Retweet",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!",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!',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..."}},d=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};t=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(p(this,k,{auth:t}),s.success(),e(await w(this,T,U).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}async function D(t){try{const l=V({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:f(this,k).auth}});if("Success"!==i||200!==(null==a?void 0:a.status))return l.error(i+`:${n}(${o})`),!1;l.success();var r=String(null===(e=a.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(w(this,W,N).call(this,t,r),this.tasks.servers=L([...this.tasks.servers,t])),!0}catch(t){return _(t,"Discord.joinServer"),!1}}async function j(t){try{if(this.whiteList.servers.includes(t))return V({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await w(this,P,F).call(this,t);if(!e)return!1;const a=V({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:o}=await I({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:f(this,k).auth}});return"Success"===s&&204===(null==o?void 0:o.status)?(a.success(),!0):(a.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Discord.leaveServer"),!1}}async function F(t){try{const n=V({type:"gettingDiscordGuild",text:t});var e=f(this,y)[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==o||200!==(null===l||void 0===l?void 0:l.status))return n.error(o+`:${a}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),w(this,W,N).call(this,t,i),i):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Discord.getGuild"),!1}}function N(t,e){try{f(this,y)[t]=e,GM_setValue("discordCache",f(this,y))}catch(t){_(t,"Discord.setCache")}}const M=class extends t{constructor(){var t;super(...arguments),e(this,W),e(this,P),e(this,G),e(this,x),e(this,S),e(this,T),g(this,"tasks",{...m}),g(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{...m}),s(this,k,{writable:!0,value:GM_getValue("discordAuth")||{}}),s(this,y,{writable:!0,value:GM_getValue("discordCache")||{}}),s(this,b,{writable:!0,value:!1})}async init(){try{return f(this,b)?!0:f(this,k).auth?await w(this,T,U).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(GM_setValue("discordAuth",{auth:null}),await w(this,S,O).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(V({}).error(E("initFailed","Discord")),!1)):!!await w(this,S,O).call(this)&&(p(this,b,!0),!0)}catch(t){return _(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!f(this,b))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)V({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Discord.toggleServers"),!1}}};function R(t,e){K(t,e),e.add(t)}function Y(t,e,s){K(t,e),e.set(t,s)}function K(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function z(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function B(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,J(t,e,"set"),s),s}function H(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function q(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,J(t,e,"get"))}function J(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const X={users:[]};var Q=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakSet,st=new WeakSet,it=new WeakSet,nt=new WeakSet;async function ot(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Instagram.toggleUsers"),!1}}};function ct(t,e){ht(t,e),e.add(t)}function dt(t,e,s){ht(t,e),e.set(t,s)}function ht(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function pt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,vt(t,e,"set"),s),s}function wt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ft(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,vt(t,e,"get"))}function vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const mt={reddits:[]};var kt=new WeakMap,yt=new WeakMap,bt=new WeakSet,Tt=new WeakSet;async function St(){try{const s=V({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await wt(this,Tt,xt).call(this,!0))}})}catch(t){return _(t,"Reddit.useBeta"),!1}}async function xt(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return _(t,"Reddit.toggle"),!1}}};function It(t,e){Gt(t,e),e.add(t)}function Lt(t,e,s){Gt(t,e),e.set(t,s)}function Gt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _t(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ct(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Et(t,e,"set"),s),s}function Vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function At(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Et(t,e,"get"))}function Et(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Pt={channels:[]};var Wt=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Dt=new WeakSet,jt=new WeakSet,Ft=new WeakSet,Nt=new WeakSet,Mt=new WeakSet;async function Rt(){try{const r=V({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==a?void 0:a.status)&&null!==(t=a.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(r.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Twitch.verifyAuth"),!1}}async function Yt(){try{const s=V({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Ct(this,Wt,t),s.success(),e(await Vt(this,Dt,Rt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return _(t,"Twitch.updateAuth"),!1}}async function Kt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return V({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Vt(this,Nt,zt).call(this,e);if(!s)return!1;const u=V({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:o,statusText:a,status:r,data:l}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken},data:t?i:n});return"Success"===o?200===(null==l?void 0:l.status)?(u.success(),t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Twitch.toggleChannel"),!1}}async function zt(t){try{const d=V({type:"gettingTwitchChannelId",text:t});var e=At(this,Ut)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:o}=await I({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==o?void 0:o.status))return d.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1;var a,r,l,u,c=String(null===(a=o.response)||void 0===a||null===(r=a[0])||void 0===r||null===(l=r.data)||void 0===l||null===(u=l.user)||void 0===u?void 0:u.id);return c?(Vt(this,Mt,Bt).call(this,t,c),d.success(),c):(d.error(`Error:${o.statusText}(${o.status})`),!1)}catch(t){return _(t,"Twitch.getChannelId"),!1}}function Bt(t,e){try{At(this,Ut)[t]=e,GM_setValue("twitchCache",At(this,Ut))}catch(t){_(t,"Twitch.setCache")}}const Ht=class extends t{constructor(){var t;super(...arguments),It(this,Mt),It(this,Nt),It(this,Ft),It(this,jt),It(this,Dt),_t(this,"tasks",{...Pt}),_t(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Pt}),Lt(this,Wt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Lt(this,Ut,{writable:!0,value:GM_getValue("twitchCache")||{}}),Lt(this,Ot,{writable:!0,value:!1})}async init(){try{return At(this,Ot)?!0:At(this,Wt).authToken?await Vt(this,Dt,Rt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(GM_setValue("twitchAuth",null),await Vt(this,jt,Yt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(V({}).error(E("initFailed","Twitch")),!1)):!!await Vt(this,jt,Yt).call(this)&&(Ct(this,Ot,!0),!0)}catch(t){return _(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!At(this,Ot))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)V({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return _(t,"Twitch.toggle"),!1}}};function qt(t,e){Xt(t,e),e.add(t)}function Jt(t,e,s){Xt(t,e),e.set(t,s)}function Xt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Zt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,se(t,e,"set"),s),s}function te(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,se(t,e,"get"))}function se(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ie={names:[]};var ne=new WeakMap,oe=new WeakMap,ae=new WeakMap,re=new WeakSet,le=new WeakSet,ue=new WeakSet,ce=new WeakSet,de=new WeakSet,he=new WeakSet,ge=new WeakSet,pe=new WeakSet;async function we(){try{const e=V({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==o&&void 0!==o&&o.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===o||void 0===o?void 0:o.status)?(Zt(this,ne,(null===(t=o.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Vk.verifyAuth"),!1}}async function fe(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Vk.toggle"),!1}}};function xe(t,e){Ie(t,e),e.add(t)}function $e(t,e,s){Ie(t,e),e.set(t,s)}function Ie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ge(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ve(t,e,"set"),s),s}function _e(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ce(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ve(t,e,"get"))}function Ve(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ae={channels:[],likes:[]},Ee=async function(t,e){try{const h=V({text:E("gettingYtbToken")}),{result:g,statusText:p,status:w,data:f}=await I({url:t,method:"GET"});if("Success"!==g)return h.error(g+`:${p}(${w})`),{};if(200!==(null===f||void 0===f?void 0:f.status))return h.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),{};{var s,i;if(f.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=f.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],o=(null===(i=f.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||f.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:v,request:m}=JSON.parse(o);if(n&&v&&m){if(v.hl="en","channel"===e){var a,r=null===(a=f.responseText.match(//))||void 0===a?void 0:a[1];return r?(h.success(),{params:{apiKey:n,client:v,request:m,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,u,c=null===(l=f.responseText.match(//))||void 0===l?void 0:l[1],d=null===(u=f.responseText.match(/"likeParams":"(.*?)"/))||void 0===u?void 0:u[1];return c?(h.success(),{params:{apiKey:n,client:v,request:m,videoId:c,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return _(t,"Youtube.getInfo"),{}}};var Pe=new WeakMap,We=new WeakMap,Ue=new WeakMap,Oe=new WeakSet,De=new WeakSet,je=new WeakSet,Fe=new WeakSet,Ne=new WeakSet;class Me extends t{constructor(){var t;super(...arguments),xe(this,Ne),xe(this,Fe),xe(this,je),xe(this,De),xe(this,Oe),Le(this,"tasks",{...Ae}),Le(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...Ae}),$e(this,Pe,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),$e(this,We,{writable:!0,value:!1}),$e(this,Ue,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return Ce(this,We)?!0:Ce(this,Pe).PAPISID?await _e(this,Oe,Re).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(GM_setValue("youtubeAuth",null),await _e(this,De,Ye).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(V({}).error(E("initFailed","Youtube")),!1)):!!await _e(this,De,Ye).call(this)&&(Ge(this,We,!0),!0)}catch(t){return _(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!Ce(this,We))return V({text:E("needInit")}),!1;const o=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)V({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return _(t,"Youtube.toggle"),!1}}}async function Re(){try{return await _e(this,Fe,ze).call(this,{link:Ce(this,Ue),doTask:!0,verify:!0})}catch(t){return _(t,"Youtube.verifyAuth"),!1}}async function Ye(){try{const s=V({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(Ge(this,Pe,t),s.success(),_e(this,Oe,Re).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}function Ke(t,e){return Ee(t,e)}async function ze(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await _e(this,je,Ke).call(this,e,"channel"),{apiKey:o,client:a,request:r,channelId:l}=i||{};if(n)return V({html:E("loginYtb")}),!1;if(!(o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return V({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const c=t?V({text:E("verifyingAuth","Youtube")}):V({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var u=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:g,data:p}=await I({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+o,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==a?void 0:a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:a,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===p||void 0===p?void 0:p.status)?s&&(/"subscribed": true/.test(p.responseText)||p.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(p.responseText)?(c.success(),s&&!t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):t&&p.responseText.includes("You may not subscribe to yourself")?(c.success(),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===p||void 0===p?void 0:p.statusText}(${null===p||void 0===p?void 0:p.status})`),!1):(c.error(d+`:${h}(${g})`),!1)}catch(t){return _(t,"Youtube.toggleChannel"),!1}}async function Be(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await _e(this,je,Ke).call(this,e,"likeVideo"),{apiKey:n,client:o,request:a,videoId:r,likeParams:l}=s||{};if(i)return V({html:""+E("loginYtb")}),!1;if(!(n&&o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return V({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const c=V({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var u=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:o,request:{sessionId:a.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return c.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:g,status:p,data:w}=await I({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(c.success(),t&&(this.tasks.likes=L([...this.tasks.likes,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(c.error(h+`:${g}(${p})`),!1)}catch(t){return _(t,"Youtube.toggleLikeVideo"),!1}}function He(t,e){Je(t,e),e.add(t)}function qe(t,e,s){Je(t,e),e.set(t,s)}function Je(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xe(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,es(t,e,"set"),s),s}function Ze(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ts(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,es(t,e,"get"))}function es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ss={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var is=new WeakMap,ns=new WeakMap,os=new WeakMap,as=new WeakMap,rs=new WeakSet,ls=new WeakSet,us=new WeakSet,cs=new WeakSet,ds=new WeakSet,hs=new WeakSet,gs=new WeakSet,ps=new WeakSet,ws=new WeakSet,fs=new WeakSet,vs=new WeakSet,ms=new WeakSet,ks=new WeakSet,ys=new WeakSet,bs=new WeakSet,Ts=new WeakSet,Ss=new WeakSet,xs=new WeakSet,$s=new WeakSet,Is=new WeakSet,Ls=new WeakSet;async function Gs(){try{const s=V({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${o})`),!1;if(200!==(null===a||void 0===a?void 0:a.status))return s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1;var t;if(a.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=a.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(ts(this,ns).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateStoreAuth"),!1}}async function _s(){try{const a=V({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:u,data:c}=await I({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return a.error(r+`:${l}(${u})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;var t,e,s;if(c.responseText.includes('href="https://steamcommunity.com/login/home/'))return a.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=c.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=c.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],o=null===(s=c.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(ts(this,ns).steam64Id=i),o&&(ts(this,ns).userName=o),n)?(ts(this,ns).communitySessionID=n,a.success(),!0):(a.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateCommunityAuth"),!1}}async function Cs(){try{const i=V({text:E("gettingAreaInfo")}),{result:n,statusText:o,status:a,data:r}=await I({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${o}(${a})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return V({text:"noAnotherArea"}),!1;[t]=s}const l=V({text:E("changingArea",t)});var{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:ts(this,ns).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${o})`),"CN";if(200!==(null==a?void 0:a.status)||"true"!==a.responseText)return l.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),"CN";var r=(await Ze(this,us,Cs).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return _(t,"Steam.changeArea"),!1}}async function As(t){try{const e=V({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:ts(this,ns).communitySessionID})});return"Success"===s?200!==(null===o||void 0===o?void 0:o.status)||o.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.success(),this.tasks.groups=L([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Steam.joinGroup"),!1}}async function Es(t){try{if(this.whiteList.groups.includes(t))return V({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Ze(this,gs,Ps).call(this,t);if(!e)return!1;const s=V({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:o,data:a}=await I({url:`https://steamcommunity.com/id/${ts(this,ns).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:ts(this,ns).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===a||void 0===a?void 0:a.status)&&a.finalUrl.includes("groups")&&0===$(a.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(s.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Steam.leaveGroup"),!1}}async function Ps(t){try{const n=V({type:"gettingSteamGroupId",text:t});var e=ts(this,is).group[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==o)return n.error(o+`:${a}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,Hs).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return _(t,"Steam.getGroupID"),!1}}async function Ws(t){try{var e;const n=V({type:"addingToWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===o?200===(null===l||void 0===l?void 0:l.status)?"CN"===ts(this,as)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ps,Ws).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Steam.addToWishlist"),!1}}async function Us(t){try{var e;if(this.whiteList.wishlists.includes(t))return V({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const o=V({type:"removingFromWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return o.success(),!0;const{result:a,statusText:r,status:l,data:u}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==a)return o.error(a+`:${r}(${l})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;if("CN"===ts(this,as)&&u.responseText.includes('id="error_box"')){o.warning(E("changeAreaNotice"));var n=await Ze(this,cs,Vs).call(this);return n&&"CN"!==n&&"skip"!==n?await Ze(this,ws,Us).call(this,t):!1}return u.responseText.includes('class="queue_actions_ctn"')&&(u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes("add_to_wishlist_area"))?(o.success(),!0):(o.error(`Error:${u.statusText}(${u.status})`),!1)}catch(t){return _(t,"Steam.removeFromWishlist"),!1}}async function Os(t,e){try{if(!e&&this.whiteList.follows.includes(t))return V({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const o=V({type:`${e?"":"un"}followingGame`,text:t}),a={sessionid:ts(this,ns).storeSessionID,appid:t};e||(a.unfollow="1");var{result:s,data:i}=await I({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(a)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return o.success(),!0;var n=await Ze(this,vs,Ds).call(this,t);return"CN"===ts(this,as)&&"areaLocked"===n?(o.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ws,Us).call(this,t)):e===n?(o.success(),e&&(this.tasks.follows=L([...this.tasks.follows,t])),!0):(o.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return _(t,"Steam.toggleFollowGame"),!1}}async function Ds(t){try{const{result:e,data:s}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===ts(this,as)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return _(t,"Steam.isFollowedGame"),!1}}async function js(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,Hs).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return _(t,"Steam.getWorkshopAppId"),!1}}async function Rs(t){try{const a=V({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:ts(this,ns).communitySessionID})});return"Success"===s?(200===(null==o?void 0:o.status)&&1===(null===(e=o.response)||void 0===e?void 0:e.success)?a.success():a.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!0):(a.error(s+`:${i}(${n})`),!0)}catch(t){return _(t,"Steam.voteupWorkshop"),!0}}async function Ys(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),v=this.getRealParams("curatorLikes",u,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==ts(this,as)&&(V({}).warning(E("steamFinishNotice")),await Ze(this,cs,Vs).call(this,"CN")),!0))}catch(t){return _(t,"Steam.toggle"),!1}}};function Js(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Xs(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Zs={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var ti,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet,oi=new WeakSet,ai=new WeakSet,ri=new WeakSet,li=new WeakSet;async function ui(){try{const e=V({text:E("getTasksInfo")}),s=[];var t=$("#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 r of t)s.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(o.includes("steam")&&/join/gi.test(a)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(a)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(a)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):o.includes("steam")&&/follow|subscribe/gim.test(a)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(a)?this.undoneTasks.steam.forumLinks.push(t):o.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):o.includes("discord")||/join.*discord/gim.test(a)?this.undoneTasks.discord.serverLinks.push(t):o.includes("instagram")||/follow.*instagram/gim.test(a)?this.undoneTasks.instagram.userLinks.push(t):o.includes("twitch")||/follow.*twitch.*channel/gim.test(a)?this.undoneTasks.twitch.channelLinks.push(t):o.includes("reddit")||/subscribe.*subreddit/gim.test(a)||/follow.*reddit/gim.test(a)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(a)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(a)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(a)||(o.includes("youtube")||o.includes("thumbs-up"))&&/(watch|like).*video/gim.test(a)?this.undoneTasks.youtube.likeLinks.push(t):o.includes("vk")||/join.*vk.*group/gim.test(a)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(a)||(/wishlist.*game|add.*wishlist/gim.test(a)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(a)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(_(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(s),e.success(),this.undoneTasks=Qs(this,ri,wi).call(this,this.undoneTasks),!0}catch(t){return _(t,"Giveawaysu.classifyTask"),!1}}function ci(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return _(t,"Giveawaysu.checkLogin"),!1}}async function di(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await o().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return _(t,"Giveawaysu.checkLeftKey"),!1}}function hi(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(V({text:E("getFailed","GiveawayId")}),!1)}async function gi(e,t){try{return{name:e,result:await t}}catch(t){return _(t,"GiveawaySu.bind"),{name:e,result:!1}}}async function pi(){try{const e=[];var t=this.undoneTasks;return t.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new M,e.push(Qs(this,oi,gi).call(this,"discord",this.social.discord.init()))),t.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new ut,e.push(Qs(this,oi,gi).call(this,"instagram",this.social.instagram.init()))),t.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new $t,e.push(Qs(this,oi,gi).call(this,"reddit",this.social.reddit.init()))),t.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new Ht,e.push(Qs(this,oi,gi).call(this,"twitch",this.social.twitch.init()))),t.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new Se,e.push(Qs(this,oi,gi).call(this,"vk",this.social.vk.init()))),t.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Me,e.push(Qs(this,oi,gi).call(this,"youtube",this.social.youtube.init()))),t.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new qs,e.push(Qs(this,oi,gi).call(this,"steam",this.social.steam.init()))),await Promise.all(e).then(t=>{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return _(t,"GiveawaySu.initSocial"),!1}}function wi(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,o]of Object.entries(i))e[s][n]=L(o)}return e}async function fi(){try{if(!this.initialized&&!this.init())return!1;if(!await Qs(this,ei,ui).call(this))return!1;if(!await Qs(this,ai,pi).call(this))return!1;const e=[];var t=this.undoneTasks;return this.social.discord&&e.push(this.social.discord.toggle({doTask:!0,...t.discord})),this.social.instagram&&e.push(this.social.instagram.toggle({doTask:!0,...t.instagram})),this.social.reddit&&e.push(this.social.reddit.toggle({doTask:!0,...t.reddit})),this.social.twitch&&e.push(this.social.twitch.toggle({doTask:!0,...t.twitch})),this.social.vk&&e.push(this.social.vk.toggle({doTask:!0,...t.vk})),this.social.youtube&&e.push(this.social.youtube.toggle({doTask:!0,...t.youtube})),this.social.steam&&e.push(this.social.steam.toggle({doTask:!0,...t.steam})),await Promise.all(e),V({}).success(E("allTasksComplete")),!0}catch(t){return _(t,"GiveawaySu.toggleTask"),!1}}const vi=class{constructor(){Js(this,li),Js(this,ri),Js(this,ai),Js(this,oi),Js(this,ni),Js(this,ii),Js(this,si),Js(this,ei),Xs(this,"undoneTasks",Zs),Xs(this,"giveawayId",void 0),Xs(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steam:!1}),Xs(this,"initialized",!1),Xs(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Qs(this,si,ci).call(this)||V({}).warning(E("checkLoginFailed")),await Qs(this,ii,di).call(this)||V({}).warning(E("checkLeftKeyFailed"))}catch(t){_(t,"Giveawaysu.after")}}init(){try{const t=V({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Qs(this,ni,hi).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return _(t,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$('#auto-task-info-div,style:contains(".swal2-popup.swal2-toast")').remove(),$("#getKey").off()}),await Qs(this,li,fi).call(this)}catch(t){return _(t,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var t;for(const e of $("#actions tr")){const s=$(e);if("adjs"!==s.attr("data-action-id")){const i=s.find("i.glyphicon-refresh"),n=i.parent();"A"!==n.prop("tagName")?i.hasClass("spin")||i.hasClass("glyphicon-ok")||(n[0].click(),await C(1e3)):(t=n.attr("href"),n.attr("href","javascript:void(0);").attr("target","_self")[0].click(),n.attr("href",t))}}}catch(t){_(t,"GiveawaySu.verifyTask")}}};"discord.com"===window.location.hostname&&(ti=null===(t=window.localStorage)||void 0===t||null===(ti=t.getItem("token"))||void 0===ti?void 0:ti.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:ti}),ti&&"#auth"===window.location.hash&&(window.close(),o().fire("",E("closePageNotice"))));$(async()=>{var t,e,s;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(t=a.get("auth-token"),!!a.get("login")?(GM_setValue("twitchAuth",{authToken:t,clientId:null===(t=commonOptions)||void 0===t||null===(e=t.headers)||void 0===e?void 0:e["Client-ID"]}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(s=a.get("ct0"),!!a.get("twid")&&s?(GM_setValue("twitterAuth",{ct0:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((s=a.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const i=$("#redesign-beta-optin-btn");if(0

    `),await n.after(),$("#auto-do-task").on("click",()=>{n.doTask()}),$("#auto-verify-task").on("click",()=>{n.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto TaskGS特供脚本初始化完成!")}})}()}(); \ 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 0a3d70d..74e1d68 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.1.7-Beta +// @version 4.1.8-Beta // @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 @@ -92,8 +92,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); !function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},o=a.name,r=a.version,l={},c=0,u=Object.entries(this.browserNameMap);c(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s=e?t:""+Array(e+1-i.length).join(s)+t},e={s:a,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),i=Math.floor(s/60),n=s%60;return(e<=0?"+":"-")+a(i,2,"0")+":"+a(n,2,"0")},m:function t(e,s){if(e.date(){s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return O(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const L=i;function G(){let e=0{setTimeout(()=>{t(!0)},e)})}const C=t=>{let{type:e,text:s,html:i,id:n}=t;const a={success:()=>a,error:()=>a,warning:()=>a,info:()=>a,view:()=>a};try{var o;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":t=$(`
  • ${E(e)}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${E(e)} ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${E(e)} ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${E(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${E(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${E("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${E(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${E(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${E(e)} - ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return O(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return O(t,"getRedirectLink"),null}},a=async(t,e)=>{try{const i=C({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return O(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return O(t,"stringToColour"),"#fff"}},o={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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},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}};var e=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return O(t,"assignObject"),o}},A=r(o,e),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?A[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(A[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",A),p().fire({title:E("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){O(t,"saveData")}},w=e=>{try{let t=`
    - `;for(const[o,r]of Object.entries(A))for(var[s,i]of Object.entries(r))if(["other","position","hotKey"].includes(o))"boolean"==typeof i?t+=`${0===Object.keys(r).indexOf(s)?``:""}`:t+=`${0===Object.keys(r).indexOf(s)?``:""}`;else for(var[n,a]of Object.entries(i))t+=`${0===Object.keys(r).indexOf(s)?``:""}`;t+="
    ${E("type")}${E("option")}${E("value")}
    ${E(o)}${E(s)}
    ${E(o)}${E(s)}
    ${E(o)}${s}.${E(n)}
    ","swal"===e?p().fire({title:E("globalOptions"),html:t,showConfirmButton:!0,confirmButtonText:E("save"),showCancelButton:!0,cancelButtonText:E("close")}).then(t=>{t=t.isConfirmed;t&&c()}):$("body").append(`

    ${E("globalOptions")}

    `+t)}catch(t){O(t,"changeGlobalOptions")}};const d={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凭证...",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:"默认显示日志",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 版本更新内容:",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",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",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",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",twitterUser:"推特用户",retweets:"转推",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:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},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.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.",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",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:"Data synchronization",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:",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",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",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",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",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",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",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweeting",unretweetting:"Unretweeting",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!",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!',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..."}},g=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};function O(s,i){p().fire({title:E("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:E("toGithub"),showDenyButton:!0,denyButtonText:E("toKeylol"),cancelButtonText:E("close")}).then(t=>{var{isDenied:e,isConfirmed:t}=t;t?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("脚本报错: "+i)}&labels=bug&body=`+encodeURIComponent(`错误链接: [${window.location.href}](${window.location.href}) + ${null===s||void 0===s?void 0:s.replace("u_","")}...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return O(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return O(t,"getRedirectLink"),null}},a=async(t,e)=>{try{const i=C({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return O(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return O(t,"stringToColour"),"#fff"}},o={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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!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,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},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}};var e=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return O(t,"assignObject"),o}},A=r(o,e),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?A[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(A[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",A),p().fire({title:E("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){O(t,"saveData")}},w=e=>{try{let t=`
    + `;for(const[o,r]of Object.entries(A))for(var[s,i]of Object.entries(r))if(["other","position","hotKey"].includes(o))"boolean"==typeof i?t+=`${0===Object.keys(r).indexOf(s)?``:""}`:t+=`${0===Object.keys(r).indexOf(s)?``:""}`;else for(var[n,a]of Object.entries(i))t+=`${0===Object.keys(r).indexOf(s)?``:""}`;t+="
    ${E("type")}${E("option")}${E("value")}
    ${E(o)}${E(s)}
    ${E(o)}${E(s)}
    ${E(o)}${s}.${E(n)}
    ","swal"===e?p().fire({title:E("globalOptions"),html:t,showConfirmButton:!0,confirmButtonText:E("save"),showCancelButton:!0,cancelButtonText:E("close")}).then(t=>{t=t.isConfirmed;t&&c()}):$("body").append(`

    ${E("globalOptions")}

    `+t)}catch(t){O(t,"changeGlobalOptions")}};const d={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凭证...",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:"默认显示日志",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 版本更新内容:",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",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",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",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",twitterUser:"推特用户",retweets:"转推",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:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",gsNotice:'为避免得到"0000-0000-0000"key, 已自动屏蔽"Grab Key"按钮,获取key时请关闭脚本!',SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},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",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:"Data synchronization",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:",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",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",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",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",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",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",twitterUser:"Twitter User",retweets:"Retweet",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!",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!',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..."}},g=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};function O(s,i){p().fire({title:E("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:E("toGithub"),showDenyButton:!0,denyButtonText:E("toKeylol"),cancelButtonText:E("close")}).then(t=>{var{isDenied:e,isConfirmed:t}=t;t?window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("脚本报错: "+i)}&labels=bug&body=`+encodeURIComponent(`错误链接: [${window.location.href}](${window.location.href}) 环境: \`\`\` @@ -125,7 +125,7 @@ ${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")} 执行日志: [code]${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")}[/code]`,GM_setClipboard(e),p().fire({title:E("copySuccess"),icon:"success",confirmButtonText:E("ok")}).then(()=>{window.open("https://keylol.com/forum.php?mod=post&action=reply&fid=319&tid=777450","_blank")}))}),console.log("%c%s","color:white;background:red",i+` -`+s.stack)}var s=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(b(this,j,{auth:t}),s.success(),e(await T(this,V,z).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return O(t,"Discord.updateAuth"),!1}}async function B(t){try{const l=C({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:x(this,j).auth}});if("Success"!==i||200!==(null==o?void 0:o.status))return l.error(i+`:${n}(${a})`),!1;l.success();var r=String(null===(e=o.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(T(this,N,H).call(this,t,r),this.tasks.servers=_([...this.tasks.servers,t])),!0}catch(t){return O(t,"Discord.joinServer"),!1}}async function Y(t){try{if(this.whiteList.servers.includes(t))return C({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await T(this,U,R).call(this,t);if(!e)return!1;const o=C({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:a}=await L({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:x(this,j).auth}});return"Success"===s&&204===(null==a?void 0:a.status)?(o.success(),!0):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Discord.leaveServer"),!1}}async function R(t){try{const n=C({type:"gettingDiscordGuild",text:t});var e=x(this,W)[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==a||200!==(null===l||void 0===l?void 0:l.status))return n.error(a+`:${o}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),T(this,N,H).call(this,t,i),i):(n.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Discord.getGuild"),!1}}function H(t,e){try{x(this,W)[t]=e,GM_setValue("discordCache",x(this,W))}catch(t){O(t,"Discord.setCache")}}const q=class extends s{constructor(){var t;super(...arguments),m(this,N),m(this,U),m(this,F),m(this,D),m(this,M),m(this,V),y(this,"tasks",{...I}),y(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{...I}),v(this,j,{writable:!0,value:GM_getValue("discordAuth")||{}}),v(this,W,{writable:!0,value:GM_getValue("discordCache")||{}}),v(this,P,{writable:!0,value:!1})}async init(){try{return x(this,P)?!0:x(this,j).auth?await T(this,V,z).call(this)?(C({}).success(E("initSuccess","Discord")),b(this,P,!0),!0):(GM_setValue("discordAuth",{auth:null}),await T(this,M,K).call(this)?(C({}).success(E("initSuccess","Discord")),b(this,P,!0),!0):(C({}).error(E("initFailed","Discord")),!1)):!!await T(this,M,K).call(this)&&(b(this,P,!0),!0)}catch(t){return O(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!x(this,P))return C({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)C({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Discord.toggleServers"),!1}}};function J(t,e){Z(t,e),e.add(t)}function X(t,e,s){Z(t,e),e.set(t,s)}function Z(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Q(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function tt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,it(t,e,"set"),s),s}function et(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function st(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,it(t,e,"get"))}function it(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const nt={users:[]};var at=new WeakMap,ot=new WeakMap,rt=new WeakMap,lt=new WeakSet,ct=new WeakSet,ut=new WeakSet,dt=new WeakSet;async function ht(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Instagram.toggleUsers"),!1}}};function mt(t,e){kt(t,e),e.add(t)}function vt(t,e,s){kt(t,e),e.set(t,s)}function kt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function bt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,xt(t,e,"set"),s),s}function Tt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function $t(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,xt(t,e,"get"))}function xt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const St={reddits:[]};var Lt=new WeakMap,_t=new WeakMap,It=new WeakSet,Gt=new WeakSet;async function Ct(){try{const s=C({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await Tt(this,Gt,At).call(this,!0))}})}catch(t){return O(t,"Reddit.useBeta"),!1}}async function At(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return O(t,"Reddit.toggle"),!1}}};function Ot(t,e){Wt(t,e),e.add(t)}function jt(t,e,s){Wt(t,e),e.set(t,s)}function Wt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Vt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ft(t,e,"set"),s),s}function Mt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Dt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ft(t,e,"get"))}function Ft(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ut={channels:[]};var Nt=new WeakMap,zt=new WeakMap,Kt=new WeakMap,Bt=new WeakSet,Yt=new WeakSet,Rt=new WeakSet,Ht=new WeakSet,qt=new WeakSet;async function Jt(){try{const r=C({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Dt(this,Nt).authToken,"Client-Id":Dt(this,Nt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==o?void 0:o.status)&&null!==(t=o.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1):(r.error(i+`:${n}(${a})`),!1)}catch(t){return O(t,"Twitch.verifyAuth"),!1}}async function Xt(){try{const s=C({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Vt(this,Nt,t),s.success(),e(await Mt(this,Bt,Jt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return O(t,"Twitch.updateAuth"),!1}}async function Zt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return C({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Mt(this,Ht,Qt).call(this,e);if(!s)return!1;const c=C({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:a,statusText:o,status:r,data:l}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Dt(this,Nt).authToken},data:t?i:n});return"Success"===a?200===(null==l?void 0:l.status)?(c.success(),t&&(this.tasks.channels=_([...this.tasks.channels,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Twitch.toggleChannel"),!1}}async function Qt(t){try{const d=C({type:"gettingTwitchChannelId",text:t});var e=Dt(this,zt)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:a}=await L({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Dt(this,Nt).authToken,"Client-Id":Dt(this,Nt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==a?void 0:a.status))return d.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1;var o,r,l,c,u=String(null===(o=a.response)||void 0===o||null===(r=o[0])||void 0===r||null===(l=r.data)||void 0===l||null===(c=l.user)||void 0===c?void 0:c.id);return u?(Mt(this,qt,te).call(this,t,u),d.success(),u):(d.error(`Error:${a.statusText}(${a.status})`),!1)}catch(t){return O(t,"Twitch.getChannelId"),!1}}function te(t,e){try{Dt(this,zt)[t]=e,GM_setValue("twitchCache",Dt(this,zt))}catch(t){O(t,"Twitch.setCache")}}const ee=class extends s{constructor(){var t;super(...arguments),Ot(this,qt),Ot(this,Ht),Ot(this,Rt),Ot(this,Yt),Ot(this,Bt),Pt(this,"tasks",{...Ut}),Pt(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Ut}),jt(this,Nt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),jt(this,zt,{writable:!0,value:GM_getValue("twitchCache")||{}}),jt(this,Kt,{writable:!0,value:!1})}async init(){try{return Dt(this,Kt)?!0:Dt(this,Nt).authToken?await Mt(this,Bt,Jt).call(this)?(C({}).success(E("initSuccess","Twitch")),Vt(this,Kt,!0),!0):(GM_setValue("twitchAuth",null),await Mt(this,Yt,Xt).call(this)?(C({}).success(E("initSuccess","Twitch")),Vt(this,Kt,!0),!0):(C({}).error(E("initFailed","Twitch")),!1)):!!await Mt(this,Yt,Xt).call(this)&&(Vt(this,Kt,!0),!0)}catch(t){return O(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Dt(this,Kt))return C({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)C({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return O(t,"Twitch.toggle"),!1}}};function se(t,e){ne(t,e),e.add(t)}function ie(t,e,s){ne(t,e),e.set(t,s)}function ne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ae(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function oe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ce(t,e,"set"),s),s}function re(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function le(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ce(t,e,"get"))}function ce(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ue={users:[],retweets:[],likes:[]};var de=new WeakMap,he=new WeakMap,pe=new WeakMap,fe=new WeakMap,we=new WeakSet,ge=new WeakSet,me=new WeakSet,ve=new WeakSet,ke=new WeakSet;async function ye(){try{return await re(this,me,Te).call(this,{name:"verify",doTask:!0,verify:!0})}catch(t){return O(t,"Twitter.verifyAuth"),!1}}async function be(){try{const s=C({text:E("updatingAuth","Twitter")});return await new Promise(e=>{const t=GM_openInTab("https://twitter.com/settings/account?k#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitterAuth");t?(oe(this,he,t),s.success(),e(await re(this,we,ye).call(this))):(s.error("Error: Update twitter auth failed!"),e(!1))}})}catch(t){return O(t,"Twitter.updateToken"),!1}}async function Te(t){var{name:e,doTask:s=!0,verify:t=!1}=t;try{if(!s&&!t&&this.whiteList.users.includes(e))return C({type:"whiteList",text:"Twitter.unfollowUser",id:e}),!0;var i=t?le(this,de):await this.userName2id(e);if(!i)return!1;const d=t?C({text:E("verifyingAuth","Twitter")}):C({type:`${s?"":"un"}followingTwitterUser`,text:e});var n,a,o,{result:r,statusText:l,status:c,data:u}=await L({url:`https://api.twitter.com/1.1/friendships/${s?"create":"destroy"}.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},responseType:"json",data:$.param({include_profile_interstitial_type:1,include_blocking:1,include_blocked_by:1,include_followed_by:1,include_want_retweets:1,include_mute_edge:1,include_can_dm:1,include_can_media_tag:1,skip_status:1,id:i})});return"Success"===r?200===(null==u?void 0:u.status)?(d.success(),s&&!t&&(this.tasks.users=_([...this.tasks.users,e])),!0):t&&403===(null==u?void 0:u.status)&&158===(null===(n=u.response)||void 0===n||null===(a=n.errors)||void 0===a||null===(o=a[0])||void 0===o?void 0:o.code)?(d.success(),!0):(d.error(`Error:${null==u?void 0:u.statusText}(${null==u?void 0:u.status})`),!1):(d.error(r+`:${l}(${c})`),!1)}catch(t){return O(t,"Twitter.toggleUser"),!1}}async function $e(t){var{retweetId:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.retweets.includes(e))return C({type:"whiteList",text:"Twitter.unretweet",id:e}),!0;const c=C({type:`${t?"":"un"}retweetting`,text:e});var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:`https://api.twitter.com/1.1/statuses/${t?"":"un"}retweet.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},data:$.param({tweet_mode:"extended",id:e}),responseType:"json"});return"Success"===a?200===(null==l?void 0:l.status)||403===(null==l?void 0:l.status)&&327===(null===(s=l.response)||void 0===s||null===(i=s.errors)||void 0===i||null===(n=i[0])||void 0===n?void 0:n.code)?(c.success(),t&&(this.tasks.retweets=_([...this.tasks.retweets,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Twitter.toggleRetweet"),!1}}function xe(t,e){try{le(this,pe)[t]=e,GM_setValue("twitterCache",le(this,pe))}catch(t){O(t,"Twitter.setCache")}}const Se=class extends s{constructor(){var t;super(...arguments),se(this,ke),se(this,ve),se(this,me),se(this,ge),se(this,we),ae(this,"tasks",{...ue}),ae(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitter)||{...ue}),ie(this,de,{writable:!0,value:A.other.twitterVerifyId}),ie(this,he,{writable:!0,value:GM_getValue("twitterAuth")||{}}),ie(this,pe,{writable:!0,value:GM_getValue("twitterCache")||{}}),ie(this,fe,{writable:!0,value:!1})}async init(){try{return le(this,fe)?!0:le(this,he).ct0?await re(this,we,ye).call(this)?(C({}).success(E("initSuccess","Twitter")),oe(this,fe,!0),!0):(GM_setValue("twitterAuth",null),await re(this,ge,be).call(this)?(C({}).success(E("initSuccess","Twitter")),oe(this,fe,!0),!0):(C({}).error(E("initFailed","Twitter")),!1)):!!await re(this,ge,be).call(this)&&(oe(this,fe,!0),!0)}catch(t){return O(t,"Twitter.init"),!1}}async userName2id(t){try{const u=C({type:"gettingTwitterUserId",text:t});var e=le(this,pe)[t];if(e)return u.success(),e;var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:"https://api.twitter.com/graphql/-xfUfZsnR_zqjFd-IfrN5A/UserByScreenName"+`?variables=%7B%22screen_name%22%3A%22${t}%22%2C%22withHighlightedLabel%22%3Atrue%7D`,method:"GET",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","content-type":"application/json"},responseType:"json",anonymous:!0});if("Success"!==a)return u.error(a+`:${o}(${r})`),!1;if(200!==(null==l?void 0:l.status))return u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1;{let e=l.response||("object"==typeof l.responseText?l.responseText:null);if(!e)try{e=JSON.parse(l.responseText)}catch(t){e=null}var c=String(null===(s=e)||void 0===s||null===(i=s.data)||void 0===i||null===(n=i.user)||void 0===n?void 0:n.rest_id);return c?(re(this,ke,xe).call(this,t,c),u.success(),c):(u.error(`Error:${l.statusText}(${l.status})`),!1)}}catch(t){return O(t,"Twitter.getUserId"),!1}}async toggle(t){var{doTask:e=!0,userLinks:s=[],retweetLinks:t=[]}=t;try{if(!le(this,fe))return C({text:E("needInit")}),!1;const a=[];if(e&&!A.doTask.twitter.users||!e&&!A.undoTask.twitter.users)C({type:"globalOptionsSkip",text:"twitter.users"});else{var i=this.getRealParams("users",s,e,t=>{return null===(t=t.match(/https:\/\/twitter\.com\/(.+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/https:\/\/twitter\.com\/.*?\/status\/([\d]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Twitter.toggle"),!1}}};function Le(t,e){Ie(t,e),e.add(t)}function _e(t,e,s){Ie(t,e),e.set(t,s)}function Ie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ge(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ce(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Oe(t,e,"set"),s),s}function Ae(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Oe(t,e,"get"))}function Oe(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const je={names:[]};var We=new WeakMap,Pe=new WeakMap,Ve=new WeakMap,Me=new WeakSet,De=new WeakSet,Fe=new WeakSet,Ue=new WeakSet,Ne=new WeakSet,ze=new WeakSet,Ke=new WeakSet,Be=new WeakSet;async function Ye(){try{const e=C({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==a&&void 0!==a&&a.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===a||void 0===a?void 0:a.status)?(Ce(this,We,(null===(t=a.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Vk.verifyAuth"),!1}}async function Re(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Vk.toggle"),!1}}};function es(t,e){is(t,e),e.add(t)}function ss(t,e,s){is(t,e),e.set(t,s)}function is(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ns(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function as(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ls(t,e,"set"),s),s}function os(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function rs(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ls(t,e,"get"))}function ls(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const cs={channels:[],likes:[]},us=async function(t,e){try{const h=C({text:E("gettingYtbToken")}),{result:p,statusText:f,status:w,data:g}=await L({url:t,method:"GET"});if("Success"!==p)return h.error(p+`:${f}(${w})`),{};if(200!==(null===g||void 0===g?void 0:g.status))return h.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`),{};{var s,i;if(g.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=g.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],a=(null===(i=g.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||g.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:m,request:v}=JSON.parse(a);if(n&&m&&v){if(m.hl="en","channel"===e){var o,r=null===(o=g.responseText.match(//))||void 0===o?void 0:o[1];return r?(h.success(),{params:{apiKey:n,client:m,request:v,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,c,u=null===(l=g.responseText.match(//))||void 0===l?void 0:l[1],d=null===(c=g.responseText.match(/"likeParams":"(.*?)"/))||void 0===c?void 0:c[1];return u?(h.success(),{params:{apiKey:n,client:m,request:v,videoId:u,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return O(t,"Youtube.getInfo"),{}}};var ds=new WeakMap,hs=new WeakMap,ps=new WeakMap,fs=new WeakSet,ws=new WeakSet,gs=new WeakSet,ms=new WeakSet,vs=new WeakSet;class ks extends s{constructor(){var t;super(...arguments),es(this,vs),es(this,ms),es(this,gs),es(this,ws),es(this,fs),ns(this,"tasks",{...cs}),ns(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...cs}),ss(this,ds,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),ss(this,hs,{writable:!0,value:!1}),ss(this,ps,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return rs(this,hs)?!0:rs(this,ds).PAPISID?await os(this,fs,ys).call(this)?(C({}).success(E("initSuccess","Youtube")),as(this,hs,!0),!0):(GM_setValue("youtubeAuth",null),await os(this,ws,bs).call(this)?(C({}).success(E("initSuccess","Youtube")),as(this,hs,!0),!0):(C({}).error(E("initFailed","Youtube")),!1)):!!await os(this,ws,bs).call(this)&&(as(this,hs,!0),!0)}catch(t){return O(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!rs(this,hs))return C({text:E("needInit")}),!1;const a=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)C({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return O(t,"Youtube.toggle"),!1}}}async function ys(){try{return await os(this,ms,$s).call(this,{link:rs(this,ps),doTask:!0,verify:!0})}catch(t){return O(t,"Youtube.verifyAuth"),!1}}async function bs(){try{const s=C({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(as(this,ds,t),s.success(),os(this,fs,ys).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return O(t,"Discord.updateAuth"),!1}}function Ts(t,e){return us(t,e)}async function $s(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await os(this,gs,Ts).call(this,e,"channel"),{apiKey:a,client:o,request:r,channelId:l}=i||{};if(n)return C({html:E("loginYtb")}),!1;if(!(a&&o&&r&&l))return C({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return C({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const u=t?C({text:E("verifyingAuth","Youtube")}):C({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var c=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:p,data:f}=await L({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+a,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==o?void 0:o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:o,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===f||void 0===f?void 0:f.status)?s&&(/"subscribed": true/.test(f.responseText)||f.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(f.responseText)?(u.success(),s&&!t&&(this.tasks.channels=_([...this.tasks.channels,e])),!0):(u.error(E("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),!1):(u.error(d+`:${h}(${p})`),!1)}catch(t){return O(t,"Youtube.toggleChannel"),!1}}async function xs(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await os(this,gs,Ts).call(this,e,"likeVideo"),{apiKey:n,client:a,request:o,videoId:r,likeParams:l}=s||{};if(i)return C({html:""+E("loginYtb")}),!1;if(!(n&&a&&o&&r&&l))return C({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return C({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const u=C({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var c=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:a,request:{sessionId:o.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return u.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:p,status:f,data:w}=await L({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(u.success(),t&&(this.tasks.likes=_([...this.tasks.likes,e])),!0):(u.error(E("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(u.error(h+`:${p}(${f})`),!1)}catch(t){return O(t,"Youtube.toggleLikeVideo"),!1}}function Ss(t,e){_s(t,e),e.add(t)}function Ls(t,e,s){_s(t,e),e.set(t,s)}function _s(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Is(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Gs(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Es(t,e,"set"),s),s}function Cs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function As(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Es(t,e,"get"))}function Es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Os={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var js=new WeakMap,Ws=new WeakMap,Ps=new WeakMap,Vs=new WeakMap,Ms=new WeakSet,Ds=new WeakSet,Fs=new WeakSet,Us=new WeakSet,Ns=new WeakSet,zs=new WeakSet,Ks=new WeakSet,Bs=new WeakSet,Ys=new WeakSet,Rs=new WeakSet,Hs=new WeakSet,qs=new WeakSet,Js=new WeakSet,Xs=new WeakSet,Zs=new WeakSet,Qs=new WeakSet,ti=new WeakSet,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet;async function ai(){try{const s=C({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${a})`),!1;if(200!==(null===o||void 0===o?void 0:o.status))return s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1;var t;if(o.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=o.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(As(this,Ws).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return O(t,"Steam.updateStoreAuth"),!1}}async function oi(){try{const o=C({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:c,data:u}=await L({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return o.error(r+`:${l}(${c})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;var t,e,s;if(u.responseText.includes('href="https://steamcommunity.com/login/home/'))return o.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=u.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=u.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],a=null===(s=u.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(As(this,Ws).steam64Id=i),a&&(As(this,Ws).userName=a),n)?(As(this,Ws).communitySessionID=n,o.success(),!0):(o.error('Error: Get "sessionID" failed'),!1)}catch(t){return O(t,"Steam.updateCommunityAuth"),!1}}async function ri(){try{const i=C({text:E("gettingAreaInfo")}),{result:n,statusText:a,status:o,data:r}=await L({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${a}(${o})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return C({text:"noAnotherArea"}),!1;[t]=s}const l=C({text:E("changingArea",t)});var{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:As(this,Ws).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${a})`),"CN";if(200!==(null==o?void 0:o.status)||"true"!==o.responseText)return l.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),"CN";var r=(await Cs(this,Fs,ri).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return O(t,"Steam.changeArea"),!1}}async function ci(t){try{const e=C({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:As(this,Ws).communitySessionID})});return"Success"===s?200!==(null===a||void 0===a?void 0:a.status)||a.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.success(),this.tasks.groups=_([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Steam.joinGroup"),!1}}async function ui(t){try{if(this.whiteList.groups.includes(t))return C({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Cs(this,Ks,di).call(this,t);if(!e)return!1;const s=C({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:a,data:o}=await L({url:`https://steamcommunity.com/id/${As(this,Ws).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:As(this,Ws).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===o||void 0===o?void 0:o.status)&&o.finalUrl.includes("groups")&&0===$(o.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(s.error(i+`:${n}(${a})`),!1)}catch(t){return O(t,"Steam.leaveGroup"),!1}}async function di(t){try{const n=C({type:"gettingSteamGroupId",text:t});var e=As(this,js).group[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==a)return n.error(a+`:${o}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Cs(this,ni,Si).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return O(t,"Steam.getGroupID"),!1}}async function hi(t){try{var e;const n=C({type:"addingToWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:As(this,Ws).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=_([...this.tasks.wishlists,t]),!0;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===a?200===(null===l||void 0===l?void 0:l.status)?"CN"===As(this,Vs)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Cs(this,Us,li).call(this)&&await Cs(this,Bs,hi).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=_([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Steam.addToWishlist"),!1}}async function pi(t){try{var e;if(this.whiteList.wishlists.includes(t))return C({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const a=C({type:"removingFromWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:As(this,Ws).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return a.success(),!0;const{result:o,statusText:r,status:l,data:c}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==o)return a.error(o+`:${r}(${l})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;if("CN"===As(this,Vs)&&c.responseText.includes('id="error_box"')){a.warning(E("changeAreaNotice"));var n=await Cs(this,Us,li).call(this);return n&&"CN"!==n&&"skip"!==n?await Cs(this,Ys,pi).call(this,t):!1}return c.responseText.includes('class="queue_actions_ctn"')&&(c.responseText.includes("ds_owned_flag ds_flag")||c.responseText.includes("add_to_wishlist_area"))?(a.success(),!0):(a.error(`Error:${c.statusText}(${c.status})`),!1)}catch(t){return O(t,"Steam.removeFromWishlist"),!1}}async function fi(t,e){try{if(!e&&this.whiteList.follows.includes(t))return C({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const a=C({type:`${e?"":"un"}followingGame`,text:t}),o={sessionid:As(this,Ws).storeSessionID,appid:t};e||(o.unfollow="1");var{result:s,data:i}=await L({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(o)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return a.success(),!0;var n=await Cs(this,Hs,wi).call(this,t);return"CN"===As(this,Vs)&&"areaLocked"===n?(a.warning(E("changeAreaNotice")),!!await Cs(this,Us,li).call(this)&&await Cs(this,Ys,pi).call(this,t)):e===n?(a.success(),e&&(this.tasks.follows=_([...this.tasks.follows,t])),!0):(a.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return O(t,"Steam.toggleFollowGame"),!1}}async function wi(t){try{const{result:e,data:s}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===As(this,Vs)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return O(t,"Steam.isFollowedGame"),!1}}async function gi(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Cs(this,ni,Si).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return O(t,"Steam.getWorkshopAppId"),!1}}async function yi(t){try{const o=C({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:As(this,Ws).communitySessionID})});return"Success"===s?(200===(null==a?void 0:a.status)&&1===(null===(e=a.response)||void 0===e?void 0:e.success)?o.success():o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!0):(o.error(s+`:${i}(${n})`),!0)}catch(t){return O(t,"Steam.voteupWorkshop"),!0}}async function bi(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),m=this.getRealParams("curatorLikes",c,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==As(this,Vs)&&(C({}).warning(E("steamFinishNotice")),await Cs(this,Us,li).call(this,"CN")),!0))}catch(t){return O(t,"Steam.toggle"),!1}}};function _i(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Ii(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Gi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Ci=new WeakSet;async function Ai(e,t){try{return{name:e,result:await t}}catch(t){return O(t,"Website.bind"),{name:e,result:!1}}}var Ei=class{constructor(){_i(this,Ci),Ii(this,"undoneTasks",void 0),Ii(this,"socialTasks",void 0),Ii(this,"giveawayId",void 0),Ii(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,twitter:!1,vk:!1,youtube:!1,steam:!1}),Ii(this,"initialized",!1),Ii(this,"social",{})}async initSocial(t){try{const s=[];var e="do"===t?this.undoneTasks:this.socialTasks;return e.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new q,s.push(Gi(this,Ci,Ai).call(this,"discord",this.social.discord.init()))),e.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new gt,s.push(Gi(this,Ci,Ai).call(this,"instagram",this.social.instagram.init()))),e.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new Et,s.push(Gi(this,Ci,Ai).call(this,"reddit",this.social.reddit.init()))),e.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new ee,s.push(Gi(this,Ci,Ai).call(this,"twitch",this.social.twitch.init()))),e.twitter&&0[...t,...e]).length&&!this.socialInitialized.twitter&&(this.social.twitter=new Se,s.push(Gi(this,Ci,Ai).call(this,"twitter",this.social.twitter.init()))),e.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new ts,s.push(Gi(this,Ci,Ai).call(this,"vk",this.social.vk.init()))),e.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new ks,s.push(Gi(this,Ci,Ai).call(this,"youtube",this.social.youtube.init()))),e.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new Li,s.push(Gi(this,Ci,Ai).call(this,"steam",this.social.steam.init()))),e.links&&0{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return O(t,"Website.initSocial"),!1}}uniqueTasks(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,a]of Object.entries(i))e[s][n]=_(a)}return e}async toggleTask(t){try{if(!this.initialized&&!this.init())return!1;if(!await this.classifyTask(t))return!1;if(!await this.initSocial(t))return!1;const i=[];var e="do"===t,s=e?this.undoneTasks:this.socialTasks;if(this.social.discord&&i.push(this.social.discord.toggle({doTask:e,...s.discord})),this.social.instagram&&i.push(this.social.instagram.toggle({doTask:e,...s.instagram})),this.social.reddit&&i.push(this.social.reddit.toggle({doTask:e,...s.reddit})),this.social.twitch&&i.push(this.social.twitch.toggle({doTask:e,...s.twitch})),this.social.twitter&&i.push(this.social.twitter.toggle({doTask:e,...s.twitter})),this.social.vk&&i.push(this.social.vk.toggle({doTask:e,...s.vk})),this.social.youtube&&i.push(this.social.youtube.toggle({doTask:e,...s.youtube})),this.social.steam&&i.push(this.social.steam.toggle({doTask:e,...s.steam})),this.social.visitLink&&s.links&&e)for(const n of s.links)i.push(this.social.visitLink(n));return e&&s.extra&&this.extraDoTask&&0[...t,...e]).length&&i.push(this.extraDoTask(s.extra)),await Promise.all(i),C({}).success(E("allTasksComplete")),!0}catch(t){return O(t,"Website.toggleTask"),!1}}async doTask(){try{return await this.toggleTask("do")}catch(t){return O(t,"Website.doTask"),!1}}async undoTask(){try{return await this.toggleTask("undo")}catch(t){return O(t,"Website.undoTask"),!1}}};function Oi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ji(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Wi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Pi={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],followLinks:[]},vk:{nameLinks:[]}};var Vi=new WeakSet,Mi=new WeakSet;function Di(){try{var t,e=null===(t=window.location.href.match(/\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){O(t,"FreeAnyWhere.getGiveawayId")}}async function Fi(t){try{const o=C({html:`
  • ${E("verifyingTask")}${t.title.trim()}...
  • `});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/challenge-status/${t.id}/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.status?(o.success(),!0):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Freeanywhere.verify"),!1}}var Ui=class extends Ei{constructor(){super(...arguments),Oi(this,Mi),Oi(this,Vi),ji(this,"name","FreeAnyWhere"),ji(this,"tasks",[]),ji(this,"socialTasks",{...Pi}),ji(this,"undoneTasks",{...Pi}),ji(this,"buttons",["doTask","undoTask","verifyTask","getKey"])}static test(){return"freeanywhere.net"===window.location.host}init(){try{const s=C({text:E("initing")});if(0<$('a[href="#/login"]').length)return window.open("/#/login","_self"),s.warning(E("needLogin")),!1;if(window.location.href.includes("/login"))return s.warning(E("needLogin")),!1;if(!/^https?:\/\/freeanywhere\.net\/#\/giveaway\/[\d]+/.test(window.location.href)){var t,e=null===(t=window.location.href.match(/https?:\/\/freeanywhere\.net\/.*?#\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];if(!e)return s.error(E("getFailed","Id")),!1;window.location.href="https://freeanywhere.net/#/giveaway/"+e}return Wi(this,Vi,Di).call(this)?(this.initialized=!0,s.success(),!0):!1}catch(t){return O(t,"Freeanywhere.init"),!1}}async classifyTask(t){try{const u=C({text:E("getTasksInfo")});var e;"undo"===t&&(this.socialTasks=(null===(e=GM_getValue("fawTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||{...Pi});var{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/?format=json`,method:"GET",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")},responseType:"json"});if("Success"!==s)return u.error(s+`:${i}(${n})`),!1;var o,r=null==a||null===(o=a.response)||void 0===o?void 0:o.challenges;if(r){"verify"===t&&(this.tasks=[]);for(const d of r){var l=d.challenge,c=d.challenge_provider;const h={id:d.id,title:d.title};if("verify"!==t||d.is_success)switch(c){case"steam":switch(h.social="steam",l){case"WL":"undo"===t&&this.socialTasks.steam.wishlistLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.wishlistLinks.push(d.link);break;case"JTG":"undo"===t&&this.socialTasks.steam.groupLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.groupLinks.push(d.link);break;case"STC":"undo"===t&&this.socialTasks.steam.curatorLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.curatorLinks.push(d.link);break;case"GF":"undo"===t&&this.socialTasks.steam.followLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.followLinks.push(d.link)}break;case"vk-oauth2":"undo"===t&&this.socialTasks.vk.nameLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.vk.nameLinks.push(d.link);break;case"website":break;default:C({}).warning(E("unKnownTaskType")+": "+c)}else this.tasks.push(h)}return u.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("fawTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}return u.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),console.error(a),!1}catch(t){return O(t,"Freeanywhere.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;const t=[];for(const e of this.tasks)t.push(Wi(this,Mi,Fi).call(this,e)),await G(1e3);return await Promise.all(t),C({}).success(E("allTasksComplete")),!!await this.getKey(!0)}catch(t){return O(t,"Freeanywhere.verifyTask"),!1}}async getKey(t){try{if(!t&&!this.initialized&&!this.init())return!1;const o=C({text:E("gettingKey")});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/reward/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.reward?(o.success(),C({}).success(a.response.reward),a.response.reward):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"FreeAnyWhere.getGiveawayId"),!1}}};function Ni(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function zi(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ki(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Bi={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var Yi=new WeakSet,Ri=new WeakSet,Hi=new WeakSet;class qi extends Ei{constructor(){super(...arguments),Ni(this,Hi),Ni(this,Ri),Ni(this,Yi),zi(this,"name","GiveawaySu"),zi(this,"socialTasks",Bi),zi(this,"undoneTasks",Bi),zi(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Ki(this,Yi,Ji).call(this)||C({}).warning(E("checkLoginFailed")),await Ki(this,Ri,Xi).call(this)||C({}).warning(E("checkLeftKeyFailed")),C({}).warning(E("gsNotice"))}catch(t){O(t,"Giveawaysu.after")}}init(){try{const t=C({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Ki(this,Hi,Zi).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Giveawaysu.init"),!1}}async classifyTask(t){try{const i=C({text:E("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gasTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||Bi,!0;const n=[];var s=$("#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 r of s)n.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(a.includes("steam")&&/join/gi.test(o)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(o)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(o)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):a.includes("steam")&&/follow|subscribe/gim.test(o)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(o)?this.undoneTasks.steam.forumLinks.push(t):a.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):a.includes("discord")||/join.*discord/gim.test(o)?this.undoneTasks.discord.serverLinks.push(t):a.includes("instagram")||/follow.*instagram/gim.test(o)?this.undoneTasks.instagram.userLinks.push(t):a.includes("twitch")||/follow.*twitch.*channel/gim.test(o)?this.undoneTasks.twitch.channelLinks.push(t):a.includes("reddit")||/subscribe.*subreddit/gim.test(o)||/follow.*reddit/gim.test(o)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(o)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(o)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(o)||(a.includes("youtube")||a.includes("thumbs-up"))&&/(watch|like).*video/gim.test(o)?this.undoneTasks.youtube.likeLinks.push(t):a.includes("vk")||/join.*vk.*group/gim.test(o)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(o)||(/wishlist.*game|add.*wishlist/gim.test(o)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(o)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(O(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(n),i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gasTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Giveawaysu.classifyTask"),!1}}}function Ji(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return O(t,"Giveawaysu.checkLogin"),!1}}async function Xi(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Giveawaysu.checkLeftKey"),!1}}function Zi(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}function Qi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function tn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function en(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var sn=new WeakSet,nn=new WeakSet,an=new WeakSet,on=new WeakSet;async function rn(){try{if(0<$("a.buttonenter:contains(Register to join)").length)return C({}).error(E("needLogin")),!1;const c=$("a.buttonenter.buttongiveaway");if(/join giveaway/gim.test(c.text())){const u=C({text:E("joiningGiveaway")+"..."});var t,e,s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:c.attr("href"),method:"POST",data:"ajax=t",dataType:"json",headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8",accept:"application/json, text/javascript, */*; q=0.01",origin:window.location.origin}});return"Success"===a?200===(null==l?void 0:l.status)?null!==(t=l.response)&&void 0!==t&&t.success?(c.addClass("buttonentered").text("Success - Giveaway joined"),$("#giveawaysjoined").slideDown(),$("#giveawaysrecommend").slideDown(),u.success("Success"+(null!==(i=l.response)&&void 0!==i&&i.text?":"+(null===(n=l.response)||void 0===n?void 0:n.text):"")),!0):(u.error("Error"+(null!==(e=l.response)&&void 0!==e&&e.text?":"+(null===(s=l.response)||void 0===s?void 0:s.text):"")),!1):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(a+`:${o}(${r})`),!1)}return/success/gim.test($("a.buttonenter.buttongiveaway").text())?!0:(C({}).warning(E("needJoinGiveaway")),!1)}catch(t){return O(t,"Indiedb.init"),!1}}async function ln(){try{const e=$("script").map((t,e)=>{var s,i,n,a,o;return/\$\(document\)/gim.test(e.innerHTML)?[null===(s=e.innerHTML.match(/"\/[\d]+"/gim))||void 0===s||null===(i=s[0])||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0],null===(e=e.innerHTML.match(/"\/newsletter\/ajax\/subscribeprofile\/optin\/[\d]+"/gim))||void 0===e||null===(a=e[0])||void 0===a||null===(o=a.match(/[\d]+/))||void 0===o?void 0:o[0]]:null});if(2!==e.length)return C({}).error(E("getFailed","TaskId")),!1;{const s=[];for(const t of $("#giveawaysjoined a[class*=promo]")){const n=$(t);if(!n.hasClass("buttonentered")){const a=C({text:`${E("doing")}:${n.parents("p").text()}...`});if(/facebookpromo|twitterpromo|visitpromo/gim.test(t.className)){let t="";t=n.hasClass("facebookpromo")?"facebookpromo":n.hasClass("twitterpromo")?"twitterpromo":"visitpromo",s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(`/giveaways/ajax/${t}/`+e[0]),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.addClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}else n.hasClass("emailoptinpromo")?s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath("/newsletter/ajax/subscribeprofile/optin/"+e[1]),timeout:6e4,dataType:"json",data:{ajax:"t",emailsystoggle:4},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):n.hasClass("watchingpromo")?s.push(new Promise(i=>{var t;const e=(t=>{try{const i={};return t?t.includes("?")&&t.split("?")[1].replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)):window.location.search.replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)),i}catch(t){return O(t,"getUrlQuery"),{}}})(n.attr("href"));e.ajax="t",$.ajax({type:"POST",url:urlPath(null===(t=n.attr("href"))||void 0===t?void 0:t.split(/[?#]/)[0]),timeout:6e4,dataType:"json",data:e,error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):/the-challenge-of-adblock/gim.test(n.attr("href"))?a.error("Error:"+E("unKnownTaskType")):s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(n.attr("href")),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}}return await Promise.all(s),C({}).success(E("allTasksComplete")),!0}}catch(t){return O(t,"Indiedb.classifyTask"),!1}}function cn(){try{return A.other.checkLogin?(0<$("a.buttonenter:contains(Register to join)").length&&window.open("/members/login","_self"),!0):!0}catch(t){return O(t,"Indiedb.checkLogin"),!1}}async function un(){try{return A.other.checkLeftKey?(0<$('a.buttonenter:contains("next time")').length&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayEnded"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Indiedb.checkLeftKey"),!1}}var dn=class{constructor(){Qi(this,on),Qi(this,an),Qi(this,nn),Qi(this,sn),tn(this,"name","Indiedb"),tn(this,"buttons",["doTask"])}static test(){return"www.indiedb.com"===window.location.host}async after(){try{en(this,an,cn).call(this)||C({}).warning(E("checkLoginFailed")),await en(this,on,un).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"Indiedb.after")}}async doTask(){try{return await en(this,sn,rn).call(this)?await en(this,nn,ln).call(this):!1}catch(t){return O(t,"Indiedb.doTask"),!1}}};function hn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function pn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function fn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const wn={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[]},discord:{serverLinks:[]},links:[]};var gn=new WeakSet,mn=new WeakSet,vn=new WeakSet;function kn(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){return O(t,"Keyhub.getGiveawayId"),!1}}async function yn(){try{return A.other.checkLeftKey?("0"===$("#keysleft").text().trim()&&await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Keyhub.checkLeftKey"),!1}}function bn(){try{return A.other.checkLogin?(0<$('a[href*="/connect/steam"]').length&&window.open("/connect/steam","_self"),!0):!0}catch(t){return O(t,"Keyhub.checkLogin"),!1}}var Tn=class extends Ei{constructor(){super(...arguments),hn(this,vn),hn(this,mn),hn(this,gn),pn(this,"name","Keyhub"),pn(this,"socialTasks",{...wn}),pn(this,"undoneTasks",{...wn}),pn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"key-hub.eu"===window.location.host}async after(){try{fn(this,vn,bn).call(this)||C({}).warning(E("checkLoginFailed")),await fn(this,mn,yn).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"Keyhub.after")}}init(){try{const t=C({text:E("initing")});return 0<$('a[href*="/connect/steam"]').length?(window.open("/connect/steam","_self"),t.warning(E("needLogin")),!1):!!fn(this,gn,kn).call(this)&&($("#VPNoverlay").hide(),$("#mainArticleSection").show(),this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Keyhub.init"),!1}}async classifyTask(e){try{const i=C({text:E("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("khTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||{...wn});for(const n of $(".task a")){let t=$(n).attr("href");var s=$(n).text().trim();t&&((/\/away\?data=/.test(t)||/steamcommunity\.com\/gid\//.test(t))&&(t=await u(t)||t),/https?:\/\/key-hub\.eu\/connect\/discord/.test(t)?window.open(t,"_blank"):/steamcommunity\.com\/groups\//.test(t)?("undo"===e&&this.socialTasks.steam.groupLinks.push(t),"do"===e&&this.undoneTasks.steam.groupLinks.push(t)):/store\.steampowered\.com\/app\//.test(t)&&/wishlist/gim.test(s)?("undo"===e&&this.socialTasks.steam.wishlistLinks.push(t),"do"===e&&this.undoneTasks.steam.wishlistLinks.push(t)):/store\.steampowered\.com\/curator\//.test(t)?("undo"===e&&this.socialTasks.steam.curatorLinks.push(t),"do"===e&&this.undoneTasks.steam.curatorLinks.push(t)):/^https?:\/\/discord\.com\/invite\//.test(t)?("undo"===e&&this.socialTasks.discord.serverLinks.push(t),"do"===e&&this.undoneTasks.discord.serverLinks.push(t)):C({}).warning(`${E("unKnownTaskType")}: ${s}(${t})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("khTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Keyhub.classifyTask"),!1}}verifyTask(){try{C({html:`
  • ${E("verifyingTask")}...
  • `}),$.get(window.location.href,t=>{VerifyTasks(t.match(/onclick="javascript:VerifyTasks\('(.*?)'\)"/)[1])})}catch(t){O(t,"keyhub.verifyTask")}}};function $n(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function xn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Sn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Ln={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[]},vk:{nameLinks:[]},discord:{serverLinks:[]}};var _n=new WeakSet,In=new WeakSet,Gn=new WeakSet;async function Cn(t){try{const s=C({html:`
  • ${E("verifyingTask")}${t}...
  • `});return await new Promise(e=>{$.ajax({url:"https://givekey.ru/giveaway/task",method:"POST",data:`id=${t}&user_id=`+this.userId,dataType:"json",headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},success:t=>{t.btn&&$(`button[data-id=${this.userId}]`).html(t.btn),"ok"===t.status?($(".task_check_"+t.id).html(``),s.success(),e(!0)):"end"===t.status?(s.success(),C({}).success(t.key),e(!0)):(s.error("Error:"+t.msg),e(!1))},error:t=>{s.error(`Error:${t.statusText}(${t.status})`),e(!1)}})})}catch(t){return O(t,"Givekey.verify"),!1}}function An(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"Givekey.getGiveawayId"),!1}}async function En(){try{return A.other.checkLeftKey?($("#keys_count").text()||await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Givekey.checkLeftKey"),!1}}var On=class extends Ei{constructor(){super(...arguments),$n(this,Gn),$n(this,In),$n(this,_n),xn(this,"name","Givekey"),xn(this,"tasks",[]),xn(this,"socialTasks",{...Ln}),xn(this,"undoneTasks",{...Ln}),xn(this,"userId",void 0),xn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"givekey.ru"===window.location.host}async after(){try{await new Promise(t=>{const e=setInterval(()=>{0<$("#navbarDropdown").length&&(clearInterval(e),t(!0))})}),await Sn(this,Gn,En).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){return O(t,"Givekey.after"),!1}}init(){try{const e=C({text:E("initing")});if(0<$('a[href*="/auth/steam"]').length)return window.open("/auth/steam","_self"),e.warning(E("needLogin")),!1;if(!Sn(this,In,An).call(this))return!1;var t=$('meta[name="user-id"]').attr("content");return t?(this.userId=t,this.initialized=!0,e.success(),!0):(e.error(E("getFailed",E("userId"))),!1)}catch(t){return O(t,"Givekey.init"),!1}}async classifyTask(e){try{const a=C({text:E("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("gkTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||Ln);for(const o of $('.card-body:has("button") .row')){const r=$(o);var s=/Complete/i.test(r.find("button").text().trim());if(!s||"undo"===e){const l=r.find("#task_check");var i=l.attr("data-id");if(i&&this.tasks.push(i),"verify"!==e){let t=r.find("a").attr("href")||null;var n=r.find("a").text().trim();const c=r.find("i");t&&n&&(/^https?:\/\/givekey\.ru\/giveaway\/[\d]+\/execution_task/.test(t)&&(t=await u(t)),t&&(/^https?:\/\/vk\.com\//.test(t)?(this.socialTasks.vk.nameLinks.push(t),"do"!==e||s||this.undoneTasks.vk.nameLinks.push(t)):/^https?:\/\/steamcommunity\.com\/groups/.test(t)?(this.socialTasks.steam.groupLinks.push(t),"do"!==e||s||this.undoneTasks.steam.groupLinks.push(t)):/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?(this.socialTasks.steam.wishlistLinks.push(t),"do"!==e||s||this.undoneTasks.steam.wishlistLinks.push(t)):/Subscribe/gi.test(n)&&c.hasClass("fa-steam-square")?/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?(this.socialTasks.steam.curatorLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLinks.push(t)):(this.socialTasks.steam.curatorLikeLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLikeLinks.push(t)):/^https?:\/\/twitter\.com\//.test(t)&&/Subscribe/gi.test(n)?(this.socialTasks.twitter.userLinks.push(t),"do"!==e||s||this.undoneTasks.twitter.userLinks.push(t)):c.hasClass("fa-discord")?(this.socialTasks.discord.serverLinks.push(t),"do"!==e||s||this.undoneTasks.discord.serverLinks.push(t)):C({}).warning(`${E("unKnownTaskType")}: ${n}(${t})`)))}}}return a.success(),this.tasks=_(this.tasks),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("gkTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Givekey.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;C({}).warning(E("giveKeyNoticeBefore"));var e=this.tasks.length;for(let t=0;t${E("giveKeyNoticeAfter")}`}),!0}catch(t){return O(t,"Givekey.verifyTask"),!1}}};function jn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Wn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Pn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Vn=new WeakSet,Mn=new WeakSet,Dn=new WeakSet;function Fn(){try{return A.other.checkLogin?(0<$('a[href*="/account/auth"]').length&&window.open($('a[href*="/account/auth"]').attr("href"),"_self"),!0):!0}catch(t){return O(t,"GiveeClub.checkLogin"),!1}}function Un(){var t=null===(t=window.location.href.match(/\/event\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}async function Nn(){try{return A.other.checkLeftKey?(0<$(".event-ended").length&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayEnded"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Giveawaysu.checkLeftKey"),!1}}var zn=class extends qi{constructor(){super(...arguments),jn(this,Dn),jn(this,Mn),jn(this,Vn),Wn(this,"name","GiveeClub"),Wn(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/givee\.club\/.*?\/event\/[\d]+/.test(window.location.href)}async after(){try{Pn(this,Vn,Fn).call(this)||C({}).warning(E("checkLoginFailed")),await Pn(this,Dn,Nn).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"GiveeClub.after")}}init(){try{const t=C({text:E("initing")});return Pn(this,Vn,Fn).call(this)?!!Pn(this,Mn,Un).call(this)&&(this.initialized=!0,t.success(),!0):(t.warning(E("needLogin")),!1)}catch(t){return O(t,"GiveeClub.init"),!1}}async classifyTask(t){try{const s=C({text:E("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gcTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||Bi,!0;const i=[];for(const n of $(".event-actions tr"))i.push(new Promise(e=>{const t=$(n).find(".event-action-label a"),s=$(n).find(".event-action-icon i").attr("class")||"",i=t.text().trim();if(s.includes("ban")||/AdBlock/i.test(i)||s.includes("envelope"))return e(!0);u(t.attr("href")).then(t=>t?(/^https?:\/\/steamcommunity\.com\/groups/.test(t)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(i)?this.undoneTasks.steam.announcementLinks.push(t):s.includes("plus")&&/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?this.undoneTasks.steam.wishlistLinks.push(t):/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):s.includes("steam")&&/follow|subscribe/gim.test(i)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(i)?this.undoneTasks.steam.forumLinks.push(t):s.includes("discord")?this.undoneTasks.discord.serverLinks.push(t):s.includes("instagram")?this.undoneTasks.instagram.userLinks.push(t):s.includes("twitch")?this.undoneTasks.twitch.channelLinks.push(t):s.includes("reddit")?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(i)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(i)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(i)||(s.includes("youtube")||s.includes("thumbs-up"))&&/(watch|like).*video/gim.test(i)?this.undoneTasks.youtube.likeLinks.push(t):s.includes("vk")||/join.*vk.*group/gim.test(i)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(i)||/follow.*button/gim.test(i)&&this.undoneTasks.steam.followLinks.push(t),void e(!0)):e(!1)).catch(t=>(O(t,"GiveeClub.classifyTask->getRedirectLink"),!1))}));return await Promise.all(i),s.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gcTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"GiveeClub.classifyTask"),!1}}};function Kn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Bn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Yn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Rn={maxPoint:"99999999"};var Hn=new WeakSet,qn=new WeakSet;async function Jn(t){try{for(const u of $(`.giveaways-page-item:contains('${t}'):not(:contains('ENTERED'))`)){var e,s,i,n,a,o,r,l=parseInt((null===(e=$(u).find(".giveaways-page-item-header-points").text().match(/[\d]+/gim))||void 0===e?void 0:e[0])||"999999",10),c=$(u).find(".giveaways-page-item-footer-name").text().trim();if("points"===t&&l>this.myPoints)C({}).warning(E("noPoints")+": "+c);else if("points"!==t||l){if(!("points"===t&&l>this.maxPoints)){const d=C({text:`${E("joiningLottery")}${c}...`}),h=$(u).find("a.giveaways-page-item-img-btn-enter:contains('enter')");if(null===h||void 0===h||null===(s=h.attr("onclick"))||void 0===s||!s.includes("checkUser")||(a=null===(i=h.attr("onclick"))||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0])&&checkUser(a),h.attr("href")){const{result:p,statusText:f,status:w,data:g}=await L({url:h.attr("href"),method:"GET"});"Success"===p?null!==g&&void 0!==g&&g.responseText&&/You've entered this giveaway/gim.test(g.responseText)?(d.success(),r=null===(o=g.responseText.match(/Points:[\s]*?([\d]+)/))||void 0===o?void 0:o[1],"points"===t&&r&&(this.myPoints=parseInt(r,10))):d.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`):d.error(p+`:${f}(${w})`)}else d.error('Error: No "href".')}}else C({}).warning(E("getNeedPointsFailed")+": "+c)}C({text:"-----END-----"})}catch(t){O(t,"OpiumPulses.toggleTask")}}function Xn(){try{return A.other.checkLogin?(1<$('a[href*="/site/login"]').length&&window.open("/site/login","_self"),!0):!0}catch(t){return O(t,"OpiumPulses.checkLogin"),!1}}var Zn=class{constructor(){Kn(this,qn),Kn(this,Hn),Bn(this,"name","OpiumPulses"),Bn(this,"options",{...Rn,...GM_getValue("OpiumPulsesOptions")}),Bn(this,"maxPoints",99999999),Bn(this,"myPoints",0),Bn(this,"buttons",["doFreeTask","doPointTask"])}static test(){return"www.opiumpulses.com"===window.location.host}async after(){try{Yn(this,qn,Xn).call(this)||C({}).warning(E("checkLoginFailed")),this.maxPoints=parseInt(this.options.maxPoint,10)}catch(t){O(t,"OpiumPulses.after")}}async doFreeTask(){try{Yn(this,Hn,Jn).call(this,"FREE")}catch(t){O(t,"OpiumPulses.doFreeTask")}}async doPointTask(){try{var t;this.myPoints=parseInt((null===(t=$(".page-header__nav-func-user-nav-items.points-items").text().match(/[\d]+/gim))||void 0===t?void 0:t[0])||"0",10),Yn(this,Hn,Jn).call(this,"points")}catch(t){O(t,"OpiumPulses.doPointTask")}}init(){return!0}classifyTask(){return!0}};function Qn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ta(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ea(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const sa={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},twitter:{userLinks:[],retweetLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var ia=new WeakSet;function na(t,e,s,i){try{$(t).after('${s.replace("Links","")}`)}catch(t){O(t,"keylol.addBtn")}}var aa=class extends Ei{constructor(){super(...arguments),Qn(this,ia),ta(this,"name","Keylol"),ta(this,"socialTasks",{...sa}),ta(this,"undoneTasks",{...sa}),ta(this,"buttons",["doTask","undoTask","selectAll","selectNone","invertSelect"])}static test(){var t;return"keylol.com"===window.location.host&&!(null===(t=$(".subforum_left_title_left_up a").eq(3).attr("href"))||void 0===t||!t.includes("319"))}init(){return!0}after(){try{var t="Keylol"===this.name?'#postlist>div[id^="post_"]:first':"div.container";const k=$(t);var e=k.find('a[href*="discord.com"]'),s=k.find('a[href*="reddit.com"]'),i=k.find('a[href*="instagram.com"]'),n=k.find('a[href*="twitter.com"]'),a=k.find('a[href*="twitch.tv"]'),o=k.find('a[href*="vk.com"]'),r=k.find('a[href*="store.steampowered.com"]'),l=k.find('a[href*="steamcommunity.com"]'),c=k.find('a[href*="youtube.com"]');if(0{e.getAttribute("selected")?e.removeAttribute("selected"):e.setAttribute("selected","selected")})}catch(t){O(t,"Keylol.invertSelect")}}};function oa(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ra(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function la(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const ca={steam:{groupLinks:[],wishlistLinks:[],followLinks:[],curatorLikeLinks:[]}};var ua=new WeakSet,da=new WeakSet;function ha(){try{var t,e=null===(t=window.location.href.match(/quests\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){return O(t,"Opquests.getGiveawayId"),!1}}function pa(){try{return A.other.checkLogin?(0<$('a[href*="/auth/redirect"]').length&&window.open("/auth/redirect","_self"),!0):!0}catch(t){return O(t,"Opquests.checkLogin"),!1}}t=class extends Ei{constructor(){super(...arguments),oa(this,da),oa(this,ua),ra(this,"name","Opquests"),ra(this,"undoneTasks",{...ca}),ra(this,"buttons",["doTask"])}static test(){return"opquests.com"===window.location.host}async after(){try{la(this,da,pa).call(this)||C({}).warning(E("checkLoginFailed"))}catch(t){O(t,"Opquests.after")}}init(){try{const t=C({text:E("initing")});return 0<$('a[href*="/auth/redirect"]').length?(window.open("/auth/redirect","_self"),t.warning(E("needLogin")),!1):!!la(this,ua,ha).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Opquests.init"),!1}}async classifyTask(t){try{if("undo"===t)return C({text:E("cannotUndo")}),!1;const i=C({text:E("getTasksInfo")});for(const n of $('.w-full:contains("Validate") .items-center')){var e=$(n).find('a:contains("Open")').attr("href"),s=$(n).find("div").eq(1).text().trim();e&&(/steamcommunity\.com\/groups\//.test(e)?this.undoneTasks.steam.groupLinks.push(e):/store\.steampowered\.com\/app\//.test(e)?/wishlist/gim.test(s)?this.undoneTasks.steam.wishlistLinks.push(e):/follow/gim.test(s)&&this.undoneTasks.steam.followLinks.push(e):/store\.steampowered\.com\/(publisher|developer)\//.test(e)&&/follow/gim.test(s)?this.undoneTasks.steam.curatorLikeLinks.push(e):C({}).warning(E("unKnownTaskType")+`: ${s}(${e})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),!0}catch(t){return O(t,"Opquests.classifyTask"),!1}}};function fa(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function wa(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ga(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const ma={steam:{groupLinks:[],wishlistLinks:[],followLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[],retweetLinks:[]},twitch:{channelLinks:[]},discord:{serverLinks:[]},youtube:{channelLinks:[]},extra:{gleam:[]}},va={vlootUsername:"",gameroundUsername:""};var ka=new WeakSet,ya=new WeakSet,ba=new WeakSet,Ta=new WeakSet,$a=new WeakSet;async function xa(){try{return await new Promise(t=>{const e=setInterval(()=>{0===$(".entry-content .entry-method i.fa-sync").length&&(clearInterval(e),t(!0))},500)})}catch(t){return O(t,"Gleam.checkSync"),!1}}async function Sa(e){try{const s=C({text:E("doingGleamTask")});return await new Promise(t=>{GM_openInTab(e+"?8b07d23f4bfa65f9",{active:!0,insert:!0,setParent:!0}).onclose=()=>{s.success(),t(!0)}})}catch(t){return O(t,"Gleam.doGleamTask"),!1}}function La(){try{var t=window.location.pathname;return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"Gleam.getGiveawayId"),!1}}async function _a(t){try{const i=C({text:E("gettingGleamLink")}),{result:n,statusText:a,status:o,data:r}=await L({url:t,method:"GET"});if("Success"!==n)return i.error(n+`:${a}(${o})`),!1;if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),!1;var e,s=null===(e=r.responseText.match(/href="(https:\/\/gleam\.io\/.*?\/.+?)"/))||void 0===e?void 0:e[1];return s?(i.success(),s):(i.error("Error:"+E("getLinkFailed")),!1)}catch(t){return O(t,"Gleam.getGleamLink"),!1}}async function Ia(){try{var e,s,i,n;if(!A.other.checkLeftKey)return!0;var a=null===(e=$("div.popup-blocks-container").attr("ng-init"))||void 0===e||null===(s=e.match(/initCampaign\(([\w\W]+?)\)$/))||void 0===s?void 0:s[1];if(!a)return!1;var o,r,l,c,{campaign:u,incentive:d}=JSON.parse(a),h=null===(i=$("div.campaign.reward").attr("ng-init"))||void 0===i||null===(n=i.match(/initContestant\(([\w\W]+?)\);/))||void 0===n?void 0:n[1];let t=!1;return h&&null!==(o=JSON.parse(h).contestant)&&void 0!==o&&null!==(r=o.claims)&&void 0!==r&&null!==(l=r.incentives)&&void 0!==l&&null!==(c=l[d.id])&&void 0!==c&&c.length&&(t=!0),(u.banned||u.finished&&!t||u.paused||(new Date).getTime()<1e3*u.starts_at)&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayNotWork"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0}catch(t){return O(t,"Gleam.checkLeftKey"),!1}}e=class extends Ei{constructor(){super(...arguments),fa(this,$a),fa(this,Ta),fa(this,ba),fa(this,ya),fa(this,ka),wa(this,"name","Gleam"),wa(this,"undoneTasks",{...ma}),wa(this,"socialTasks",{...ma}),wa(this,"options",{...va,...GM_getValue("GleamOptions")}),wa(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"gleam.io"===window.location.host}async after(){try{if(window.location.search.includes("8b07d23f4bfa65f9")){const s=setInterval(()=>{0<$(".entry-content .entry-method i.fa-check").length&&(clearInterval(s),window.close())});for(const i of $(".entry-content .entry-method")){const n=$(i).find(".user-links"),a=$(i).find(".expandable");var t=a.find("a.btn,a:contains(Continue),button:contains(Continue)");if(0!0)}catch(t){return O(t,"Gleam.extraDoTask"),!1}}async verifyTask(){try{C({text:E("verifyingTask")+"..."});for(const t of $(".entry-content .entry-method")){const e=$(t);if(0!==e.find("i.fa-question").length){const s=e.find(".user-links");s[0].click(),await G(500),await ga(this,ka,xa).call(this);for(const i of e.find(".expandable").find("span:contains(Continue),button:contains(Continue)"))i.click(),await G(500),await ga(this,ka,xa).call(this)}}C({text:E("verifiedGleamTasks")})}catch(t){return O(t,"Gleam.verifyTask"),!1}}};function Ga(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Ca(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Aa(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Ea={username:"",email:""};var Oa=new WeakSet,ja=new WeakSet,Wa=new WeakSet,Pa=new WeakSet;function Va(){try{return 0<$("#twitter_login_button").length&&$("#twitter_login_button")[0].click(),!0}catch(t){return O(t,"SweepWidget.checkLogin"),!1}}function Ma(){try{var t,e=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"SweepWidget.getGiveawayId"),!1}}async function Da(){try{return new Promise(t=>{const e=setInterval(()=>{0<$("#unlock_rewards_main_wrapper").length&&(clearInterval(e),t(!0))})})}catch(t){return O(t,"SweepWidget.checkEnter"),!1}}async function Fa(s){try{return new Promise(t=>{const e=setInterval(()=>{(0div.sw_entry")){const a=$(n);if(!(0 +`+s.stack)}var s=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(b(this,j,{auth:t}),s.success(),e(await T(this,V,z).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return O(t,"Discord.updateAuth"),!1}}async function B(t){try{const l=C({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:x(this,j).auth}});if("Success"!==i||200!==(null==o?void 0:o.status))return l.error(i+`:${n}(${a})`),!1;l.success();var r=String(null===(e=o.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(T(this,N,H).call(this,t,r),this.tasks.servers=I([...this.tasks.servers,t])),!0}catch(t){return O(t,"Discord.joinServer"),!1}}async function Y(t){try{if(this.whiteList.servers.includes(t))return C({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await T(this,U,R).call(this,t);if(!e)return!1;const o=C({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:a}=await L({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:x(this,j).auth}});return"Success"===s&&204===(null==a?void 0:a.status)?(o.success(),!0):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Discord.leaveServer"),!1}}async function R(t){try{const n=C({type:"gettingDiscordGuild",text:t});var e=x(this,W)[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==a||200!==(null===l||void 0===l?void 0:l.status))return n.error(a+`:${o}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),T(this,N,H).call(this,t,i),i):(n.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Discord.getGuild"),!1}}function H(t,e){try{x(this,W)[t]=e,GM_setValue("discordCache",x(this,W))}catch(t){O(t,"Discord.setCache")}}const q=class extends s{constructor(){var t;super(...arguments),m(this,N),m(this,U),m(this,F),m(this,M),m(this,D),m(this,V),y(this,"tasks",{..._}),y(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{..._}),v(this,j,{writable:!0,value:GM_getValue("discordAuth")||{}}),v(this,W,{writable:!0,value:GM_getValue("discordCache")||{}}),v(this,P,{writable:!0,value:!1})}async init(){try{return x(this,P)?!0:x(this,j).auth?await T(this,V,z).call(this)?(C({}).success(E("initSuccess","Discord")),b(this,P,!0),!0):(GM_setValue("discordAuth",{auth:null}),await T(this,D,K).call(this)?(C({}).success(E("initSuccess","Discord")),b(this,P,!0),!0):(C({}).error(E("initFailed","Discord")),!1)):!!await T(this,D,K).call(this)&&(b(this,P,!0),!0)}catch(t){return O(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!x(this,P))return C({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)C({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Discord.toggleServers"),!1}}};function J(t,e){Z(t,e),e.add(t)}function X(t,e,s){Z(t,e),e.set(t,s)}function Z(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Q(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function tt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,it(t,e,"set"),s),s}function et(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function st(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,it(t,e,"get"))}function it(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const nt={users:[]};var at=new WeakMap,ot=new WeakMap,rt=new WeakMap,lt=new WeakSet,ct=new WeakSet,ut=new WeakSet,dt=new WeakSet;async function ht(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Instagram.toggleUsers"),!1}}};function mt(t,e){kt(t,e),e.add(t)}function vt(t,e,s){kt(t,e),e.set(t,s)}function kt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function yt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function bt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,xt(t,e,"set"),s),s}function Tt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function $t(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,xt(t,e,"get"))}function xt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const St={reddits:[]};var Lt=new WeakMap,It=new WeakMap,_t=new WeakSet,Gt=new WeakSet;async function Ct(){try{const s=C({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await Tt(this,Gt,At).call(this,!0))}})}catch(t){return O(t,"Reddit.useBeta"),!1}}async function At(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return O(t,"Reddit.toggle"),!1}}};function Ot(t,e){Wt(t,e),e.add(t)}function jt(t,e,s){Wt(t,e),e.set(t,s)}function Wt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Pt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Vt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ft(t,e,"set"),s),s}function Dt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Mt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ft(t,e,"get"))}function Ft(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ut={channels:[]};var Nt=new WeakMap,zt=new WeakMap,Kt=new WeakMap,Bt=new WeakSet,Yt=new WeakSet,Rt=new WeakSet,Ht=new WeakSet,qt=new WeakSet;async function Jt(){try{const r=C({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:a,data:o}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Mt(this,Nt).authToken,"Client-Id":Mt(this,Nt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==o?void 0:o.status)&&null!==(t=o.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1):(r.error(i+`:${n}(${a})`),!1)}catch(t){return O(t,"Twitch.verifyAuth"),!1}}async function Xt(){try{const s=C({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Vt(this,Nt,t),s.success(),e(await Dt(this,Bt,Jt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return O(t,"Twitch.updateAuth"),!1}}async function Zt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return C({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Dt(this,Ht,Qt).call(this,e);if(!s)return!1;const c=C({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:a,statusText:o,status:r,data:l}=await L({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Mt(this,Nt).authToken},data:t?i:n});return"Success"===a?200===(null==l?void 0:l.status)?(c.success(),t&&(this.tasks.channels=I([...this.tasks.channels,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Twitch.toggleChannel"),!1}}async function Qt(t){try{const d=C({type:"gettingTwitchChannelId",text:t});var e=Mt(this,zt)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:a}=await L({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Mt(this,Nt).authToken,"Client-Id":Mt(this,Nt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==a?void 0:a.status))return d.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1;var o,r,l,c,u=String(null===(o=a.response)||void 0===o||null===(r=o[0])||void 0===r||null===(l=r.data)||void 0===l||null===(c=l.user)||void 0===c?void 0:c.id);return u?(Dt(this,qt,te).call(this,t,u),d.success(),u):(d.error(`Error:${a.statusText}(${a.status})`),!1)}catch(t){return O(t,"Twitch.getChannelId"),!1}}function te(t,e){try{Mt(this,zt)[t]=e,GM_setValue("twitchCache",Mt(this,zt))}catch(t){O(t,"Twitch.setCache")}}const ee=class extends s{constructor(){var t;super(...arguments),Ot(this,qt),Ot(this,Ht),Ot(this,Rt),Ot(this,Yt),Ot(this,Bt),Pt(this,"tasks",{...Ut}),Pt(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Ut}),jt(this,Nt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),jt(this,zt,{writable:!0,value:GM_getValue("twitchCache")||{}}),jt(this,Kt,{writable:!0,value:!1})}async init(){try{return Mt(this,Kt)?!0:Mt(this,Nt).authToken?await Dt(this,Bt,Jt).call(this)?(C({}).success(E("initSuccess","Twitch")),Vt(this,Kt,!0),!0):(GM_setValue("twitchAuth",null),await Dt(this,Yt,Xt).call(this)?(C({}).success(E("initSuccess","Twitch")),Vt(this,Kt,!0),!0):(C({}).error(E("initFailed","Twitch")),!1)):!!await Dt(this,Yt,Xt).call(this)&&(Vt(this,Kt,!0),!0)}catch(t){return O(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Mt(this,Kt))return C({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)C({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return O(t,"Twitch.toggle"),!1}}};function se(t,e){ne(t,e),e.add(t)}function ie(t,e,s){ne(t,e),e.set(t,s)}function ne(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ae(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function oe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ce(t,e,"set"),s),s}function re(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function le(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ce(t,e,"get"))}function ce(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ue={users:[],retweets:[],likes:[]};var de=new WeakMap,he=new WeakMap,pe=new WeakMap,fe=new WeakMap,we=new WeakSet,ge=new WeakSet,me=new WeakSet,ve=new WeakSet,ke=new WeakSet;async function ye(){try{return await re(this,me,Te).call(this,{name:"verify",doTask:!0,verify:!0})}catch(t){return O(t,"Twitter.verifyAuth"),!1}}async function be(){try{const s=C({text:E("updatingAuth","Twitter")});return await new Promise(e=>{const t=GM_openInTab("https://twitter.com/settings/account?k#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitterAuth");t?(oe(this,he,t),s.success(),e(await re(this,we,ye).call(this))):(s.error("Error: Update twitter auth failed!"),e(!1))}})}catch(t){return O(t,"Twitter.updateToken"),!1}}async function Te(t){var{name:e,doTask:s=!0,verify:t=!1}=t;try{if(!s&&!t&&this.whiteList.users.includes(e))return C({type:"whiteList",text:"Twitter.unfollowUser",id:e}),!0;var i=t?le(this,de):await this.userName2id(e);if(!i)return!1;const d=t?C({text:E("verifyingAuth","Twitter")}):C({type:`${s?"":"un"}followingTwitterUser`,text:e});var n,a,o,{result:r,statusText:l,status:c,data:u}=await L({url:`https://api.twitter.com/1.1/friendships/${s?"create":"destroy"}.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},responseType:"json",data:$.param({include_profile_interstitial_type:1,include_blocking:1,include_blocked_by:1,include_followed_by:1,include_want_retweets:1,include_mute_edge:1,include_can_dm:1,include_can_media_tag:1,skip_status:1,id:i})});return"Success"===r?200===(null==u?void 0:u.status)?(d.success(),s&&!t&&(this.tasks.users=I([...this.tasks.users,e])),!0):t&&403===(null==u?void 0:u.status)&&158===(null===(n=u.response)||void 0===n||null===(a=n.errors)||void 0===a||null===(o=a[0])||void 0===o?void 0:o.code)?(d.success(),!0):(d.error(`Error:${null==u?void 0:u.statusText}(${null==u?void 0:u.status})`),!1):(d.error(r+`:${l}(${c})`),!1)}catch(t){return O(t,"Twitter.toggleUser"),!1}}async function $e(t){var{retweetId:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.retweets.includes(e))return C({type:"whiteList",text:"Twitter.unretweet",id:e}),!0;const c=C({type:`${t?"":"un"}retweetting`,text:e});var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:`https://api.twitter.com/1.1/statuses/${t?"":"un"}retweet.json`,method:"POST",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","Content-Type":"application/x-www-form-urlencoded","x-csrf-token":le(this,he).ct0},data:$.param({tweet_mode:"extended",id:e}),responseType:"json"});return"Success"===a?200===(null==l?void 0:l.status)||403===(null==l?void 0:l.status)&&327===(null===(s=l.response)||void 0===s||null===(i=s.errors)||void 0===i||null===(n=i[0])||void 0===n?void 0:n.code)?(c.success(),t&&(this.tasks.retweets=I([...this.tasks.retweets,e])),!0):(c.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(c.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Twitter.toggleRetweet"),!1}}function xe(t,e){try{le(this,pe)[t]=e,GM_setValue("twitterCache",le(this,pe))}catch(t){O(t,"Twitter.setCache")}}const Se=class extends s{constructor(){var t;super(...arguments),se(this,ke),se(this,ve),se(this,me),se(this,ge),se(this,we),ae(this,"tasks",{...ue}),ae(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitter)||{...ue}),ie(this,de,{writable:!0,value:A.other.twitterVerifyId}),ie(this,he,{writable:!0,value:GM_getValue("twitterAuth")||{}}),ie(this,pe,{writable:!0,value:GM_getValue("twitterCache")||{}}),ie(this,fe,{writable:!0,value:!1})}async init(){try{return le(this,fe)?!0:le(this,he).ct0?await re(this,we,ye).call(this)?(C({}).success(E("initSuccess","Twitter")),oe(this,fe,!0),!0):(GM_setValue("twitterAuth",null),await re(this,ge,be).call(this)?(C({}).success(E("initSuccess","Twitter")),oe(this,fe,!0),!0):(C({}).error(E("initFailed","Twitter")),!1)):!!await re(this,ge,be).call(this)&&(oe(this,fe,!0),!0)}catch(t){return O(t,"Twitter.init"),!1}}async userName2id(t){try{const u=C({type:"gettingTwitterUserId",text:t});var e=le(this,pe)[t];if(e)return u.success(),e;var s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:"https://api.twitter.com/graphql/-xfUfZsnR_zqjFd-IfrN5A/UserByScreenName"+`?variables=%7B%22screen_name%22%3A%22${t}%22%2C%22withHighlightedLabel%22%3Atrue%7D`,method:"GET",headers:{authorization:"Bearer AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA","content-type":"application/json"},responseType:"json",anonymous:!0});if("Success"!==a)return u.error(a+`:${o}(${r})`),!1;if(200!==(null==l?void 0:l.status))return u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1;{let e=l.response||("object"==typeof l.responseText?l.responseText:null);if(!e)try{e=JSON.parse(l.responseText)}catch(t){e=null}var c=String(null===(s=e)||void 0===s||null===(i=s.data)||void 0===i||null===(n=i.user)||void 0===n?void 0:n.rest_id);return c?(re(this,ke,xe).call(this,t,c),u.success(),c):(u.error(`Error:${l.statusText}(${l.status})`),!1)}}catch(t){return O(t,"Twitter.getUserId"),!1}}async toggle(t){var{doTask:e=!0,userLinks:s=[],retweetLinks:t=[]}=t;try{if(!le(this,fe))return C({text:E("needInit")}),!1;const a=[];if(e&&!A.doTask.twitter.users||!e&&!A.undoTask.twitter.users)C({type:"globalOptionsSkip",text:"twitter.users"});else{var i=this.getRealParams("users",s,e,t=>{return null===(t=t.match(/https:\/\/twitter\.com\/(.+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/https:\/\/twitter\.com\/.*?\/status\/([\d]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Twitter.toggle"),!1}}};function Le(t,e){_e(t,e),e.add(t)}function Ie(t,e,s){_e(t,e),e.set(t,s)}function _e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ge(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ce(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Oe(t,e,"set"),s),s}function Ae(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Oe(t,e,"get"))}function Oe(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const je={names:[]};var We=new WeakMap,Pe=new WeakMap,Ve=new WeakMap,De=new WeakSet,Me=new WeakSet,Fe=new WeakSet,Ue=new WeakSet,Ne=new WeakSet,ze=new WeakSet,Ke=new WeakSet,Be=new WeakSet;async function Ye(){try{const e=C({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==a&&void 0!==a&&a.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===a||void 0===a?void 0:a.status)?(Ce(this,We,(null===(t=a.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Vk.verifyAuth"),!1}}async function Re(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return O(t,"Vk.toggle"),!1}}};function es(t,e){is(t,e),e.add(t)}function ss(t,e,s){is(t,e),e.set(t,s)}function is(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ns(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function as(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ls(t,e,"set"),s),s}function os(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function rs(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ls(t,e,"get"))}function ls(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const cs={channels:[],likes:[]},us=async function(t,e){try{const h=C({text:E("gettingYtbToken")}),{result:p,statusText:f,status:w,data:g}=await L({url:t,method:"GET"});if("Success"!==p)return h.error(p+`:${f}(${w})`),{};if(200!==(null===g||void 0===g?void 0:g.status))return h.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`),{};{var s,i;if(g.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=g.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],a=(null===(i=g.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||g.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:m,request:v}=JSON.parse(a);if(n&&m&&v){if(m.hl="en","channel"===e){var o,r=null===(o=g.responseText.match(//))||void 0===o?void 0:o[1];return r?(h.success(),{params:{apiKey:n,client:m,request:v,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,c,u=null===(l=g.responseText.match(//))||void 0===l?void 0:l[1],d=null===(c=g.responseText.match(/"likeParams":"(.*?)"/))||void 0===c?void 0:c[1];return u?(h.success(),{params:{apiKey:n,client:m,request:v,videoId:u,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return O(t,"Youtube.getInfo"),{}}};var ds=new WeakMap,hs=new WeakMap,ps=new WeakMap,fs=new WeakSet,ws=new WeakSet,gs=new WeakSet,ms=new WeakSet,vs=new WeakSet;class ks extends s{constructor(){var t;super(...arguments),es(this,vs),es(this,ms),es(this,gs),es(this,ws),es(this,fs),ns(this,"tasks",{...cs}),ns(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...cs}),ss(this,ds,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),ss(this,hs,{writable:!0,value:!1}),ss(this,ps,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return rs(this,hs)?!0:rs(this,ds).PAPISID?await os(this,fs,ys).call(this)?(C({}).success(E("initSuccess","Youtube")),as(this,hs,!0),!0):(GM_setValue("youtubeAuth",null),await os(this,ws,bs).call(this)?(C({}).success(E("initSuccess","Youtube")),as(this,hs,!0),!0):(C({}).error(E("initFailed","Youtube")),!1)):!!await os(this,ws,bs).call(this)&&(as(this,hs,!0),!0)}catch(t){return O(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!rs(this,hs))return C({text:E("needInit")}),!1;const a=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)C({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return O(t,"Youtube.toggle"),!1}}}async function ys(){try{return await os(this,ms,$s).call(this,{link:rs(this,ps),doTask:!0,verify:!0})}catch(t){return O(t,"Youtube.verifyAuth"),!1}}async function bs(){try{const s=C({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(as(this,ds,t),s.success(),os(this,fs,ys).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return O(t,"Discord.updateAuth"),!1}}function Ts(t,e){return us(t,e)}async function $s(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await os(this,gs,Ts).call(this,e,"channel"),{apiKey:a,client:o,request:r,channelId:l}=i||{};if(n)return C({html:E("loginYtb")}),!1;if(!(a&&o&&r&&l))return C({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return C({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const u=t?C({text:E("verifyingAuth","Youtube")}):C({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var c=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:p,data:f}=await L({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+a,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==o?void 0:o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:o,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===f||void 0===f?void 0:f.status)?s&&(/"subscribed": true/.test(f.responseText)||f.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(f.responseText)?(u.success(),s&&!t&&(this.tasks.channels=I([...this.tasks.channels,e])),!0):t&&f.responseText.includes("You may not subscribe to yourself")?(u.success(),!0):(u.error(E("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),!1):(u.error(d+`:${h}(${p})`),!1)}catch(t){return O(t,"Youtube.toggleChannel"),!1}}async function xs(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await os(this,gs,Ts).call(this,e,"likeVideo"),{apiKey:n,client:a,request:o,videoId:r,likeParams:l}=s||{};if(i)return C({html:""+E("loginYtb")}),!1;if(!(n&&a&&o&&r&&l))return C({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return C({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const u=C({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var c=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:a,request:{sessionId:o.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return u.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:p,status:f,data:w}=await L({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${c}_`+sha1(`${c} ${rs(this,ds).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(u.success(),t&&(this.tasks.likes=I([...this.tasks.likes,e])),!0):(u.error(E("tryUpdateYtbAuth"),!0),!1):(u.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(u.error(h+`:${p}(${f})`),!1)}catch(t){return O(t,"Youtube.toggleLikeVideo"),!1}}function Ss(t,e){Is(t,e),e.add(t)}function Ls(t,e,s){Is(t,e),e.set(t,s)}function Is(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _s(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Gs(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Es(t,e,"set"),s),s}function Cs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function As(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Es(t,e,"get"))}function Es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Os={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var js=new WeakMap,Ws=new WeakMap,Ps=new WeakMap,Vs=new WeakMap,Ds=new WeakSet,Ms=new WeakSet,Fs=new WeakSet,Us=new WeakSet,Ns=new WeakSet,zs=new WeakSet,Ks=new WeakSet,Bs=new WeakSet,Ys=new WeakSet,Rs=new WeakSet,Hs=new WeakSet,qs=new WeakSet,Js=new WeakSet,Xs=new WeakSet,Zs=new WeakSet,Qs=new WeakSet,ti=new WeakSet,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet;async function ai(){try{const s=C({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${a})`),!1;if(200!==(null===o||void 0===o?void 0:o.status))return s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1;var t;if(o.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=o.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(As(this,Ws).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return O(t,"Steam.updateStoreAuth"),!1}}async function oi(){try{const o=C({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:c,data:u}=await L({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return o.error(r+`:${l}(${c})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;var t,e,s;if(u.responseText.includes('href="https://steamcommunity.com/login/home/'))return o.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=u.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=u.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],a=null===(s=u.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(As(this,Ws).steam64Id=i),a&&(As(this,Ws).userName=a),n)?(As(this,Ws).communitySessionID=n,o.success(),!0):(o.error('Error: Get "sessionID" failed'),!1)}catch(t){return O(t,"Steam.updateCommunityAuth"),!1}}async function ri(){try{const i=C({text:E("gettingAreaInfo")}),{result:n,statusText:a,status:o,data:r}=await L({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${a}(${o})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return C({text:"noAnotherArea"}),!1;[t]=s}const l=C({text:E("changingArea",t)});var{result:i,statusText:n,status:a,data:o}=await L({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:As(this,Ws).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${a})`),"CN";if(200!==(null==o?void 0:o.status)||"true"!==o.responseText)return l.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),"CN";var r=(await Cs(this,Fs,ri).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return O(t,"Steam.changeArea"),!1}}async function ci(t){try{const e=C({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:As(this,Ws).communitySessionID})});return"Success"===s?200!==(null===a||void 0===a?void 0:a.status)||a.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(e.success(),this.tasks.groups=I([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Steam.joinGroup"),!1}}async function ui(t){try{if(this.whiteList.groups.includes(t))return C({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Cs(this,Ks,di).call(this,t);if(!e)return!1;const s=C({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:a,data:o}=await L({url:`https://steamcommunity.com/id/${As(this,Ws).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:As(this,Ws).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===o||void 0===o?void 0:o.status)&&o.finalUrl.includes("groups")&&0===$(o.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(s.error(i+`:${n}(${a})`),!1)}catch(t){return O(t,"Steam.leaveGroup"),!1}}async function di(t){try{const n=C({type:"gettingSteamGroupId",text:t});var e=As(this,js).group[t];if(e)return n.success(),e;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==a)return n.error(a+`:${o}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Cs(this,ni,Si).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return O(t,"Steam.getGroupID"),!1}}async function hi(t){try{var e;const n=C({type:"addingToWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:As(this,Ws).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=I([...this.tasks.wishlists,t]),!0;const{result:a,statusText:o,status:r,data:l}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===a?200===(null===l||void 0===l?void 0:l.status)?"CN"===As(this,Vs)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Cs(this,Us,li).call(this)&&await Cs(this,Bs,hi).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=I([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(a+`:${o}(${r})`),!1)}catch(t){return O(t,"Steam.addToWishlist"),!1}}async function pi(t){try{var e;if(this.whiteList.wishlists.includes(t))return C({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const a=C({type:"removingFromWishlist",text:t});var{result:s,data:i}=await L({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:As(this,Ws).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return a.success(),!0;const{result:o,statusText:r,status:l,data:c}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==o)return a.error(o+`:${r}(${l})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;if("CN"===As(this,Vs)&&c.responseText.includes('id="error_box"')){a.warning(E("changeAreaNotice"));var n=await Cs(this,Us,li).call(this);return n&&"CN"!==n&&"skip"!==n?await Cs(this,Ys,pi).call(this,t):!1}return c.responseText.includes('class="queue_actions_ctn"')&&(c.responseText.includes("ds_owned_flag ds_flag")||c.responseText.includes("add_to_wishlist_area"))?(a.success(),!0):(a.error(`Error:${c.statusText}(${c.status})`),!1)}catch(t){return O(t,"Steam.removeFromWishlist"),!1}}async function fi(t,e){try{if(!e&&this.whiteList.follows.includes(t))return C({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const a=C({type:`${e?"":"un"}followingGame`,text:t}),o={sessionid:As(this,Ws).storeSessionID,appid:t};e||(o.unfollow="1");var{result:s,data:i}=await L({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(o)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return a.success(),!0;var n=await Cs(this,Hs,wi).call(this,t);return"CN"===As(this,Vs)&&"areaLocked"===n?(a.warning(E("changeAreaNotice")),!!await Cs(this,Us,li).call(this)&&await Cs(this,Ys,pi).call(this,t)):e===n?(a.success(),e&&(this.tasks.follows=I([...this.tasks.follows,t])),!0):(a.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return O(t,"Steam.toggleFollowGame"),!1}}async function wi(t){try{const{result:e,data:s}=await L({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===As(this,Vs)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return O(t,"Steam.isFollowedGame"),!1}}async function gi(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Cs(this,ni,Si).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return O(t,"Steam.getWorkshopAppId"),!1}}async function yi(t){try{const o=C({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:a}=await L({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:As(this,Ws).communitySessionID})});return"Success"===s?(200===(null==a?void 0:a.status)&&1===(null===(e=a.response)||void 0===e?void 0:e.success)?o.success():o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!0):(o.error(s+`:${i}(${n})`),!0)}catch(t){return O(t,"Steam.voteupWorkshop"),!0}}async function bi(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),m=this.getRealParams("curatorLikes",c,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==As(this,Vs)&&(C({}).warning(E("steamFinishNotice")),await Cs(this,Us,li).call(this,"CN")),!0))}catch(t){return O(t,"Steam.toggle"),!1}}};function Ii(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function _i(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Gi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Ci=new WeakSet;async function Ai(e,t){try{return{name:e,result:await t}}catch(t){return O(t,"Website.bind"),{name:e,result:!1}}}var Ei=class{constructor(){Ii(this,Ci),_i(this,"undoneTasks",void 0),_i(this,"socialTasks",void 0),_i(this,"giveawayId",void 0),_i(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,twitter:!1,vk:!1,youtube:!1,steam:!1}),_i(this,"initialized",!1),_i(this,"social",{})}async initSocial(t){try{const s=[];var e="do"===t?this.undoneTasks:this.socialTasks;return e.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new q,s.push(Gi(this,Ci,Ai).call(this,"discord",this.social.discord.init()))),e.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new gt,s.push(Gi(this,Ci,Ai).call(this,"instagram",this.social.instagram.init()))),e.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new Et,s.push(Gi(this,Ci,Ai).call(this,"reddit",this.social.reddit.init()))),e.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new ee,s.push(Gi(this,Ci,Ai).call(this,"twitch",this.social.twitch.init()))),e.twitter&&0[...t,...e]).length&&!this.socialInitialized.twitter&&(this.social.twitter=new Se,s.push(Gi(this,Ci,Ai).call(this,"twitter",this.social.twitter.init()))),e.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new ts,s.push(Gi(this,Ci,Ai).call(this,"vk",this.social.vk.init()))),e.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new ks,s.push(Gi(this,Ci,Ai).call(this,"youtube",this.social.youtube.init()))),e.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new Li,s.push(Gi(this,Ci,Ai).call(this,"steam",this.social.steam.init()))),e.links&&0{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return O(t,"Website.initSocial"),!1}}uniqueTasks(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,a]of Object.entries(i))e[s][n]=I(a)}return e}async toggleTask(t){try{if(!this.initialized&&!this.init())return!1;if(!await this.classifyTask(t))return!1;if(!await this.initSocial(t))return!1;const i=[];var e="do"===t,s=e?this.undoneTasks:this.socialTasks;if(this.social.discord&&i.push(this.social.discord.toggle({doTask:e,...s.discord})),this.social.instagram&&i.push(this.social.instagram.toggle({doTask:e,...s.instagram})),this.social.reddit&&i.push(this.social.reddit.toggle({doTask:e,...s.reddit})),this.social.twitch&&i.push(this.social.twitch.toggle({doTask:e,...s.twitch})),this.social.twitter&&i.push(this.social.twitter.toggle({doTask:e,...s.twitter})),this.social.vk&&i.push(this.social.vk.toggle({doTask:e,...s.vk})),this.social.youtube&&i.push(this.social.youtube.toggle({doTask:e,...s.youtube})),this.social.steam&&i.push(this.social.steam.toggle({doTask:e,...s.steam})),this.social.visitLink&&s.links&&e)for(const n of s.links)i.push(this.social.visitLink(n));return e&&s.extra&&this.extraDoTask&&0[...t,...e]).length&&i.push(this.extraDoTask(s.extra)),await Promise.all(i),C({}).success(E("allTasksComplete")),!0}catch(t){return O(t,"Website.toggleTask"),!1}}async doTask(){try{return await this.toggleTask("do")}catch(t){return O(t,"Website.doTask"),!1}}async undoTask(){try{return await this.toggleTask("undo")}catch(t){return O(t,"Website.undoTask"),!1}}};function Oi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ji(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Wi(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Pi={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],followLinks:[]},vk:{nameLinks:[]}};var Vi=new WeakSet,Di=new WeakSet;function Mi(){try{var t,e=null===(t=window.location.href.match(/\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){O(t,"FreeAnyWhere.getGiveawayId")}}async function Fi(t){try{const o=C({html:`
  • ${E("verifyingTask")}${t.title.trim()}...
  • `});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/challenge-status/${t.id}/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.status?(o.success(),!0):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"Freeanywhere.verify"),!1}}var Ui=class extends Ei{constructor(){super(...arguments),Oi(this,Di),Oi(this,Vi),ji(this,"name","FreeAnyWhere"),ji(this,"tasks",[]),ji(this,"socialTasks",{...Pi}),ji(this,"undoneTasks",{...Pi}),ji(this,"buttons",["doTask","undoTask","verifyTask","getKey"])}static test(){return"freeanywhere.net"===window.location.host}init(){try{const s=C({text:E("initing")});if(0<$('a[href="#/login"]').length)return window.open("/#/login","_self"),s.warning(E("needLogin")),!1;if(window.location.href.includes("/login"))return s.warning(E("needLogin")),!1;if(!/^https?:\/\/freeanywhere\.net\/#\/giveaway\/[\d]+/.test(window.location.href)){var t,e=null===(t=window.location.href.match(/https?:\/\/freeanywhere\.net\/.*?#\/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];if(!e)return s.error(E("getFailed","Id")),!1;window.location.href="https://freeanywhere.net/#/giveaway/"+e}return Wi(this,Vi,Mi).call(this)?(this.initialized=!0,s.success(),!0):!1}catch(t){return O(t,"Freeanywhere.init"),!1}}async classifyTask(t){try{const u=C({text:E("getTasksInfo")});var e;"undo"===t&&(this.socialTasks=(null===(e=GM_getValue("fawTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||{...Pi});var{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/?format=json`,method:"GET",headers:{authorization:"Token "+window.localStorage.getItem("token"),"x-csrftoken":f.get("csrftoken")},responseType:"json"});if("Success"!==s)return u.error(s+`:${i}(${n})`),!1;var o,r=null==a||null===(o=a.response)||void 0===o?void 0:o.challenges;if(r){"verify"===t&&(this.tasks=[]);for(const d of r){var l=d.challenge,c=d.challenge_provider;const h={id:d.id,title:d.title};if("verify"!==t||d.is_success)switch(c){case"steam":switch(h.social="steam",l){case"WL":"undo"===t&&this.socialTasks.steam.wishlistLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.wishlistLinks.push(d.link);break;case"JTG":"undo"===t&&this.socialTasks.steam.groupLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.groupLinks.push(d.link);break;case"STC":"undo"===t&&this.socialTasks.steam.curatorLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.curatorLinks.push(d.link);break;case"GF":"undo"===t&&this.socialTasks.steam.followLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.steam.followLinks.push(d.link)}break;case"vk-oauth2":"undo"===t&&this.socialTasks.vk.nameLinks.push(d.link),"do"!==t||d.is_success||this.undoneTasks.vk.nameLinks.push(d.link);break;case"website":break;default:C({}).warning(E("unKnownTaskType")+": "+c)}else this.tasks.push(h)}return u.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("fawTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}return u.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),console.error(a),!1}catch(t){return O(t,"Freeanywhere.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;const t=[];for(const e of this.tasks)t.push(Wi(this,Di,Fi).call(this,e)),await G(1e3);return await Promise.all(t),C({}).success(E("allTasksComplete")),!!await this.getKey(!0)}catch(t){return O(t,"Freeanywhere.verifyTask"),!1}}async getKey(t){try{if(!t&&!this.initialized&&!this.init())return!1;const o=C({text:E("gettingKey")});var e,{result:s,statusText:i,status:n,data:a}=await L({url:`https://freeanywhere.net/api/v1/giveaway/${this.giveawayId}/reward/?format=json`,method:"GET",dataType:"json",headers:{authorization:"Token "+window.localStorage.getItem("token")}});return"Success"===s?null!=a&&null!==(e=a.response)&&void 0!==e&&e.reward?(o.success(),C({}).success(a.response.reward),a.response.reward):(o.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(o.error(s+`:${i}(${n})`),!1)}catch(t){return O(t,"FreeAnyWhere.getGiveawayId"),!1}}};function Ni(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function zi(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ki(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Bi={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var Yi=new WeakSet,Ri=new WeakSet,Hi=new WeakSet;class qi extends Ei{constructor(){super(...arguments),Ni(this,Hi),Ni(this,Ri),Ni(this,Yi),zi(this,"name","GiveawaySu"),zi(this,"socialTasks",Bi),zi(this,"undoneTasks",Bi),zi(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Ki(this,Yi,Ji).call(this)||C({}).warning(E("checkLoginFailed")),await Ki(this,Ri,Xi).call(this)||C({}).warning(E("checkLeftKeyFailed")),C({}).warning(E("gsNotice"))}catch(t){O(t,"Giveawaysu.after")}}init(){try{const t=C({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Ki(this,Hi,Zi).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Giveawaysu.init"),!1}}async classifyTask(t){try{const i=C({text:E("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gasTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||Bi,!0;const n=[];var s=$("#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 r of s)n.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(a.includes("steam")&&/join/gi.test(o)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(o)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(o)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):a.includes("steam")&&/follow|subscribe/gim.test(o)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(o)?this.undoneTasks.steam.forumLinks.push(t):a.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):a.includes("discord")||/join.*discord/gim.test(o)?this.undoneTasks.discord.serverLinks.push(t):a.includes("instagram")||/follow.*instagram/gim.test(o)?this.undoneTasks.instagram.userLinks.push(t):a.includes("twitch")||/follow.*twitch.*channel/gim.test(o)?this.undoneTasks.twitch.channelLinks.push(t):a.includes("reddit")||/subscribe.*subreddit/gim.test(o)||/follow.*reddit/gim.test(o)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(o)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(o)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(o)||(a.includes("youtube")||a.includes("thumbs-up"))&&/(watch|like).*video/gim.test(o)?this.undoneTasks.youtube.likeLinks.push(t):a.includes("vk")||/join.*vk.*group/gim.test(o)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(o)||(/wishlist.*game|add.*wishlist/gim.test(o)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(o)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(O(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(n),i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gasTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Giveawaysu.classifyTask"),!1}}}function Ji(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return O(t,"Giveawaysu.checkLogin"),!1}}async function Xi(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Giveawaysu.checkLeftKey"),!1}}function Zi(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}function Qi(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function tn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function en(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var sn=new WeakSet,nn=new WeakSet,an=new WeakSet,on=new WeakSet;async function rn(){try{if(0<$("a.buttonenter:contains(Register to join)").length)return C({}).error(E("needLogin")),!1;const c=$("a.buttonenter.buttongiveaway");if(/join giveaway/gim.test(c.text())){const u=C({text:E("joiningGiveaway")+"..."});var t,e,s,i,n,{result:a,statusText:o,status:r,data:l}=await L({url:c.attr("href"),method:"POST",data:"ajax=t",dataType:"json",headers:{"content-type":"application/x-www-form-urlencoded; charset=UTF-8",accept:"application/json, text/javascript, */*; q=0.01",origin:window.location.origin}});return"Success"===a?200===(null==l?void 0:l.status)?null!==(t=l.response)&&void 0!==t&&t.success?(c.addClass("buttonentered").text("Success - Giveaway joined"),$("#giveawaysjoined").slideDown(),$("#giveawaysrecommend").slideDown(),u.success("Success"+(null!==(i=l.response)&&void 0!==i&&i.text?":"+(null===(n=l.response)||void 0===n?void 0:n.text):"")),!0):(u.error("Error"+(null!==(e=l.response)&&void 0!==e&&e.text?":"+(null===(s=l.response)||void 0===s?void 0:s.text):"")),!1):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(a+`:${o}(${r})`),!1)}return/success/gim.test($("a.buttonenter.buttongiveaway").text())?!0:(C({}).warning(E("needJoinGiveaway")),!1)}catch(t){return O(t,"Indiedb.init"),!1}}async function ln(){try{const e=$("script").map((t,e)=>{var s,i,n,a,o;return/\$\(document\)/gim.test(e.innerHTML)?[null===(s=e.innerHTML.match(/"\/[\d]+"/gim))||void 0===s||null===(i=s[0])||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0],null===(e=e.innerHTML.match(/"\/newsletter\/ajax\/subscribeprofile\/optin\/[\d]+"/gim))||void 0===e||null===(a=e[0])||void 0===a||null===(o=a.match(/[\d]+/))||void 0===o?void 0:o[0]]:null});if(2!==e.length)return C({}).error(E("getFailed","TaskId")),!1;{const s=[];for(const t of $("#giveawaysjoined a[class*=promo]")){const n=$(t);if(!n.hasClass("buttonentered")){const a=C({text:`${E("doing")}:${n.parents("p").text()}...`});if(/facebookpromo|twitterpromo|visitpromo/gim.test(t.className)){let t="";t=n.hasClass("facebookpromo")?"facebookpromo":n.hasClass("twitterpromo")?"twitterpromo":"visitpromo",s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(`/giveaways/ajax/${t}/`+e[0]),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.addClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}else n.hasClass("emailoptinpromo")?s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath("/newsletter/ajax/subscribeprofile/optin/"+e[1]),timeout:6e4,dataType:"json",data:{ajax:"t",emailsystoggle:4},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):n.hasClass("watchingpromo")?s.push(new Promise(i=>{var t;const e=(t=>{try{const i={};return t?t.includes("?")&&t.split("?")[1].replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)):window.location.search.replace(/([^?&=]+)=([^&]+)/g,(t,e,s)=>(i[e]=s,t)),i}catch(t){return O(t,"getUrlQuery"),{}}})(n.attr("href"));e.ajax="t",$.ajax({type:"POST",url:urlPath(null===(t=n.attr("href"))||void 0===t?void 0:t.split(/[?#]/)[0]),timeout:6e4,dataType:"json",data:e,error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})})):/the-challenge-of-adblock/gim.test(n.attr("href"))?a.error("Error:"+E("unKnownTaskType")):s.push(new Promise(i=>{$.ajax({type:"POST",url:urlPath(n.attr("href")),timeout:6e4,dataType:"json",data:{ajax:"t"},error(t,e,s){console.log({response:t,error:e,exception:s}),a.error("Error:An error has occurred performing the action requested. Please try again shortly."),i(!0)},success(t){console.log(t),t.success?(a.success("Success:"+t.text),n.toggleClass("buttonentered").closest("p").html(n.closest("p").find("span").html())):a.error("Error:"+t.text),i(!0)}})}))}}return await Promise.all(s),C({}).success(E("allTasksComplete")),!0}}catch(t){return O(t,"Indiedb.classifyTask"),!1}}function cn(){try{return A.other.checkLogin?(0<$("a.buttonenter:contains(Register to join)").length&&window.open("/members/login","_self"),!0):!0}catch(t){return O(t,"Indiedb.checkLogin"),!1}}async function un(){try{return A.other.checkLeftKey?(0<$('a.buttonenter:contains("next time")').length&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayEnded"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Indiedb.checkLeftKey"),!1}}var dn=class{constructor(){Qi(this,on),Qi(this,an),Qi(this,nn),Qi(this,sn),tn(this,"name","Indiedb"),tn(this,"buttons",["doTask"])}static test(){return"www.indiedb.com"===window.location.host}async after(){try{en(this,an,cn).call(this)||C({}).warning(E("checkLoginFailed")),await en(this,on,un).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"Indiedb.after")}}async doTask(){try{return await en(this,sn,rn).call(this)?await en(this,nn,ln).call(this):!1}catch(t){return O(t,"Indiedb.doTask"),!1}}};function hn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function pn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function fn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const wn={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[]},discord:{serverLinks:[]},links:[]};var gn=new WeakSet,mn=new WeakSet,vn=new WeakSet;function kn(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){return O(t,"Keyhub.getGiveawayId"),!1}}async function yn(){try{return A.other.checkLeftKey?("0"===$("#keysleft").text().trim()&&await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Keyhub.checkLeftKey"),!1}}function bn(){try{return A.other.checkLogin?(0<$('a[href*="/connect/steam"]').length&&window.open("/connect/steam","_self"),!0):!0}catch(t){return O(t,"Keyhub.checkLogin"),!1}}var Tn=class extends Ei{constructor(){super(...arguments),hn(this,vn),hn(this,mn),hn(this,gn),pn(this,"name","Keyhub"),pn(this,"socialTasks",{...wn}),pn(this,"undoneTasks",{...wn}),pn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"key-hub.eu"===window.location.host}async after(){try{fn(this,vn,bn).call(this)||C({}).warning(E("checkLoginFailed")),await fn(this,mn,yn).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"Keyhub.after")}}init(){try{const t=C({text:E("initing")});return 0<$('a[href*="/connect/steam"]').length?(window.open("/connect/steam","_self"),t.warning(E("needLogin")),!1):!!fn(this,gn,kn).call(this)&&($("#VPNoverlay").hide(),$("#mainArticleSection").show(),this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Keyhub.init"),!1}}async classifyTask(e){try{const i=C({text:E("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("khTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||{...wn});for(const n of $(".task a")){let t=$(n).attr("href");var s=$(n).text().trim();t&&((/\/away\?data=/.test(t)||/steamcommunity\.com\/gid\//.test(t))&&(t=await u(t)||t),/https?:\/\/key-hub\.eu\/connect\/discord/.test(t)?window.open(t,"_blank"):/steamcommunity\.com\/groups\//.test(t)?("undo"===e&&this.socialTasks.steam.groupLinks.push(t),"do"===e&&this.undoneTasks.steam.groupLinks.push(t)):/store\.steampowered\.com\/app\//.test(t)&&/wishlist/gim.test(s)?("undo"===e&&this.socialTasks.steam.wishlistLinks.push(t),"do"===e&&this.undoneTasks.steam.wishlistLinks.push(t)):/store\.steampowered\.com\/curator\//.test(t)?("undo"===e&&this.socialTasks.steam.curatorLinks.push(t),"do"===e&&this.undoneTasks.steam.curatorLinks.push(t)):/^https?:\/\/discord\.com\/invite\//.test(t)?("undo"===e&&this.socialTasks.discord.serverLinks.push(t),"do"===e&&this.undoneTasks.discord.serverLinks.push(t)):C({}).warning(`${E("unKnownTaskType")}: ${s}(${t})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("khTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Keyhub.classifyTask"),!1}}verifyTask(){try{C({html:`
  • ${E("verifyingTask")}...
  • `}),$.get(window.location.href,t=>{VerifyTasks(t.match(/onclick="javascript:VerifyTasks\('(.*?)'\)"/)[1])})}catch(t){O(t,"keyhub.verifyTask")}}};function $n(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function xn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Sn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Ln={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[]},vk:{nameLinks:[]},discord:{serverLinks:[]}};var In=new WeakSet,_n=new WeakSet,Gn=new WeakSet;async function Cn(t){try{const s=C({html:`
  • ${E("verifyingTask")}${t}...
  • `});return await new Promise(e=>{$.ajax({url:"https://givekey.ru/giveaway/task",method:"POST",data:`id=${t}&user_id=`+this.userId,dataType:"json",headers:{"X-CSRF-TOKEN":$('meta[name="csrf-token"]').attr("content")},success:t=>{t.btn&&$(`button[data-id=${this.userId}]`).html(t.btn),"ok"===t.status?($(".task_check_"+t.id).html(``),s.success(),e(!0)):"end"===t.status?(s.success(),C({}).success(t.key),e(!0)):(s.error("Error:"+t.msg),e(!1))},error:t=>{s.error(`Error:${t.statusText}(${t.status})`),e(!1)}})})}catch(t){return O(t,"Givekey.verify"),!1}}function An(){try{var t,e=null===(t=window.location.href.match(/giveaway\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"Givekey.getGiveawayId"),!1}}async function En(){try{return A.other.checkLeftKey?($("#keys_count").text()||await p().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Givekey.checkLeftKey"),!1}}var On=class extends Ei{constructor(){super(...arguments),$n(this,Gn),$n(this,_n),$n(this,In),xn(this,"name","Givekey"),xn(this,"tasks",[]),xn(this,"socialTasks",{...Ln}),xn(this,"undoneTasks",{...Ln}),xn(this,"userId",void 0),xn(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"givekey.ru"===window.location.host}async after(){try{await new Promise(t=>{const e=setInterval(()=>{0<$("#navbarDropdown").length&&(clearInterval(e),t(!0))})}),await Sn(this,Gn,En).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){return O(t,"Givekey.after"),!1}}init(){try{const e=C({text:E("initing")});if(0<$('a[href*="/auth/steam"]').length)return window.open("/auth/steam","_self"),e.warning(E("needLogin")),!1;if(!Sn(this,_n,An).call(this))return!1;var t=$('meta[name="user-id"]').attr("content");return t?(this.userId=t,this.initialized=!0,e.success(),!0):(e.error(E("getFailed",E("userId"))),!1)}catch(t){return O(t,"Givekey.init"),!1}}async classifyTask(e){try{const a=C({text:E("getTasksInfo")});var t;"undo"===e&&(this.socialTasks=(null===(t=GM_getValue("gkTasks-"+this.giveawayId))||void 0===t?void 0:t.tasks)||Ln);for(const o of $('.card-body:has("button") .row')){const r=$(o);var s=/Complete/i.test(r.find("button").text().trim());if(!s||"undo"===e){const l=r.find("#task_check");var i=l.attr("data-id");if(i&&this.tasks.push(i),"verify"!==e){let t=r.find("a").attr("href")||null;var n=r.find("a").text().trim();const c=r.find("i");t&&n&&(/^https?:\/\/givekey\.ru\/giveaway\/[\d]+\/execution_task/.test(t)&&(t=await u(t)),t&&(/^https?:\/\/vk\.com\//.test(t)?(this.socialTasks.vk.nameLinks.push(t),"do"!==e||s||this.undoneTasks.vk.nameLinks.push(t)):/^https?:\/\/steamcommunity\.com\/groups/.test(t)?(this.socialTasks.steam.groupLinks.push(t),"do"!==e||s||this.undoneTasks.steam.groupLinks.push(t)):/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?(this.socialTasks.steam.wishlistLinks.push(t),"do"!==e||s||this.undoneTasks.steam.wishlistLinks.push(t)):/Subscribe/gi.test(n)&&c.hasClass("fa-steam-square")?/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?(this.socialTasks.steam.curatorLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLinks.push(t)):(this.socialTasks.steam.curatorLikeLinks.push(t),"do"!==e||s||this.undoneTasks.steam.curatorLikeLinks.push(t)):/^https?:\/\/twitter\.com\//.test(t)&&/Subscribe/gi.test(n)?(this.socialTasks.twitter.userLinks.push(t),"do"!==e||s||this.undoneTasks.twitter.userLinks.push(t)):c.hasClass("fa-discord")?(this.socialTasks.discord.serverLinks.push(t),"do"!==e||s||this.undoneTasks.discord.serverLinks.push(t)):C({}).warning(`${E("unKnownTaskType")}: ${n}(${t})`)))}}}return a.success(),this.tasks=I(this.tasks),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.uniqueTasks(this.socialTasks),GM_setValue("gkTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"Givekey.classifyTask"),!1}}async verifyTask(){try{if(!this.initialized&&!this.init())return!1;if(0===this.tasks.length&&!await this.classifyTask("verify"))return!1;C({}).warning(E("giveKeyNoticeBefore"));var e=this.tasks.length;for(let t=0;t${E("giveKeyNoticeAfter")}`}),!0}catch(t){return O(t,"Givekey.verifyTask"),!1}}};function jn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Wn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Pn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}var Vn=new WeakSet,Dn=new WeakSet,Mn=new WeakSet;function Fn(){try{return A.other.checkLogin?(0<$('a[href*="/account/auth"]').length&&window.open($('a[href*="/account/auth"]').attr("href"),"_self"),!0):!0}catch(t){return O(t,"GiveeClub.checkLogin"),!1}}function Un(){var t=null===(t=window.location.href.match(/\/event\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}async function Nn(){try{return A.other.checkLeftKey?(0<$(".event-ended").length&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayEnded"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return O(t,"Giveawaysu.checkLeftKey"),!1}}var zn=class extends qi{constructor(){super(...arguments),jn(this,Mn),jn(this,Dn),jn(this,Vn),Wn(this,"name","GiveeClub"),Wn(this,"buttons",["doTask","undoTask"])}static test(){return/^https?:\/\/givee\.club\/.*?\/event\/[\d]+/.test(window.location.href)}async after(){try{Pn(this,Vn,Fn).call(this)||C({}).warning(E("checkLoginFailed")),await Pn(this,Mn,Nn).call(this)||C({}).warning(E("checkLeftKeyFailed"))}catch(t){O(t,"GiveeClub.after")}}init(){try{const t=C({text:E("initing")});return Pn(this,Vn,Fn).call(this)?!!Pn(this,Dn,Un).call(this)&&(this.initialized=!0,t.success(),!0):(t.warning(E("needLogin")),!1)}catch(t){return O(t,"GiveeClub.init"),!1}}async classifyTask(t){try{const s=C({text:E("getTasksInfo")});var e;if("undo"===t)return this.socialTasks=(null===(e=GM_getValue("gcTasks-"+this.giveawayId))||void 0===e?void 0:e.tasks)||Bi,!0;const i=[];for(const n of $(".event-actions tr"))i.push(new Promise(e=>{const t=$(n).find(".event-action-label a"),s=$(n).find(".event-action-icon i").attr("class")||"",i=t.text().trim();if(s.includes("ban")||/AdBlock/i.test(i)||s.includes("envelope"))return e(!0);u(t.attr("href")).then(t=>t?(/^https?:\/\/steamcommunity\.com\/groups/.test(t)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(i)?this.undoneTasks.steam.announcementLinks.push(t):s.includes("plus")&&/^https?:\/\/store\.steampowered\.com\/app\//.test(t)?this.undoneTasks.steam.wishlistLinks.push(t):/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):s.includes("steam")&&/follow|subscribe/gim.test(i)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(i)?this.undoneTasks.steam.forumLinks.push(t):s.includes("discord")?this.undoneTasks.discord.serverLinks.push(t):s.includes("instagram")?this.undoneTasks.instagram.userLinks.push(t):s.includes("twitch")?this.undoneTasks.twitch.channelLinks.push(t):s.includes("reddit")?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(i)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(i)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(i)||(s.includes("youtube")||s.includes("thumbs-up"))&&/(watch|like).*video/gim.test(i)?this.undoneTasks.youtube.likeLinks.push(t):s.includes("vk")||/join.*vk.*group/gim.test(i)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(i)||/follow.*button/gim.test(i)&&this.undoneTasks.steam.followLinks.push(t),void e(!0)):e(!1)).catch(t=>(O(t,"GiveeClub.classifyTask->getRedirectLink"),!1))}));return await Promise.all(i),s.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),this.socialTasks=this.undoneTasks,GM_setValue("gcTasks-"+this.giveawayId,{tasks:this.socialTasks,time:(new Date).getTime()}),!0}catch(t){return O(t,"GiveeClub.classifyTask"),!1}}};function Kn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Bn(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Yn(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Rn={maxPoint:"99999999"};var Hn=new WeakSet,qn=new WeakSet;async function Jn(t){try{for(const u of $(`.giveaways-page-item:contains('${t}'):not(:contains('ENTERED'))`)){var e,s,i,n,a,o,r,l=parseInt((null===(e=$(u).find(".giveaways-page-item-header-points").text().match(/[\d]+/gim))||void 0===e?void 0:e[0])||"999999",10),c=$(u).find(".giveaways-page-item-footer-name").text().trim();if("points"===t&&l>this.myPoints)C({}).warning(E("noPoints")+": "+c);else if("points"!==t||l){if(!("points"===t&&l>this.maxPoints)){const d=C({text:`${E("joiningLottery")}${c}...`}),h=$(u).find("a.giveaways-page-item-img-btn-enter:contains('enter')");if(null===h||void 0===h||null===(s=h.attr("onclick"))||void 0===s||!s.includes("checkUser")||(a=null===(i=h.attr("onclick"))||void 0===i||null===(n=i.match(/[\d]+/))||void 0===n?void 0:n[0])&&checkUser(a),h.attr("href")){const{result:p,statusText:f,status:w,data:g}=await L({url:h.attr("href"),method:"GET"});"Success"===p?null!==g&&void 0!==g&&g.responseText&&/You've entered this giveaway/gim.test(g.responseText)?(d.success(),r=null===(o=g.responseText.match(/Points:[\s]*?([\d]+)/))||void 0===o?void 0:o[1],"points"===t&&r&&(this.myPoints=parseInt(r,10))):d.error(`Error:${null===g||void 0===g?void 0:g.statusText}(${null===g||void 0===g?void 0:g.status})`):d.error(p+`:${f}(${w})`)}else d.error('Error: No "href".')}}else C({}).warning(E("getNeedPointsFailed")+": "+c)}C({text:"-----END-----"})}catch(t){O(t,"OpiumPulses.toggleTask")}}function Xn(){try{return A.other.checkLogin?(1<$('a[href*="/site/login"]').length&&window.open("/site/login","_self"),!0):!0}catch(t){return O(t,"OpiumPulses.checkLogin"),!1}}var Zn=class{constructor(){Kn(this,qn),Kn(this,Hn),Bn(this,"name","OpiumPulses"),Bn(this,"options",{...Rn,...GM_getValue("OpiumPulsesOptions")}),Bn(this,"maxPoints",99999999),Bn(this,"myPoints",0),Bn(this,"buttons",["doFreeTask","doPointTask"])}static test(){return"www.opiumpulses.com"===window.location.host}async after(){try{Yn(this,qn,Xn).call(this)||C({}).warning(E("checkLoginFailed")),this.maxPoints=parseInt(this.options.maxPoint,10)}catch(t){O(t,"OpiumPulses.after")}}async doFreeTask(){try{Yn(this,Hn,Jn).call(this,"FREE")}catch(t){O(t,"OpiumPulses.doFreeTask")}}async doPointTask(){try{var t;this.myPoints=parseInt((null===(t=$(".page-header__nav-func-user-nav-items.points-items").text().match(/[\d]+/gim))||void 0===t?void 0:t[0])||"0",10),Yn(this,Hn,Jn).call(this,"points")}catch(t){O(t,"OpiumPulses.doPointTask")}}init(){return!0}classifyTask(){return!0}};function Qn(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ta(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ea(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const sa={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},twitter:{userLinks:[],retweetLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var ia=new WeakSet;function na(t,e,s,i){try{$(t).after('${s.replace("Links","")}`)}catch(t){O(t,"keylol.addBtn")}}var aa=class extends Ei{constructor(){super(...arguments),Qn(this,ia),ta(this,"name","Keylol"),ta(this,"socialTasks",{...sa}),ta(this,"undoneTasks",{...sa}),ta(this,"buttons",["doTask","undoTask","selectAll","selectNone","invertSelect"])}static test(){var t;return"keylol.com"===window.location.host&&!(null===(t=$(".subforum_left_title_left_up a").eq(3).attr("href"))||void 0===t||!t.includes("319"))}init(){return!0}after(){try{var t="Keylol"===this.name?'#postlist>div[id^="post_"]:first':"div.container";const k=$(t);var e=k.find('a[href*="discord.com"]'),s=k.find('a[href*="reddit.com"]'),i=k.find('a[href*="instagram.com"]'),n=k.find('a[href*="twitter.com"]'),a=k.find('a[href*="twitch.tv"]'),o=k.find('a[href*="vk.com"]'),r=k.find('a[href*="store.steampowered.com"]'),l=k.find('a[href*="steamcommunity.com"]'),c=k.find('a[href*="youtube.com"]');if(0{e.getAttribute("selected")?e.removeAttribute("selected"):e.setAttribute("selected","selected")})}catch(t){O(t,"Keylol.invertSelect")}}};function oa(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function ra(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function la(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const ca={steam:{groupLinks:[],wishlistLinks:[],followLinks:[],curatorLikeLinks:[]}};var ua=new WeakSet,da=new WeakSet;function ha(){try{var t,e=null===(t=window.location.href.match(/quests\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({}).error(E("getFailed","GiveawayId")),!1)}catch(t){return O(t,"Opquests.getGiveawayId"),!1}}function pa(){try{return A.other.checkLogin?(0<$('a[href*="/auth/redirect"]').length&&window.open("/auth/redirect","_self"),!0):!0}catch(t){return O(t,"Opquests.checkLogin"),!1}}t=class extends Ei{constructor(){super(...arguments),oa(this,da),oa(this,ua),ra(this,"name","Opquests"),ra(this,"undoneTasks",{...ca}),ra(this,"buttons",["doTask"])}static test(){return"opquests.com"===window.location.host}async after(){try{la(this,da,pa).call(this)||C({}).warning(E("checkLoginFailed"))}catch(t){O(t,"Opquests.after")}}init(){try{const t=C({text:E("initing")});return 0<$('a[href*="/auth/redirect"]').length?(window.open("/auth/redirect","_self"),t.warning(E("needLogin")),!1):!!la(this,ua,ha).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return O(t,"Opquests.init"),!1}}async classifyTask(t){try{if("undo"===t)return C({text:E("cannotUndo")}),!1;const i=C({text:E("getTasksInfo")});for(const n of $('.w-full:contains("Validate") .items-center')){var e=$(n).find('a:contains("Open")').attr("href"),s=$(n).find("div").eq(1).text().trim();e&&(/steamcommunity\.com\/groups\//.test(e)?this.undoneTasks.steam.groupLinks.push(e):/store\.steampowered\.com\/app\//.test(e)?/wishlist/gim.test(s)?this.undoneTasks.steam.wishlistLinks.push(e):/follow/gim.test(s)&&this.undoneTasks.steam.followLinks.push(e):/store\.steampowered\.com\/(publisher|developer)\//.test(e)&&/follow/gim.test(s)?this.undoneTasks.steam.curatorLikeLinks.push(e):C({}).warning(E("unKnownTaskType")+`: ${s}(${e})`))}return i.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),!0}catch(t){return O(t,"Opquests.classifyTask"),!1}}};function fa(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function wa(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function ga(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const ma={steam:{groupLinks:[],wishlistLinks:[],followLinks:[],curatorLinks:[],curatorLikeLinks:[]},twitter:{userLinks:[],retweetLinks:[]},twitch:{channelLinks:[]},discord:{serverLinks:[]},youtube:{channelLinks:[]},extra:{gleam:[]}},va={vlootUsername:"",gameroundUsername:""};var ka=new WeakSet,ya=new WeakSet,ba=new WeakSet,Ta=new WeakSet,$a=new WeakSet;async function xa(){try{return await new Promise(t=>{const e=setInterval(()=>{0===$(".entry-content .entry-method i.fa-sync").length&&(clearInterval(e),t(!0))},500)})}catch(t){return O(t,"Gleam.checkSync"),!1}}async function Sa(e){try{const s=C({text:E("doingGleamTask")});return await new Promise(t=>{GM_openInTab(e+"?8b07d23f4bfa65f9",{active:!0,insert:!0,setParent:!0}).onclose=()=>{s.success(),t(!0)}})}catch(t){return O(t,"Gleam.doGleamTask"),!1}}function La(){try{var t=window.location.pathname;return t?(this.giveawayId=t,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"Gleam.getGiveawayId"),!1}}async function Ia(t){try{const i=C({text:E("gettingGleamLink")}),{result:n,statusText:a,status:o,data:r}=await L({url:t,method:"GET"});if("Success"!==n)return i.error(n+`:${a}(${o})`),!1;if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),!1;var e,s=null===(e=r.responseText.match(/href="(https:\/\/gleam\.io\/.*?\/.+?)"/))||void 0===e?void 0:e[1];return s?(i.success(),s):(i.error("Error:"+E("getLinkFailed")),!1)}catch(t){return O(t,"Gleam.getGleamLink"),!1}}async function _a(){try{var e,s,i,n;if(!A.other.checkLeftKey)return!0;var a=null===(e=$("div.popup-blocks-container").attr("ng-init"))||void 0===e||null===(s=e.match(/initCampaign\(([\w\W]+?)\)$/))||void 0===s?void 0:s[1];if(!a)return!1;var o,r,l,c,{campaign:u,incentive:d}=JSON.parse(a),h=null===(i=$("div.campaign.reward").attr("ng-init"))||void 0===i||null===(n=i.match(/initContestant\(([\w\W]+?)\);/))||void 0===n?void 0:n[1];let t=!1;return h&&null!==(o=JSON.parse(h).contestant)&&void 0!==o&&null!==(r=o.claims)&&void 0!==r&&null!==(l=r.incentives)&&void 0!==l&&null!==(c=l[d.id])&&void 0!==c&&c.length&&(t=!0),(u.banned||u.finished&&!t||u.paused||(new Date).getTime()<1e3*u.starts_at)&&await p().fire({icon:"warning",title:E("notice"),text:E("giveawayNotWork"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0}catch(t){return O(t,"Gleam.checkLeftKey"),!1}}e=class extends Ei{constructor(){super(...arguments),fa(this,$a),fa(this,Ta),fa(this,ba),fa(this,ya),fa(this,ka),wa(this,"name","Gleam"),wa(this,"undoneTasks",{...ma}),wa(this,"socialTasks",{...ma}),wa(this,"options",{...va,...GM_getValue("GleamOptions")}),wa(this,"buttons",["doTask","undoTask","verifyTask"])}static test(){return"gleam.io"===window.location.host}async after(){try{if(window.location.search.includes("8b07d23f4bfa65f9")){const s=setInterval(()=>{0<$(".entry-content .entry-method i.fa-check").length&&(clearInterval(s),window.close())});for(const i of $(".entry-content .entry-method")){const n=$(i).find(".user-links"),a=$(i).find(".expandable");var t=a.find("a.btn,a:contains(Continue),button:contains(Continue)");if(0!0)}catch(t){return O(t,"Gleam.extraDoTask"),!1}}async verifyTask(){try{C({text:E("verifyingTask")+"..."});for(const t of $(".entry-content .entry-method")){const e=$(t);if(0!==e.find("i.fa-question").length){const s=e.find(".user-links");s[0].click(),await G(500),await ga(this,ka,xa).call(this);for(const i of e.find(".expandable").find("span:contains(Continue),button:contains(Continue)"))i.click(),await G(500),await ga(this,ka,xa).call(this)}}C({text:E("verifiedGleamTasks")})}catch(t){return O(t,"Gleam.verifyTask"),!1}}};function Ga(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Ca(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Aa(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Ea={username:"",email:""};var Oa=new WeakSet,ja=new WeakSet,Wa=new WeakSet,Pa=new WeakSet;function Va(){try{return 0<$("#twitter_login_button").length&&$("#twitter_login_button")[0].click(),!0}catch(t){return O(t,"SweepWidget.checkLogin"),!1}}function Da(){try{var t,e=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return e?(this.giveawayId=e,!0):(C({text:E("getFailed","GiveawayId")}),!1)}catch(t){return O(t,"SweepWidget.getGiveawayId"),!1}}async function Ma(){try{return new Promise(t=>{const e=setInterval(()=>{0<$("#unlock_rewards_main_wrapper").length&&(clearInterval(e),t(!0))})})}catch(t){return O(t,"SweepWidget.checkEnter"),!1}}async function Fa(s){try{return new Promise(t=>{const e=setInterval(()=>{(0div.sw_entry")){const a=$(n);if(!(0 `;for(const[i,n]of Object.entries(r))t+=Object.keys(n).map((t,e)=>{var s;return null!==(s=za[i])&&void 0!==s&&s.includes(t)?"":`${0===e?``:""}`}).join("");t+="
    ${E("website")}${E("type")}${E("edit")}
    ${i}${E(t)}
    ","swal"===o?p().fire({title:E("whiteListOptions"),html:t,showConfirmButton:!1,showCloseButton:!0}):$("body").append(`

    ${E("whiteList")}

    `+t),$(".editWhiteList").on("click",function(){var t;const e=$(this).attr("data-value");if(e){const[n,a]=e.split(".");null!==r&&void 0!==r&&null!==(t=r[n])&&void 0!==t&&t[a]?(p().fire({title:E("changeWhiteListOption",e),input:"textarea",html:`

    在下方填写白名单,每行一个

    `,inputValue:r[n][a].join("\n"),showConfirmButton:!0,confirmButtonText:E("save"),showCancelButton:!0,cancelButtonText:E("close"),showDenyButton:!0,denyButtonText:E("return")}).then(t=>{let{isDenied:e,isConfirmed:s,value:i}=t;e?"swal"===o&&Ua(o):s&&(r[n][a]=i.split("\n"),GM_setValue("whiteList",r),p().fire({title:E("changeWhiteListSuccess"),icon:"success"}))}),$("#link2id").on("click",async function(){var t=$(this).attr("data-type");$("#socialLink").val(await async function(e){var s,i,n,a,o,r,l,c,u,d,h,p,f,w,g,m;try{const y=$("#socialLink").val();let t="";switch(e){case"discord.servers":t=(null===(s=y.match(/invite\/(.+)/))||void 0===s?void 0:s[1])||"";break;case"instagram.users":t=(null===(i=y.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===i?void 0:i[1])||"";break;case"twitch.channels":t=(null===(n=y.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===n?void 0:n[2])||"";break;case"twitter.users":t=(null===(a=y.match(/https:\/\/twitter\.com\/(.+)/))||void 0===a?void 0:a[1])||"";break;case"twitter.retweets":t=(null===(o=y.match(/https:\/\/twitter\.com\/.*?\/status\/([\d]+)/))||void 0===o?void 0:o[1])||"";break;case"vk.names":t=(null===(r=y.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===r?void 0:r[1])||"";break;case"youtube.channels":t=(null===(l=await us(y,"channel"))||void 0===l||null===(c=l.params)||void 0===c?void 0:c.channelId)||"";break;case"youtube.likes":t=(null===(u=await us(y,"likeVideo"))||void 0===u||null===(d=u.params)||void 0===d?void 0:d.videoId)||"";break;case"reddit.reddits":t=(null===(h=y.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===h?void 0:h[1])||(null===(p=y.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===p?void 0:p[1])||"";break;case"steam.groups":t=(null===(f=y.match(/groups\/(.+)\/?/))||void 0===f?void 0:f[1])||"";break;case"steam.wishlists":case"steam.follows":case"steam.forums":t=(null===(w=y.match(/app\/([\d]+)/))||void 0===w?void 0:w[1])||"";break;case"steam.workshops":t=(null===(g=y.match(/\?id=([\d]+)/))||void 0===g?void 0:g[1])||"";break;case"steam.curators":if(y.includes("curator"))t=(null===(m=y.match(/curator\/([\d]+)/))||void 0===m?void 0:m[1])||"";else{var v,k=null===(v=y.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===v?void 0:v.slice(1,3);if(!k||2!==k.length)break;const b=new Li;await b.init()&&(t=await b.getCuratorId(k[0],k[1])||"")}}return t}catch(t){return O(t,"link2id"),E("getFailed","id")}}(t))})):C({}).warning(E("whiteListNotFound",e))}})}catch(t){O(t,"whiteListOptions")}}const Na={discord:{servers:[]},instagram:{users:[]},twitch:{channels:[]},twitter:{users:[],retweets:[],likes:[]},vk:{names:[]},youtube:{channels:[],likes:[]},reddit:{reddits:[]},steam:{groups:[],wishlists:[],follows:[],forums:[],workshops:[],curators:[],workshopVotes:[],curatorLikes:[],announcements:[]}},za={steam:["workshopVotes","curatorLikes","announcements"],twitter:["likes"]},Ka=Ua,Ba=async(t,e,s)=>{try{const u=C({text:E("gettingData")});var i,n,a,{result:o,statusText:r,status:l,data:c}=await L({url:"https://api.github.com/gists/"+e,headers:{Accept:"application/vnd.github.v3+json",Authorization:"token "+t},responseType:"json",method:"GET",timeout:3e4});return"Success"===o?200===(null==c?void 0:c.status)?(u.success(),JSON.parse((null===(i=c.response)||void 0===i||null===(n=i.files)||void 0===n||null===(a=n[s])||void 0===a?void 0:a.content)||null)):(u.error(`Error:${null==c?void 0:c.statusText}(${null==c?void 0:c.status})`),!1):(u.error(o+`:${r}(${l})`),!1)}catch(t){return O(t,"getGistData"),!1}},Ya=()=>{try{var{TOKEN:t,GIST_ID:e,FILE_NAME:s,SYNC_HISTORY:i}=GM_getValue("gistOptions")||{TOKEN:"",GIST_ID:"",FILE_NAME:"",SYNC_HISTORY:!0};p().fire({title:E("gistOptions"),html:`

    Github Token

    `+`

    Gist ID

    `+`

    ${E("fileName")}

    `+'

    `+`

    `),$("#getTwitterUserId").on("click",()=>{Ja(this,Xa,Qa).call(this,"twitterUser")}),$('input[name="other.youtubeVerifyChannel"]').after(``),$("#getYoutubeChannelId").on("click",()=>{Ja(this,Xa,Qa).call(this,"youtubeChannel")}),$('input[name^="position"]').on("input",function(){var t="rightleft",e="topbottpm";switch($(this).attr("name").replace("position.","")){case"buttonSideX":case"buttonSideY":case"buttonDistance":{const l=$('input[name="position.buttonDistance"]').val();var s=$('input[name="position.buttonSideX"]').val(),i=$('input[name="position.buttonSideY"]').val();if(!["right","left"].includes(s))break;if(!["top","bottom"].includes(i))break;if(!/^[\d]+?,[\d]+$/.test(l))break;var n=l.split(",");$("#auto-task-buttons").css(s,n[0]+"px").css(i,n[1]+"px").css(t.replace(s,""),"").css(e.replace(i,""),"");break}case"showButtonSideX":case"showButtonSideY":case"showButtonDistance":{const c=$('input[name="position.showButtonDistance"]').val();var a=$('input[name="position.showButtonSideX"]').val(),o=$('input[name="position.showButtonSideY"]').val();if(!["right","left"].includes(a))break;if(!["top","bottom"].includes(o))break;if(!/^[\d]+?,[\d]+$/.test(c))break;var r=c.split(",");$("div.show-button-div").css(a,r[0]+"px").css(o,r[1]+"px").css(t.replace(a,""),"").css(e.replace(o,""),"");break}case"logSideX":case"logSideY":case"logDistance":{const u=$('input[name="position.logDistance"]').val();r=$('input[name="position.logSideX"]').val(),a=$('input[name="position.logSideY"]').val();if(!["right","left"].includes(r))break;if(!["top","bottom"].includes(a))break;if(!/^[\d]+?,[\d]+$/.test(u))break;o=u.split(",");$("#auto-task-info").css(r,o[0]+"px").css(a,o[1]+"px").css(t.replace(r,""),"").css(e.replace(a,""),"");break}}}),$('input[name^="hotKey"]').attr("readonly","readonly").off("keydown").on("keydown",function(t){let e="";t.altKey?e+="alt + ":t.ctrlKey?e+="ctrl + ":t.shiftKey&&(e+="shift + "),$(this).val(e+(1===t.key.length?t.key.toLowerCase():""))})}catch(t){O(t,"Setting.after")}}saveGlobalOptions(){c()}},eo=po(698);function so(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function io(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var no=new WeakSet;function ao(i){try{var n=GM_getValue(i);if(null==n||!n.tasks)return;let t="",e="",s="";var a,o,[r,l]=i.split("-");switch(r){case"fawTasks":e=`Freeanywhere[${l}]`,s="https://freeanywhere.net/#/giveaway/"+l;break;case"gasTasks":e=`Giveawaysu[${l}]`,s="https://giveaway.su/giveaway/view/"+l;break;case"gcTasks":e=`GiveeClub[${l}]`,s="https://givee.club/event/"+l;break;case"gkTasks":e=`Givekey[${l}]`,s="https://givekey.ru/giveaway/"+l;break;case"gleamTasks":e=`Gleam[${l}]`,s="https://gleam.io"+l;break;case"khTasks":e=`keyhub[${l}]`,s="https://key-hub.eu/giveaway/"+l;break;case"prysTasks":e=`Prys[${l}]`,s="https://prys.revadike.com/giveaway/?id="+l;break;default:return}for([a,o]of Object.entries(n.tasks))for(var[c,u]of Object.entries(o))for(const d of u)t+=`

  • ${a}.${E(c.replace("Link",""))}: ${55
  • `;$(".container").append(`
      ${t}
    ${E("lastChangeTime")}: ${eo(n.time).format("YYYY-MM-DD HH:mm:ss")}
    `),$("span.delete-task").on("click",function(){var t=$(this).attr("data-name");t?(GM_deleteValue(t),p().fire({title:E("clearTaskFinished"),text:t,icon:"success"})):p().fire({title:E("clearTaskFailed"),icon:"error"})})}catch(t){O(t,"History.addItem")}}const oo=[Ui,qi,dn,Tn,On,zn,Zn,aa,t,e,s,Ei,class extends aa{constructor(){super(...arguments),so(this,no),io(this,"name","History"),io(this,"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 t=GM_listValues()||[];for(const e of t.map(t=>/^[\w]+?Tasks-/.test(t)?t:null).filter(t=>t))!function(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}(this,no,ao).call(this,e)}catch(t){O(t,"History.before")}}clearHistory(){try{const t=GM_listValues()||[];for(const e of t.map(t=>/^[\w]+?Tasks-/.test(t)?t:null).filter(t=>t))GM_deleteValue(e);p().fire({title:E("clearHistoryFinished"),icon:"success"})}catch(t){O(t,"History.after")}}}];const ro=function(e,s){let t=`
    +
    `;$("body").append(`

    ${E("environment")}

    `+e)}catch(t){O(t,"Setting.environment")}}var Ei=class{constructor(){Ha(this,Za),Ha(this,Xa),qa(this,"name","Setting"),qa(this,"buttons",["saveGlobalOptions","syncData","tasksHistory"]),qa(this,"syncData",Ra)}tasksHistory(){window.open("https://auto-task-v4.hclonely.com/history.html","_blank")}static test(){return"auto-task-v4.hclonely.com"===window.location.host&&"/setting.html"===window.location.pathname}before(){$("body").html("").addClass("auto-task-options")}after(){try{Ja(this,Za,to).call(this),w("page"),Ka("page"),$('input[name="other.twitterVerifyId"]').after(``),$("#getTwitterUserId").on("click",()=>{Ja(this,Xa,Qa).call(this,"twitterUser")}),$('input[name="other.youtubeVerifyChannel"]').after(``),$("#getYoutubeChannelId").on("click",()=>{Ja(this,Xa,Qa).call(this,"youtubeChannel")}),$('input[name^="position"]').on("input",function(){var t="rightleft",e="topbottpm";switch($(this).attr("name").replace("position.","")){case"buttonSideX":case"buttonSideY":case"buttonDistance":{const l=$('input[name="position.buttonDistance"]').val();var s=$('input[name="position.buttonSideX"]').val(),i=$('input[name="position.buttonSideY"]').val();if(!["right","left"].includes(s))break;if(!["top","bottom"].includes(i))break;if(!/^[\d]+?,[\d]+$/.test(l))break;var n=l.split(",");$("#auto-task-buttons").css(s,n[0]+"px").css(i,n[1]+"px").css(t.replace(s,""),"").css(e.replace(i,""),"");break}case"showButtonSideX":case"showButtonSideY":case"showButtonDistance":{const c=$('input[name="position.showButtonDistance"]').val();var a=$('input[name="position.showButtonSideX"]').val(),o=$('input[name="position.showButtonSideY"]').val();if(!["right","left"].includes(a))break;if(!["top","bottom"].includes(o))break;if(!/^[\d]+?,[\d]+$/.test(c))break;var r=c.split(",");$("div.show-button-div").css(a,r[0]+"px").css(o,r[1]+"px").css(t.replace(a,""),"").css(e.replace(o,""),"");break}case"logSideX":case"logSideY":case"logDistance":{const u=$('input[name="position.logDistance"]').val();r=$('input[name="position.logSideX"]').val(),a=$('input[name="position.logSideY"]').val();if(!["right","left"].includes(r))break;if(!["top","bottom"].includes(a))break;if(!/^[\d]+?,[\d]+$/.test(u))break;o=u.split(",");$("#auto-task-info").css(r,o[0]+"px").css(a,o[1]+"px").css(t.replace(r,""),"").css(e.replace(a,""),"");break}}}),$('input[name^="hotKey"]').attr("readonly","readonly").off("keydown").on("keydown",function(t){let e="";t.altKey?e+="alt + ":t.ctrlKey?e+="ctrl + ":t.shiftKey&&(e+="shift + "),$(this).val(e+(1===t.key.length?t.key.toLowerCase():""))})}catch(t){O(t,"Setting.after")}}saveGlobalOptions(){c()}},eo=po(698);function so(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function io(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}var no=new WeakSet;function ao(i){try{var n=GM_getValue(i);if(null==n||!n.tasks)return;let t="",e="",s="";var a,o,[r,l]=i.split("-");switch(r){case"fawTasks":e=`Freeanywhere[${l}]`,s="https://freeanywhere.net/#/giveaway/"+l;break;case"gasTasks":e=`Giveawaysu[${l}]`,s="https://giveaway.su/giveaway/view/"+l;break;case"gcTasks":e=`GiveeClub[${l}]`,s="https://givee.club/event/"+l;break;case"gkTasks":e=`Givekey[${l}]`,s="https://givekey.ru/giveaway/"+l;break;case"gleamTasks":e=`Gleam[${l}]`,s="https://gleam.io"+l;break;case"khTasks":e=`keyhub[${l}]`,s="https://key-hub.eu/giveaway/"+l;break;case"prysTasks":e=`Prys[${l}]`,s="https://prys.revadike.com/giveaway/?id="+l;break;default:return}for([a,o]of Object.entries(n.tasks))for(var[c,u]of Object.entries(o))for(const d of u)t+=`
  • ${a}.${E(c.replace("Link",""))}: ${55
  • `;$(".container").append(`
      ${t}
    ${E("lastChangeTime")}: ${eo(n.time).format("YYYY-MM-DD HH:mm:ss")}
    `),$("span.delete-task").on("click",function(){var t=$(this).attr("data-name");t?(GM_deleteValue(t),p().fire({title:E("clearTaskFinished"),text:t,icon:"success"})):p().fire({title:E("clearTaskFailed"),icon:"error"})})}catch(t){O(t,"History.addItem")}}const oo=[Ui,qi,dn,Tn,On,zn,Zn,aa,t,e,s,Ei,class extends aa{constructor(){super(...arguments),so(this,no),io(this,"name","History"),io(this,"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 t=GM_listValues()||[];for(const e of t.map(t=>/^[\w]+?Tasks-/.test(t)?t:null).filter(t=>t))!function(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}(this,no,ao).call(this,e)}catch(t){O(t,"History.before")}}clearHistory(){try{const t=GM_listValues()||[];for(const e of t.map(t=>/^[\w]+?Tasks-/.test(t)?t:null).filter(t=>t))GM_deleteValue(e);p().fire({title:E("clearHistoryFinished"),icon:"success"})}catch(t){O(t,"History.after")}}}];const ro=function(e,s){let t=`
    `;for(var[i,n]of Object.entries(s))t+=``;t+="
    ${E("option")}${E("value")}
    ${i}
    ",p().fire({title:E("websiteOptions"),html:t,showConfirmButton:!0,confirmButtonText:E("save"),showCancelButton:!0,cancelButtonText:E("close")}).then(t=>{t=t.isConfirmed;t&&($("#websiteOptionsForm").serializeArray().map(t=>(s[t.name]=t.value,t)),GM_setValue(e+"Options",s),p().fire({title:E("changeWebsiteOptionsSuccess"),icon:"success"}))})};var aa=keyboardJS,lo=po.n(aa);const co=async(t,e)=>{try{var s,i=t+"package.json?time="+(new Date).getTime(),{result:n,statusText:a,status:o,data:r}=await L({url:i,responseType:"json",method:"GET",timeout:3e4});return"Success"===n?null!=r&&null!==(s=r.response)&&void 0!==s&&s.version?r.response:(e||C({}).error(`${E("checkUpdateFailed")}[${null==r?void 0:r.statusText}(${null==r?void 0:r.status})]`),!1):(e||C({}).error(E("checkUpdateFailed")+`[${n}:${a}(${o})]`),!1)}catch(t){return O(t,"checkUpdate"),!1}};const uo=async()=>{try{var i,n=GM_info.script.version,a=A.other.autoUpdateSource.toLowerCase(),o={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 t,e="",s;["github","jsdelivr","standby"].includes(a)?(e=o[a],s=await co(e,!1)):(e=o.github,s=await co(e,!0),s||(e=o.jsdelivr,s=await co(e,!0),s||(e=o.standby,s=await co(e,!0)))),s?t=s.version||n:(t=n,C({}).error(E("checkUpdateFailed"))),s&&((t,e)=>{try{const[l]=t.split("-"),[c]=e.split("-");var[s,i,n]=l.split(".").map(t=>parseInt(t,10)),[a,o,r]=c.split(".").map(t=>parseInt(t,10));return s${E("newVersionNotice",t,`${e}dist/${GM_info.script.name}.user.js`)}`}),C({html:`
  • ${E("updateText",t)}
    1. ${null===(i=s.change)||void 0===i?void 0:i.map(t=>`
    2. ${t}
    3. `).join("")}
    `}))}catch(t){O(t,"updateChecker")}};"discord.com"===window.location.hostname&&(ho=null===(aa=window.localStorage)||void 0===aa||null===(ho=aa.getItem("token"))||void 0===ho?void 0:ho.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:ho}),ho&&"#auth"===window.location.hash&&(window.close(),p().fire("",E("closePageNotice"))));var ho=async()=>{var t,e,s,i;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(s=f.get("auth-token"),!!f.get("login")?(GM_setValue("twitchAuth",{authToken:s,clientId:null===(s=commonOptions)||void 0===s||null===(i=s.headers)||void 0===i?void 0:i["Client-ID"]}),window.close(),p().fire("",E("closePageNotice"))):p().fire("",E("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(i=f.get("ct0"),!!f.get("twid")&&i?(GM_setValue("twitterAuth",{ct0:i}),window.close(),p().fire("",E("closePageNotice"))):p().fire("",E("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((a=f.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:a}),window.close(),p().fire("",E("closePageNotice"))):p().fire("",E("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const o=$("#redesign-beta-optin-btn");if(0
    `),$("div.show-button-div").on("click",()=>{$("#auto-task-buttons").show(),$("div.show-button-div").hide()});var a=()=>{const t=$("#toggle-log");"show"===t.attr("data-status")?($("#auto-task-info").hide(),t.attr("data-status","hide").text(E("showLog"))):($("#auto-task-info").show(),t.attr("data-status","show").text(E("hideLog")))};if(lo().bind(A.hotKey.doTaskKey,()=>{n.doTask&&n.doTask()}),lo().bind(A.hotKey.undoTaskKey,()=>{n.undoTask&&n.doTask()}),lo().bind(A.hotKey.toggleLogKey,a),null!==(t=n)&&void 0!==t&&t.after&&await(null===(e=n)||void 0===e?void 0:e.after()),null!==(e=n)&&void 0!==e&&e.buttons&&0===$("#auto-task-buttons").children().length){$("#auto-task-buttons").addClass(n.name+"-buttons");for(const u of n.buttons)if(n[u]){const d=$(`

    ${E(u)}

    `);d.find("a.auto-task-website-btn").on("click",()=>{n[u]()}),$("#auto-task-buttons").append(d)}}const l=$(`

    ${E("hideButton")}

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

    - ${A.other.defaultShowLog?E("hideLog"):E("showLog")}

    `);c.find("a.auto-task-website-btn").on("click",a),$("#auto-task-buttons").append(l).append(c),null!==(a=n)&&void 0!==a&&a.options&&GM_registerMenuCommand(E("changeWebsiteOptions"),()=>{ro(n.name,n.options)}),"Setting"!==n.name&&(GM_registerMenuCommand(E("whiteList"),()=>{Ka("swal")}),GM_registerMenuCommand(E("changeGlobalOptions"),()=>{w("swal")}),GM_registerMenuCommand(E("tasksHistory"),()=>{window.open("https://auto-task-v4.hclonely.com/history.html","_blank")}),GM_registerMenuCommand(E("syncData"),Ra),GM_registerMenuCommand(E("settingPage"),()=>{window.open("https://auto-task-v4.hclonely.com/setting.html","_blank")})),GM_addStyle(h.Z),console.log("%c%s","color:#1bbe1a","Auto Task脚本初始化完成!"),GM_getValue("notice")||(p().fire({title:E("swalNotice"),icon:"warning"}).then(()=>{window.open(E("noticeLink"),"_blank"),GM_setValue("notice",(new Date).getTime())}),null!==(a=C({html:`
  • ${E("echoNotice",E("noticeLink"))}
  • `}).font)&&void 0!==a&&a.find("a").on("click",()=>{GM_setValue("notice",(new Date).getTime())})),uo()}else console.log("%c%s","color:#ff0000","Auto Task脚本停止加载:当前网站不支持!")};"opquests.com"===window.location.hostname?ho():$(ho)}()}(); \ No newline at end of file + ${A.other.defaultShowLog?E("hideLog"):E("showLog")}

    `);c.find("a.auto-task-website-btn").on("click",a),$("#auto-task-buttons").append(l).append(c),null!==(a=n)&&void 0!==a&&a.options&&GM_registerMenuCommand(E("changeWebsiteOptions"),()=>{ro(n.name,n.options)}),"Setting"!==n.name&&(GM_registerMenuCommand(E("changeGlobalOptions"),()=>{w("swal")}),GM_registerMenuCommand(E("settingPage"),()=>{window.open("https://auto-task-v4.hclonely.com/setting.html","_blank")})),GM_addStyle(h.Z),console.log("%c%s","color:#1bbe1a","Auto Task脚本初始化完成!"),GM_getValue("notice")||(p().fire({title:E("swalNotice"),icon:"warning"}).then(()=>{window.open(E("noticeLink"),"_blank"),GM_setValue("notice",(new Date).getTime())}),null!==(a=C({html:`
  • ${E("echoNotice",E("noticeLink"))}
  • `}).font)&&void 0!==a&&a.find("a").on("click",()=>{GM_setValue("notice",(new Date).getTime())})),uo()}else console.log("%c%s","color:#ff0000","Auto Task脚本停止加载:当前网站不支持!")};"opquests.com"===window.location.hostname?ho():$(ho)}()}(); \ 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 bbe55e8..bcc7a04 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.1.7-Beta +// @version 4.1.8-Beta // @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 @@ -1193,8 +1193,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); globalOptions: '全局设置', checkLogin: '登录检测
    需要登录的网站自动登录,部分本网站支持', checkLeftKey: '剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持', - twitterVerifyId: '通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214', - youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q', + twitterVerifyId: '通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号', + youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道', autoUpdateSource: '更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新', saveGlobalOptions: '保存全局设置', settingPage: '设置页面', @@ -1429,8 +1429,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); 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.', - youtubeVerifyChannel: 'Verify YouTube token by trying to subscribe to the channel.
    ' + 'The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.', + 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', @@ -1564,8 +1564,8 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); retweets: 'Retweet', followingTwitterUser: 'Following Twitter User', unfollowingTwitterUser: 'Unfollowing Twitter User', - retweetting: 'Retweeting', - unretweetting: 'Unretweeting', + retweetting: 'Retweetting', + unretweetting: 'Unretweetting', names: 'Group/Public/Wall', loginVk: 'Please log in to Vk', gettingVkId: 'Getting Vk task Id', @@ -4459,6 +4459,10 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ } return true; } + if (verify && data.responseText.includes('You may not subscribe to yourself')) { + logStatus.success(); + return true; + } logStatus.error(i18n('tryUpdateYtbAuth'), true); return false; } @@ -5540,7 +5544,7 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ if (!doTask && this.whiteList.forums.includes(gameId)) { scripts_echoLog({ type: 'whiteList', - text: 'Steam.unsubscribForum', + text: 'Steam.unsubscribeForum', id: gameId }); return true; @@ -8130,8 +8134,8 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ } after() { try { - const selecter = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container'; - const mainPost = $(selecter); + const selector = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container'; + const mainPost = $(selector); const discordLinks = mainPost.find('a[href*="discord.com"]'); const redditLinks = mainPost.find('a[href*="reddit.com"]'); const insLinks = mainPost.find('a[href*="instagram.com"]'); @@ -9597,7 +9601,7 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ Setting_classPrivateMethodInitSpec(this, Setting_getId); Setting_defineProperty(this, 'name', 'Setting'); Setting_defineProperty(this, 'buttons', [ 'saveGlobalOptions', 'syncData', 'tasksHistory' ]); - Setting_defineProperty(this, 'dataSync', dataSync); + Setting_defineProperty(this, 'syncData', dataSync); } tasksHistory() { window.open('https://auto-task-v4.hclonely.com/history.html', '_blank'); @@ -10181,16 +10185,9 @@ ${$.makeArray($('#auto-task-info>li')).map(element => element.innerText).join('\ }); } if (website.name !== 'Setting') { - GM_registerMenuCommand(i18n('whiteList'), () => { - whiteList('swal'); - }); GM_registerMenuCommand(i18n('changeGlobalOptions'), () => { changeGlobalOptions('swal'); }); - GM_registerMenuCommand(i18n('tasksHistory'), () => { - window.open('https://auto-task-v4.hclonely.com/history.html', '_blank'); - }); - GM_registerMenuCommand(i18n('syncData'), dataSync); GM_registerMenuCommand(i18n('settingPage'), () => { window.open('https://auto-task-v4.hclonely.com/setting.html', '_blank'); }); diff --git a/page/package.json b/page/package.json index 4164f98..c35f7bc 100644 --- a/page/package.json +++ b/page/package.json @@ -1,8 +1,10 @@ { "name": "auto-task-new", - "version": "4.1.7-Beta", + "version": "4.1.8-Beta", "change": [ - "Gleam任务识别优化,自动填写表单优化" + "油管、推特验证机制优化", + "白名单、任务历史、数据同步功能移动到设置页面", + "其他优化" ], "description": "赠Key站自动任务脚本", "main": "package.json", @@ -10,10 +12,10 @@ "test": "eslint", "tsc": "tsc", "gs": "webpack --config webpack.giveawaysu.config.js", - "pack": "webpack --config webpack.config.js", + "dev": "webpack --config webpack.config.js", "build": "webpack --config webpack.config.js && webpack --config webpack.compatibility.config.js && webpack --config webpack.giveawaysu.config.js && node copy.js" }, - "author": "HCLonely", + "author": "HCLonely ", "license": "MIT", "devDependencies": { "@babel/core": "^7.16.0", diff --git a/src/index.ts b/src/index.ts index a3fbd23..ffe48c2 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ /* * @Author : HCLonely * @Date : 2021-10-26 15:44:54 - * @LastEditTime : 2022-01-06 13:35:09 + * @LastEditTime : 2022-01-08 17:19:28 * @LastEditors : HCLonely * @FilePath : /auto-task-new/src/index.ts * @Description : @@ -128,7 +128,6 @@ const loadScript = async () => { }); keyboardJS.bind(globalOptions.hotKey.toggleLogKey, toggleLog); - // do something // @ts-ignore if (website?.after) await website?.after(); @@ -141,7 +140,6 @@ const loadScript = async () => { // @ts-ignore if (website[button]) { // @ts-ignore - // GM_registerMenuCommand(__(button), () => { website[button](); }); const btnElement = $(`

    ${__(button)}

    `); // @ts-ignore @@ -173,12 +171,12 @@ const loadScript = async () => { } if (website.name !== 'Setting') { - GM_registerMenuCommand(__('whiteList'), () => { whiteListOptions('swal'); }); + // GM_registerMenuCommand(__('whiteList'), () => { whiteListOptions('swal'); }); GM_registerMenuCommand(__('changeGlobalOptions'), () => { changeGlobalOptions('swal'); }); - GM_registerMenuCommand(__('tasksHistory'), () => { - window.open('https://auto-task-v4.hclonely.com/history.html', '_blank'); - }); - GM_registerMenuCommand(__('syncData'), syncOptions); + // GM_registerMenuCommand(__('tasksHistory'), () => { + // window.open('https://auto-task-v4.hclonely.com/history.html', '_blank'); + // }); + // GM_registerMenuCommand(__('syncData'), syncOptions); GM_registerMenuCommand(__('settingPage'), () => { window.open('https://auto-task-v4.hclonely.com/setting.html', '_blank'); }); diff --git a/src/locales/en-US.js b/src/locales/en-US.js index d629287..1fc097b 100644 --- a/src/locales/en-US.js +++ b/src/locales/en-US.js @@ -1,7 +1,7 @@ /* * @Author : HCLonely * @Date : 2021-12-30 17:08:27 - * @LastEditTime : 2022-01-07 10:09:45 + * @LastEditTime : 2022-01-08 17:03:59 * @LastEditors : HCLonely * @FilePath : /auto-task-new/src/locales/en-US.js * @Description : i18n英文 @@ -76,9 +76,11 @@ const data = { 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.', + 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.', + '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', @@ -236,8 +238,8 @@ const data = { retweets: 'Retweet', followingTwitterUser: 'Following Twitter User', unfollowingTwitterUser: 'Unfollowing Twitter User', - retweetting: 'Retweeting', - unretweetting: 'Unretweeting', + retweetting: 'Retweetting', + unretweetting: 'Unretweetting', // Vk names: 'Group/Public/Wall', diff --git a/src/locales/zh-CN.js b/src/locales/zh-CN.js index 30113b2..b32c602 100644 --- a/src/locales/zh-CN.js +++ b/src/locales/zh-CN.js @@ -75,8 +75,8 @@ const data = { globalOptions: '全局设置', checkLogin: '登录检测
    需要登录的网站自动登录,部分本网站支持', checkLeftKey: '剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持', - twitterVerifyId: '通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214', - youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q', + twitterVerifyId: '通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214
    不想关注官方账号可以改为自己的帐号', + youtubeVerifyChannel: '通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q
    不想关注官方频道可以改为自己的频道', autoUpdateSource: '更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    standby: 备用
    auto: 依次使用github, jsdelivr, standby源进行尝试更新', saveGlobalOptions: '保存全局设置', settingPage: '设置页面', diff --git a/src/scripts/social/Discord.ts b/src/scripts/social/Discord.ts index 8dcd21b..1d9f2ff 100644 --- a/src/scripts/social/Discord.ts +++ b/src/scripts/social/Discord.ts @@ -1,7 +1,7 @@ /* * @Author : HCLonely * @Date : 2021-09-28 15:03:10 - * @LastEditTime : 2022-01-02 12:38:07 + * @LastEditTime : 2022-01-08 17:02:01 * @LastEditors : HCLonely * @FilePath : /auto-task-new/src/scripts/social/Discord.ts * @Description : Discord 加入&移除服务器 @@ -24,7 +24,6 @@ class Discord extends Social { #cache: cache = GM_getValue('discordCache') || {}; #initialized = false; - // TODO:优化 async init(): Promise { /** * @description: 验证及获取Auth @@ -93,7 +92,7 @@ class Discord extends Social { async #updateAuth(): Promise { /** * @internal - * @description 通过打开Discord网站更新Token. // TODO: 需优化 + * @description 通过打开Discord网站更新Token. * @return true: 更新Token成功 | false: 更新Token失败 */ try { diff --git a/src/scripts/social/Steam.ts b/src/scripts/social/Steam.ts index 4632c80..9fa3c26 100644 --- a/src/scripts/social/Steam.ts +++ b/src/scripts/social/Steam.ts @@ -1,7 +1,7 @@ /* * @Author : HCLonely * @Date : 2021-10-04 16:07:55 - * @LastEditTime : 2022-01-02 12:39:02 + * @LastEditTime : 2022-01-08 17:02:39 * @LastEditors : HCLonely * @FilePath : /auto-task-new/src/scripts/social/Steam.ts * @Description : steam相关功能 @@ -543,7 +543,7 @@ class Steam extends Social { */ try { if (!doTask && this.whiteList.forums.includes(gameId)) { - echoLog({ type: 'whiteList', text: 'Steam.unsubscribForum', id: gameId }); + echoLog({ type: 'whiteList', text: 'Steam.unsubscribeForum', id: gameId }); return true; } const forumId = await this.#getForumId(gameId); diff --git a/src/scripts/social/Twitter.ts b/src/scripts/social/Twitter.ts index ae0b67b..7df0f18 100644 --- a/src/scripts/social/Twitter.ts +++ b/src/scripts/social/Twitter.ts @@ -1,7 +1,7 @@ /* * @Author : HCLonely * @Date : 2021-10-04 10:36:57 - * @LastEditTime : 2022-01-02 12:39:56 + * @LastEditTime : 2022-01-08 16:54:26 * @LastEditors : HCLonely * @FilePath : /auto-task-new/src/scripts/social/Twitter.ts * @Description : Twitter 关注/取关用户,转推/取消转推推文 @@ -343,5 +343,4 @@ class Twitter extends Social { } } } - export default Twitter; diff --git a/src/scripts/social/Youtube.ts b/src/scripts/social/Youtube.ts index 89b27ed..33b67d6 100644 --- a/src/scripts/social/Youtube.ts +++ b/src/scripts/social/Youtube.ts @@ -1,7 +1,7 @@ /* * @Author : HCLonely * @Date : 2021-10-04 12:18:06 - * @LastEditTime : 2022-01-02 12:41:10 + * @LastEditTime : 2022-01-08 17:01:24 * @LastEditors : HCLonely * @FilePath : /auto-task-new/src/scripts/social/Youtube.ts * @Description : Youtube 订阅/取消订阅频道,点赞/取消点赞视频 @@ -245,6 +245,10 @@ class Youtube extends Social { } return true; } + if (verify && data.responseText.includes('You may not subscribe to yourself')) { + logStatus.success(); + return true; + } logStatus.error(__('tryUpdateYtbAuth'), true); return false; } diff --git a/src/scripts/website/Keylol.ts b/src/scripts/website/Keylol.ts index bbabdb0..e00e71e 100644 --- a/src/scripts/website/Keylol.ts +++ b/src/scripts/website/Keylol.ts @@ -1,7 +1,7 @@ /* * @Author : HCLonely * @Date : 2021-11-15 13:58:41 - * @LastEditTime : 2022-01-03 15:36:59 + * @LastEditTime : 2022-01-08 17:07:34 * @LastEditors : HCLonely * @FilePath : /auto-task-new/src/scripts/website/Keylol.ts * @Description : https://keylol.com/f319-1 @@ -70,8 +70,8 @@ class Keylol extends Website { } after(): void { try { - const selecter = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container'; - const mainPost = $(selecter); + const selector = this.name === 'Keylol' ? '#postlist>div[id^="post_"]:first' : 'div.container'; + const mainPost = $(selector); const discordLinks = mainPost.find('a[href*="discord.com"]'); const redditLinks = mainPost.find('a[href*="reddit.com"]'); const insLinks = mainPost.find('a[href*="instagram.com"]'); diff --git a/src/scripts/website/Setting.ts b/src/scripts/website/Setting.ts index 0b8aaca..7f0dda3 100644 --- a/src/scripts/website/Setting.ts +++ b/src/scripts/website/Setting.ts @@ -1,7 +1,7 @@ /* * @Author : HCLonely * @Date : 2021-12-25 19:00:53 - * @LastEditTime : 2022-01-02 12:32:13 + * @LastEditTime : 2022-01-08 17:18:55 * @LastEditors : HCLonely * @FilePath : /auto-task-new/src/scripts/website/Setting.ts * @Description : 设置页面 @@ -24,7 +24,7 @@ class Setting { 'syncData', 'tasksHistory' ]; - dataSync = syncOptions; + syncData = syncOptions; tasksHistory(): void { window.open('https://auto-task-v4.hclonely.com/history.html', '_blank');