export const NotificationManager={'isSupported'(){return'Notification'in window;},'isEnabled'(){if(!this['isSupported']())return![];return localStorage['getItem']('notifications-enabled')==='true';},'setEnabled'(_0x42bcef){localStorage['setItem']('notifications-enabled',_0x42bcef?'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 _0x2473a9=await Notification['requestPermission']();return _0x2473a9;}catch(_0x545fee){return console['error']('Failed\x20to\x20request\x20notification\x20permission:',_0x545fee),'denied';}},async 'show'(_0x35642f,_0x226a1d={}){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 _0x440d09=new Notification(_0x35642f,{'icon':_0x226a1d['icon']||'/favicon.ico','badge':_0x226a1d['badge']||'/favicon.ico','body':_0x226a1d['body']||'','tag':_0x226a1d['tag']||'','requireInteraction':_0x226a1d['requireInteraction']||![],'silent':_0x226a1d['silent']||![],'data':_0x226a1d['data']||{}});_0x226a1d['onClick']&&(_0x440d09['onclick']=_0xc8bd8e=>{_0xc8bd8e['preventDefault'](),window['focus'](),_0x226a1d['onClick'](_0xc8bd8e,_0x440d09),_0x440d09['close']();});if(!_0x226a1d['requireInteraction']){const _0x4adb0f=_0x226a1d['duration']||0x1388;setTimeout(()=>{_0x440d09['close']();},_0x4adb0f);}return _0x440d09;}catch(_0x754c91){return console['error']('Failed\x20to\x20show\x20notification:',_0x754c91),null;}},async 'notifyTaskComplete'(_0x4e4769){const _0x3b8648=_0x4e4769['exitCode']!==undefined?_0x4e4769['exitCode']:_0x4e4769['exit_code'],_0x23c9b4=_0x4e4769['status']==='completed'&&_0x3b8648===0x0,_0x153930=_0x4e4769['status']==='interrupted',_0x32263e=_0x23c9b4?'✅\x20Task\x20Completed\x20Successfully':_0x153930?'⏹️\x20Task\x20Interrupted':'❌\x20Task\x20Failed';let _0x2f32a7;if(_0x4e4769['taskType']==='test'){const _0x4250a9=_0x4e4769['testName']||'Test',_0x25586e=_0x4e4769['testDescription']||_0x4e4769['description']||'';if(_0x25586e&&_0x25586e['length']>0x0){let _0x179ce0=_0x25586e;_0x25586e['length']>0x50&&(_0x179ce0=_0x25586e['substring'](0x0,0x4d)+'...'),_0x2f32a7='Test:\x20'+_0x4250a9+'\x20-\x20'+_0x179ce0;}else _0x2f32a7='Test:\x20'+_0x4250a9;}else{if(_0x4e4769['taskType']==='deploy'){const _0x45fba4=_0x4e4769['deployProfile']||'Deploy',_0x1c910d=_0x4e4769['deployDescription']||_0x4e4769['description']||'';if(_0x1c910d&&_0x1c910d['length']>0x0){let _0x125f59=_0x1c910d;_0x1c910d['length']>0x50&&(_0x125f59=_0x1c910d['substring'](0x0,0x4d)+'...'),_0x2f32a7='Deploy:\x20'+_0x45fba4+'\x20-\x20'+_0x125f59;}else _0x2f32a7='Deploy:\x20'+_0x45fba4;}else{const _0x19a5c9=_0x4e4769['name']?_0x4e4769['name']['trim']():null,_0x5b5a87=_0x4e4769['envVars']?.['CODER_AGENT']||_0x4e4769['envVars']?.['default_agent']||'Unknown',_0xff126=_0x5b5a87['charAt'](0x0)['toUpperCase']()+_0x5b5a87['slice'](0x1);let _0x3a36d6,_0x2c1e86=![];if(_0x4e4769['followUpHistory']&&Array['isArray'](_0x4e4769['followUpHistory'])&&_0x4e4769['followUpHistory']['length']>0x0){const _0x2db78f=_0x4e4769['followUpHistory'][_0x4e4769['followUpHistory']['length']-0x1];_0x3a36d6=_0x2db78f['instructions'],_0x2c1e86=!![];}else _0x3a36d6=_0x4e4769['description']||_0x4e4769['instructions']||_0x4e4769['taskId'];_0x3a36d6['length']>0x64&&(_0x3a36d6=_0x3a36d6['substring'](0x0,0x61)+'...');const _0xa3fea6=_0x2c1e86?'[Follow-up]\x20':'';_0x19a5c9?_0x2f32a7=_0x19a5c9+'\x0a'+_0xff126+':\x20'+_0xa3fea6+_0x3a36d6:_0x2f32a7=_0xff126+':\x20'+_0xa3fea6+_0x3a36d6;}}return this['show'](_0x32263e,{'body':_0x2f32a7,'tag':'task-'+_0x4e4769['taskId'],'requireInteraction':![],'duration':0x1f40,'data':{'taskId':_0x4e4769['taskId']},'onClick':(_0x54e70b,_0x2831d5)=>{window['open']('task.html?id='+_0x4e4769['taskId'],'_blank');}});},'shouldNotify'(_0x86ee2c,_0x4e7e5b){if(!this['isEnabled']())return![];if(_0x86ee2c['status']!=='completed'&&_0x86ee2c['status']!=='failed'&&_0x86ee2c['status']!=='interrupted')return![];if(!_0x4e7e5b['has'](_0x86ee2c['taskId']))return![];const _0x5952ec='notified-'+_0x86ee2c['taskId'];if(sessionStorage['getItem'](_0x5952ec)==='true')return![];return!![];},'markNotified'(_0x372863){sessionStorage['setItem']('notified-'+_0x372863,'true');},'clearNotificationHistory'(){const _0x3765ef=[];for(let _0x5d841d=0x0;_0x5d841d<sessionStorage['length'];_0x5d841d++){const _0x395db1=sessionStorage['key'](_0x5d841d);_0x395db1['startsWith']('notified-')&&_0x3765ef['push'](_0x395db1);}_0x3765ef['forEach'](_0x33640b=>sessionStorage['removeItem'](_0x33640b));}};