faker3/jd_opencard_0718.js
2024-07-18 13:00:42 +08:00

15 lines
35 KiB
JavaScript

/*
环境变量:
export jd_opencard_draw="3" //抽奖次数 3
export jd_opencard_notify="true" // 是否推送
cron:1 1 1 1 *
*/
const $ = new Env('7.18-7.25 瓜分百万京豆')
function _0x3fe7(){const _0x351fa8=['W6rQnCoS','WOWshWpcKXjG','F+E5QEAFOUAxPEMxTU+/HG','W7tdNSko','WRKbW7jcDxzMsa','B8oclmoWWRqrDb3dSvBdOaKcW4VcMSo5lYRcO8ofW5CwsCobgmkJWPpcVa','gCkMWQZcG8oe','W4f5W7f8yG','W4S0vmo+dxhcRCkuW5dcKSkqWRW','WQ/dImozA8oMW5eH','W5niW7C','pe3dKqtdP2e8','BNRcISo5','8yYMTE+6KWBKViJMG6tLIjC','5RsB5yU65BsU57I55P6IhW','eZOwW5addLxcOSklW7iwWRL1WOFdPCk6veFcNZDfWPCn','W6jEmCo7FNb4','W6Xqj8oC','WRpORQ/MS4ZLKzZLUP4e','W60sW6hcL8olAwlcNJ0','W43dICkXjJ/cTSoWlG','5BwH6k+j57+55OQe5Asm','CgJdKa','5Q2D5OUz5Asv','W4n7W7f2FmoPB8oX','pfavvmkQ','F8kQWRNcJSohmry','5A+z5PER5yM15yMX5Bsp5RQa','W78yW7a','W7DGtG','W4T2W6f6CG','suldVmoMWQ7dM0iUWQu','W4JdImk1','aq3cGHaYvq','rdpcQmkl','W44miCkoWOGn','W48ylmkjWOitzW','C23dKwzADSoAW7TppmkmFa','hSoSpq','W7SfeSksWOuHW4GzF3WeWOn7ssK','pIzIWPPrla','vSkbo8kJofK','8l6jNCky','lCoGaai','WQ/dNmksW7ioWPHF','W4hdN8oaxq/dJSo8uq','lSkEDCkOW6nRBr3dLLxdLJW','W7WnbCk+','6AgN5y695B2S5yYk5OUK5yUj5yQE5AE85yUvpCkb','C3tcISoJ','dbaCW5v+qa','ovldNqtdU3C','dahcKq','dbeWW40','W6a3W6pdTa','eJujW4FdMqKjkmosimkZWQNcJSoIW6jhW543W6SxWQTkWQe','W6n/nmoUWQyKW7bsqG','p+IVNoAYKEwKQEI1R8o94PY+WOhMLzFLKztLU57MLAdMJA8','vh8qW4pdOXeBC8o1nG','tmoWd8kLxZ8','WPeiW6xdP8kDh3VdHMtcTmocW7X+cSoIW5pcKCkrufK','aCkTW61FswxcJ8oY','W64tW7pcJq','W4PuW7xdOCkIpa','8jcnP3K','W7XKiq','Fmk1WRS','iKmrsW','usGaW4ebrKu','W6JcLri','WQhdGSoeFSoUW5e','ALJcTMOgWRldHCoiW5K','FKJcP3e8WRG','8y+4HSkk','W5jcW6pdOmkvfg0','W4ZdLmojWQSsWO9zrq','xLFdQCo1','4PYFWOZLI6ZLIitMI4RLI4e','W6JdG8kaDmoM','4P62iEADJ+IaT+ATNoEGP+wNN+EtU8kk','qCo8ha','W7Gsb8kWWRi/W6OxFW','WQdcRtCtW7BdIYNdGGtdMSo8uCklisjNvmkRDcpcI0JcP8kRvH0oW5pdLmoAoCoEW40','6ykc556j5O+z6yoEsH0p','i8kuW6RdU3u','C0tcTa','xSoMgmkVtcNdJq','8lEUKCkL5OgY5zAw6iY75B6X5AYl54MJWOlLPjpLKj7LKjtNPyhVV6a','p0ODxmkQqmk6W4/dRa','WRhcQdqx','W4xcSSovbwhdKK7dRW','mCkFW7/dOgBcLG','5Q665OQY5Aw/W6dLJz7MIQtLPPu','5B6+5yYhWQZOVl3PNR/LVl0','eCoFW4LYA8kWtq','5QYXW5dLIBxLIBVNOPpVVzLA','WP5GeCkR','WPtcJ8ocWP4U','W63dGSkmFmopxmofeCo1','kSo2gGqGcMG','W78fW7tcJmojwelcLW','umkbpG','W5ackmkVWPus','W6m3W6FdV35xCG','WOVcHmoiWP8ZWPT7EW','WPpcGmolWP4','dHeTW6b5sG','fMldM0HMWRfxWPK7','WOddVCo1W6q','WQjOWR7cOtSuCajgba','CmoigSoWWQO7AHVdVMpdLHe1W63dICk6','W6rEna','W7PQoIxdOCkK','W7hdGSk2BmoXvSodeW','WPFdNSopASojW5CPdG','W75HxW','W7apaq','W7C3W6ddTa','iCoMeq','DCozmCozWRy/yW','W4WcjSkeWPmtjW','CgJcVmoVW7KpWOldVG','5A+P5PwJ5P+25RAV6kwA5zsf5zk7','W6PuW7xdOCk6eMxcJa','W7HEoSotzxeM','W6HMiYK','5lIh5Asv6yk3556K','jmkDW7JdOG','W5jQW6XLBW','WQxdImoEsmo1W5K8eSoioSk8WQH6uG','WRhdHColASoIW6mXaSo/','jSkzW6xdRxxcGCkYW7e','WPhdT8oGW7rYEmkT','dmkHW74','W49HW4zWBSoPDmoGza','i8oUhq0','tgGvW4NdLq','WORdOCooW6nLBSk4WRG','xtOsW4aeB0hcOCkh','W6mfW75dpW','W70deSkUWOeOW5eC','W6q5W6FdPq','dmkMWRFcLSot','5P2555+y5yID5yUX6l2M5zUn56gr','WQ4tW71uDfbwxmkk','bmk1WRu','mfZcTNOPW7ldJSooW5ddScq/Dmoql8k2xX7cUSkrpG','WPTIeCkJssW','WOP0fSkI','m8oQgHG','bt9SWO1RnSoKga','rCo2gSkOtcJdJq','W7PSxCkLW4D8','WR8wW7vCDq','W7P6xCkKW55RWOdcPCkRWR8','W4ddHSkMkW','W7CwW6ny','omokhCo8WP/dSSoKW40','776C6k+85OIn5yIV5y2Z5AcO5ysa5zYe5z27W53cLW','W6/cGWnDuSo/da','ySomWRS','5B+l5yIH5BAd6ygF6k6hbW','W5acka','5B6E5AAT5Pw26zsr776L','tmkbmmkalvRcVG','W6j+kmocWQyN','jSoShqu3exKmzSoOW7q','W6JcK8olWQTfW5uW','nvtdMb7dL2e','dCoFgSkOe3/dNmk5','m8ogamo7WQddSW','W64jW7a','Dh7cKmo+W6OnWOy','W7CfW7zoh1X7WPhcNa','cW7cRCkKW6ZdMLWeWRDfWQu','WPhcHmoiWPWIWOe','W79UxCkT','WPRMIRBKUAVLRjNNIQfJ','AhuxW5BdNHy','sYddMsHYWPu','mtdcJYuQk8onW7X5p8k6ra','W4H3W6XXwCoKsCoLr8olkmk9Fmod','W5hcMCotWR1k','W44yiCkVWOKe','W49vW7NdQCkr','W6Xuj8oCEg5M','WOSUzmoUWQxcJW','chpdMLjPWRfB','vIiAW5WPrq','W7O2W6RdThi','W6H7w8kLW59+WQRcRmk2','5Bw357I55yIr5yMd6l+J5lI05zkkWRW','WPykbr8','B+AoHoIJPEw8OEwLNUAuOoMxIU+/Pq','whK5','W5jTW7z3','WOKIACoIWP/cHLnh','W7KoaSktWP4GW70','W7zIkSoZWQ0X','W6adW6vqneLGWPJcLW','WQ3cSIa','waxcKJGdsmox','5Ro45P6G5yUa5yIo5Q+i5PEN5lI0W7W','WQFcTd8','W7KBemkTfgKTw8oB','W67dLmkhASoMqCoRha','W6CwW6rs','5y6K6yAR5B2d5zkk54QH5OcVkKa4W5xcVq','e20zW5hdK0OpACoPkSk/WOpcKSo0W5mcW4KCW6uiWQm','W68ib8k1WPiyW60rAq','W7ezjCkOWPmOW4OnyW','ttFcR8kzWPWgBG','C3/cVmoIW7SpWO3dTKNdPmoNWRFcSsRdKCkRW6z2','WObPsmkPuq','dmk6WRm','5y+46yAD54MQ5OoR57IU5PY+nG4rW6RcRG','fwtdGfTT','aczGWPf2oW','W6n+jCoKWQ0WW6O','W4ZdNSkcA8oT','5OUy5Awa5Q6i5PwrmSo2zq','cCkGW6Pttxq','W5ldGSk8lI/cOmoCoq','umkblCkApfVdTq','yConWRRcUcddH8kjW7bSWRO+WPq','bSooW496Bmk7v8kZW40','lZ3cKYejkCoj','5PYw55+/5AsQ5zgY776Q','WQJcRGuwW7hdJaVdLX/dKq','nComb8oYWP3dVW','WPJcJ8ocWQ8/WOrx','W78fW7tcJmojwf/cMIZdV8ot','W4/cS8osda','pmktW7/dVxxcGCkc','qcZdHc9nWPq','W7SfeSkeWPGIW7mrAeSiWOP6sq','zmkOWQNcHq','5lMalEEMIUwlJowpKoAlTowMJCoh','W6Onh8k7h1a','W6H8ls/dSSkYW4u','W77dNCkgyCoX','WPuQzmoTWR7cIG','caBcRSkGW6ldUwK7WOLSWRm','W7iOW77dVwnhiueEw1aHqmkoCgNdPbhcGSkQlCkzW7ZdQSojW5zqW6uqWQC','gsXNWPTXkSoK','WOyOFSoGWQFcGNDg','W6H7smk+W4vnWQRcP8kQ','WQLDqmoUqaKMtSoZW5WOW78','ivZdMG7dNx4','dG/cMXW','W6aIW7BdQh9kBuCugLD9xmkxFgVcSaFcJSoLpmkfW7q','W5FdGSk8lGtcVCoHnbNcLW','W7GbeSkM','WO8/FSo5W6VdIbfbW5LqW6ldGH1yWQVcMCkxW4/dLgKiW4VcUSkldCkfWOhcNmk7cwddN8oAsa','ACoyn8o2WRq5Br7dPG','gJX6WPC','4P6XW4hMNOZNNj7ORQhMSQSs','WQ5kWQOezW','AmonWRldShVcGCkwW41J','vwKJW5hdGGaBBa','axNdH0q','5yIZ5ys95BIz6zgR5lYq5zg85OMq5yQQ','ySoiWRZdKwRcLCk6W5Ts','WPC+ECoH','nmoqkSo6WO3dSG','td3cUW','eaeTW4jJrG','W60FfmkTjNi','ifxdLrJdLW','ywtdGsFdVfO3','FgpcISo5','WPzUaG','kY/dLmovW7emWQldM1S','fgddRmoDW4ruyLzLWPpdTXW','WPaQy8o9','WQZcUdqmW77dJY0','572A5BoF5B2C6kA35y+95PwW77+k6k2H6ysY5PA/6l6S6kcN','WRuGq8kOW7j2WQZcOCkMWR8','sepdS8orWRtdQW','WQPCqSoRseSwu8o3W60n','44kd5lU05lQs6lA35y+9','8kEpP8ow5Ocu5zEy6i6h5BYd5AY654Q4aZJLP7pLK4tLKRdNPihVVk0','W5eipmkzWOyhCq','W6LQwmk5W5rQWRC','bcTfW4RdMXCxx8oc','W4KdpmkpWPmJEWezbCoh','W5eeiq','WQVdG8ooFCo/','qslcRmkpWPmfsfXcWQpdTGaV','W4KEkSkyWQSpCWCC','wsVdJdnHWQupW5HQ','mCkFW7/dOgBcMSkpW6X0WP0B','5PYw5BQ86zcP5BYy5yYR5AES6lAhWO3OTytOVz7MIk3OOzX/','uvVcMsKavSo/W74','5lUA6AcE5y6U5PsB6i2f5y625As06lAp772O6k+W6ywS5PsC6l2u6kom','uJFcGZqkECoZ','EhJcL8oKW70pWRFdVfZdUSoM','yGtcHflcHsmHWPucBSoKCa','W4XtW6ldUSkAfghcJ08','5PY155+o5AAf5zoz772q','5lIu5A2d5z+l','ENtcH8oO','pCo0WRK','W5Gmo8kl','WQVcSIu','W7DMkq','W6TEn8oy','W50oo8kdWPefxqO','W7OzW7nCiG','WOldSCoLW6HHBG','WPtdS8o4W7u','vLpdS8oZWQ7dPW','iKSFrCkbDmkIW4m','nmkDW7/dQa','FN7cL8oaW64zWPddTe/dSW','WRFdHSki','WO1Gdmk+','w0hdVmoMWR7dGuOUWQu','k8kED8kTW69SmK/dPNZdTIudW7i','W5VdNSkhESoMxCowvCopbmorwG','W7FdGCkmymoGuSoqhmoeeCoitmkJ','W783W6K','DKxcShq/WRNdH8os','WRJORyBMSQVLPl/OTQyt4PY+wa','sCoYaSkbsci','W6NcMCoF','W7FcG8owWP1kW5y','W75HtCkyW5H0WQy','emk7W6PE','WO0oaGZcHGG','dNpdKa','jmk7WR/cKmonW4bGAmkMW7NcMSoXecCeW5S4WO9oW4SJiCohW7lcVb4CWQhdMw3cHtJcOSkAp8oDrmkfW7n2WPeOW7xdNZJdILpdIColpgu1EvZdSMNdICk5W5COWQyQWONcSmoNdhlcM8o5W50BW7BdM8oEqmkGcmoZW7PFpqiFtrbtWOfeWPtdNSkPW6qKW4NdGmkcW6ddU150WQ9BW7eLW6FdTG/dImkxAXSGW7tcMN1BCHqJbSk4WOHtd8kyWQVcGHddSspcQmkgyYr+uwddKSo6WRxdPmoAaCo5uCoOleVdR1lcSM1mghO/','5PYa5Rsm6kwL5zsh5zof','W7effCk0WPyQW70','5P2w5ysm6ykR5B6L5y22','mJFcItWCpq','W6ZcMmoCWR1C','W6/cMCorWRzTW5y','W43dICkHlZJcPG','gCovW5O','lrVdOW','cmk3WRhcKmoxW4K','44kd5O6i56A044ka6k+95ywS6i+35y+JnfTrzupcMa','FCowlmoVW7z+yb3dUx3dKZO0WRpcImkVBq','arNcLWSGFSo1W4NcTa','AxtcISoJW78zW5e','WOLPbmk4wG','FCk/WQ/cK8oZjb8','WP/cKCkvh23dSSoMC8k9WQxcPW','ANpcJmo9W4io','kSoQgH8Gh2G','W7G9W7FdOG','W6JdHmkAzG','fmozW4L6Dmk5AmkA','5OUi5AES6iYk5B6eomo8','W6TiW7VdTSkAaa'];_0x3fe7=function(){return _0x351fa8;};return _0x3fe7();}const _0x462ec3=_0x2892;(function(_0x3b24d5,_0x55f8e8){const _0x2c2512=_0x2892,_0x7fc23e=_0x3b24d5();while(!![]){try{const _0xd2d141=parseInt(_0x2c2512(0x24a,'Be$d'))/0x1*(parseInt(_0x2c2512(0x260,'JU@i'))/0x2)+-parseInt(_0x2c2512(0x23b,'@64l'))/0x3*(-parseInt(_0x2c2512(0x22b,'0pHW'))/0x4)+-parseInt(_0x2c2512(0x184,'h]H9'))/0x5*(parseInt(_0x2c2512(0x1e7,'0pHW'))/0x6)+parseInt(_0x2c2512(0x219,'@64l'))/0x7+-parseInt(_0x2c2512(0x202,'JU@i'))/0x8*(parseInt(_0x2c2512(0x113,'uNG$'))/0x9)+-parseInt(_0x2c2512(0x262,'(mMB'))/0xa*(-parseInt(_0x2c2512(0x1e2,'v9R]'))/0xb)+parseInt(_0x2c2512(0x141,'hhYz'))/0xc*(parseInt(_0x2c2512(0x23f,'@64l'))/0xd);if(_0xd2d141===_0x55f8e8)break;else _0x7fc23e['push'](_0x7fc23e['shift']());}catch(_0x137d67){_0x7fc23e['push'](_0x7fc23e['shift']());}}}(_0x3fe7,0xaf064));function _0x2892(_0x2191d4,_0x1d90b4){const _0x3fe788=_0x3fe7();return _0x2892=function(_0x2892f7,_0x557a20){_0x2892f7=_0x2892f7-0x111;let _0x366bd1=_0x3fe788[_0x2892f7];if(_0x2892['GUvHAB']===undefined){var _0x3e55a7=function(_0x2672e0){const _0x2014f9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x41f8ec='',_0x622341='';for(let _0x1a839d=0x0,_0x13c94b,_0x214e10,_0x1b5e89=0x0;_0x214e10=_0x2672e0['charAt'](_0x1b5e89++);~_0x214e10&&(_0x13c94b=_0x1a839d%0x4?_0x13c94b*0x40+_0x214e10:_0x214e10,_0x1a839d++%0x4)?_0x41f8ec+=String['fromCharCode'](0xff&_0x13c94b>>(-0x2*_0x1a839d&0x6)):0x0){_0x214e10=_0x2014f9['indexOf'](_0x214e10);}for(let _0x5ab4ef=0x0,_0x5c995b=_0x41f8ec['length'];_0x5ab4ef<_0x5c995b;_0x5ab4ef++){_0x622341+='%'+('00'+_0x41f8ec['charCodeAt'](_0x5ab4ef)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x622341);};const _0x3955c8=function(_0x3a18ab,_0x3663ac){let _0x2fdf46=[],_0x9f70a0=0x0,_0x41d698,_0x44be39='';_0x3a18ab=_0x3e55a7(_0x3a18ab);let _0x5aaed1;for(_0x5aaed1=0x0;_0x5aaed1<0x100;_0x5aaed1++){_0x2fdf46[_0x5aaed1]=_0x5aaed1;}for(_0x5aaed1=0x0;_0x5aaed1<0x100;_0x5aaed1++){_0x9f70a0=(_0x9f70a0+_0x2fdf46[_0x5aaed1]+_0x3663ac['charCodeAt'](_0x5aaed1%_0x3663ac['length']))%0x100,_0x41d698=_0x2fdf46[_0x5aaed1],_0x2fdf46[_0x5aaed1]=_0x2fdf46[_0x9f70a0],_0x2fdf46[_0x9f70a0]=_0x41d698;}_0x5aaed1=0x0,_0x9f70a0=0x0;for(let _0x440248=0x0;_0x440248<_0x3a18ab['length'];_0x440248++){_0x5aaed1=(_0x5aaed1+0x1)%0x100,_0x9f70a0=(_0x9f70a0+_0x2fdf46[_0x5aaed1])%0x100,_0x41d698=_0x2fdf46[_0x5aaed1],_0x2fdf46[_0x5aaed1]=_0x2fdf46[_0x9f70a0],_0x2fdf46[_0x9f70a0]=_0x41d698,_0x44be39+=String['fromCharCode'](_0x3a18ab['charCodeAt'](_0x440248)^_0x2fdf46[(_0x2fdf46[_0x5aaed1]+_0x2fdf46[_0x9f70a0])%0x100]);}return _0x44be39;};_0x2892['pGAjpo']=_0x3955c8,_0x2191d4=arguments,_0x2892['GUvHAB']=!![];}const _0x55c181=_0x3fe788[0x0],_0x49aa43=_0x2892f7+_0x55c181,_0x1d670f=_0x2191d4[_0x49aa43];return!_0x1d670f?(_0x2892['RqltDQ']===undefined&&(_0x2892['RqltDQ']=!![]),_0x366bd1=_0x2892['pGAjpo'](_0x366bd1,_0x557a20),_0x2191d4[_0x49aa43]=_0x366bd1):_0x366bd1=_0x1d670f,_0x366bd1;},_0x2892(_0x2191d4,_0x1d90b4);}const notify=require('./utils/Rebels_sendJDNotify'),jdCookie=require(_0x462ec3(0x24e,']4mu')),getToken=require(_0x462ec3(0x175,'tsn!')),common=require(_0x462ec3(0x170,'n01[')),isNotify=process[_0x462ec3(0x1ac,']4mu')][_0x462ec3(0x20d,'5ZCs')]===_0x462ec3(0x225,'8Qgs'),opencard_draw=process[_0x462ec3(0x20f,'LBAK')][_0x462ec3(0x1a7,'uNG$')]||0x5;let domains='https://szxyun-rc.isvjcloud.com',cookie='';const cookiesArr=Object[_0x462ec3(0x134,'$Sy3')](jdCookie)['map'](_0x3955c8=>jdCookie[_0x3955c8])[_0x462ec3(0x1e1,'(mMB')](_0x2672e0=>_0x2672e0);!cookiesArr[0x0]&&($['msg']($[_0x462ec3(0x232,'JU@i')],_0x462ec3(0x12b,'$Sy3')),process[_0x462ec3(0x247,'5ZCs')](0x1));!(async()=>{const _0x4c98dc=_0x462ec3;console[_0x4c98dc(0x17a,'(kL%')](_0x4c98dc(0x23a,'r][c')+$['name']+_0x4c98dc(0x208,'4%pX')),console['log']('代理开关:\x20['+common[_0x4c98dc(0x1ba,'g(oi')]()+']'),console[_0x4c98dc(0x128,'Qxcc')](_0x4c98dc(0x215,'d0KD')+opencard_draw+'次]'),console[_0x4c98dc(0x155,'r][c')](_0x4c98dc(0x18c,'cp0Q')+(isNotify?'开启':'关闭')+']'),console['log']('====='+$[_0x4c98dc(0x17c,'c!&g')]+_0x4c98dc(0x210,'Be$d')),authorCodeList=await getAuthorCodeList(_0x4c98dc(0x236,'rgK9')),$[_0x4c98dc(0x1bf,'twbO')]=![];if(authorCodeList)$['myCodeRun']=!![],$['authorCode']=authorCodeList[random(0x0,authorCodeList[_0x4c98dc(0x243,'4%pX')])];else{}$[_0x4c98dc(0x132,'5ZCs')]=_0x4c98dc(0x1a6,'$Sy3'),$[_0x4c98dc(0x151,'twbO')]=_0x4c98dc(0x13e,'uNG$'),$[_0x4c98dc(0x1df,'gYZ7')]='https://szxyun-rc.isvjcloud.com/pagec/unionOpenZDH240222/index.html',$[_0x4c98dc(0x20a,'T2m^')]=$[_0x4c98dc(0x1d3,']4mu')],notify[_0x4c98dc(0x17f,'g(oi')]({'title':$['name']});for(let _0x2014f9=0x0;_0x2014f9<cookiesArr[_0x4c98dc(0x11e,'eJOc')];_0x2014f9++){$[_0x4c98dc(0x157,'twbO')]=_0x2014f9+0x1,cookie=cookiesArr[_0x2014f9],common['setCookie'](cookie),$[_0x4c98dc(0x1ab,'g(oi')]=decodeURIComponent(common[_0x4c98dc(0x224,'T2m^')](cookie,_0x4c98dc(0x16b,'4%pX'))),$['UA']=common['genUA']($[_0x4c98dc(0x1b4,'tsn!')]),$['message']=notify['create']($[_0x4c98dc(0x26d,'r][c')],$['UserName']),$[_0x4c98dc(0x1fd,'rgK9')]='',console['log']('\x0a******开始【京东账号'+$[_0x4c98dc(0x19a,'h]H9')]+'】'+($['nickName']||$['UserName'])+_0x4c98dc(0x165,'Yfu%')),await Main(),common[_0x4c98dc(0x256,'aXSI')]();if($[_0x4c98dc(0x1a3,'4%pX')])break;await $[_0x4c98dc(0x24b,'rgK9')](parseInt(Math[_0x4c98dc(0x15c,'aXSI')]()*0x5dc+0x7d0,0xa));}isNotify&&notify[_0x4c98dc(0x273,'5ZCs')]()&&(notify[_0x4c98dc(0x259,'Be$d')]('\x0a'),await notify[_0x4c98dc(0x135,'[[tV')]());})()[_0x462ec3(0x140,'twbO')](_0x41f8ec=>$[_0x462ec3(0x19f,'aXSI')](_0x41f8ec))['finally'](()=>$[_0x462ec3(0x1ae,'$Sy3')]());async function Main(){const _0x5b3224=_0x462ec3;try{$[_0x5b3224(0x1fe,'T2m^')]=0x0,$[_0x5b3224(0x1aa,'[[tV')]=![],$['Token']='',$[_0x5b3224(0x161,'*XDE')]='',$[_0x5b3224(0x1ef,'Yfu%')]=await getToken(cookie,domains);if($['Token']==''){console[_0x5b3224(0x242,'Be$d')](_0x5b3224(0x24d,'LTaV')),$[_0x5b3224(0x130,'8Qgs')]['fix']('TOKEN获取失败~');return;}await $[_0x5b3224(0x111,'hhYz')](parseInt(Math['random']()*0x1f4+0x1f4,0xa)),await sendRequest(_0x5b3224(0x19b,'[[tV'));if($['Tokens']){$[_0x5b3224(0x1ec,'y)51')]='',await sendRequest(_0x5b3224(0x1a9,'8DP4'));if($[_0x5b3224(0x1f0,'aXSI')])return;if($[_0x5b3224(0x1d1,']4mu')]){$[_0x5b3224(0x1f6,'$Sy3')]===0x1&&(console['log'](''+($[_0x5b3224(0x220,'5th)')]&&'活动名称:#'+$['activeTitle'])),console[_0x5b3224(0x156,']4mu')](_0x5b3224(0x1dc,'5th)')+$[_0x5b3224(0x158,'0pHW')]+_0x5b3224(0x13b,'Qxcc')+$['endTime']+_0x5b3224(0x1fa,'d0KD')+$[_0x5b3224(0x166,'a5rE')]+'\x0a'));console[_0x5b3224(0x13c,'[[tV')](_0x5b3224(0x1da,'cp0Q')+$['points']+_0x5b3224(0x226,'hhYz')+$[_0x5b3224(0x1a0,'$Sy3')]+_0x5b3224(0x198,'8Qgs')+$['joinId']);for(let _0x1a839d in $[_0x5b3224(0x1cc,'hhYz')][_0x5b3224(0x162,'v9R]')]){let _0x13c94b=$['active']['jobMap'][_0x1a839d];_0x13c94b['details']=_0x13c94b[_0x5b3224(0x1f2,'#q$D')][_0x5b3224(0x1ff,'(kL%')](_0x5ab4ef=>_0x5ab4ef[_0x5b3224(0x23d,'d0KD')]===null);let _0x214e10=_0x13c94b[_0x5b3224(0x119,'Ok7)')]||0x1,_0x1b5e89=_0x13c94b['finishNum']||0x0;for(let _0x5c995b=_0x1b5e89;_0x5c995b<_0x214e10;_0x5c995b++){$['key']=_0x1a839d,$[_0x5b3224(0x1b8,'@64l')]=_0x13c94b,await sendRequest(_0x5b3224(0x269,'6%aV'));}}$['opencard_list']=$[_0x5b3224(0x12a,'LBAK')]['bindCardInfo']||[];let _0x622341=$['opencard_list']['filter'](_0x3a18ab=>!_0x3a18ab[_0x5b3224(0x21d,'6%aV')])||[];console[_0x5b3224(0x1a8,'#q$D')]('共有'+$[_0x5b3224(0x115,'[[tV')][_0x5b3224(0x1f3,'rgK9')]+_0x5b3224(0x196,'5th)')+_0x622341[_0x5b3224(0x1e8,'h]H9')]+'张卡');for(let _0x3663ac of _0x622341){$['openUrl']=_0x3663ac[_0x5b3224(0x144,'(mMB')],$[_0x5b3224(0x1a1,'h]H9')]=common[_0x5b3224(0x160,'T2m^')]($['openUrl'],_0x5b3224(0x13d,'V75l'));(!$[_0x5b3224(0x153,'8Qgs')]||!/^\d+$/[_0x5b3224(0x1ce,'gYZ7')]($[_0x5b3224(0x206,'[[tV')]))&&($[_0x5b3224(0x1bc,'@64l')]=_0x3663ac['val2']);const _0x2fdf46=await common[_0x5b3224(0x1ee,'twbO')]($[_0x5b3224(0x217,'g7SJ')]);if(_0x2fdf46)console[_0x5b3224(0x13c,'[[tV')](_0x5b3224(0x23e,'$Sy3')),await $[_0x5b3224(0x145,'5ZCs')](parseInt(Math[_0x5b3224(0x227,'cp0Q')]()*0x3e8+0x3e8,0xa));else{console[_0x5b3224(0x1ad,'T2m^')](_0x5b3224(0x25d,'wd(^'));break;}}if(opencard_draw){await sendRequest('active'),await $[_0x5b3224(0x1c6,'$Sy3')](parseInt(Math[_0x5b3224(0x22a,'rgK9')]()*0x1f4+0x1f4,0xa));let _0x9f70a0=parseInt($['points2']/0x1),_0x41d698=Math[_0x5b3224(0x257,'aXSI')](opencard_draw,_0x9f70a0);$[_0x5b3224(0x1c1,'n01[')]=[],console[_0x5b3224(0x155,'r][c')](_0x5b3224(0x14e,'r][c')+opencard_draw+'次,共有'+_0x9f70a0+_0x5b3224(0x195,']4mu')+_0x41d698+'次');for(m=0x1;_0x41d698--;m++){await sendRequest(_0x5b3224(0x222,'@64l'));if(Number(_0x41d698)<=0x0)break;if($[_0x5b3224(0x1b2,'5ZCs')])break;await $[_0x5b3224(0x1f9,'eJOc')](parseInt(Math['random']()*0x3e8+0x3e8,0xa));}$[_0x5b3224(0x152,'c!&g')][_0x5b3224(0x21e,'x2eW')]&&console['log'](_0x5b3224(0x137,'Qxcc')+$[_0x5b3224(0x1d2,'V75l')][_0x5b3224(0x164,'gYZ7')](',\x20')+'\x0a');}if($[_0x5b3224(0x23c,'n01[')]||$[_0x5b3224(0x24f,'0pHW')])return;await sendRequest(_0x5b3224(0x12f,'hhYz'));if($[_0x5b3224(0x20b,'T2m^')])for(let _0x44be39=0x0;_0x44be39<authorCodeList[_0x5b3224(0x270,'0pHW')];_0x44be39++){$['myCode']=authorCodeList[_0x44be39],await sendRequest(_0x5b3224(0x1d8,'fR7)')),await $[_0x5b3224(0x26f,'#!Q*')](parseInt(Math['random']()*0x190+0x190,0xa));}$[_0x5b3224(0x125,'Yfu%')]==0x1&&($[_0x5b3224(0x1bb,'g(oi')]=$[_0x5b3224(0x223,'y)51')],console[_0x5b3224(0x189,'Ok7)')]('后面的号都会助力\x20->\x20'+$[_0x5b3224(0x191,'c!&g')])),await $['wait'](parseInt(Math[_0x5b3224(0x231,'(mMB')]()*0x3e8+0x3e8,0xa));}else console[_0x5b3224(0x11a,'Yfu%')](_0x5b3224(0x25f,'eJOc'));}}catch(_0x5aaed1){console[_0x5b3224(0x19e,'v9R]')](_0x5aaed1['message']);}}async function handleResponse(_0x440248,_0x3d71be){const _0x4e0367=_0x462ec3;try{switch(_0x440248){case _0x4e0367(0x25a,'aXSI'):if(_0x3d71be[_0x4e0367(0x266,'5ZCs')]===_0x4e0367(0x274,'Yfu%')&&_0x3d71be[_0x4e0367(0x213,'(kL%')]===!![])$[_0x4e0367(0x138,'tsn!')]=_0x3d71be['data'];else _0x3d71be[_0x4e0367(0x24c,'6%aV')]?console[_0x4e0367(0x1db,'aXSI')](''+(_0x3d71be[_0x4e0367(0x142,'g(oi')]||'')):console[_0x4e0367(0x248,'hhYz')](''+_0x3d71be);break;case'active':if(_0x3d71be['code']===_0x4e0367(0x1d9,'@64l')&&_0x3d71be[_0x4e0367(0x15d,'aXSI')]===!![])$[_0x4e0367(0x1cc,'hhYz')]=_0x3d71be[_0x4e0367(0x185,'0pHW')],$[_0x4e0367(0x261,'5ZCs')]=$[_0x4e0367(0x15a,'JU@i')]['activeVO']['activeTitle'],$[_0x4e0367(0x14c,'5th)')]=$[_0x4e0367(0x26e,'#!Q*')][_0x4e0367(0x1d6,'x2eW')][_0x4e0367(0x22f,']4mu')],$[_0x4e0367(0x11c,']4mu')]=$[_0x4e0367(0x194,'@64l')]['activeVO'][_0x4e0367(0x21f,'h]H9')],$['overTime']=$[_0x4e0367(0x174,'Ok7)')][_0x4e0367(0x136,'Qxcc')][_0x4e0367(0x1cf,'*XDE')],$[_0x4e0367(0x212,'*XDE')]=$[_0x4e0367(0x194,'@64l')][_0x4e0367(0x178,'tsn!')][_0x4e0367(0x126,'Yfu%')]||'',$[_0x4e0367(0x1dd,'v9R]')]=$['active'][_0x4e0367(0x244,'cp0Q')][_0x4e0367(0x12e,'5ZCs')]||0x0,$[_0x4e0367(0x124,'QBYH')]=$[_0x4e0367(0x181,'wd(^')][_0x4e0367(0x244,'cp0Q')]['points']||0x0,$[_0x4e0367(0x1b1,'aXSI')]=$['active']['userVO'][_0x4e0367(0x1b5,'#q$D')]||0x0,$[_0x4e0367(0x174,'Ok7)')]['showBeanList'][_0x4e0367(0x1e8,'h]H9')]>0x0&&console[_0x4e0367(0x128,'Qxcc')](_0x4e0367(0x169,'eJOc')+$['active'][_0x4e0367(0x1ed,'QBYH')][_0x4e0367(0x1ca,'LBAK')](_0x52a99d=>(_0x52a99d[_0x4e0367(0x22d,'*XDE')]||0x0)+'京豆')[_0x4e0367(0x16a,'5ZCs')](',\x20'));else _0x3d71be[_0x4e0367(0x17d,'w[*e')]?($[_0x4e0367(0x18a,'T2m^')]=_0x3d71be[_0x4e0367(0x130,'8Qgs')],console[_0x4e0367(0x16d,'JU@i')](''+($[_0x4e0367(0x1e6,'r][c')]||'')),['未开始','结束',_0x4e0367(0x265,'5ZCs'),'不在'][_0x4e0367(0x16f,'$Sy3')](_0x2dae13=>$['drawError'][_0x4e0367(0x193,'&f$)')](_0x2dae13))&&($['runEnd']=!![],$[_0x4e0367(0x1e0,'Yfu%')][_0x4e0367(0x204,'6%aV')](_0x4e0367(0x147,'Be$d')))):console[_0x4e0367(0x18e,'wd(^')]('❓'+_0x440248+'\x20'+JSON[_0x4e0367(0x200,'r][c')](_0x3d71be));break;case _0x4e0367(0x17e,'fR7)'):if(_0x3d71be[_0x4e0367(0x26b,'#q$D')]==='200'&&_0x3d71be[_0x4e0367(0x228,'8DP4')]===!![]){let {val:val='',awardName:awardName=''}=_0x3d71be['data'],_0x374df1=[];if(awardName)_0x374df1[_0x4e0367(0x16e,'4%pX')](awardName);if(val)_0x374df1[_0x4e0367(0x1cd,'hhYz')](val+_0x4e0367(0x150,'4%pX'));console[_0x4e0367(0x1be,'LTaV')]('完成任务['+$[_0x4e0367(0x11f,'d0KD')]+_0x4e0367(0x267,'LTaV')+_0x374df1[_0x4e0367(0x164,'gYZ7')](','));}else _0x3d71be['message']?console['log'](''+(_0x3d71be['message']||'')):console[_0x4e0367(0x201,'6%aV')]('❓'+_0x440248+'\x20'+JSON[_0x4e0367(0x263,'tsn!')](_0x3d71be));break;case'lottery':if(_0x3d71be[_0x4e0367(0x221,'&f$)')]===_0x4e0367(0x14f,'QBYH')&&_0x3d71be[_0x4e0367(0x18f,'Ok7)')]===!![]){if(_0x3d71be[_0x4e0367(0x15b,'Be$d')]!=null)switch(_0x3d71be[_0x4e0367(0x1e9,']4mu')][_0x4e0367(0x1c9,'V75l')]){case 0x0:$[_0x4e0367(0x1b9,'twbO')][_0x4e0367(0x1fc,'twbO')](_0x4e0367(0x21c,'n01[')+_0x3d71be[_0x4e0367(0x168,'cp0Q')]['awardName']);break;case 0x1:$[_0x4e0367(0x13f,'LBAK')][_0x4e0367(0x11d,'LTaV')](_0x4e0367(0x179,'v9R]')+_0x3d71be[_0x4e0367(0x15b,'Be$d')][_0x4e0367(0x12d,'JU@i')]+'\x20🐶'),$[_0x4e0367(0x122,'T2m^')][_0x4e0367(0x216,'LTaV')](_0x3d71be[_0x4e0367(0x14a,'#q$D')]['awardName']+'🐶');break;case 0x2:$[_0x4e0367(0x1c4,'r][c')][_0x4e0367(0x192,'6%aV')](_0x4e0367(0x146,'V75l'));break;case 0x3:$[_0x4e0367(0x1f1,'tsn!')][_0x4e0367(0x240,'rgK9')](_0x4e0367(0x190,'twbO')+_0x3d71be[_0x4e0367(0x1d5,'r][c')][_0x4e0367(0x1c3,'w[*e')]),$['message'][_0x4e0367(0x127,'g7SJ')](_0x4e0367(0x252,'JU@i')+_0x3d71be[_0x4e0367(0x1c0,'gYZ7')][_0x4e0367(0x112,'0pHW')]),await notify[_0x4e0367(0x234,'g7SJ')]($[_0x4e0367(0x1a2,'h]H9')]+_0x4e0367(0x1b7,'y)51'),_0x4e0367(0x251,'$Sy3')+$[_0x4e0367(0x258,'g(oi')]+'】'+$[_0x4e0367(0x271,'c!&g')]+_0x4e0367(0x1ea,'(kL%')+_0x3d71be['data'][_0x4e0367(0x12d,'JU@i')]+_0x4e0367(0x1d7,'(kL%')+$[_0x4e0367(0x25c,'@64l')]);break;default:$[_0x4e0367(0x211,'d0KD')][_0x4e0367(0x238,'*XDE')](_0x4e0367(0x264,'wd(^')+_0x3d71be[_0x4e0367(0x235,'T2m^')]['awardName']+'-'+_0x3d71be[_0x4e0367(0x1d4,'g7SJ')][_0x4e0367(0x205,'cp0Q')]);break;}else $['prize'][_0x4e0367(0x177,'5th)')]('💨\x20空气');}else _0x3d71be[_0x4e0367(0x253,'aXSI')]?($[_0x4e0367(0x187,'[[tV')]['push'](''+(_0x3d71be[_0x4e0367(0x20c,'Be$d')]||'')),['开卡'][_0x4e0367(0x1b6,'8DP4')](_0x210c34=>_0x3d71be[_0x4e0367(0x133,'gYZ7')][_0x4e0367(0x117,'wd(^')](_0x210c34))&&($[_0x4e0367(0x1c2,'#!Q*')]=!![]),['结束']['some'](_0x4e236a=>_0x3d71be['message'][_0x4e0367(0x14d,'g7SJ')](_0x4e236a))&&($[_0x4e0367(0x1de,'(kL%')]=!![])):console[_0x4e0367(0x143,'tsn!')]('❓'+_0x440248+'\x20'+JSON[_0x4e0367(0x1a4,'d0KD')](_0x3d71be));break;case _0x4e0367(0x245,'(mMB'):if(_0x3d71be[_0x4e0367(0x1a5,'#!Q*')]===_0x4e0367(0x129,'wd(^')&&_0x3d71be['success']===!![]){let _0xaefafa=_0x3d71be['data'][_0x4e0367(0x173,'n01[')]||0x0;switch(_0xaefafa){case'':case undefined:case 0x0:break;case 0x1:console[_0x4e0367(0x17b,'8Qgs')](_0x4e0367(0x186,'uNG$'));break;case 0x2:console[_0x4e0367(0x116,'$Sy3')](_0x4e0367(0x1f8,'Yfu%'));break;case 0x3:case 0xc:console[_0x4e0367(0x143,'tsn!')](_0x4e0367(0x203,'x2eW'));break;case 0x4:console[_0x4e0367(0x159,'g7SJ')]('对方助力已达到限制');break;case 0x5:console[_0x4e0367(0x19e,'v9R]')](_0x4e0367(0x154,'Be$d'));break;case 0x7:console[_0x4e0367(0x17b,'8Qgs')](_0x4e0367(0x123,'4%pX'));break;case 0x24:console[_0x4e0367(0x26a,'8DP4')](_0x4e0367(0x121,'y)51'));break;case 0x25:console[_0x4e0367(0x155,'r][c')](_0x4e0367(0x1b3,'8Qgs'));break;default:console[_0x4e0367(0x1be,'LTaV')](_0x4e0367(0x1c8,'(mMB'));break;}}else _0x3d71be[_0x4e0367(0x183,'tsn!')]?console[_0x4e0367(0x17b,'8Qgs')](''+(_0x3d71be[_0x4e0367(0x122,'T2m^')]||'')):console[_0x4e0367(0x17b,'8Qgs')]('❓'+_0x440248+'\x20'+JSON[_0x4e0367(0x171,'(kL%')](_0x3d71be));break;case _0x4e0367(0x13a,'eJOc'):if(_0x3d71be['code']===_0x4e0367(0x1fb,'*XDE')&&_0x3d71be['success']===!![]){}else{if(_0x3d71be[_0x4e0367(0x21b,'QBYH')]){}else{}}break;}}catch(_0x20c426){console[_0x4e0367(0x248,'hhYz')](_0x4e0367(0x188,'hhYz')+_0x440248+_0x4e0367(0x14b,'$Sy3')+(_0x20c426[_0x4e0367(0x1e5,'5ZCs')]||_0x20c426));}}async function sendRequest(_0x3d403b){const _0x5ba671=_0x462ec3;if($[_0x5ba671(0x11b,'Yfu%')])return;let _0x3af3b5='',_0x57a670=null,_0x56a032=null,_0x705d9e='POST',_0x409fe7={},_0x10a81e={};switch(_0x3d403b){case _0x5ba671(0x180,'wd(^'):_0x10a81e={'shopId':$['shopId'],'token':$[_0x5ba671(0x214,'[[tV')],'source':'01'},_0x3af3b5=domains+_0x5ba671(0x1cb,'wd(^'),_0x57a670=JSON[_0x5ba671(0x237,'uNG$')](_0x10a81e);break;case'active':_0x10a81e={'activeId':$[_0x5ba671(0x22e,'rgK9')],'shareId':$[_0x5ba671(0x25b,'y)51')]||null},_0x3af3b5=domains+'/webc/unionOpen/active',_0x57a670=JSON[_0x5ba671(0x21a,'Qxcc')](_0x10a81e);break;case'job':_0x10a81e={'activeId':$[_0x5ba671(0x26c,'aXSI')],'jobForm':$[_0x5ba671(0x139,'(kL%')][_0x5ba671(0x149,'#q$D')],'jobDetail':$[_0x5ba671(0x207,'r][c')][_0x5ba671(0x197,'Qxcc')][_0x5ba671(0x1e4,'5th)')]()['config']||0x1,'joinId':$['joinId']},_0x3af3b5=domains+'/webc/unionOpen/job',_0x57a670=JSON['stringify'](_0x10a81e);break;case _0x5ba671(0x218,'v9R]'):_0x10a81e={'activeId':$[_0x5ba671(0x176,'LTaV')],'joinId':$[_0x5ba671(0x16c,'(mMB')],'lotteryForm':0x0},_0x3af3b5=domains+_0x5ba671(0x148,'w[*e'),_0x57a670=JSON['stringify'](_0x10a81e);break;case _0x5ba671(0x18d,'@64l'):_0x10a81e={'activeId':$[_0x5ba671(0x19d,'5th)')],'joinId':$[_0x5ba671(0x1f5,'w[*e')],'shareId':$['shareUuid']},_0x3af3b5=domains+'/webc/unionOpen/share',_0x57a670=JSON['stringify'](_0x10a81e);break;case _0x5ba671(0x19c,'gYZ7'):_0x10a81e={'activeId':$[_0x5ba671(0x1c5,'T2m^')],'joinId':$[_0x5ba671(0x1e3,'x2eW')],'shareId':$[_0x5ba671(0x241,'x2eW')]},_0x3af3b5=domains+_0x5ba671(0x209,'n01['),_0x57a670=JSON[_0x5ba671(0x1f7,']4mu')](_0x10a81e);break;default:console[_0x5ba671(0x1ad,'T2m^')](_0x5ba671(0x239,'h]H9')+_0x3d403b);return;}const _0x19e8b8={'url':_0x3af3b5,'method':_0x705d9e,'headers':{'Accept':_0x5ba671(0x18b,'6%aV'),'Accept-Encoding':_0x5ba671(0x12c,'uNG$'),'Accept-Language':_0x5ba671(0x20e,'hhYz'),'Connection':'keep-alive','Content-Type':_0x5ba671(0x22c,'$Sy3'),'jd-fast-token':$[_0x5ba671(0x1eb,'n01[')]||null,'Host':_0x5ba671(0x233,'$Sy3'),'Cookie':cookie,'Referer':domains,'Origin':domains,'User-Agent':$['UA']},'data':_0x57a670,'timeout':0x4e20};_0x705d9e===_0x5ba671(0x15f,'x2eW')&&(delete _0x19e8b8['data'],delete _0x19e8b8[_0x5ba671(0x1d0,'Ok7)')][_0x5ba671(0x114,'[[tV')]);const _0xe490f8=0x1;let _0x1ce7e5=0x0,_0x54b8ef=null,_0x4cceea=![];while(_0x1ce7e5<_0xe490f8){_0x1ce7e5>0x0&&await $['wait'](0x3e8);const _0x50b79e=await common[_0x5ba671(0x1bd,'#!Q*')](_0x19e8b8);if(!_0x50b79e[_0x5ba671(0x18f,'Ok7)')]){_0x54b8ef=_0x5ba671(0x163,'Yfu%')+_0x3d403b+_0x5ba671(0x118,'[[tV')+_0x50b79e[_0x5ba671(0x1c7,'LBAK')],_0x1ce7e5++;continue;}if(!_0x50b79e[_0x5ba671(0x199,'hhYz')]){_0x54b8ef=_0x5ba671(0x182,'g(oi')+_0x3d403b+_0x5ba671(0x172,'wd(^'),_0x1ce7e5++;continue;}handleResponse(_0x3d403b,_0x50b79e[_0x5ba671(0x272,'@64l')]),_0x4cceea=![];break;}_0x1ce7e5>=_0xe490f8&&(console[_0x5ba671(0x143,'tsn!')](_0x54b8ef),_0x4cceea&&($[_0x5ba671(0x1b0,'uNG$')]=!![],$[_0x5ba671(0x24c,'6%aV')]&&$[_0x5ba671(0x1f4,'d0KD')][_0x5ba671(0x1af,'gYZ7')](_0x54b8ef)));}async function getAuthorCodeList(_0x462804){const _0x1736dd=_0x462ec3,_0x1e62a8=await common[_0x1736dd(0x254,']4mu')]({'url':_0x462804,'method':'GET','headers':{'User-Agent':_0x1736dd(0x120,'LBAK')},'proxy':null,'debug':![],'timeout':0x7530}),_0x4e5e5c=_0x1e62a8[_0x1736dd(0x268,'aXSI')];return _0x4e5e5c;}function random(_0x294f64,_0x5326fd){const _0x54486f=_0x462ec3;return Math[_0x54486f(0x229,'[[tV')](Math['random']()*(_0x5326fd-_0x294f64))+_0x294f64;}
// prettier-ignore
function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s}`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }