'use strict';const a0_0x4dbc40=a0_0x265a;(function(_0x4b3928,_0x45a5bf){const _0x56c910=a0_0x265a,_0x2ea9d5=_0x4b3928();while(!![]){try{const _0x3198ee=parseInt(_0x56c910(0x94))/0x1+parseInt(_0x56c910(0x9b))/0x2*(-parseInt(_0x56c910(0xac))/0x3)+-parseInt(_0x56c910(0x9a))/0x4+parseInt(_0x56c910(0xb1))/0x5+-parseInt(_0x56c910(0x9f))/0x6*(-parseInt(_0x56c910(0xae))/0x7)+parseInt(_0x56c910(0xa0))/0x8*(parseInt(_0x56c910(0x9c))/0x9)+parseInt(_0x56c910(0x9d))/0xa*(-parseInt(_0x56c910(0x9e))/0xb);if(_0x3198ee===_0x45a5bf)break;else _0x2ea9d5['push'](_0x2ea9d5['shift']());}catch(_0xde89e4){_0x2ea9d5['push'](_0x2ea9d5['shift']());}}}(a0_0x4531,0x5bd32));const {logger}=require(a0_0x4dbc40(0xab));function a0_0x265a(_0xb69c88,_0x5d17b9){_0xb69c88=_0xb69c88-0x94;const _0x453113=a0_0x4531();let _0x265a07=_0x453113[_0xb69c88];if(a0_0x265a['ivNhIC']===undefined){var _0x2eab7b=function(_0x470afd){const _0x1c4212='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2a8861='',_0x2df9b5='';for(let _0x76384=0x0,_0x1f01e2,_0x17254b,_0x22a40a=0x0;_0x17254b=_0x470afd['charAt'](_0x22a40a++);~_0x17254b&&(_0x1f01e2=_0x76384%0x4?_0x1f01e2*0x40+_0x17254b:_0x17254b,_0x76384++%0x4)?_0x2a8861+=String['fromCharCode'](0xff&_0x1f01e2>>(-0x2*_0x76384&0x6)):0x0){_0x17254b=_0x1c4212['indexOf'](_0x17254b);}for(let _0x156df4=0x0,_0x9f5ff9=_0x2a8861['length'];_0x156df4<_0x9f5ff9;_0x156df4++){_0x2df9b5+='%'+('00'+_0x2a8861['charCodeAt'](_0x156df4)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2df9b5);};a0_0x265a['sCHirg']=_0x2eab7b,a0_0x265a['SlVukF']={},a0_0x265a['ivNhIC']=!![];}const _0x443be2=_0x453113[0x0],_0x298a73=_0xb69c88+_0x443be2,_0x5584b0=a0_0x265a['SlVukF'][_0x298a73];return!_0x5584b0?(_0x265a07=a0_0x265a['sCHirg'](_0x265a07),a0_0x265a['SlVukF'][_0x298a73]=_0x265a07):_0x265a07=_0x5584b0,_0x265a07;}function a0_0x4531(){const _0x396009=['mZeYmZa2m0rnuMrbzq','nZaWCfLbBeHz','mZiXntK2Dhj6zKje','nJbZEejquxK','mtzqrvvyCui','DxbSB2fKx2nSzwfUDxbFzxjYB3i','DxbSB2fKx2nSzwfUDxbFzw1WDhK','vxbSB2fKignSzwfUDxaGy29TCgXLDgvKoIa','DxbSB2fKx2nSzwfUDxbFC2TPChbLza','sg9SueW','DxbSB2fKx2nSzwfUDxbFzg9Uzq','ig9YCgHHBIbMAwXLkhmP','vxbSB2fKignSzwfUDxa6ig5Vig9YCgHHBIbMAwXLCYbMB3vUza','vuvzvgK','igzPBguOCYKGzMfPBgvKihrVigrLBgv0zq','lI4VlI4VDxrPBhmVBg9Nz2vY','mZu5nfvTwNbhtG','Be5WCve','ndu1mdqYy3btDvnt','D2fYBG','ChnUr24','mZi2ndm2mgfyreHszG','u3rVCMfNzsbWCM92AwrLCIbUB3qGyxzHAwXHyMXL','zvzVwKu','zxjYB3i','CM91BMq','nJG4mJmWrLzUyMzw','zMfPBgvK','BgvUz3rO','vxbSB2fKignSzwfUDxa6ia','zgvSzxrLza','igrLBgv0zwqSia','odyZmJGWENPLtenP','nZHuqw5wq00'];a0_0x4531=function(){return _0x396009;};return a0_0x4531();}async function execute(){const _0x1b7cf=a0_0x4dbc40,_0x4fd897={'psnGn':function(_0x8e6e7a,_0x2999b3){return _0x8e6e7a(_0x2999b3);},'eIoNk':'./upload-pending-tracker','uxIfS':'./index','UEYTi':_0x1b7cf(0xa4),'HolPL':'Upload\x20cleanup\x20skipped:\x20storage\x20provider\x20not\x20available','kMVCW':_0x1b7cf(0xa2),'lNpqQ':_0x1b7cf(0xa6),'ZZAlz':'upload_cleanup_partial_failure','eVoZE':_0x1b7cf(0xa1)},_0x4cafc1=parseInt(process['env']['UPLOAD_CLEANUP_THRESHOLD'],0xa)||0x15180,_0x4b5aa5=_0x4cafc1*0x3e8;try{const {getOrphanKeys:_0x310d83,removeOrphanKeys:_0x4ffff3}=_0x4fd897['psnGn'](require,_0x4fd897['eIoNk']),{getStorageProvider:_0xf16a60}=require(_0x4fd897['uxIfS']),_0x18593a=_0xf16a60();if(!_0x18593a)return logger[_0x1b7cf(0xaf)]({'event':_0x4fd897[_0x1b7cf(0xa9)],'reason':_0x1b7cf(0xb2)},_0x4fd897[_0x1b7cf(0xa5)]),{'deleted':0x0,'failed':0x0,'skipped':!![]};const _0x2c1d59=await _0x310d83(_0x4b5aa5);if(_0x2c1d59[_0x1b7cf(0x96)]===0x0)return logger['info']({'event':_0x4fd897['kMVCW']},_0x1b7cf(0xa8)),{'deleted':0x0,'failed':0x0,'skipped':![]};logger['info']({'event':'upload_cleanup_start','count':_0x2c1d59['length'],'thresholdHours':Math[_0x1b7cf(0xb5)](_0x4cafc1/0xe10)},'Upload\x20cleanup:\x20found\x20'+_0x2c1d59['length']+_0x1b7cf(0xa7));const _0x52e7b6=await _0x18593a['deleteMany'](_0x2c1d59);return _0x52e7b6[_0x1b7cf(0x98)]['length']>0x0&&await _0x4fd897[_0x1b7cf(0xb0)](_0x4ffff3,_0x52e7b6[_0x1b7cf(0x98)]),logger['info']({'event':_0x4fd897[_0x1b7cf(0xad)],'deleted':_0x52e7b6[_0x1b7cf(0x98)][_0x1b7cf(0x96)],'failed':_0x52e7b6['failed'][_0x1b7cf(0x96)]},_0x1b7cf(0xa3)+_0x52e7b6[_0x1b7cf(0x98)]['length']+_0x1b7cf(0x99)+_0x52e7b6[_0x1b7cf(0x95)][_0x1b7cf(0x96)]+'\x20failed'),_0x52e7b6[_0x1b7cf(0x95)]['length']>0x0&&logger[_0x1b7cf(0xaf)]({'event':_0x4fd897['ZZAlz'],'failed':_0x52e7b6['failed']},_0x1b7cf(0x97)+_0x52e7b6[_0x1b7cf(0x95)]['length']+_0x1b7cf(0xaa)),{'deleted':_0x52e7b6[_0x1b7cf(0x98)]['length'],'failed':_0x52e7b6[_0x1b7cf(0x95)]['length'],'skipped':![]};}catch(_0x2eb7ac){logger[_0x1b7cf(0xb4)]({'event':_0x4fd897[_0x1b7cf(0xb3)],'error':_0x2eb7ac['message']},'Upload\x20cleanup\x20failed:\x20'+_0x2eb7ac['message']);throw _0x2eb7ac;}}module['exports']={'execute':execute};