export const NotificationManager={'isSupported'(){return'Notification'in window;},'isEnabled'(){if(!this['isSupported']())return![];return localStorage['getItem']('notifications-enabled')==='true';},'setEnabled'(_0x17f9fb){localStorage['setItem']('notifications-enabled',_0x17f9fb?'true':'false');},'getPermission'(){if(!this['isSupported']())return'unsupported';return Notification['permission'];},async 'requestPermission'(){if(!this['isSupported']())return'unsupported';if(Notification['permission']==='granted')return'granted';if(Notification['permission']==='denied')return'denied';try{const _0x3457b5=await Notification['requestPermission']();return _0x3457b5;}catch(_0x167e3b){return console['error']('Failed\x20to\x20request\x20notification\x20permission:',_0x167e3b),'denied';}},async 'show'(_0x437e6f,_0xa3fbf4={}){if(!this['isEnabled']())return null;if(!this['isSupported']())return console['warn']('Notifications\x20are\x20not\x20supported\x20in\x20this\x20browser'),null;if(Notification['permission']!=='granted')return console['warn']('Notification\x20permission\x20not\x20granted'),null;try{const _0x4f86dc=new Notification(_0x437e6f,{'icon':_0xa3fbf4['icon']||'/favicon.ico','badge':_0xa3fbf4['badge']||'/favicon.ico','body':_0xa3fbf4['body']||'','tag':_0xa3fbf4['tag']||'','requireInteraction':_0xa3fbf4['requireInteraction']||![],'silent':_0xa3fbf4['silent']||![],'data':_0xa3fbf4['data']||{}});_0xa3fbf4['onClick']&&(_0x4f86dc['onclick']=_0x1a9ae4=>{_0x1a9ae4['preventDefault'](),window['focus'](),_0xa3fbf4['onClick'](_0x1a9ae4,_0x4f86dc),_0x4f86dc['close']();});if(!_0xa3fbf4['requireInteraction']){const _0x14c3cb=_0xa3fbf4['duration']||0x1388;setTimeout(()=>{_0x4f86dc['close']();},_0x14c3cb);}return _0x4f86dc;}catch(_0x3a7e79){return console['error']('Failed\x20to\x20show\x20notification:',_0x3a7e79),null;}},async 'notifyTaskComplete'(_0x4c1ac9){const _0x4a79ef=_0x4c1ac9['exitCode']!==undefined?_0x4c1ac9['exitCode']:_0x4c1ac9['exit_code'],_0x102bfc=_0x4c1ac9['status']==='completed'&&_0x4a79ef===0x0,_0x49adba=_0x4c1ac9['status']==='interrupted',_0x4d576e=_0x102bfc?'✅\x20Task\x20Completed\x20Successfully':_0x49adba?'⏹️\x20Task\x20Interrupted':'❌\x20Task\x20Failed';let _0x9f8548;if(_0x4c1ac9['taskType']==='test'){const _0x380f7b=_0x4c1ac9['testName']||'Test',_0xd573f8=_0x4c1ac9['testDescription']||_0x4c1ac9['description']||'';if(_0xd573f8&&_0xd573f8['length']>0x0){let _0x540cb9=_0xd573f8;_0xd573f8['length']>0x50&&(_0x540cb9=_0xd573f8['substring'](0x0,0x4d)+'...'),_0x9f8548='Test:\x20'+_0x380f7b+'\x20-\x20'+_0x540cb9;}else _0x9f8548='Test:\x20'+_0x380f7b;}else{if(_0x4c1ac9['taskType']==='deploy'){const _0x23c95d=_0x4c1ac9['deployProfile']||'Deploy',_0x7f74f2=_0x4c1ac9['deployDescription']||_0x4c1ac9['description']||'';if(_0x7f74f2&&_0x7f74f2['length']>0x0){let _0x31cb45=_0x7f74f2;_0x7f74f2['length']>0x50&&(_0x31cb45=_0x7f74f2['substring'](0x0,0x4d)+'...'),_0x9f8548='Deploy:\x20'+_0x23c95d+'\x20-\x20'+_0x31cb45;}else _0x9f8548='Deploy:\x20'+_0x23c95d;}else{const _0x5035a8=_0x4c1ac9['name']?_0x4c1ac9['name']['trim']():null,_0x5da12d=_0x4c1ac9['envVars']?.['CODER_AGENT']||_0x4c1ac9['envVars']?.['default_agent']||'Unknown',_0x23ada2=_0x5da12d['charAt'](0x0)['toUpperCase']()+_0x5da12d['slice'](0x1);let _0x24acac,_0x304d1c=![];if(_0x4c1ac9['followUpHistory']&&Array['isArray'](_0x4c1ac9['followUpHistory'])&&_0x4c1ac9['followUpHistory']['length']>0x0){const _0x46aca9=_0x4c1ac9['followUpHistory'][_0x4c1ac9['followUpHistory']['length']-0x1];_0x24acac=_0x46aca9['instructions'],_0x304d1c=!![];}else _0x24acac=_0x4c1ac9['description']||_0x4c1ac9['instructions']||_0x4c1ac9['taskId'];_0x24acac['length']>0x64&&(_0x24acac=_0x24acac['substring'](0x0,0x61)+'...');const _0x2f7f6e=_0x304d1c?'[Follow-up]\x20':'';_0x5035a8?_0x9f8548=_0x5035a8+'\x0a'+_0x23ada2+':\x20'+_0x2f7f6e+_0x24acac:_0x9f8548=_0x23ada2+':\x20'+_0x2f7f6e+_0x24acac;}}return this['show'](_0x4d576e,{'body':_0x9f8548,'tag':'task-'+_0x4c1ac9['taskId'],'requireInteraction':![],'duration':0x1f40,'data':{'taskId':_0x4c1ac9['taskId']},'onClick':(_0x525eca,_0x3597a1)=>{window['open']('task.html?id='+_0x4c1ac9['taskId'],'_blank');}});},'shouldNotify'(_0x396214,_0x273ef4){if(!this['isEnabled']())return![];if(_0x396214['status']!=='completed'&&_0x396214['status']!=='failed'&&_0x396214['status']!=='interrupted')return![];if(!_0x273ef4['has'](_0x396214['taskId']))return![];const _0x44216a='notified-'+_0x396214['taskId'];if(sessionStorage['getItem'](_0x44216a)==='true')return![];return!![];},'markNotified'(_0x5207c7){sessionStorage['setItem']('notified-'+_0x5207c7,'true');},'clearNotificationHistory'(){const _0x3b7171=[];for(let _0x72d7fd=0x0;_0x72d7fd<sessionStorage['length'];_0x72d7fd++){const _0x577d59=sessionStorage['key'](_0x72d7fd);_0x577d59['startsWith']('notified-')&&_0x3b7171['push'](_0x577d59);}_0x3b7171['forEach'](_0x4ae011=>sessionStorage['removeItem'](_0x4ae011));}};