diff --git a/.gitignore b/.gitignore index 13a11ef..5d8a1ad 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ node_modules release-builds -obfuscate.js diff --git a/index.html b/index.html index 36f0933..c85da55 100644 --- a/index.html +++ b/index.html @@ -1,47 +1,109 @@ - - Perplexity AI - + Settings + + + -
- -
-
+
+
+ Settings Icon +

Settings

+ +
+
+
+

General

+
+ + +
-
-
+ +
+ +
+ Enable Shortcuts + + + + +
+ + + + + +
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
+
+ + +
+
-
-
- diff --git a/main.js b/main.js index 3a90636..d658e24 100644 --- a/main.js +++ b/main.js @@ -1 +1,416 @@ -const _0x521a17=_0x3e1c;(function(_0xeb717,_0x135211){const _0x577236=_0x3e1c,_0x501eaa=_0xeb717();while(!![]){try{const _0x5702a8=-parseInt(_0x577236(0x246))/0x1+-parseInt(_0x577236(0x28c))/0x2*(parseInt(_0x577236(0x203))/0x3)+parseInt(_0x577236(0x285))/0x4+parseInt(_0x577236(0x1eb))/0x5*(-parseInt(_0x577236(0x1f2))/0x6)+-parseInt(_0x577236(0x218))/0x7*(-parseInt(_0x577236(0x2c9))/0x8)+parseInt(_0x577236(0x27d))/0x9+parseInt(_0x577236(0x24a))/0xa*(parseInt(_0x577236(0x26f))/0xb);if(_0x5702a8===_0x135211)break;else _0x501eaa['push'](_0x501eaa['shift']());}catch(_0x1a4743){_0x501eaa['push'](_0x501eaa['shift']());}}}(_0x5831,0x30cf8));const _0x5ce78e=(function(){const _0x45dfe5=_0x3e1c,_0x1b176a={'TKRQD':function(_0x46f0f8){return _0x46f0f8();},'FlHzn':function(_0x369eb2,_0xcbd69c){return _0x369eb2!==_0xcbd69c;},'IGznP':_0x45dfe5(0x28e),'bfcbB':function(_0x475606,_0x1e8a04){return _0x475606+_0x1e8a04;},'teWLF':_0x45dfe5(0x1f1),'DYSjh':'{}.constructor(\x22return\x20this\x22)(\x20)','GdeoO':_0x45dfe5(0x264),'abjDD':'close','goEMt':function(_0xde05fa,_0x69f7b){return _0xde05fa===_0x69f7b;},'Mlbhu':'BghgU','KAfnH':'giAIW'};let _0x123383=!![];return function(_0x501a32,_0x19964d){const _0x609bf2=_0x45dfe5,_0x10a0f0={'cickG':function(_0x4c05bc,_0x13d812){const _0x39af87=_0x3e1c;return _0x1b176a[_0x39af87(0x2b1)](_0x4c05bc,_0x13d812);},'AuAre':_0x1b176a[_0x609bf2(0x271)],'PUidj':_0x1b176a[_0x609bf2(0x2dc)],'hkDAm':_0x1b176a[_0x609bf2(0x235)],'vSGob':_0x1b176a[_0x609bf2(0x284)],'lXHPg':_0x609bf2(0x2d9)};if(_0x1b176a[_0x609bf2(0x249)](_0x1b176a[_0x609bf2(0x2ac)],_0x1b176a[_0x609bf2(0x28d)])){let _0x561314;try{_0x561314=_0x2b02b3(_0x10a0f0[_0x609bf2(0x24e)](_0x10a0f0[_0x609bf2(0x24e)](_0x10a0f0[_0x609bf2(0x202)],_0x10a0f0[_0x609bf2(0x2cc)]),');'))();}catch(_0x662faa){_0x561314=_0x12331d;}return _0x561314;}else{const _0x56c55c=_0x123383?function(){const _0x1c8559=_0x609bf2,_0x1af23b={'nNnRz':function(_0xc7047f){return _0xc7047f();},'IEkBS':function(_0x33a185){const _0x570c2a=_0x3e1c;return _0x1b176a[_0x570c2a(0x292)](_0x33a185);}};if(_0x1b176a[_0x1c8559(0x1da)](_0x1b176a[_0x1c8559(0x2b8)],_0x1b176a[_0x1c8559(0x2b8)])){const _0x333dbe=_0x1c8559(0x296)[_0x1c8559(0x20f)]('|');let _0x5e7e5a=0x0;while(!![]){switch(_0x333dbe[_0x5e7e5a++]){case'0':_0x256c39['on'](_0x10a0f0['hkDAm'],_0x52073a);continue;case'1':_0x44a4c['on'](_0x10a0f0[_0x1c8559(0x2e1)],_0xafbfae=>{const _0x2c385f=_0x1c8559;!_0x21396b[_0x2c385f(0x1e1)]&&(_0xafbfae[_0x2c385f(0x2ce)](),_0x2b3f47['hide']());});continue;case'2':_0x3c8d8a[_0x1c8559(0x1f8)]('index.html')['catch'](_0x4d1313[_0x1c8559(0x205)]);continue;case'3':_0x4ae686=new _0x228b5b({'width':0x4b0,'height':0x320,'webPreferences':{'preload':_0x356a2d[_0x1c8559(0x23f)](_0x4a9a77,_0x1c8559(0x216),'js',_0x1c8559(0x237),_0x10a0f0[_0x1c8559(0x253)]),'contextIsolation':!![],'nodeIntegration':![]}});continue;case'4':_0x320b5f[_0x1c8559(0x2c5)]['on'](_0x1c8559(0x21f),()=>{const _0x2bb465=_0x1c8559;_0x11747a[_0x2bb465(0x2c0)](),_0x1af23b['nNnRz'](_0x3a0d23),_0x1af23b['nNnRz'](_0x58eebd),_0x1af23b['IEkBS'](_0x21bf41);});continue;case'5':_0x889a47['setApplicationMenu'](null);continue;}break;}}else{if(_0x19964d){const _0x1e87db=_0x19964d[_0x1c8559(0x1f6)](_0x501a32,arguments);return _0x19964d=null,_0x1e87db;}}}:function(){};return _0x123383=![],_0x56c55c;}};}()),_0x161b62=_0x5ce78e(this,function(){const _0x590133=_0x3e1c,_0x251c4e={'nntfZ':function(_0x5985e8,_0x38046b){return _0x5985e8+_0x38046b;},'rDpGz':_0x590133(0x1f1),'seoYt':_0x590133(0x2cb),'OieSE':'defaultAI','fZNYW':_0x590133(0x2c2),'hnrSv':function(_0x259e04,_0x3fdeae){return _0x259e04(_0x3fdeae);},'EkNwr':function(_0x423b29,_0x14dc44){return _0x423b29!==_0x14dc44;},'usAFM':'igLIi','qqnhF':_0x590133(0x2c3),'HuYCd':function(_0x4ac14e,_0x2fd16d){return _0x4ac14e+_0x2fd16d;},'gvSHb':function(_0x41dcad,_0x379f3f){return _0x41dcad+_0x379f3f;},'YRnGJ':function(_0x55b41a){return _0x55b41a();},'joFdV':_0x590133(0x256),'VGBXy':_0x590133(0x205),'BRddv':'exception','ChvvF':'table','pCazV':_0x590133(0x283),'QUYsu':function(_0x33a13b,_0x335dcb){return _0x33a13b<_0x335dcb;}},_0x223d86=function(){const _0x87e920=_0x590133,_0x47dc6a={'EUeLW':_0x251c4e[_0x87e920(0x290)],'SbZlK':_0x251c4e[_0x87e920(0x2d3)],'aDaLx':function(_0x583703,_0x23dad7){const _0x5300d5=_0x87e920;return _0x251c4e[_0x5300d5(0x238)](_0x583703,_0x23dad7);}};if(_0x251c4e['EkNwr'](_0x87e920(0x21e),_0x251c4e['usAFM'])){const _0x4199aa=_0x47638a[_0x87e920(0x2b5)](_0x47dc6a[_0x87e920(0x26e)],_0x47dc6a[_0x87e920(0x2a0)]);_0x47dc6a['aDaLx'](_0x124a6f,_0x4199aa);}else{let _0x2a1c55;try{_0x251c4e['EkNwr'](_0x251c4e[_0x87e920(0x275)],_0x251c4e['qqnhF'])?_0x16d0d5=_0x41277a(_0x251c4e['nntfZ'](_0x251c4e[_0x87e920(0x29f)],_0x251c4e['seoYt'])+');')():_0x2a1c55=Function(_0x251c4e['HuYCd'](_0x251c4e[_0x87e920(0x287)](_0x251c4e[_0x87e920(0x29f)],_0x87e920(0x2cb)),');'))();}catch(_0x25e7b7){_0x2a1c55=window;}return _0x2a1c55;}},_0xe1f1a7=_0x251c4e[_0x590133(0x1db)](_0x223d86),_0xb44c91=_0xe1f1a7['console']=_0xe1f1a7['console']||{},_0x2b80a1=[_0x251c4e['joFdV'],_0x590133(0x1e9),'info',_0x251c4e[_0x590133(0x209)],_0x251c4e[_0x590133(0x281)],_0x251c4e['ChvvF'],_0x251c4e['pCazV']];for(let _0x362471=0x0;_0x251c4e['QUYsu'](_0x362471,_0x2b80a1[_0x590133(0x24d)]);_0x362471++){const _0x6572a9=_0x5ce78e[_0x590133(0x26c)][_0x590133(0x27f)][_0x590133(0x277)](_0x5ce78e),_0x49925d=_0x2b80a1[_0x362471],_0x4286f5=_0xb44c91[_0x49925d]||_0x6572a9;_0x6572a9[_0x590133(0x265)]=_0x5ce78e[_0x590133(0x277)](_0x5ce78e),_0x6572a9[_0x590133(0x1fd)]=_0x4286f5['toString'][_0x590133(0x277)](_0x4286f5),_0xb44c91[_0x49925d]=_0x6572a9;}});_0x161b62();function _0x3e1c(_0x2c7935,_0x570255){const _0x7c3836=_0x5831();return _0x3e1c=function(_0x161b62,_0x5ce78e){_0x161b62=_0x161b62-0x1d8;let _0x5b775a=_0x7c3836[_0x161b62];return _0x5b775a;},_0x3e1c(_0x2c7935,_0x570255);}const {app,BrowserWindow,ipcMain,BrowserView,Menu,globalShortcut,Tray,shell,net}=require('electron'),path=require('path'),Store=require(_0x521a17(0x258)),settings=new Store(),isMac=process[_0x521a17(0x2a5)]==='darwin';let mainWindow,currentView,views={},tray=null,settingsWindow=null,updateWindow=null;const defaultShortcuts=isMac?{'perplexityAI':_0x521a17(0x220),'perplexityLabs':_0x521a17(0x1de),'minimizeApp':_0x521a17(0x231),'sendToTray':_0x521a17(0x276),'restoreApp':_0x521a17(0x207),'reload':_0x521a17(0x21c)}:{'perplexityAI':_0x521a17(0x20c),'perplexityLabs':_0x521a17(0x1ed),'minimizeApp':'Control+M','sendToTray':_0x521a17(0x23a),'restoreApp':_0x521a17(0x289),'reload':_0x521a17(0x1dc)};let shortcuts=settings[_0x521a17(0x2b5)](_0x521a17(0x1df),defaultShortcuts);function registerShortcuts(){const _0x5ab3b2=_0x521a17,_0x5d4a96={'wKKPB':'jLCPC','ZAtoP':_0x5ab3b2(0x27e),'eWayv':function(_0x384210){return _0x384210();},'pjOaR':function(_0x4f7fb8,_0x4ee237){return _0x4f7fb8===_0x4ee237;},'kIoxy':_0x5ab3b2(0x29b),'tcidR':_0x5ab3b2(0x2d7)};globalShortcut[_0x5ab3b2(0x2ca)]();const _0x10e234={'perplexityAI':()=>switchView(_0x5ab3b2(0x2c2)),'perplexityLabs':()=>switchView(_0x5ab3b2(0x2df)),'minimizeApp':()=>mainWindow[_0x5ab3b2(0x291)](),'sendToTray':()=>mainWindow[_0x5ab3b2(0x1e4)](),'restoreApp':()=>{const _0xc516a=_0x5ab3b2;if(mainWindow[_0xc516a(0x22d)]()||!mainWindow[_0xc516a(0x263)]()){if(_0x5d4a96[_0xc516a(0x224)]!==_0x5d4a96[_0xc516a(0x211)])mainWindow[_0xc516a(0x2c0)](),mainWindow[_0xc516a(0x273)]();else{_0x34eba0[_0xc516a(0x2c5)][_0xc516a(0x25d)]();return;}}},'reload':()=>{const _0x11089b=_0x5ab3b2;_0x5d4a96[_0x11089b(0x27a)](_0x5d4a96[_0x11089b(0x201)],_0x5d4a96['kIoxy'])?currentView&¤tView[_0x11089b(0x2c5)][_0x11089b(0x25d)]():_0x5d4a96[_0x11089b(0x274)](_0xf8b145);}};for(const [_0x532f44,_0x40ba26]of Object[_0x5ab3b2(0x2ad)](shortcuts)){_0x5d4a96[_0x5ab3b2(0x27a)](_0x5d4a96['tcidR'],'jOsfx')?_0x10e234[_0x532f44]&&globalShortcut[_0x5ab3b2(0x25b)](_0x40ba26,_0x10e234[_0x532f44]):_0x197107[_0x5ab3b2(0x2c5)][_0x5ab3b2(0x25d)]();}}function createWindow(){const _0x401183=_0x521a17,_0x37c39e={'FNeQB':function(_0x352e14,_0xee0e53){return _0x352e14!==_0xee0e53;},'uimwL':_0x401183(0x2b3),'jMZiZ':function(_0x441afd){return _0x441afd();},'gQlvH':function(_0x2e24a5,_0x36b42b){return _0x2e24a5!==_0x36b42b;},'OuwHq':_0x401183(0x2b0),'UWnEr':_0x401183(0x237),'SACdb':_0x401183(0x1ff),'vdwbG':_0x401183(0x264),'gvpVo':'close'};mainWindow=new BrowserWindow({'width':0x4b0,'height':0x320,'webPreferences':{'preload':path[_0x401183(0x23f)](__dirname,'src','js',_0x37c39e['UWnEr'],_0x401183(0x2d9)),'contextIsolation':!![],'nodeIntegration':![]}}),Menu[_0x401183(0x23b)](null),mainWindow[_0x401183(0x1f8)](_0x37c39e[_0x401183(0x2ae)])[_0x401183(0x2a6)](console[_0x401183(0x205)]),mainWindow[_0x401183(0x2c5)]['on'](_0x401183(0x21f),()=>{const _0x283620=_0x401183;if(_0x37c39e['FNeQB']('hrkFl',_0x37c39e[_0x283620(0x2be)]))mainWindow[_0x283620(0x2c0)](),_0x37c39e['jMZiZ'](registerShortcuts),_0x37c39e[_0x283620(0x2bf)](loadDefaultAI),checkForUpdates();else{const _0x425303=_0x34adde[_0x283620(0x20f)]('.')[_0x283620(0x2d0)](_0x440833),_0x774fde=_0x5b6352['split']('.')[_0x283620(0x2d0)](_0x281a33);for(let _0xc79613=0x0;_0xc79613<_0x5c74cc[_0x283620(0x2c7)](_0x425303[_0x283620(0x24d)],_0x774fde[_0x283620(0x24d)]);_0xc79613++){const _0x4cb860=_0x425303[_0xc79613]||0x0,_0x27dbef=_0x774fde[_0xc79613]||0x0;if(_0x4cb860>_0x27dbef)return 0x1;if(_0x4cb860<_0x27dbef)return-0x1;}return 0x0;}}),mainWindow['on'](_0x37c39e['vdwbG'],adjustViewBounds),mainWindow['on'](_0x37c39e['gvpVo'],_0xb367e4=>{const _0x155aca=_0x401183;_0x37c39e[_0x155aca(0x242)](_0x37c39e['OuwHq'],'optup')?!app[_0x155aca(0x1e1)]&&(_0xb367e4[_0x155aca(0x2ce)](),mainWindow[_0x155aca(0x1e4)]()):(_0x1cc734[_0x155aca(0x2ce)](),_0x2548ef[_0x155aca(0x1e4)]());});}function _0x5831(){const _0x450846=['src','ATnNP','23744ZjBLmw','close-update-window','defaultAI','removeBrowserView','Command+R','iVMWJ','igLIi','did-finish-load','Command+1','ZDyRr','qBEOF','openExternal','wKKPB','close','HCmES','preload_inject.js','open-settings','ZoOXh','png','oSfPv','jIvDD','isMinimized','whenReady','activate','lbhSe','Command+M','uiBUf','end','rLreT','GdeoO','EcQjl','preload','hnrSv','ItKjo','Control+T','setApplicationMenu','set','request','gyFun','join','HFmsS','qEilL','gQlvH','IXTDl','ZKpbk','UbHnK','129546xdKQoe','IQqjD','open-external','goEMt','9710elThrr','iAAgb','preload_update.js','length','cickG','BaClA','loadURL','darwin','handle','lXHPg','favicon.png','JbsPS','log','data','electron-store','download-update','get-shortcuts','register','setPressedImage','reload','close-settings','eqwOp','icons','noRqh','YQoSQ','isVisible','resize','__proto__','wOrWH','https://raw.githubusercontent.com/inulute/perplexity-ai-app/main/package.json','jYXyg','zBAeP','LimqA','QVdFy','constructor','btWhg','EUeLW','3707WOFAbV','Jfnoi','teWLF','jDgil','focus','eWayv','qqnhF','Command+T','bind','did-stop-loading','mVOxn','pjOaR','kQodY','IsKuh','2485890TtPhUU','oqgFY','prototype','pgWRs','BRddv','goBYs','trace','abjDD','688540CVnfGL','before-quit','gvSHb','bHYYp','Control+Shift+T','https://github.com/inulute/perplexity-ai-app/releases/latest','qSsyv','46VeSFIg','KAfnH','MpgvR','zIEKx','OieSE','minimize','TKRQD','hcHba','refresh','qeqgn','3|5|2|4|0|1','SIewV','CQPpg','HHUyG','height','JWzqt','response','Kgllv','Jobps','rDpGz','SbZlK','FLSDD','XMnlx','BxFEN','AhqgF','platform','catch','then','oxbTQ','quit','WhhPu','second-instance','Mlbhu','entries','SACdb','tMoeI','unpXd','bfcbB','startsWith','JWsdu','closed','get','set-shortcuts','page-loading','IGznP','VNmoP','yDwUy','assets','getVersion','\x0a\x20\x20\x20\x20\x20\x20\x20\x20(function\x20removeNagScreens()\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20nagScreenSelectors\x20=\x20[\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27div.max-w-\x5c\x5c[400px\x5c\x5c].rounded-xl\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27div.rounded-lg.p-md.animate-in.fade-in\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27div.flex.items-center.gap-sm\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20nagScreenSelectors.forEach((selector)\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20document.querySelectorAll(selector).forEach((el)\x20=>\x20el.remove());\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20})();\x0a\x20\x20\x20\x20\x20\x20','uimwL','jMZiZ','show','latest-version','https://perplexity.ai','nrOWN','did-start-loading','webContents','alDjC','max','ZDsnb','288ASyNsA','unregisterAll','{}.constructor(\x22return\x20this\x22)(\x20)','PUidj','JYaCx','preventDefault','uvCVW','map','settings.html','BaLAA','fZNYW','bbWAa','IDRqf','EGCnd','jOsfx','XAOqR','preload.js','send','iiAUk','DYSjh','WZqUA','win','https://labs.perplexity.ai','RFgKA','vSGob','UAzwN','PRiQd','get-app-version','FlHzn','YRnGJ','Control+R','qwdWy','Command+2','shortcuts','GpnPu','isQuiting','NDVrJ','ajJww','hide','DNate','sender','OORQP','WGVUS','warn','ZZuId','1562595nZUotJ','update.html','Control+2','MJVEZ','click','jTWsx','return\x20(function()\x20','6hOHffB','executeJavaScript','OAukt','YAyxH','apply','AEUyX','loadFile','vqJYb','DHdfp','http','oTmrF','toString','Failed\x20to\x20create\x20tray\x20icon:','index.html','deny','kIoxy','AuAre','33351ocHqhq','ZZNTu','error','kZNsR','Command+Shift+T','TcULK','VGBXy','icon.ico','iemie','Control+1','once','mac','split','win32','ZAtoP','koMlu','xcBHm','BwMet','bcmdw'];_0x5831=function(){return _0x450846;};return _0x5831();}function loadDefaultAI(){const _0x1b9c56=_0x521a17,_0x5bae7b={'IXTDl':'defaultAI','lbhSe':function(_0x57345f,_0x1d29f3){return _0x57345f(_0x1d29f3);}},_0x391fe3=settings[_0x1b9c56(0x2b5)](_0x5bae7b[_0x1b9c56(0x243)],_0x1b9c56(0x2c2));_0x5bae7b[_0x1b9c56(0x230)](switchView,_0x391fe3);}function adjustViewBounds(){const _0xb03ca4=_0x521a17,_0x4476ca={'dFFvP':function(_0x5b36cf,_0x257209){return _0x5b36cf-_0x257209;}};if(currentView){const _0x50721f=mainWindow['getContentBounds'](),_0x535426=0x3c;currentView['setBounds']({'x':_0x535426,'y':0x0,'width':_0x4476ca['dFFvP'](_0x50721f['width'],_0x535426),'height':_0x50721f[_0xb03ca4(0x29a)]});}}function switchView(_0x3fad8e){const _0x430b64=_0x521a17,_0x44fc55={'alDjC':_0x430b64(0x28f),'Jfnoi':_0x430b64(0x2b7),'kQodY':function(_0x3c3b7a,_0x4a6824){return _0x3c3b7a===_0x4a6824;},'iAAgb':_0x430b64(0x294),'keAaB':function(_0x321bcf,_0x170600){return _0x321bcf===_0x170600;},'kPoNR':_0x430b64(0x2cf),'IsKuh':_0x430b64(0x245),'iVMWJ':function(_0x36ef45,_0x5d5c76){return _0x36ef45!==_0x5d5c76;},'MJVEZ':'XMnlx','xzsPV':_0x430b64(0x216),'qDmsT':_0x430b64(0x237),'DNate':_0x430b64(0x227),'goBYs':_0x430b64(0x21f),'iiAUk':_0x430b64(0x2c4),'TjPzM':_0x430b64(0x278),'sVHEH':function(_0x42ab58){return _0x42ab58();}};if(_0x44fc55[_0x430b64(0x27b)](_0x3fad8e,_0x44fc55[_0x430b64(0x24b)])&¤tView){currentView[_0x430b64(0x2c5)]['reload']();return;}currentView&&(_0x44fc55['keAaB'](_0x44fc55['kPoNR'],_0x44fc55[_0x430b64(0x27c)])?_0x389848[_0x430b64(0x2c0)]():mainWindow[_0x430b64(0x21b)](currentView));if(views[_0x3fad8e]){if(_0x44fc55[_0x430b64(0x21d)](_0x430b64(0x2a2),_0x44fc55[_0x430b64(0x1ee)])){if(_0x3c19ec){const _0x4ca938=_0xb04bad[_0x430b64(0x1f6)](_0x58822a,arguments);return _0x37bb17=null,_0x4ca938;}}else currentView=views[_0x3fad8e];}else currentView=new BrowserView({'webPreferences':{'contextIsolation':!![],'preload':path[_0x430b64(0x23f)](__dirname,_0x44fc55['xzsPV'],'js',_0x44fc55['qDmsT'],_0x44fc55[_0x430b64(0x1e5)])}}),currentView[_0x430b64(0x2c5)][_0x430b64(0x250)](_0x3fad8e),views[_0x3fad8e]=currentView,currentView['webContents']['setWindowOpenHandler'](({url:_0x25a950})=>{const _0x4e9007=_0x430b64;if(_0x44fc55[_0x4e9007(0x2c6)]!==_0x4e9007(0x28f))_0x55a141&&(_0x3b478d[_0x4e9007(0x225)](),_0x4fd1ba=null);else return shell[_0x4e9007(0x223)](_0x25a950),{'action':_0x4e9007(0x200)};}),currentView[_0x430b64(0x2c5)]['on'](_0x44fc55[_0x430b64(0x282)],()=>{const _0x3de95e=_0x430b64;currentView[_0x3de95e(0x2c5)][_0x3de95e(0x1f3)](_0x3de95e(0x2bd));}),currentView[_0x430b64(0x2c5)]['on'](_0x44fc55[_0x430b64(0x2db)],()=>{const _0x56c2b4=_0x430b64;mainWindow[_0x56c2b4(0x2c5)][_0x56c2b4(0x2da)](_0x44fc55[_0x56c2b4(0x270)],!![]);}),currentView[_0x430b64(0x2c5)]['on'](_0x44fc55['TjPzM'],()=>{const _0x16a1b5=_0x430b64;mainWindow[_0x16a1b5(0x2c5)][_0x16a1b5(0x2da)](_0x44fc55['Jfnoi'],![]);});mainWindow['addBrowserView'](currentView),_0x44fc55['sVHEH'](adjustViewBounds);}function createTray(){const _0x6b8348=_0x521a17,_0x4e8e05={'HHUyG':function(_0x1e9ca8,_0x2326b3){return _0x1e9ca8!==_0x2326b3;},'BaLAA':'wlcNM','mVOxn':_0x6b8348(0x210),'qEilL':_0x6b8348(0x2bb),'btWhg':'icons','TMmah':_0x6b8348(0x20a),'koMlu':function(_0x430ab2,_0xcceed3){return _0x430ab2===_0xcceed3;},'IQqjD':_0x6b8348(0x251),'XQOXs':_0x6b8348(0x20e),'HCmES':'favicon.icns','SIewV':_0x6b8348(0x22a),'BNHbZ':'Perplexity\x20AI','pPcKQ':_0x6b8348(0x1ef),'pgWRs':_0x6b8348(0x1fe)};let _0x4629ce;if(process[_0x6b8348(0x2a5)]===_0x4e8e05[_0x6b8348(0x279)])_0x4629ce=path[_0x6b8348(0x23f)](__dirname,_0x4e8e05[_0x6b8348(0x241)],_0x4e8e05[_0x6b8348(0x26d)],_0x6b8348(0x2de),_0x4e8e05['TMmah']);else _0x4e8e05[_0x6b8348(0x212)](process[_0x6b8348(0x2a5)],_0x4e8e05[_0x6b8348(0x247)])?_0x4629ce=path[_0x6b8348(0x23f)](__dirname,_0x4e8e05['qEilL'],_0x4e8e05[_0x6b8348(0x26d)],_0x4e8e05['XQOXs'],_0x4e8e05[_0x6b8348(0x226)]):_0x4629ce=path[_0x6b8348(0x23f)](__dirname,_0x4e8e05[_0x6b8348(0x241)],_0x6b8348(0x260),_0x4e8e05[_0x6b8348(0x297)],_0x6b8348(0x254));try{tray=new Tray(_0x4629ce),tray['setToolTip'](_0x4e8e05['BNHbZ']),tray['on'](_0x4e8e05['pPcKQ'],()=>{const _0x17fc89=_0x6b8348;_0x4e8e05[_0x17fc89(0x299)](_0x4e8e05['BaLAA'],_0x4e8e05[_0x17fc89(0x2d2)])?_0x10b13b():((mainWindow['isMinimized']()||!mainWindow['isVisible']())&&mainWindow[_0x17fc89(0x2c0)](),mainWindow['focus']());}),process[_0x6b8348(0x2a5)]===_0x6b8348(0x251)&&tray[_0x6b8348(0x25c)](_0x4629ce);}catch(_0x40d1d6){console[_0x6b8348(0x205)](_0x4e8e05[_0x6b8348(0x280)],_0x40d1d6);}}function checkForUpdates(){const _0x41ebf5=_0x521a17,_0x222145={'wOrWH':'Error\x20parsing\x20latest\x20version:','RFgKA':function(_0x4e7418,_0x2248f9){return _0x4e7418===_0x2248f9;},'rLreT':function(_0x2e2b44,_0x19ba26){return _0x2e2b44(_0x19ba26);},'ZDyRr':_0x41ebf5(0x2d4),'tMoeI':_0x41ebf5(0x23e),'qwdWy':function(_0x12869f,_0xaa7781,_0x2726df){return _0x12869f(_0xaa7781,_0x2726df);},'jIvDD':function(_0x2e429b,_0x196b05){return _0x2e429b!==_0x196b05;},'BwMet':_0x41ebf5(0x239),'zWgfB':'wiiBw','DHdfp':function(_0x10fa61,_0x563993){return _0x10fa61(_0x563993);},'ZDsnb':function(_0x119b00,_0x313e6f){return _0x119b00===_0x313e6f;},'uiBUf':'xaiUb','GpnPu':_0x41ebf5(0x1fc),'ZZuId':function(_0x22879e,_0x4f3948){return _0x22879e!==_0x4f3948;},'cPzyW':_0x41ebf5(0x298),'jDgil':'FYjkH','UAzwN':_0x41ebf5(0x257),'Jobps':'end','iemie':_0x41ebf5(0x267),'AhqgF':_0x41ebf5(0x29c),'ZZNTu':'error'},_0x59867f=app['getVersion'](),_0x56ed1e=net[_0x41ebf5(0x23d)](_0x222145[_0x41ebf5(0x20b)]);_0x56ed1e['on'](_0x222145[_0x41ebf5(0x2a4)],_0x42d085=>{const _0xd4292f=_0x41ebf5,_0x3779c5={'cpOwE':function(_0x44a0a8,_0x6a9931){const _0x584812=_0x3e1c;return _0x222145[_0x584812(0x1fa)](_0x44a0a8,_0x6a9931);}};if(_0x222145[_0xd4292f(0x1ea)](_0x222145['cPzyW'],_0x222145[_0xd4292f(0x272)])){let _0x5c774e='';_0x42d085['on'](_0x222145[_0xd4292f(0x2e2)],_0x11a0aa=>_0x5c774e+=_0x11a0aa),_0x42d085['on'](_0x222145[_0xd4292f(0x29e)],()=>{const _0x2ef015=_0xd4292f,_0x2640ef={'ATnNP':_0x222145[_0x2ef015(0x266)],'TNsKd':function(_0x1a8dcc,_0x73aa6a){const _0x11afb6=_0x2ef015;return _0x222145[_0x11afb6(0x2e0)](_0x1a8dcc,_0x73aa6a);},'bcmdw':function(_0x584744,_0x14b2ef){const _0x6491bb=_0x2ef015;return _0x222145[_0x6491bb(0x234)](_0x584744,_0x14b2ef);}};try{if(_0x222145[_0x2ef015(0x221)]===_0x222145[_0x2ef015(0x2af)])_0x3fe1f4[_0x2ef015(0x205)](_0x2640ef[_0x2ef015(0x217)],_0x36b2ef);else{const _0x34cd13=JSON['parse'](_0x5c774e),_0x5c7fdb=_0x34cd13['version'];_0x222145[_0x2ef015(0x2e0)](_0x222145[_0x2ef015(0x1dd)](compareVersions,_0x5c7fdb,_0x59867f),0x1)&&(_0x222145[_0x2ef015(0x22c)](_0x222145[_0x2ef015(0x214)],_0x222145['zWgfB'])?_0x222145[_0x2ef015(0x1fa)](showUpdateWindow,_0x5c7fdb):_0x3779c5['cpOwE'](_0x110304,_0x274b93));}}catch(_0x10b27b){if(_0x222145[_0x2ef015(0x2c8)](_0x222145[_0x2ef015(0x232)],_0x222145[_0x2ef015(0x1e0)])){const _0x3f9b39=_0x5df4c9['parse'](_0x412a62),_0x496121=_0x3f9b39['version'];_0x2640ef['TNsKd'](_0x1bd3b8(_0x496121,_0x3ebcde),0x1)&&_0x2640ef[_0x2ef015(0x215)](_0x5422a7,_0x496121);}else console[_0x2ef015(0x205)](_0x222145[_0x2ef015(0x266)],_0x10b27b);}});}else{const _0x3ab7bb=_0x3a28ef[_0xd4292f(0x26c)][_0xd4292f(0x27f)]['bind'](_0x38631b),_0x2a5257=_0x32752e[_0x4cba79],_0x2c07b0=_0x3ed608[_0x2a5257]||_0x3ab7bb;_0x3ab7bb[_0xd4292f(0x265)]=_0x4b5db2[_0xd4292f(0x277)](_0x1b8328),_0x3ab7bb[_0xd4292f(0x1fd)]=_0x2c07b0['toString']['bind'](_0x2c07b0),_0x45a837[_0x2a5257]=_0x3ab7bb;}}),_0x56ed1e['on'](_0x222145[_0x41ebf5(0x204)],console['error']),_0x56ed1e[_0x41ebf5(0x233)]();}function compareVersions(_0x1526b9,_0x4bb09e){const _0x2b7e34=_0x521a17,_0x23762f={'eqwOp':function(_0x36a1c8){return _0x36a1c8();},'JbsPS':function(_0x2af4e3,_0x1b7d55){return _0x2af4e3<_0x1b7d55;},'JQQiM':function(_0xbd319d,_0x27a291){return _0xbd319d!==_0x27a291;},'BxFEN':_0x2b7e34(0x268),'Iftvr':function(_0x181702,_0x384df5){return _0x181702>_0x384df5;}},_0x4be9b7=_0x1526b9[_0x2b7e34(0x20f)]('.')[_0x2b7e34(0x2d0)](Number),_0x1ea5a2=_0x4bb09e[_0x2b7e34(0x20f)]('.')[_0x2b7e34(0x2d0)](Number);for(let _0x1439ab=0x0;_0x23762f['JbsPS'](_0x1439ab,Math[_0x2b7e34(0x2c7)](_0x4be9b7[_0x2b7e34(0x24d)],_0x1ea5a2['length']));_0x1439ab++){if(_0x23762f['JQQiM'](_0x2b7e34(0x1e2),_0x23762f[_0x2b7e34(0x2a3)])){const _0x23a337=_0x4be9b7[_0x1439ab]||0x0,_0x4b9264=_0x1ea5a2[_0x1439ab]||0x0;if(_0x23762f['Iftvr'](_0x23a337,_0x4b9264))return 0x1;if(_0x23762f[_0x2b7e34(0x255)](_0x23a337,_0x4b9264))return-0x1;}else _0x2d3f85[_0x2b7e34(0x2c0)](),_0x23762f[_0x2b7e34(0x25f)](_0x162d8c),_0x17a993(),_0x23762f[_0x2b7e34(0x25f)](_0x2d7076);}return 0x0;}function showUpdateWindow(_0x3c8c0a){const _0x209961=_0x521a17,_0x387c01={'WZqUA':function(_0x365890,_0x57eccd){return _0x365890===_0x57eccd;},'zBAeP':_0x209961(0x2aa),'xcBHm':_0x209961(0x2c1),'qSsyv':function(_0x44cfa2,_0x3a31fb){return _0x44cfa2===_0x3a31fb;},'FLSDD':_0x209961(0x2d6),'jTWsx':'src','OORQP':'ready-to-show'};if(updateWindow)return;updateWindow=new BrowserWindow({'width':0x226,'height':0x208,'parent':mainWindow,'modal':!![],'show':![],'frame':![],'resizable':![],'webPreferences':{'preload':path[_0x209961(0x23f)](__dirname,_0x387c01[_0x209961(0x1f0)],'js','preload',_0x209961(0x24c)),'contextIsolation':!![],'nodeIntegration':![]}}),updateWindow['loadFile'](_0x209961(0x1ec)),updateWindow[_0x209961(0x20d)](_0x387c01[_0x209961(0x1e7)],()=>{const _0x317d5c=_0x209961;_0x387c01[_0x317d5c(0x2dd)](_0x387c01[_0x317d5c(0x269)],_0x387c01[_0x317d5c(0x269)])?(updateWindow['webContents'][_0x317d5c(0x2da)](_0x387c01[_0x317d5c(0x213)],_0x3c8c0a),updateWindow[_0x317d5c(0x2c0)]()):_0x367662[_0x317d5c(0x2c5)]['send']('page-loading',!![]);}),updateWindow['on'](_0x209961(0x2b4),()=>{const _0x409d36=_0x209961;_0x387c01[_0x409d36(0x28b)](_0x409d36(0x2d6),_0x387c01[_0x409d36(0x2a1)])?updateWindow=null:_0xe37b95['openExternal'](_0x47297b);});}function detachAllShortcuts(){const _0x335c34=_0x521a17;globalShortcut[_0x335c34(0x2ca)]();}function reattachShortcuts(){const _0xb8181e=_0x521a17,_0x3a9d55={'oSfPv':function(_0x3e1c0f){return _0x3e1c0f();}};_0x3a9d55[_0xb8181e(0x22b)](registerShortcuts);}ipcMain['on'](_0x521a17(0x25a),_0x61d9a3=>{const _0xc80b51=_0x521a17,_0xc3b9bc={'BaClA':_0xc80b51(0x1df)};_0x61d9a3[_0xc80b51(0x1e6)][_0xc80b51(0x2da)](_0xc3b9bc[_0xc80b51(0x24f)],shortcuts);}),ipcMain['on'](_0x521a17(0x2b6),(_0x408124,_0x11968a)=>{const _0x3b6851=_0x521a17,_0x5bae3c={'qeqgn':'shortcuts','RTlmA':function(_0x3a0dc6){return _0x3a0dc6();}};shortcuts=_0x11968a,settings['set'](_0x5bae3c[_0x3b6851(0x295)],shortcuts),_0x5bae3c['RTlmA'](reattachShortcuts);}),ipcMain['on'](_0x521a17(0x228),()=>{const _0x523fcd=_0x521a17,_0x2dc3b2={'YAyxH':function(_0x29884d){return _0x29884d();}};_0x2dc3b2[_0x523fcd(0x1f5)](detachAllShortcuts),_0x2dc3b2[_0x523fcd(0x1f5)](openSettingsWindow);}),ipcMain['on'](_0x521a17(0x25e),()=>{const _0x4acf7a=_0x521a17;settingsWindow&&(settingsWindow[_0x4acf7a(0x225)](),settingsWindow=null,reattachShortcuts());}),ipcMain['on']('switch-ai-tool',(_0x4900d2,_0xad56e4)=>{const _0x3ad92b=_0x521a17,_0x6438af={'AEUyX':function(_0x27a5b9){return _0x27a5b9();},'yDwUy':function(_0x18c682,_0x5518c5){return _0x18c682===_0x5518c5;},'OAukt':function(_0x2540b8,_0x1d0ed7){return _0x2540b8===_0x1d0ed7;},'bHYYp':'wDebC','PRiQd':function(_0x39dfbe,_0x6d4fa5){return _0x39dfbe(_0x6d4fa5);}};(_0xad56e4[_0x3ad92b(0x2b2)](_0x3ad92b(0x1fb))||_0x6438af[_0x3ad92b(0x2ba)](_0xad56e4,_0x3ad92b(0x294)))&&(_0x6438af[_0x3ad92b(0x1f4)](_0x3ad92b(0x222),_0x6438af[_0x3ad92b(0x288)])?_0x1a988c&&(_0x9d5de4['close'](),_0x515269=null,_0x6438af[_0x3ad92b(0x1f7)](_0x1f1427)):_0x6438af[_0x3ad92b(0x1d8)](switchView,_0xad56e4));}),ipcMain['on']('get-settings',_0x468867=>{const _0x4840aa=_0x521a17,_0x3ea516={'XAOqR':_0x4840aa(0x21a)},_0x412bd7={'shortcuts':shortcuts,'defaultAI':settings[_0x4840aa(0x2b5)](_0x3ea516[_0x4840aa(0x2d8)],_0x4840aa(0x2c2))};_0x468867[_0x4840aa(0x1e6)]['send']('settings',_0x412bd7);}),ipcMain['on']('set-settings',(_0xdb932c,_0x444fd2)=>{const _0x432685=_0x521a17,_0x4f90c1={'ZNAfY':_0x432685(0x1df),'TcULK':_0x432685(0x21a)};shortcuts=_0x444fd2[_0x432685(0x1df)],settings[_0x432685(0x23c)](_0x4f90c1['ZNAfY'],shortcuts),registerShortcuts(),settings[_0x432685(0x23c)](_0x4f90c1[_0x432685(0x208)],_0x444fd2[_0x432685(0x21a)]);}),ipcMain[_0x521a17(0x252)](_0x521a17(0x1d9),()=>app[_0x521a17(0x2bc)]()),ipcMain['on'](_0x521a17(0x248),(_0x58d028,_0x39d77e)=>{shell['openExternal'](_0x39d77e);}),ipcMain['on'](_0x521a17(0x219),()=>{const _0x2c4da0=_0x521a17,_0x4b3275={'HFmsS':'deny','EcQjl':function(_0xbc8551,_0x1e18a1){return _0xbc8551!==_0x1e18a1;},'hcHba':_0x2c4da0(0x26b)};if(updateWindow){if(_0x4b3275[_0x2c4da0(0x236)](_0x4b3275[_0x2c4da0(0x293)],_0x2c4da0(0x26b)))return _0x1a7077[_0x2c4da0(0x223)](_0x990d3d),{'action':_0x4b3275[_0x2c4da0(0x240)]};else updateWindow['close'](),updateWindow=null;}}),ipcMain['on'](_0x521a17(0x259),()=>{const _0x43333f=_0x521a17,_0x1a8e0f={'VNmoP':_0x43333f(0x28a)};shell['openExternal'](_0x1a8e0f[_0x43333f(0x2b9)]);});function openSettingsWindow(){const _0x696923=_0x521a17,_0x4a2ee9={'IDRqf':_0x696923(0x216),'ZKpbk':'preload','dhuWY':_0x696923(0x2d9),'BPxKn':_0x696923(0x2b4)};if(settingsWindow){settingsWindow[_0x696923(0x273)]();return;}settingsWindow=new BrowserWindow({'width':0x1f4,'height':0x2bc,'parent':mainWindow,'modal':!![],'frame':![],'webPreferences':{'preload':path[_0x696923(0x23f)](__dirname,_0x4a2ee9[_0x696923(0x2d5)],'js',_0x4a2ee9[_0x696923(0x244)],_0x4a2ee9['dhuWY']),'contextIsolation':!![],'nodeIntegration':![]}}),settingsWindow[_0x696923(0x1f8)](_0x696923(0x2d1))[_0x696923(0x2a6)](console[_0x696923(0x205)]),settingsWindow['on'](_0x4a2ee9['BPxKn'],()=>{settingsWindow=null;});}app[_0x521a17(0x22e)]()[_0x521a17(0x2a7)](()=>{const _0x21f1af=_0x521a17,_0x1b7ebc={'WGVUS':_0x21f1af(0x2b7),'YrdRf':function(_0x37ccd9,_0x3a8bf0){return _0x37ccd9===_0x3a8bf0;},'noRqh':function(_0x4c67da){return _0x4c67da();},'LimqA':function(_0x2e9590,_0x2009c1){return _0x2e9590===_0x2009c1;},'Kgllv':_0x21f1af(0x262),'ZoOXh':_0x21f1af(0x2cd),'ajJww':_0x21f1af(0x206),'TEnEh':_0x21f1af(0x2ab),'oxbTQ':_0x21f1af(0x22f)};!app['requestSingleInstanceLock']()?_0x1b7ebc[_0x21f1af(0x229)]!==_0x1b7ebc[_0x21f1af(0x229)]?_0x4d70da[_0x21f1af(0x2ca)]():app[_0x21f1af(0x2a9)]():_0x1b7ebc[_0x21f1af(0x1e3)]!==_0x21f1af(0x206)?_0x5d4e2a=null:(_0x1b7ebc[_0x21f1af(0x261)](createWindow),_0x1b7ebc['noRqh'](createTray),app['on'](_0x1b7ebc['TEnEh'],()=>{const _0x9a3240=_0x21f1af;mainWindow&&((!mainWindow[_0x9a3240(0x263)]()||mainWindow[_0x9a3240(0x22d)]())&&mainWindow[_0x9a3240(0x2c0)](),mainWindow['focus']());}),app['on'](_0x1b7ebc[_0x21f1af(0x2a8)],()=>{const _0x532cca=_0x21f1af;_0x1b7ebc['YrdRf'](BrowserWindow['getAllWindows']()[_0x532cca(0x24d)],0x0)?_0x1b7ebc[_0x532cca(0x261)](createWindow):_0x1b7ebc[_0x532cca(0x26a)](_0x532cca(0x1f9),_0x1b7ebc[_0x532cca(0x29d)])?_0x3708dc[_0x532cca(0x2c5)][_0x532cca(0x2da)](_0x1b7ebc[_0x532cca(0x1e8)],![]):mainWindow['show']();}));}),app['on'](_0x521a17(0x286),()=>{const _0x4fe7d6=_0x521a17;app[_0x4fe7d6(0x1e1)]=!![],globalShortcut[_0x4fe7d6(0x2ca)]();}); \ No newline at end of file +// main.js + +const { app, BrowserWindow, ipcMain, BrowserView, Menu, globalShortcut, Tray, shell, net } = require('electron'); +const path = require('path'); +const Store = require('electron-store'); +const settings = new Store(); + +const isMac = process.platform === 'darwin'; + +let mainWindow; +let currentView; +let views = {}; +let tray = null; +let settingsWindow = null; +let updateWindow = null; + +const defaultShortcuts = isMac + ? { + perplexityAI: 'Command+1', + perplexityLabs: 'Command+2', + minimizeApp: 'Command+M', + sendToTray: 'Command+T', + restoreApp: 'Command+Shift+T', + reload: 'Command+R', + } + : { + perplexityAI: 'Control+1', + perplexityLabs: 'Control+2', + minimizeApp: 'Control+M', + sendToTray: 'Control+T', + restoreApp: 'Control+Shift+T', + reload: 'Control+R', + }; + +let shortcuts = settings.get('shortcuts', defaultShortcuts); +let shortcutEnabled = settings.get('shortcutEnabled', true); + +function registerShortcuts() { + if (!shortcutEnabled) return; + globalShortcut.unregisterAll(); + + const shortcutActions = { + perplexityAI: () => switchView('https://perplexity.ai'), + perplexityLabs: () => switchView('https://labs.perplexity.ai'), + minimizeApp: () => mainWindow.minimize(), + sendToTray: () => mainWindow.hide(), + restoreApp: () => { + if (mainWindow.isMinimized() || !mainWindow.isVisible()) { + mainWindow.show(); + mainWindow.focus(); + } + }, + reload: () => { + if (currentView) { + currentView.webContents.reload(); + } + }, + }; + + for (const [key, shortcut] of Object.entries(shortcuts)) { + if (shortcutActions[key]) { + globalShortcut.register(shortcut, shortcutActions[key]); + } + } +} + +function createWindow() { + mainWindow = new BrowserWindow({ + width: 1200, + height: 800, + webPreferences: { + preload: path.join(__dirname, 'src', 'js', 'preload', 'preload.js'), + contextIsolation: true, + nodeIntegration: false, + }, + }); + + Menu.setApplicationMenu(null); + + mainWindow.loadFile('index.html').catch(console.error); + + mainWindow.webContents.on('did-finish-load', () => { + mainWindow.show(); + registerShortcuts(); + loadDefaultAI(); + checkForUpdates(); + }); + + mainWindow.on('resize', adjustViewBounds); + + mainWindow.on('close', (event) => { + const choice = require('electron').dialog.showMessageBoxSync(mainWindow, { + type: 'question', + buttons: ['Yes', 'No'], + title: 'Confirm', + message: 'Are you sure you want to quit?' + }); + if (choice !== 0) { + event.preventDefault(); + return; + } + }); + +} + +function loadDefaultAI() { + const defaultAI = settings.get('defaultAI', 'https://perplexity.ai'); + switchView(defaultAI); +} + +function adjustViewBounds() { + if (currentView) { + const bounds = mainWindow.getContentBounds(); + const sidebarWidth = 60; + currentView.setBounds({ + x: sidebarWidth, + y: 0, + width: bounds.width - sidebarWidth, + height: bounds.height, + }); + } +} + +function switchView(url) { + if (url === 'refresh' && currentView) { + currentView.webContents.reload(); + return; + } + + if (currentView) { + mainWindow.removeBrowserView(currentView); + } + + if (views[url]) { + currentView = views[url]; + } else { + currentView = new BrowserView({ + webPreferences: { + contextIsolation: true, + preload: path.join(__dirname, 'src', 'js', 'preload', 'preload_inject.js'), + }, + }); + currentView.webContents.loadURL(url); + views[url] = currentView; + + currentView.webContents.setWindowOpenHandler(({ url }) => { + shell.openExternal(url); + return { action: 'deny' }; + }); + + currentView.webContents.on('did-finish-load', () => { + currentView.webContents.executeJavaScript(` + (function removeNagScreens() { + const nagScreenSelectors = [ + 'div.max-w-\\\\[400px\\\\].rounded-xl', + 'div.rounded-lg.p-md.animate-in.fade-in', + 'div.flex.items-center.gap-sm', + ]; + nagScreenSelectors.forEach((selector) => { + document.querySelectorAll(selector).forEach((el) => el.remove()); + }); + })(); + `); + }); + + currentView.webContents.on('did-start-loading', () => { + mainWindow.webContents.send('page-loading', true); + }); + currentView.webContents.on('did-stop-loading', () => { + mainWindow.webContents.send('page-loading', false); + }); + } + + mainWindow.addBrowserView(currentView); + adjustViewBounds(); +} + +function createTray() { + let iconPath; + + if (process.platform === 'win32') { + iconPath = path.join(__dirname, 'assets', 'icons', 'win', 'icon.ico'); + } else if (process.platform === 'darwin') { + iconPath = path.join(__dirname, 'assets', 'icons', 'mac', 'favicon.icns'); + } else { + iconPath = path.join(__dirname, 'assets', 'icons', 'png', 'favicon.png'); + } + + if (!fs.existsSync(iconPath)) { + console.error(`Tray icon not found at path: ${iconPath}`); + return; + } + + try { + tray = new Tray(iconPath); + tray.setToolTip('Perplexity AI'); + + tray.on('click', () => { + if (mainWindow && (mainWindow.isMinimized() || !mainWindow.isVisible())) { + mainWindow.show(); + } + mainWindow?.focus(); + }); + + } catch (error) { + console.error('Failed to create tray:', error); + } +} + + +app.once('before-quit', () => { + app.quit(); +}); + +module.exports = { createTray }; + +function checkForUpdates() { + const currentVersion = app.getVersion(); + const request = net.request('https://raw.githubusercontent.com/inulute/perplexity-ai-app/main/package.json'); + + request.on('response', (response) => { + let body = ''; + response.on('data', (chunk) => (body += chunk)); + response.on('end', () => { + try { + const data = JSON.parse(body); + const latestVersion = data.version; + + if (compareVersions(latestVersion, currentVersion) === 1) { + showUpdateWindow(latestVersion); + } + } catch (error) { + console.error('Error parsing latest version:', error); + } + }); + }); + request.on('error', console.error); + request.end(); +} + +function compareVersions(v1, v2) { + const parts1 = v1.split('.').map(Number); + const parts2 = v2.split('.').map(Number); + + for (let i = 0; i < Math.max(parts1.length, parts2.length); i++) { + const part1 = parts1[i] || 0; + const part2 = parts2[i] || 0; + + if (part1 > part2) return 1; + if (part1 < part2) return -1; + } + return 0; +} + +function showUpdateWindow(latestVersion) { + if (updateWindow) return; + + updateWindow = new BrowserWindow({ + width: 550, + height: 520, + parent: mainWindow, + modal: true, + show: false, + frame: false, + resizable: false, + webPreferences: { + preload: path.join(__dirname, 'src', 'js', 'preload', 'preload_update.js'), + contextIsolation: true, + nodeIntegration: false, + }, + }); + + updateWindow.loadFile('update.html'); + + updateWindow.once('ready-to-show', () => { + updateWindow.webContents.send('latest-version', latestVersion); + updateWindow.show(); + }); + + updateWindow.on('closed', () => { + updateWindow = null; + }); +} + +function detachAllShortcuts() { + globalShortcut.unregisterAll(); +} + +function reattachShortcuts() { + registerShortcuts(); +} + +ipcMain.on('get-shortcuts', (event) => { + event.sender.send('shortcuts', shortcuts); +}); + +ipcMain.on('set-shortcuts', (event, newShortcuts) => { + shortcuts = newShortcuts; + settings.set('shortcuts', shortcuts); + reattachShortcuts(); +}); + +ipcMain.on('open-settings', () => { + detachAllShortcuts(); + openSettingsWindow(); +}); + +ipcMain.on('close-settings', () => { + if (settingsWindow) { + settingsWindow.close(); + settingsWindow = null; + reattachShortcuts(); + } +}); + +ipcMain.on('switch-ai-tool', (event, url) => { + if (url.startsWith('http') || url === 'refresh') { + switchView(url); + } +}); + +ipcMain.on('set-settings', (event, data) => { + if (data.shortcutEnabled !== undefined) { + shortcutEnabled = data.shortcutEnabled; + settings.set('shortcutEnabled', shortcutEnabled); + + if (shortcutEnabled) { + registerShortcuts(); + } else { + globalShortcut.unregisterAll(); + } + } +}); + +ipcMain.on('get-settings', (event) => { + const data = { + shortcuts, + defaultAI: settings.get('defaultAI', 'https://perplexity.ai'), + shortcutEnabled, + }; + event.sender.send('settings', data); +}); + +ipcMain.handle('get-app-version', () => app.getVersion()); + +ipcMain.on('open-external', (event, url) => { + shell.openExternal(url); +}); + +ipcMain.on('close-update-window', () => { + if (updateWindow) { + updateWindow.close(); + updateWindow = null; + } +}); + +ipcMain.on('download-update', () => { + shell.openExternal('https://github.com/inulute/perplexity-ai-app/releases/latest'); +}); + +function openSettingsWindow() { + if (settingsWindow) { + settingsWindow.focus(); + return; + } + + settingsWindow = new BrowserWindow({ + width: 500, + height: 700, + parent: mainWindow, + modal: true, + frame: false, + webPreferences: { + preload: path.join(__dirname, 'src', 'js', 'preload', 'preload.js'), + contextIsolation: true, + nodeIntegration: false, + }, + }); + + settingsWindow.loadFile('settings.html').catch(console.error); + + settingsWindow.on('closed', () => { + settingsWindow = null; + }); +} + +app.whenReady().then(() => { + if (!app.requestSingleInstanceLock()) { + app.quit(); + } else { + createWindow(); + createTray(); + + app.on('second-instance', () => { + if (mainWindow) { + if (!mainWindow.isVisible() || mainWindow.isMinimized()) { + mainWindow.show(); + } + mainWindow.focus(); + } + }); + + app.on('activate', () => { + if (BrowserWindow.getAllWindows().length === 0) { + createWindow(); + } else { + mainWindow.show(); + } + }); + } +}); + +app.on('will-quit', () => { + globalShortcut.unregisterAll(); +}); + diff --git a/package-lock.json b/package-lock.json index 538150b..fe05d58 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "perplexity-ai-app", - "version": "3.0.0", + "version": "3.1.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "perplexity-ai-app", - "version": "3.0.0", + "version": "3.1.1", "license": "GPL-3.0-only", "dependencies": { "electron-store": "^7.0.3" @@ -2052,9 +2052,9 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", "dev": true, "license": "MIT", "dependencies": { diff --git a/release_notes/v3.2.0.md b/release_notes/v3.2.0.md new file mode 100644 index 0000000..a3f0359 --- /dev/null +++ b/release_notes/v3.2.0.md @@ -0,0 +1,16 @@ +### **Perplexity AI v3.1.1** + +--- + +- **Fixed**: Shortcuts not working after closing the window. +- **Added**: Option to disable shortcuts completely. +- **Fixed**: Threads not being deleted properly. +- **Improved**: Various minor enhancements for better performance and stability. + +--- + + + +--- + +**Upgrade now to Perplexity AI v3.1.1!** \ No newline at end of file diff --git a/src/css/settings.css b/src/css/settings.css index ceb8a17..32c64ae 100644 --- a/src/css/settings.css +++ b/src/css/settings.css @@ -199,4 +199,69 @@ opacity: 0.8; transition: opacity 0.2s; } - \ No newline at end of file + + + input[disabled] { + background-color: #2d2d2d; + color: #aaa; + border-color: #343434; + } + + + /* Style for Enable Shortcuts section */ +.toggle-container { + display: flex; + align-items: center; + gap: 10px; + margin-top: 20px; + margin-bottom: 20px; +} + +.toggle-container .toggle-description { + font-size: 16px; + color: #e0e0e0; /* Lighter color for better visibility */ + font-weight: 500; + margin-left: 5px; + +} + +.toggle-container input[type="checkbox"] { + appearance: none; + width: 45px; + height: 24px; + background-color: #aeaeae; + border-radius: 12px; + position: relative; + outline: none; + cursor: pointer; + transition: background-color 0.3s; +} + +.toggle-container input[type="checkbox"]:checked { + background-color: #20808D; +} + +.toggle-container input[type="checkbox"]:before { + content: ''; + position: absolute; + top: 2px; + left: 2px; + width: 20px; + height: 20px; + background-color: #fff; + border-radius: 50%; + transition: transform 0.3s ease-in-out; +} + +.toggle-container input[type="checkbox"]:checked:before { + transform: translateX(26px); +} + +.toggle-container .toggle-icon { + font-size: 20px; + color: #e0e0e0; +} + +.toggle-container:hover .toggle-icon { + color: #ffffff; +} diff --git a/src/js/preload/preload.js b/src/js/preload/preload.js index 11154a5..8848355 100644 --- a/src/js/preload/preload.js +++ b/src/js/preload/preload.js @@ -1 +1,18 @@ -function _0x349a(_0x145600,_0x4e6452){const _0x4e1ea4=_0xeeb1();return _0x349a=function(_0x36b45d,_0x48794a){_0x36b45d=_0x36b45d-0x15d;let _0x128451=_0x4e1ea4[_0x36b45d];return _0x128451;},_0x349a(_0x145600,_0x4e6452);}const _0x24fa95=_0x349a;(function(_0x154eb5,_0x21fef9){const _0x4edc32=_0x349a,_0x22c2c6=_0x154eb5();while(!![]){try{const _0x5802bf=parseInt(_0x4edc32(0x174))/0x1+parseInt(_0x4edc32(0x187))/0x2*(-parseInt(_0x4edc32(0x15d))/0x3)+parseInt(_0x4edc32(0x15f))/0x4+-parseInt(_0x4edc32(0x165))/0x5*(-parseInt(_0x4edc32(0x160))/0x6)+parseInt(_0x4edc32(0x175))/0x7+parseInt(_0x4edc32(0x186))/0x8*(parseInt(_0x4edc32(0x168))/0x9)+parseInt(_0x4edc32(0x17f))/0xa*(-parseInt(_0x4edc32(0x172))/0xb);if(_0x5802bf===_0x21fef9)break;else _0x22c2c6['push'](_0x22c2c6['shift']());}catch(_0x3ea1d1){_0x22c2c6['push'](_0x22c2c6['shift']());}}}(_0xeeb1,0x76e04));const _0x48794a=(function(){const _0x3259e0=_0x349a,_0x3883de={'pttHV':function(_0x309fab,_0x41656b){return _0x309fab+_0x41656b;},'mRsbt':function(_0x2416a1){return _0x2416a1();},'xYpkV':function(_0x4a5647,_0x595d4f){return _0x4a5647!==_0x595d4f;},'qxisB':_0x3259e0(0x18b),'uhLyK':'jkzrs','PiwIz':'zNstV'};let _0x1b4bd0=!![];return function(_0x992712,_0x3db6df){const _0x6dbf5a=_0x1b4bd0?function(){const _0x6501d0=_0x349a,_0x31270d={'NvDMu':function(_0x1d55e4,_0x3329f7){return _0x3883de['pttHV'](_0x1d55e4,_0x3329f7);},'EgBin':function(_0x50e315){const _0x2d62c7=_0x349a;return _0x3883de[_0x2d62c7(0x188)](_0x50e315);}};if(_0x3883de[_0x6501d0(0x16f)](_0x3883de[_0x6501d0(0x18a)],'mTYIC')){if(_0x3db6df){if(_0x3883de[_0x6501d0(0x184)]===_0x3883de[_0x6501d0(0x16b)]){const _0x1f3159=_0x5c5478?function(){const _0xdfae0b=_0x6501d0;if(_0x291fa5){const _0x2f84ed=_0x384128[_0xdfae0b(0x169)](_0x188610,arguments);return _0x234307=null,_0x2f84ed;}}:function(){};return _0x5d0afb=![],_0x1f3159;}else{const _0x5ec1e6=_0x3db6df[_0x6501d0(0x169)](_0x992712,arguments);return _0x3db6df=null,_0x5ec1e6;}}}else{const _0x357eac=_0x57c629(_0x31270d[_0x6501d0(0x164)](_0x6501d0(0x17c)+'{}.constructor(\x22return\x20this\x22)(\x20)',');'));_0x588fa2=_0x31270d['EgBin'](_0x357eac);}}:function(){};return _0x1b4bd0=![],_0x6dbf5a;};}()),_0x36b45d=_0x48794a(this,function(){const _0x58ca37=_0x349a,_0x4911a7={'WxeRo':function(_0x278425,_0x304fe7){return _0x278425+_0x304fe7;},'vpQks':_0x58ca37(0x17c),'gKgne':_0x58ca37(0x17a),'TASkv':function(_0x143c5b){return _0x143c5b();},'jHosh':_0x58ca37(0x177),'zZVag':'warn','oDYih':_0x58ca37(0x16d),'SMhlE':'error','thZlu':_0x58ca37(0x162),'LWdko':'table','FGVVG':_0x58ca37(0x181)};let _0x492cfd;try{const _0x44fb50=Function(_0x4911a7['WxeRo'](_0x4911a7[_0x58ca37(0x163)]+_0x4911a7[_0x58ca37(0x167)],');'));_0x492cfd=_0x4911a7[_0x58ca37(0x179)](_0x44fb50);}catch(_0x21f574){_0x492cfd=window;}const _0x405b79=_0x492cfd['console']=_0x492cfd[_0x58ca37(0x185)]||{},_0x5ed141=[_0x4911a7['jHosh'],_0x4911a7[_0x58ca37(0x161)],_0x4911a7[_0x58ca37(0x16e)],_0x4911a7[_0x58ca37(0x16a)],_0x4911a7[_0x58ca37(0x17b)],_0x4911a7[_0x58ca37(0x17d)],_0x4911a7[_0x58ca37(0x15e)]];for(let _0x1ee9bc=0x0;_0x1ee9bc<_0x5ed141[_0x58ca37(0x171)];_0x1ee9bc++){const _0x203d25=_0x48794a['constructor']['prototype']['bind'](_0x48794a),_0x1ad53e=_0x5ed141[_0x1ee9bc],_0x3f588f=_0x405b79[_0x1ad53e]||_0x203d25;_0x203d25[_0x58ca37(0x189)]=_0x48794a[_0x58ca37(0x182)](_0x48794a),_0x203d25[_0x58ca37(0x17e)]=_0x3f588f[_0x58ca37(0x17e)][_0x58ca37(0x182)](_0x3f588f),_0x405b79[_0x1ad53e]=_0x203d25;}});_0x36b45d();const {contextBridge,ipcRenderer}=require(_0x24fa95(0x16c));function _0xeeb1(){const _0x10e66b=['exposeInMainWorld','trace','bind','switch-ai-tool','uhLyK','console','38944gTjKyc','4iiTdDN','mRsbt','__proto__','qxisB','URJQs','get-app-version','electronAPI','37227tHDzTa','FGVVG','2638640wwABfz','6siJpOT','zZVag','exception','vpQks','NvDMu','1742210uqNAaL','send','gKgne','243kjHnxD','apply','SMhlE','PiwIz','electron','info','oDYih','xYpkV','open-settings','length','253iNuxXe','page-loading','321638kJljcN','1692740Jzwypi','invoke','log','set-shortcuts','TASkv','{}.constructor(\x22return\x20this\x22)(\x20)','thZlu','return\x20(function()\x20','LWdko','toString','517940BHrDdY'];_0xeeb1=function(){return _0x10e66b;};return _0xeeb1();}contextBridge[_0x24fa95(0x180)](_0x24fa95(0x18d),{'switchAITool':_0x2e9332=>ipcRenderer[_0x24fa95(0x166)](_0x24fa95(0x183),_0x2e9332),'onPageLoading':_0x4cc46d=>ipcRenderer['on'](_0x24fa95(0x173),(_0x7461ce,_0x106081)=>_0x4cc46d(_0x106081)),'openSettings':()=>ipcRenderer['send'](_0x24fa95(0x170)),'getShortcuts':()=>ipcRenderer[_0x24fa95(0x166)]('get-shortcuts'),'onShortcutsReceived':_0x47e332=>ipcRenderer['on']('shortcuts',(_0x454d15,_0xb6e151)=>_0x47e332(_0xb6e151)),'setShortcuts':_0x261201=>ipcRenderer[_0x24fa95(0x166)](_0x24fa95(0x178),_0x261201),'closeSettings':()=>ipcRenderer[_0x24fa95(0x166)]('close-settings'),'getSettings':()=>ipcRenderer[_0x24fa95(0x166)]('get-settings'),'onSettingsReceived':_0x1694f3=>ipcRenderer['on']('settings',(_0xe3f2b2,_0x26db1b)=>_0x1694f3(_0x26db1b)),'setSettings':_0x47119e=>ipcRenderer[_0x24fa95(0x166)]('set-settings',_0x47119e),'getAppVersion':()=>ipcRenderer[_0x24fa95(0x176)](_0x24fa95(0x18c)),'platform':process['platform']}); \ No newline at end of file +// preload.js + +const { contextBridge, ipcRenderer } = require('electron'); + +contextBridge.exposeInMainWorld('electronAPI', { + switchAITool: (url) => ipcRenderer.send('switch-ai-tool', url), + onPageLoading: (callback) => ipcRenderer.on('page-loading', (event, isLoading) => callback(isLoading)), + openSettings: () => ipcRenderer.send('open-settings'), + getShortcuts: () => ipcRenderer.send('get-shortcuts'), + onShortcutsReceived: (callback) => ipcRenderer.on('shortcuts', (event, shortcuts) => callback(shortcuts)), + setShortcuts: (shortcuts) => ipcRenderer.send('set-shortcuts', shortcuts), + closeSettings: () => ipcRenderer.send('close-settings'), + getSettings: () => ipcRenderer.send('get-settings'), + onSettingsReceived: (callback) => ipcRenderer.on('settings', (event, data) => callback(data)), + setSettings: (data) => ipcRenderer.send('set-settings', data), + getAppVersion: () => ipcRenderer.invoke('get-app-version'), + platform: process.platform, +}); diff --git a/src/js/preload/preload_inject.js b/src/js/preload/preload_inject.js index 7c18cfe..2a268c3 100644 --- a/src/js/preload/preload_inject.js +++ b/src/js/preload/preload_inject.js @@ -1 +1,41 @@ -function _0x122b(_0x19e5e1,_0x1e98fe){const _0x3b3795=_0x3152();return _0x122b=function(_0x274940,_0xc9d61c){_0x274940=_0x274940-0x75;let _0x1bf2b1=_0x3b3795[_0x274940];return _0x1bf2b1;},_0x122b(_0x19e5e1,_0x1e98fe);}const _0x1100bc=_0x122b;(function(_0x3c150d,_0xd1b558){const _0x390589=_0x122b,_0x1d4527=_0x3c150d();while(!![]){try{const _0xb05d15=parseInt(_0x390589(0x9b))/0x1+-parseInt(_0x390589(0xb0))/0x2+-parseInt(_0x390589(0x98))/0x3*(-parseInt(_0x390589(0xb6))/0x4)+parseInt(_0x390589(0x8e))/0x5*(parseInt(_0x390589(0x97))/0x6)+-parseInt(_0x390589(0x91))/0x7*(-parseInt(_0x390589(0xa0))/0x8)+-parseInt(_0x390589(0x8a))/0x9+parseInt(_0x390589(0x7f))/0xa;if(_0xb05d15===_0xd1b558)break;else _0x1d4527['push'](_0x1d4527['shift']());}catch(_0x5d6596){_0x1d4527['push'](_0x1d4527['shift']());}}}(_0x3152,0xbcf92));function _0x3152(){const _0x518684=['YERva','7LwldVH','LyrWa','addEventListener','includes','querySelectorAll','NqdxC','90lFUdWK','1127187rkuqwQ','EQCba','DOMContentLoaded','786840JGBOBP','cIsVE','location','mIqIu','ehnIv','9859512uFjFZr','apply','toString','mdSNd','length','KzJVM','EBLjE','EoFKT','mvtyC','HfzmT','dQaRO','__proto__','perplexity.ai','return\x20(function()\x20','trace','div.max-w-\x5c[400px\x5c].overflow-hidden.rounded-xl.md\x5c:flex.md\x5c:max-w-\x5c[960px\x5c].border-borderMain\x5c/50','3040166jAxkzB','remove','vPCfJ','forEach','okzfV','wBOPF','4fIxnyn','BlAoS','UPmCp','table','CYZMI','szZdh','div.rounded-lg.p-md.animate-in.fade-in','qjbdK','ArHRd','labs.perplexity.ai','console','body','error','PlTFE','log','div.flex.items-center.gap-sm','dtqQw','FLAkK','fphvM','info','OKRcI','7044750qntiaK','sVNDr','{}.constructor(\x22return\x20this\x22)(\x20)','bind','exception','hostname','kvLki','Exsbe','vABWk','SMCBp','maKRf','13191939LOUSys','FTzWl','ACNQI','warn','220135tdpSje','jvdzL'];_0x3152=function(){return _0x518684;};return _0x3152();}const _0xc9d61c=(function(){const _0x10e60d=_0x122b,_0x3618cd={'FVkWK':_0x10e60d(0xad),'nqLyQ':function(_0x9f79f4){return _0x9f79f4();},'EoFKT':_0x10e60d(0x78),'HfzmT':_0x10e60d(0x8d),'dmybh':'info','XjIHy':_0x10e60d(0x83),'tQBfg':_0x10e60d(0x9e),'BlAoS':_0x10e60d(0x7c)};let _0x9b4f=!![];return function(_0x99b35c,_0x4e335a){const _0x69b0c8=_0x10e60d,_0x20fff5={'PlTFE':_0x3618cd['FVkWK'],'iOTWD':function(_0x26021e){return _0x3618cd['nqLyQ'](_0x26021e);},'FLAkK':_0x3618cd[_0x69b0c8(0xa7)],'OKRcI':_0x3618cd[_0x69b0c8(0xa9)],'wBOPF':_0x3618cd['dmybh'],'dQaRO':_0x69b0c8(0x76),'EBLjE':_0x3618cd['XjIHy'],'okzfV':_0x3618cd['tQBfg'],'mvtyC':_0x3618cd[_0x69b0c8(0xb7)]},_0x207874=_0x9b4f?function(){const _0x369597=_0x69b0c8,_0x573499={'ArHRd':function(_0x2c6443,_0x2f489e){return _0x2c6443+_0x2f489e;},'SMCBp':function(_0x3499f6,_0x2f1ec9){return _0x3499f6+_0x2f1ec9;},'griqw':_0x20fff5[_0x369597(0x77)],'szZdh':_0x369597(0x81),'mdSNd':function(_0x28f772){return _0x20fff5['iOTWD'](_0x28f772);},'LyrWa':_0x20fff5[_0x369597(0x7b)],'ehnIv':_0x20fff5[_0x369597(0x7e)],'ESWKo':_0x20fff5[_0x369597(0xb5)],'KzJVM':_0x20fff5[_0x369597(0xaa)],'gFwNR':_0x20fff5[_0x369597(0xa6)],'qMboo':_0x369597(0xb9)};if(_0x20fff5[_0x369597(0xb4)]!==_0x20fff5[_0x369597(0xa8)]){if(_0x4e335a){const _0x237bbf=_0x4e335a[_0x369597(0xa1)](_0x99b35c,arguments);return _0x4e335a=null,_0x237bbf;}}else{let _0x22e79c;try{const _0x28fa94=_0x5292fa(_0x573499[_0x369597(0xbe)](_0x573499[_0x369597(0x88)](_0x573499['griqw'],_0x573499[_0x369597(0xbb)]),');'));_0x22e79c=_0x573499[_0x369597(0xa3)](_0x28fa94);}catch(_0x3054cd){_0x22e79c=_0x1e6fdb;}const _0x29fa1a=_0x22e79c[_0x369597(0xc0)]=_0x22e79c[_0x369597(0xc0)]||{},_0xee6a21=[_0x573499[_0x369597(0x92)],_0x573499[_0x369597(0x9f)],_0x573499['ESWKo'],_0x573499[_0x369597(0xa5)],_0x573499['gFwNR'],_0x573499['qMboo'],_0x369597(0xae)];for(let _0x50be8a=0x0;_0x50be8a<_0xee6a21[_0x369597(0xa4)];_0x50be8a++){const _0x4394d9=_0x15ee4f['constructor']['prototype']['bind'](_0x1c88a9),_0x29489c=_0xee6a21[_0x50be8a],_0x31c33d=_0x29fa1a[_0x29489c]||_0x4394d9;_0x4394d9[_0x369597(0xab)]=_0x2511c4[_0x369597(0x82)](_0x2ad81e),_0x4394d9['toString']=_0x31c33d[_0x369597(0xa2)][_0x369597(0x82)](_0x31c33d),_0x29fa1a[_0x29489c]=_0x4394d9;}}}:function(){};return _0x9b4f=![],_0x207874;};}()),_0x274940=_0xc9d61c(this,function(){const _0x20efd0=_0x122b,_0x36d7f0={'ACNQI':function(_0x5e5ac1,_0x4668dd){return _0x5e5ac1+_0x4668dd;},'IglVE':_0x20efd0(0xad),'scpcz':'{}.constructor(\x22return\x20this\x22)(\x20)','qjbdK':function(_0x2c2bde){return _0x2c2bde();},'YERva':_0x20efd0(0x8d),'vPCfJ':_0x20efd0(0xb9),'yvnBj':_0x20efd0(0xae),'maKRf':function(_0x2d1603,_0x3dc4ec){return _0x2d1603<_0x3dc4ec;}};let _0x53a192;try{const _0x47fa80=Function(_0x36d7f0[_0x20efd0(0x8c)](_0x36d7f0[_0x20efd0(0x8c)](_0x36d7f0['IglVE'],_0x36d7f0['scpcz']),');'));_0x53a192=_0x36d7f0[_0x20efd0(0xbd)](_0x47fa80);}catch(_0x5c31ba){_0x53a192=window;}const _0x5f410b=_0x53a192['console']=_0x53a192['console']||{},_0x536aef=[_0x20efd0(0x78),_0x36d7f0[_0x20efd0(0x90)],_0x20efd0(0x7d),_0x20efd0(0x76),_0x20efd0(0x83),_0x36d7f0[_0x20efd0(0xb2)],_0x36d7f0['yvnBj']];for(let _0x4fe0e2=0x0;_0x36d7f0[_0x20efd0(0x89)](_0x4fe0e2,_0x536aef['length']);_0x4fe0e2++){const _0x46c40f=_0xc9d61c['constructor']['prototype']['bind'](_0xc9d61c),_0x458332=_0x536aef[_0x4fe0e2],_0x4afb54=_0x5f410b[_0x458332]||_0x46c40f;_0x46c40f[_0x20efd0(0xab)]=_0xc9d61c[_0x20efd0(0x82)](_0xc9d61c),_0x46c40f[_0x20efd0(0xa2)]=_0x4afb54[_0x20efd0(0xa2)][_0x20efd0(0x82)](_0x4afb54),_0x5f410b[_0x458332]=_0x46c40f;}});_0x274940(),window[_0x1100bc(0x93)](_0x1100bc(0x9a),()=>{const _0x3f1e76=_0x1100bc,_0x4348c5={'UPmCp':_0x3f1e76(0x96),'EQCba':function(_0x3aa5ce,_0x10ade1){return _0x3aa5ce(_0x10ade1);},'mwkVL':_0x3f1e76(0xbf),'vABWk':_0x3f1e76(0xac),'Adzuj':'div.max-w-\x5c[400px\x5c].rounded-xl','sVNDr':_0x3f1e76(0xbc),'GUyLX':'div.items-stretch.md\x5c:items-center.fill-mode-both.fixed.bottom-0.left-0.right-0.top-0.bg-backdrop\x5c/70.backdrop-blur-sm.animate-in.fade-in.ease-outExpo.duration-200','FTzWl':function(_0x200399,_0x4f061c){return _0x200399!==_0x4f061c;},'DkqwO':_0x3f1e76(0x9c),'tZTAo':_0x3f1e76(0x85),'CYZMI':function(_0x2efccd,_0x23362c){return _0x2efccd(_0x23362c);},'OIBPc':function(_0x5cc83e,_0x406eab){return _0x5cc83e===_0x406eab;},'jvdzL':_0x3f1e76(0x86)},_0x317bda=window[_0x3f1e76(0x9d)][_0x3f1e76(0x84)][_0x3f1e76(0x94)](_0x4348c5['mwkVL']),_0x54ecb9=window[_0x3f1e76(0x9d)][_0x3f1e76(0x84)][_0x3f1e76(0x94)](_0x4348c5[_0x3f1e76(0x87)])&&!_0x317bda,_0x2fd7f0=[_0x4348c5['Adzuj'],_0x4348c5[_0x3f1e76(0x80)],_0x4348c5['GUyLX'],_0x3f1e76(0xaf)],_0x53e8bd=[_0x3f1e76(0x79)];function _0xed18c2(_0x12059d){_0x12059d['forEach'](_0x5bfd96=>{const _0x531c8d=_0x122b;document[_0x531c8d(0x95)](_0x5bfd96)['forEach'](_0x1c727d=>{const _0x11e6be=_0x531c8d;_0x1c727d[_0x11e6be(0xb1)]();});});}if(_0x317bda)_0x4348c5[_0x3f1e76(0x8b)](_0x4348c5['DkqwO'],_0x4348c5['tZTAo'])?_0x4348c5[_0x3f1e76(0xba)](_0xed18c2,_0x53e8bd):_0x574253[_0x3f1e76(0xb3)](_0x14a76d=>{const _0xe66425=_0x3f1e76;_0x32fe87[_0xe66425(0x95)](_0x14a76d)[_0xe66425(0xb3)](_0x46b5d7=>{const _0x5bca82=_0xe66425;_0x46b5d7[_0x5bca82(0xb1)]();});});else _0x54ecb9&&(_0x4348c5['OIBPc'](_0x4348c5[_0x3f1e76(0x8f)],_0x4348c5[_0x3f1e76(0x8f)])?_0x4348c5['EQCba'](_0xed18c2,_0x2fd7f0):_0x1303fc(_0x2b9c3f));const _0x457ee2=new MutationObserver(()=>{const _0x2d5df2=_0x3f1e76;if(_0x2d5df2(0x7a)!==_0x4348c5[_0x2d5df2(0xb8)]){if(_0x317bda)_0x4348c5[_0x2d5df2(0x99)](_0xed18c2,_0x53e8bd);else _0x54ecb9&&_0x4348c5[_0x2d5df2(0x99)](_0xed18c2,_0x2fd7f0);}else{const _0x433171=_0x457ca7['apply'](_0x9a8fc8,arguments);return _0xde1a02=null,_0x433171;}});_0x457ee2['observe'](document[_0x3f1e76(0x75)],{'childList':!![],'subtree':!![]});}); \ No newline at end of file +window.addEventListener('DOMContentLoaded', () => { + const isLabs = window.location.hostname.includes('labs.perplexity.ai'); + const isMain = window.location.hostname.includes('perplexity.ai') && !isLabs; + + const mainSelectors = [ + 'div.items-stretch.md\\:items-center.fill-mode-both.fixed.bottom-0.left-0.right-0.top-0.bg-backdrop\\/70.backdrop-blur-sm.animate-in.fade-in.ease-outExpo.duration-200', + 'div.max-w-\\[400px\\].overflow-hidden.rounded-xl.md\\:flex.md\\:max-w-\\[960px\\].border-borderMain\\/50', + 'relative.flex.flex-col.p-lg.md\\:w-\\[45\\%\\].md\\:p-xl', + 'md\\:h-\\[55\\%\\].md\\:w-\\[55\\%\\]', + 'rounded-lg.p-md.duration-300.ease-out.animate-in.fade-in.!p-lg.border-borderMain\\/50.ring-borderMain\\/50.divide-borderMain\\/50.dark\\:divide-borderMainDark\\/50.dark\\:ring-borderMainDark\\/50.dark\\:border-borderMainDark\\/50.bg-offset.dark\\:bg-offsetDark', + + ]; + + const labsSelectors = [ + 'div.flex.items-center.gap-sm' + ]; + + function removeNagScreens(selectors) { + selectors.forEach((selector) => { + document.querySelectorAll(selector).forEach((el) => { + el.remove(); + }); + }); + } + + if (isLabs) { + removeNagScreens(labsSelectors); + } else if (isMain) { + removeNagScreens(mainSelectors); + } + + const observer = new MutationObserver(() => { + if (isLabs) { + removeNagScreens(labsSelectors); + } else if (isMain) { + removeNagScreens(mainSelectors); + } + }); + + observer.observe(document.body, { childList: true, subtree: true }); +}); diff --git a/src/js/preload/preload_update.js b/src/js/preload/preload_update.js index 2e385cd..7e0ea1b 100644 --- a/src/js/preload/preload_update.js +++ b/src/js/preload/preload_update.js @@ -1 +1,9 @@ -const _0xfc6009=_0x5d0a;(function(_0x4caed1,_0x244d49){const _0x3f9917=_0x5d0a,_0x58631=_0x4caed1();while(!![]){try{const _0x41bd55=-parseInt(_0x3f9917(0xc9))/0x1*(parseInt(_0x3f9917(0xc3))/0x2)+-parseInt(_0x3f9917(0xc7))/0x3+parseInt(_0x3f9917(0xde))/0x4*(-parseInt(_0x3f9917(0xcc))/0x5)+-parseInt(_0x3f9917(0xeb))/0x6+parseInt(_0x3f9917(0xd0))/0x7*(parseInt(_0x3f9917(0xc8))/0x8)+parseInt(_0x3f9917(0xe8))/0x9*(parseInt(_0x3f9917(0xea))/0xa)+parseInt(_0x3f9917(0xd3))/0xb;if(_0x41bd55===_0x244d49)break;else _0x58631['push'](_0x58631['shift']());}catch(_0x55203d){_0x58631['push'](_0x58631['shift']());}}}(_0x461f,0x8e90b));const _0x3a2981=(function(){const _0x5ed50d={'QhfXi':'ksoXO'};let _0x117379=!![];return function(_0x5c24aa,_0x3d56d4){const _0x3a5de7=_0x5d0a;if(_0x5ed50d[_0x3a5de7(0xc4)]===_0x3a5de7(0xdd)){const _0x58f345=_0x43f32c?function(){const _0xbb26a5=_0x3a5de7;if(_0x55481c){const _0x23eaef=_0x2b0b80[_0xbb26a5(0xcf)](_0x53f576,arguments);return _0x184c0a=null,_0x23eaef;}}:function(){};return _0x9da5de=![],_0x58f345;}else{const _0x45461f=_0x117379?function(){if(_0x3d56d4){const _0x4b8443=_0x3d56d4['apply'](_0x5c24aa,arguments);return _0x3d56d4=null,_0x4b8443;}}:function(){};return _0x117379=![],_0x45461f;}};}()),_0x358c3e=_0x3a2981(this,function(){const _0x4aac24=_0x5d0a,_0x212756={'ILYwP':function(_0x1b1097,_0x472ef0){return _0x1b1097!==_0x472ef0;},'SWTLO':_0x4aac24(0xd8),'bhBev':function(_0x481f13,_0xf7c8d0){return _0x481f13(_0xf7c8d0);},'fSSSI':function(_0x268234,_0x572383){return _0x268234+_0x572383;},'XrQFX':function(_0x1de815,_0x44d610){return _0x1de815+_0x44d610;},'jtwoJ':_0x4aac24(0xcb),'CclJO':function(_0x441678){return _0x441678();},'CFCxP':function(_0x7e8a50,_0x3648ea){return _0x7e8a50===_0x3648ea;},'Umhpb':'PSchF','NFQVG':_0x4aac24(0xe7),'krgdy':_0x4aac24(0xe0),'HjAIy':_0x4aac24(0xe1),'kLBHt':'error','sLsvQ':_0x4aac24(0xd2),'OhdMO':_0x4aac24(0xe5),'zIHkh':'trace','MXMUG':function(_0x276bc6,_0x2a39b2){return _0x276bc6<_0x2a39b2;},'dcTkQ':'QQXGX'};let _0x5c7f7a;try{if(_0x212756[_0x4aac24(0xce)](_0x212756[_0x4aac24(0xc0)],_0x212756['SWTLO'])){const _0x379a12=_0x4fa177['apply'](_0x2841aa,arguments);return _0x19dc99=null,_0x379a12;}else{const _0x2e465d=_0x212756[_0x4aac24(0xc5)](Function,_0x212756[_0x4aac24(0xd7)](_0x212756[_0x4aac24(0xbf)](_0x212756['jtwoJ'],'{}.constructor(\x22return\x20this\x22)(\x20)'),');'));_0x5c7f7a=_0x212756['CclJO'](_0x2e465d);}}catch(_0x142c53){if(_0x212756['CFCxP'](_0x4aac24(0xd5),_0x212756[_0x4aac24(0xe2)])){if(_0x28c989){const _0x31bc2a=_0x4de0d8['apply'](_0x4714fd,arguments);return _0x21e5b4=null,_0x31bc2a;}}else _0x5c7f7a=window;}const _0x505e79=_0x5c7f7a[_0x4aac24(0xd9)]=_0x5c7f7a[_0x4aac24(0xd9)]||{},_0x279948=[_0x212756[_0x4aac24(0xe3)],_0x212756['krgdy'],_0x212756[_0x4aac24(0xda)],_0x212756[_0x4aac24(0xd4)],_0x212756['sLsvQ'],_0x212756[_0x4aac24(0xdc)],_0x212756[_0x4aac24(0xcd)]];for(let _0x669d0e=0x0;_0x212756['MXMUG'](_0x669d0e,_0x279948[_0x4aac24(0xbe)]);_0x669d0e++){if(_0x212756[_0x4aac24(0xce)](_0x212756[_0x4aac24(0xe9)],_0x212756[_0x4aac24(0xe9)]))_0x2a06c5=_0xfea676;else{const _0x4afd17=_0x3a2981[_0x4aac24(0xe4)][_0x4aac24(0xc6)][_0x4aac24(0xdb)](_0x3a2981),_0x4a5fbd=_0x279948[_0x669d0e],_0x2fa8fe=_0x505e79[_0x4a5fbd]||_0x4afd17;_0x4afd17[_0x4aac24(0xd6)]=_0x3a2981[_0x4aac24(0xdb)](_0x3a2981),_0x4afd17[_0x4aac24(0xca)]=_0x2fa8fe[_0x4aac24(0xca)][_0x4aac24(0xdb)](_0x2fa8fe),_0x505e79[_0x4a5fbd]=_0x4afd17;}}});_0x358c3e();const {contextBridge,ipcRenderer}=require(_0xfc6009(0xc1));contextBridge[_0xfc6009(0xc2)]('electronAPI',{'onLatestVersion':_0x511abe=>ipcRenderer['on'](_0xfc6009(0xe6),(_0x57532d,_0x288920)=>_0x511abe(_0x288920)),'closeUpdateWindow':()=>ipcRenderer[_0xfc6009(0xdf)]('close-update-window'),'downloadUpdate':()=>ipcRenderer[_0xfc6009(0xdf)](_0xfc6009(0xd1))});function _0x5d0a(_0x34eb57,_0x1ed85c){const _0x266b76=_0x461f();return _0x5d0a=function(_0x358c3e,_0x3a2981){_0x358c3e=_0x358c3e-0xbe;let _0x1566b1=_0x266b76[_0x358c3e];return _0x1566b1;},_0x5d0a(_0x34eb57,_0x1ed85c);}function _0x461f(){const _0x45475a=['4URqUBr','send','warn','info','Umhpb','NFQVG','constructor','table','latest-version','log','387KhrmmD','dcTkQ','136970QqBLcJ','2597238ejiioF','length','XrQFX','SWTLO','electron','exposeInMainWorld','10888FDPzjm','QhfXi','bhBev','prototype','3260841tVMtQW','24qsWFmA','40JGVCPk','toString','return\x20(function()\x20','2673010CDyQKz','zIHkh','ILYwP','apply','93233PzbYas','download-update','exception','24499211ByQiJT','kLBHt','TyIuH','__proto__','fSSSI','IixDA','console','HjAIy','bind','OhdMO','yEPqt'];_0x461f=function(){return _0x45475a;};return _0x461f();} \ No newline at end of file +// preload_update.js + +const { contextBridge, ipcRenderer } = require('electron'); + +contextBridge.exposeInMainWorld('electronAPI', { + onLatestVersion: (callback) => ipcRenderer.on('latest-version', (event, version) => callback(version)), + closeUpdateWindow: () => ipcRenderer.send('close-update-window'), + downloadUpdate: () => ipcRenderer.send('download-update'), +}); diff --git a/src/js/renderer/renderer.js b/src/js/renderer/renderer.js index 0f65d5e..a341515 100644 --- a/src/js/renderer/renderer.js +++ b/src/js/renderer/renderer.js @@ -1 +1,259 @@ -function _0x1068(_0x229c77,_0x43a18c){const _0x304751=_0x3ce5();return _0x1068=function(_0x49728f,_0x545b8a){_0x49728f=_0x49728f-0x197;let _0x3badd7=_0x304751[_0x49728f];return _0x3badd7;},_0x1068(_0x229c77,_0x43a18c);}const _0x4586c1=_0x1068;(function(_0x1a6128,_0x5c3382){const _0x46bb2d=_0x1068,_0x2f5e9b=_0x1a6128();while(!![]){try{const _0x4ef5c2=-parseInt(_0x46bb2d(0x22f))/0x1+-parseInt(_0x46bb2d(0x206))/0x2+-parseInt(_0x46bb2d(0x268))/0x3*(-parseInt(_0x46bb2d(0x28f))/0x4)+-parseInt(_0x46bb2d(0x20f))/0x5+-parseInt(_0x46bb2d(0x288))/0x6+parseInt(_0x46bb2d(0x1b0))/0x7*(parseInt(_0x46bb2d(0x251))/0x8)+parseInt(_0x46bb2d(0x19a))/0x9;if(_0x4ef5c2===_0x5c3382)break;else _0x2f5e9b['push'](_0x2f5e9b['shift']());}catch(_0xf4da3a){_0x2f5e9b['push'](_0x2f5e9b['shift']());}}}(_0x3ce5,0xc2566));function _0x3ce5(){const _0x406755=['gfUlY','afWih','WUakf','FvbWv','bFqbg','sort','qYoqD','pgpFL','YeyWf','UDVIx','shortcuts','UUdrx','left','WCuea','1055669YbjLeC','MisIA','FBnKg','ecGOZ','FHiwi','remove','\x22\x20is\x20already\x20assigned\x20to\x20\x22','RWlSB','top','yqXac','includes','sOIKd','length','constructor','nFAQN','console','MDxpF','oxTjx','click','split','.close-button','JHFYi','loading','JUEhV','pyoMd','ZdZag','tWpOa','replace','settings-container','hwEYv','nMKEk','UscIE','entries','sGoUz','173136ibfKjU','parentElement','iMuav','MetaRight','QccgT','tsMBH','ctrlKey','getAppVersion','join','bQbOs','shortcut-perplexityAI','Control','aoJSP','GbiUU','itpPK','querySelector','kYBrB','settings-form','pFIVK','jVsJx','toString','startsWith','KTefx','216AALkrD','ShiftLeft','rKszV','LzTsN','toUpperCase','{}.constructor(\x22return\x20this\x22)(\x20)','Shift','gYgpP','show','apply','jZBYK','YNlFQ','igJXp','RTqVw','JrTcs','setSettings','rFbhF','Restore\x20App','scrollX','XwZEZ','offsetHeight','xBYuu','pefcI','eFhPo','AtfpK','shortcut-restoreApp','Ctrl','Cmd','Shortcut\x20\x22','Key','keydown','toLowerCase','6450660LZUmXx','heKKt','JhMux','PwmdT','VESRe','offsetWidth','className','11944UGfpzB','OMOrR','LkWJP','griiT','FAGVe','KOHcQ','Yzeug','otRSe','YXxKU','38835162OCfiKh','OKlrz','shortcut-reload','kDRUF','AltRight','ControlLeft','rbfAj','Command','fKGZO','table','GWIlj','metaKey','WQWNU','electronAPI','fBoMn','bind','HXLfv','axSYk','getBoundingClientRect','onPageLoading','JycXY','wzeBs','343YIERqb','ccOkj','UKoKn','.tooltip','cmWnw','Nnjkd','wHBMq','tmocZ','bPyij','active','Perplexity\x20AI','UcRsF','then','FyWfv','lgeFC','BRUlV','wlxCg','TNprZ','getElementById','AltLeft','shortcut-perplexityLabs','ICxas','code','Please\x20set\x20a\x20shortcut\x20for\x20\x22','ShiftRight','FQcVQ','trace','appendChild','blur','restore-button','pOIWo','tooltip\x20visible','feDSS','ecRtx','push','dcCwo','RTdfy','ivCHZ','nextElementSibling','ARnDB','UjbKl','altKey','defaultAI','bqlSy','IfzoM','imPka','Reload','jbcvZ','oClUC','shiftKey','RshOi','ZDUyv','QJIAR','MetaLeft','DOMContentLoaded','LwGbA','kGnBZ','addEventListener','zbmmM','PrTbb','YIsXe','PwrNW','NPaGd','ifkOt','slice','uHFOY','getSettings','createElement','poeFV','add','UmlNP','Send\x20to\x20Tray','MEZkm','classList','textContent','eixkS','scrollY','qdQMc','indexOf','czFvu','forEach','platform','sFinw','UrxZU','preventDefault','gaNsi','2150734ALDeWr','closeSettings','Alt','pkJaB','tzTCf','MlJPV','wnXxm','asbXz','WKlff','7941580WcEZWX','jtPhT','mftyt','vqZTo','ControlRight','nlXVo','OZhTk','aZdkq','trim','prototype','ptTJm','DPOgP','value','style','XpFLx','__proto__','cBURn','div'];_0x3ce5=function(){return _0x406755;};return _0x3ce5();}const _0x545b8a=(function(){const _0x4179d8=_0x1068,_0x402b5f={'DMpDA':function(_0x29ce2f,_0x2cbe5b){return _0x29ce2f(_0x2cbe5b);},'JrTcs':'Shortcuts\x20must\x20include\x20at\x20least\x20one\x20modifier\x20key\x20(Ctrl\x20or\x20Cmd,\x20Alt,\x20Shift).','axSYk':_0x4179d8(0x1b3),'LzTsN':_0x4179d8(0x1cf),'MEZkm':function(_0x28e104,_0x584380){return _0x28e104-_0x584380;},'cmWnw':function(_0x6b293a,_0x2818b3){return _0x6b293a+_0x2818b3;},'RTdfy':function(_0x4b0611,_0x48fc48){return _0x4b0611/_0x48fc48;},'wONOq':function(_0x3795bb,_0x255c96){return _0x3795bb===_0x255c96;},'wzeBs':_0x4179d8(0x1ce),'JycXY':function(_0x1e8778,_0x41dc47){return _0x1e8778!==_0x41dc47;},'RTqVw':_0x4179d8(0x253),'qdQMc':'GcvNA','feDSS':_0x4179d8(0x25f)};let _0x3fdbde=!![];return function(_0x4ddf7f,_0x299ac6){const _0x1abacd=_0x4179d8;if(_0x402b5f[_0x1abacd(0x1fd)]===_0x402b5f[_0x1abacd(0x1d0)]){_0x402b5f['DMpDA'](_0x1b5570,_0x402b5f[_0x1abacd(0x276)]),_0x15e265[_0x1abacd(0x21b)]='';return;}else{const _0x410247=_0x3fdbde?function(){const _0x53bb65=_0x1abacd,_0x3e4951={'kYBrB':_0x402b5f[_0x53bb65(0x1ab)],'ICxas':_0x402b5f[_0x53bb65(0x26b)],'hvNha':function(_0x28b076,_0x386be0){const _0x41d3c7=_0x53bb65;return _0x402b5f[_0x41d3c7(0x1f8)](_0x28b076,_0x386be0);},'nFAQN':function(_0x17b274,_0x54ed1f){return _0x17b274-_0x54ed1f;},'ecRtx':function(_0x4901f2,_0x43365d){const _0x249553=_0x53bb65;return _0x402b5f[_0x249553(0x1b4)](_0x4901f2,_0x43365d);},'RmeXA':function(_0x49a99d,_0x25e70c){const _0x31c530=_0x53bb65;return _0x402b5f[_0x31c530(0x1f8)](_0x49a99d,_0x25e70c);},'tzTCf':function(_0xde5d33,_0x5d4ed3){const _0x1d7f15=_0x53bb65;return _0x402b5f[_0x1d7f15(0x1d4)](_0xde5d33,_0x5d4ed3);}};if(_0x402b5f['wONOq'](_0x402b5f[_0x53bb65(0x1af)],_0x402b5f['wzeBs'])){if(_0x299ac6){if(_0x402b5f[_0x53bb65(0x1ae)](_0x402b5f[_0x53bb65(0x275)],_0x402b5f[_0x53bb65(0x275)]))_0x5f2834['electronAPI'][_0x53bb65(0x207)]();else{const _0x54cdf0=_0x299ac6[_0x53bb65(0x271)](_0x4ddf7f,arguments);return _0x299ac6=null,_0x54cdf0;}}}else{let _0x2c230=_0x6fad96['parentElement'][_0x53bb65(0x260)](_0x3e4951[_0x53bb65(0x261)]);if(_0x2c230)_0x2c230['remove']();const _0x523dff=_0x56196c[_0x53bb65(0x1f3)]('div');_0x523dff[_0x53bb65(0x28e)]=_0x3e4951[_0x53bb65(0x1c5)],_0x523dff[_0x53bb65(0x1fa)]=_0xa37903,_0x412a30[_0x53bb65(0x252)][_0x53bb65(0x1cb)](_0x523dff);const _0x4077f5=_0x20113d['getBoundingClientRect']();_0x523dff[_0x53bb65(0x21c)][_0x53bb65(0x237)]=_0x3e4951['hvNha'](_0x3e4951[_0x53bb65(0x23d)](_0x3e4951['ecRtx'](_0x4077f5['top'],_0x1208e8[_0x53bb65(0x1fc)]),_0x523dff['offsetHeight']),0x5)+'px',_0x523dff[_0x53bb65(0x21c)][_0x53bb65(0x22d)]=_0x3e4951['RmeXA'](_0x3e4951[_0x53bb65(0x1d1)](_0x4077f5[_0x53bb65(0x22d)],_0x4b546a[_0x53bb65(0x27a)])+_0x2590f1[_0x53bb65(0x28d)]/0x2,_0x3e4951[_0x53bb65(0x20a)](_0x523dff[_0x53bb65(0x28d)],0x2))+'px';}}:function(){};return _0x3fdbde=![],_0x410247;}};}()),_0x49728f=_0x545b8a(this,function(){const _0x6d378c=_0x1068,_0x2bd7ea={'KOHcQ':function(_0x1d8ac2,_0x8d5c1e){return _0x1d8ac2+_0x8d5c1e;},'eixkS':function(_0x5a0a62,_0x1ab2db){return _0x5a0a62+_0x1ab2db;},'UjbKl':'return\x20(function()\x20','griiT':'{}.constructor(\x22return\x20this\x22)(\x20)','tmocZ':function(_0x37a3f1){return _0x37a3f1();},'ssovl':'log','GbiUU':'info','heKKt':_0x6d378c(0x1ca)},_0x167c66=function(){const _0x4e6753=_0x6d378c;let _0x53d6c2;try{_0x53d6c2=Function(_0x2bd7ea[_0x4e6753(0x294)](_0x2bd7ea[_0x4e6753(0x1fb)](_0x2bd7ea[_0x4e6753(0x1d8)],_0x2bd7ea[_0x4e6753(0x292)]),');'))();}catch(_0x35f85b){_0x53d6c2=window;}return _0x53d6c2;},_0x234bdb=_0x2bd7ea[_0x6d378c(0x1b7)](_0x167c66),_0x4fc104=_0x234bdb[_0x6d378c(0x23e)]=_0x234bdb['console']||{},_0x2f9a9f=[_0x2bd7ea['ssovl'],'warn',_0x2bd7ea[_0x6d378c(0x25e)],'error','exception',_0x6d378c(0x1a3),_0x2bd7ea[_0x6d378c(0x289)]];for(let _0x1ef83a=0x0;_0x1ef83a<_0x2f9a9f['length'];_0x1ef83a++){const _0x5d3a54=_0x545b8a[_0x6d378c(0x23c)][_0x6d378c(0x218)][_0x6d378c(0x1a9)](_0x545b8a),_0x185458=_0x2f9a9f[_0x1ef83a],_0x48826d=_0x4fc104[_0x185458]||_0x5d3a54;_0x5d3a54[_0x6d378c(0x21e)]=_0x545b8a[_0x6d378c(0x1a9)](_0x545b8a),_0x5d3a54['toString']=_0x48826d[_0x6d378c(0x265)][_0x6d378c(0x1a9)](_0x48826d),_0x4fc104[_0x185458]=_0x5d3a54;}});_0x49728f(),document[_0x4586c1(0x1e9)](_0x4586c1(0x1e6),()=>{const _0x3f8a49=_0x4586c1,_0x4ce1f9={'igJXp':_0x3f8a49(0x282),'oxTjx':_0x3f8a49(0x283),'otRSe':function(_0x2a23df,_0x3c3929){return _0x2a23df!==_0x3c3929;},'HXLfv':_0x3f8a49(0x1bb),'yqXac':_0x3f8a49(0x21a),'jbcvZ':function(_0x3c7209){return _0x3c7209();},'pefcI':function(_0x452a11,_0x5883a6){return _0x452a11!==_0x5883a6;},'QccgT':_0x3f8a49(0x22c),'VESRe':function(_0x14f1e9){return _0x14f1e9();},'UKoKn':'https://perplexity.ai','JhMux':_0x3f8a49(0x1b9),'GWIlj':_0x3f8a49(0x208),'IfzoM':'Shift','FyWfv':_0x3f8a49(0x269),'bqlSy':_0x3f8a49(0x1c8),'YNlFQ':_0x3f8a49(0x19f),'FQcVQ':_0x3f8a49(0x213),'gaNsi':_0x3f8a49(0x1e5),'VewdH':function(_0x55f525,_0x35564e){return _0x55f525===_0x35564e;},'gYgpP':'Shortcuts\x20must\x20include\x20at\x20least\x20one\x20modifier\x20key\x20(Ctrl\x20or\x20Cmd,\x20Alt,\x20Shift).','dcCwo':_0x3f8a49(0x1a1),'WCuea':_0x3f8a49(0x25c),'WHeOs':'QBiLH','rFbhF':_0x3f8a49(0x20b),'UrxZU':function(_0x2f364f,_0x2b8463){return _0x2f364f!==_0x2b8463;},'FBnKg':_0x3f8a49(0x1a0),'RJwaY':_0x3f8a49(0x1c3),'WUakf':_0x3f8a49(0x254),'TNprZ':function(_0x17076e,_0x499bd9){return _0x17076e===_0x499bd9;},'pgpFL':function(_0x279b32,_0x58010a){return _0x279b32(_0x58010a);},'sGoUz':_0x3f8a49(0x285),'KvCyq':function(_0x318602,_0x1d1966){return _0x318602!==_0x1d1966;},'ecGOZ':'FHiwi','acXGf':function(_0x1fa412){return _0x1fa412();},'lgeFC':function(_0x1eeb32,_0x3c99cb){return _0x1eeb32(_0x3c99cb);},'qYoqD':function(_0x128086,_0x51e78b,_0x399bb4){return _0x128086(_0x51e78b,_0x399bb4);},'MZylV':_0x3f8a49(0x21d),'CZVCH':function(_0x1e6439){return _0x1e6439();},'PrTbb':_0x3f8a49(0x197),'kDRUF':'MqGzj','czFvu':function(_0x3618ec){return _0x3618ec();},'UmlNP':function(_0x4feebe,_0x5590d7){return _0x4feebe===_0x5590d7;},'jZBYK':'kAWio','jtPhT':_0x3f8a49(0x1b3),'YIsXe':'oDGLB','ekOeB':_0x3f8a49(0x27b),'LLBFN':function(_0x4a43a2,_0x5edd2c){return _0x4a43a2!==_0x5edd2c;},'WKlff':_0x3f8a49(0x1a2),'ARnDB':_0x3f8a49(0x1e0),'tsMBH':function(_0x2ec9b1,_0x1c2407,_0x313204){return _0x2ec9b1(_0x1c2407,_0x313204);},'jVsJx':function(_0x28917f,_0x232caf){return _0x28917f(_0x232caf);},'ifkOt':_0x3f8a49(0x209),'OMOrR':_0x3f8a49(0x211),'bFqbg':function(_0x5bbf49,_0x2b7fa5){return _0x5bbf49===_0x2b7fa5;},'wVOCv':_0x3f8a49(0x212),'cBURn':function(_0x21823f,_0x4a9915){return _0x21823f+_0x4a9915;},'OZhTk':'return\x20(function()\x20','Jmzem':_0x3f8a49(0x26d),'WvDgy':_0x3f8a49(0x291),'KTefx':_0x3f8a49(0x1a8),'VXZHC':_0x3f8a49(0x1ba),'LwGbA':'Perplexity\x20Labs','UDVIx':'Minimize\x20App','sjtxV':_0x3f8a49(0x1f7),'bQbOs':_0x3f8a49(0x279),'xBYuu':_0x3f8a49(0x1de),'afWih':function(_0xac5ca6,_0x2eb967){return _0xac5ca6===_0x2eb967;},'Nnjkd':_0x3f8a49(0x1dd),'PIFMY':_0x3f8a49(0x1cf),'hwEYv':function(_0x56337a,_0x22f323){return _0x56337a-_0x22f323;},'sFinw':function(_0x294785,_0x4bacec){return _0x294785-_0x4bacec;},'PwmdT':function(_0x5cab80,_0x3c97ad){return _0x5cab80/_0x3c97ad;},'MisIA':function(_0x348f2d,_0x5b3609){return _0x348f2d(_0x5b3609);},'aoJSP':_0x3f8a49(0x270),'uHFOY':'.version-display','PwrNW':function(_0xab7d03,_0x1a7ad8){return _0xab7d03===_0x1a7ad8;},'ccOkj':_0x3f8a49(0x236),'FvbWv':_0x3f8a49(0x1c0),'wnXxm':_0x3f8a49(0x24b),'bPyij':_0x3f8a49(0x1c4),'jrMoi':'shortcut-minimizeApp','pFIVK':'shortcut-sendToTray','HTbuJ':_0x3f8a49(0x281),'pyoMd':_0x3f8a49(0x1da),'sOIKd':'darwin','AtfpK':'focus','BqccZ':'submit','ivCHZ':_0x3f8a49(0x243),'nMKEk':_0x3f8a49(0x241),'sRJmc':function(_0x40b67e,_0x2c43f2){return _0x40b67e!==_0x2c43f2;},'nlXVo':_0x3f8a49(0x229),'MDxpF':_0x3f8a49(0x245)};if(document[_0x3f8a49(0x1c2)](_0x4ce1f9[_0x3f8a49(0x20c)])){const _0x7b78b6={'perplexityAI':document[_0x3f8a49(0x1c2)](_0x3f8a49(0x25b)),'perplexityLabs':document['getElementById'](_0x4ce1f9[_0x3f8a49(0x1b8)]),'minimizeApp':document[_0x3f8a49(0x1c2)](_0x4ce1f9['jrMoi']),'sendToTray':document[_0x3f8a49(0x1c2)](_0x4ce1f9[_0x3f8a49(0x263)]),'restoreApp':document[_0x3f8a49(0x1c2)](_0x4ce1f9['HTbuJ']),'reload':document[_0x3f8a49(0x1c2)](_0x3f8a49(0x19c))},_0x167a0c=document[_0x3f8a49(0x1c2)](_0x4ce1f9[_0x3f8a49(0x247)]);let _0x197131={},_0x2980ea={};const _0xddf150=window['electronAPI'][_0x3f8a49(0x201)]===_0x4ce1f9[_0x3f8a49(0x23a)];function _0x5e8b21(){const _0x35da95=_0x3f8a49;for(const [_0x577a3b,_0x3f7e54]of Object[_0x35da95(0x24f)](_0x7b78b6)){const _0x3371b5=_0x2980ea[_0x577a3b][_0x35da95(0x24a)](/Control/g,_0x4ce1f9[_0x35da95(0x274)])[_0x35da95(0x24a)](/Command/g,_0x4ce1f9[_0x35da95(0x240)]);_0x3f7e54[_0x35da95(0x21b)]=_0xddf150?_0x3371b5[_0x35da95(0x24a)](/Ctrl/g,_0x4ce1f9[_0x35da95(0x240)]):_0x3371b5[_0x35da95(0x24a)](/Cmd/g,_0x4ce1f9[_0x35da95(0x274)]),_0x3f7e54['nextElementSibling'][_0x35da95(0x1fa)]='';}}function _0x211054(){const _0x95bad=_0x3f8a49;if(_0x4ce1f9[_0x95bad(0x198)](_0x4ce1f9[_0x95bad(0x1aa)],_0x95bad(0x1e3)))for(const _0xe8e337 of Object['values'](_0x7b78b6)){_0xe8e337[_0x95bad(0x21b)]='',_0xe8e337[_0x95bad(0x1d6)][_0x95bad(0x1fa)]='';}else _0x3a02d2(),_0x24ac94['electronAPI'][_0x95bad(0x207)]();}function _0x2d6c37(){const _0x5bc156=_0x3f8a49;if('DPOgP'!==_0x4ce1f9[_0x5bc156(0x238)]){if(_0x23000f){const _0x56a477=_0x21193c[_0x5bc156(0x271)](_0x1146f5,arguments);return _0x40946b=null,_0x56a477;}}else _0x4ce1f9[_0x5bc156(0x1df)](_0x5e8b21);}window[_0x3f8a49(0x1a7)][_0x3f8a49(0x1f2)](),window[_0x3f8a49(0x1a7)]['onSettingsReceived'](_0x5e4c96=>{const _0x1b26bf=_0x3f8a49;_0x4ce1f9[_0x1b26bf(0x27e)](_0x1b26bf(0x216),_0x4ce1f9[_0x1b26bf(0x255)])?(_0x197131={..._0x5e4c96['shortcuts']},_0x2980ea={..._0x5e4c96[_0x1b26bf(0x22b)]},_0x4ce1f9[_0x1b26bf(0x28c)](_0x5e8b21),_0x167a0c['value']=_0x5e4c96[_0x1b26bf(0x1da)]||_0x4ce1f9[_0x1b26bf(0x1b2)]):_0x24e0d2=_0xbbb333;});for(const [_0x41a073,_0x23ae21]of Object[_0x3f8a49(0x24f)](_0x7b78b6)){_0x23ae21[_0x3f8a49(0x1e9)](_0x4ce1f9[_0x3f8a49(0x280)],()=>{const _0x107997=_0x3f8a49;_0x23ae21[_0x107997(0x1f9)][_0x107997(0x1f5)](_0x4ce1f9['JhMux']);const _0x1f7546=_0x23ae21[_0x107997(0x1d6)];_0x1f7546[_0x107997(0x1fa)]='';}),_0x23ae21['addEventListener'](_0x3f8a49(0x1cc),()=>{const _0x21d240=_0x3f8a49;_0x23ae21['classList']['remove'](_0x4ce1f9[_0x21d240(0x28a)]),_0x4ce1f9[_0x21d240(0x28c)](_0x2d00fa);}),_0x23ae21[_0x3f8a49(0x1e9)](_0x3f8a49(0x286),_0x4320c5=>{const _0x3c056c=_0x3f8a49,_0x8e9b09={'kGnBZ':_0x4ce1f9['GWIlj'],'QJIAR':_0x4ce1f9[_0x3c056c(0x1dc)],'poeFV':_0x4ce1f9[_0x3c056c(0x274)],'RshOi':_0x4ce1f9[_0x3c056c(0x1bd)],'OKlrz':_0x4ce1f9[_0x3c056c(0x1db)],'gfUlY':_0x4ce1f9[_0x3c056c(0x273)],'asbXz':_0x4ce1f9[_0x3c056c(0x1c9)],'JHFYi':_0x3c056c(0x1c3),'WQWNU':_0x3c056c(0x19e),'ZdZag':_0x4ce1f9[_0x3c056c(0x205)],'ptTJm':function(_0x27eedf,_0x243054){return _0x4ce1f9['VewdH'](_0x27eedf,_0x243054);},'JUEhV':_0x4ce1f9[_0x3c056c(0x26f)],'tWpOa':_0x3c056c(0x285),'rKszV':_0x4ce1f9[_0x3c056c(0x1d3)],'BRUlV':_0x4ce1f9[_0x3c056c(0x22e)]};if(_0x4ce1f9['WHeOs']!==_0x4ce1f9[_0x3c056c(0x278)]){_0x4320c5[_0x3c056c(0x204)]();let _0x2129a8=[];if(_0xddf150){if(_0x4320c5[_0x3c056c(0x1a5)])_0x2129a8[_0x3c056c(0x1d2)](_0x4ce1f9[_0x3c056c(0x240)]);if(_0x4320c5[_0x3c056c(0x1d9)])_0x2129a8[_0x3c056c(0x1d2)](_0x4ce1f9['GWIlj']);if(_0x4320c5[_0x3c056c(0x1e1)])_0x2129a8[_0x3c056c(0x1d2)](_0x4ce1f9[_0x3c056c(0x1dc)]);}else{if(_0x4ce1f9[_0x3c056c(0x203)](_0x3c056c(0x199),_0x4ce1f9[_0x3c056c(0x231)])){if(_0x4320c5['ctrlKey'])_0x2129a8[_0x3c056c(0x1d2)](_0x4ce1f9['igJXp']);if(_0x4320c5[_0x3c056c(0x1d9)])_0x2129a8[_0x3c056c(0x1d2)](_0x3c056c(0x208));if(_0x4320c5['shiftKey'])_0x2129a8[_0x3c056c(0x1d2)](_0x4ce1f9[_0x3c056c(0x1dc)]);}else{_0x364cd8[_0x3c056c(0x204)]();let _0x92a929=[];if(_0x184389){if(_0x24f1d1['metaKey'])_0x92a929['push'](_0x3c056c(0x283));if(_0x4c1d24[_0x3c056c(0x1d9)])_0x92a929['push'](_0x8e9b09[_0x3c056c(0x1e8)]);if(_0x27c060[_0x3c056c(0x1e1)])_0x92a929['push'](_0x8e9b09['QJIAR']);}else{if(_0x2d1b89[_0x3c056c(0x257)])_0x92a929[_0x3c056c(0x1d2)](_0x8e9b09[_0x3c056c(0x1f4)]);if(_0x20a9ae[_0x3c056c(0x1d9)])_0x92a929[_0x3c056c(0x1d2)](_0x8e9b09[_0x3c056c(0x1e8)]);if(_0x1abf2e[_0x3c056c(0x1e1)])_0x92a929[_0x3c056c(0x1d2)](_0x8e9b09[_0x3c056c(0x1e4)]);}const _0x33563a=[_0x8e9b09[_0x3c056c(0x1e2)],_0x8e9b09[_0x3c056c(0x19b)],_0x8e9b09[_0x3c056c(0x221)],_0x8e9b09[_0x3c056c(0x20d)],_0x8e9b09[_0x3c056c(0x244)],_0x8e9b09[_0x3c056c(0x1a6)],_0x8e9b09[_0x3c056c(0x248)],'MetaRight'];if(_0x33563a[_0x3c056c(0x239)](_0x48b07c[_0x3c056c(0x1c6)]))return;if(_0x8e9b09[_0x3c056c(0x219)](_0x92a929['length'],0x0)){_0x151856(_0x8e9b09[_0x3c056c(0x246)]),_0xba01cb['value']='';return;}const _0x7970f1=_0x451353[_0x3c056c(0x1c6)]['startsWith'](_0x8e9b09[_0x3c056c(0x249)])?_0x4f3fbd[_0x3c056c(0x1c6)]['slice'](0x3)[_0x3c056c(0x26c)]():_0x47a913['key'],_0x8366e0=[..._0x92a929,_0x7970f1][_0x3c056c(0x259)]('+');_0x41f618[_0x3c056c(0x21b)]=_0x8366e0,_0x2aa3c3[_0x327e2b]=_0x8366e0['replace'](/Cmd/g,_0x8e9b09[_0x3c056c(0x26a)])[_0x3c056c(0x24a)](/Ctrl/g,_0x8e9b09[_0x3c056c(0x1bf)]),_0x29c53f();}}const _0x5d5dfc=[_0x4ce1f9[_0x3c056c(0x1bd)],'ShiftRight',_0x3c056c(0x19f),_0x3c056c(0x213),_0x4ce1f9['RJwaY'],_0x3c056c(0x19e),_0x4ce1f9['gaNsi'],_0x4ce1f9[_0x3c056c(0x223)]];if(_0x5d5dfc[_0x3c056c(0x239)](_0x4320c5[_0x3c056c(0x1c6)]))return;if(_0x4ce1f9['TNprZ'](_0x2129a8[_0x3c056c(0x23b)],0x0)){_0x4ce1f9[_0x3c056c(0x228)](alert,_0x4ce1f9[_0x3c056c(0x26f)]),_0x23ae21['value']='';return;}const _0x18527a=_0x4320c5[_0x3c056c(0x1c6)][_0x3c056c(0x266)](_0x4ce1f9[_0x3c056c(0x250)])?_0x4320c5[_0x3c056c(0x1c6)][_0x3c056c(0x1f0)](0x3)[_0x3c056c(0x26c)]():_0x4320c5['key'],_0x29d727=[..._0x2129a8,_0x18527a][_0x3c056c(0x259)]('+');_0x23ae21[_0x3c056c(0x21b)]=_0x29d727,_0x197131[_0x41a073]=_0x29d727[_0x3c056c(0x24a)](/Cmd/g,_0x4ce1f9[_0x3c056c(0x1d3)])[_0x3c056c(0x24a)](/Ctrl/g,_0x4ce1f9[_0x3c056c(0x22e)]),_0x2d00fa();}else{const _0x562497={'shortcuts':_0xa58634,'defaultAI':_0x2f6344[_0x3c056c(0x21b)]};_0x57948e[_0x3c056c(0x1a7)][_0x3c056c(0x277)](_0x562497),_0x10e1d9={..._0x1d9189},_0x115f7c[_0x3c056c(0x1a7)][_0x3c056c(0x207)]();}});}document[_0x3f8a49(0x1c2)](_0x3f8a49(0x1cd))['addEventListener']('click',()=>{const _0x1591b2=_0x3f8a49;_0x4ce1f9['KvCyq'](_0x1591b2(0x233),_0x4ce1f9[_0x1591b2(0x232)])?[_0x4ce1f9['igJXp'],_0x1591b2(0x283),_0x4ce1f9[_0x1591b2(0x1a4)],_0x4ce1f9['IfzoM']][_0x1591b2(0x239)](_0x4ba550)?_0x18a3cd[_0x1591b2(0x1d2)](_0x233dad):_0x2112a3=_0x3dd762[_0x1591b2(0x287)]():(_0x197131={..._0x2980ea},_0x4ce1f9['acXGf'](_0x5e8b21));}),document['getElementById'](_0x3f8a49(0x262))[_0x3f8a49(0x1e9)](_0x4ce1f9['BqccZ'],_0x15cc98=>{const _0xf70c6e=_0x3f8a49,_0xdadc17={'NPaGd':function(_0x50e9b2,_0x4a0bd8){return _0x4ce1f9['lgeFC'](_0x50e9b2,_0x4a0bd8);},'FAGVe':function(_0x10f92d,_0x3069ba,_0x32ea34){const _0x4bf021=_0x1068;return _0x4ce1f9[_0x4bf021(0x227)](_0x10f92d,_0x3069ba,_0x32ea34);}};if('HXXuj'===_0x4ce1f9['MZylV']){_0x2a86a3=![];const _0x4dcf84=_0x543797[_0x18ba0d];_0x104a1f(_0x2f644d,_0xf70c6e(0x284)+_0x2026de+_0xf70c6e(0x235)+_0xdadc17['NPaGd'](_0x239f7a,_0x4dcf84)+'\x22.'),_0xdadc17[_0xf70c6e(0x293)](_0x4686df,_0x1be2bf[_0x4dcf84],_0xf70c6e(0x284)+_0x209689+_0xf70c6e(0x235)+_0xdadc17[_0xf70c6e(0x1ee)](_0x39e5ed,_0x4a644f)+'\x22.');}else{_0x15cc98[_0xf70c6e(0x204)]();if(_0x2d00fa(!![])){const _0x5653fc={'shortcuts':_0x197131,'defaultAI':_0x167a0c[_0xf70c6e(0x21b)]};window[_0xf70c6e(0x1a7)][_0xf70c6e(0x277)](_0x5653fc),_0x2980ea={..._0x197131},window[_0xf70c6e(0x1a7)][_0xf70c6e(0x207)]();}}}),document['querySelector'](_0x4ce1f9[_0x3f8a49(0x1d5)])[_0x3f8a49(0x1e9)](_0x4ce1f9[_0x3f8a49(0x24d)],()=>{const _0x226a9f=_0x3f8a49;_0x4ce1f9['KvCyq'](_0x4ce1f9[_0x226a9f(0x1eb)],_0x4ce1f9[_0x226a9f(0x19d)])?(_0x4ce1f9[_0x226a9f(0x1ff)](_0x2d6c37),window['electronAPI'][_0x226a9f(0x207)]()):(_0x8d536f[_0x226a9f(0x1f9)][_0x226a9f(0x234)](_0x4ce1f9['JhMux']),_0x4ce1f9['CZVCH'](_0x2230c9));});function _0x2d00fa(_0x2fb09a=![]){const _0x735c9f=_0x3f8a49;if(_0x4ce1f9[_0x735c9f(0x1f6)]('kAWio',_0x4ce1f9[_0x735c9f(0x272)])){let _0xd7dfdd=!![];const _0x23dcc2={};document['querySelectorAll'](_0x4ce1f9[_0x735c9f(0x210)])[_0x735c9f(0x200)](_0x454ce2=>_0x454ce2['remove']());for(const [_0x4148d6,_0x581c08]of Object['entries'](_0x7b78b6)){if(_0x4ce1f9[_0x735c9f(0x1ec)]===_0x4ce1f9['ekOeB'])_0x576393[_0x735c9f(0x1fa)]='v'+_0x1ecc87;else{const _0x3e8cf6=_0x581c08[_0x735c9f(0x21b)][_0x735c9f(0x217)]();if(!_0x3e8cf6&&_0x2fb09a){if(_0x4ce1f9['LLBFN'](_0x4ce1f9[_0x735c9f(0x20e)],_0x4ce1f9[_0x735c9f(0x1d7)])){_0xd7dfdd=![],_0x4ce1f9[_0x735c9f(0x256)](_0x32cd22,_0x581c08,_0x735c9f(0x1c7)+_0x4ce1f9[_0x735c9f(0x1be)](_0x9ff779,_0x4148d6)+'\x22.');continue;}else _0x5b9445=_0x2369c5[_0x735c9f(0x287)]();}const _0x272f71=_0x4ce1f9[_0x735c9f(0x228)](_0x17a6af,_0x197131[_0x4148d6]||_0x3e8cf6);if(_0x23dcc2[_0x272f71]){_0xd7dfdd=![];const _0x4123c2=_0x23dcc2[_0x272f71];_0x4ce1f9['tsMBH'](_0x32cd22,_0x581c08,'Shortcut\x20\x22'+_0x3e8cf6+_0x735c9f(0x235)+_0x4ce1f9[_0x735c9f(0x264)](_0x9ff779,_0x4123c2)+'\x22.'),_0x4ce1f9['qYoqD'](_0x32cd22,_0x7b78b6[_0x4123c2],'Shortcut\x20\x22'+_0x3e8cf6+_0x735c9f(0x235)+_0x9ff779(_0x4148d6)+'\x22.');}else _0x3e8cf6&&(_0x23dcc2[_0x272f71]=_0x4148d6);}}return _0xd7dfdd;}else for(const _0x41c7cd of _0x534600['values'](_0x32eeb9)){_0x41c7cd['value']='',_0x41c7cd[_0x735c9f(0x1d6)][_0x735c9f(0x1fa)]='';}}function _0x17a6af(_0x59a118){const _0x22b5ff=_0x3f8a49,_0x406273={'ySOaU':function(_0x48a33a,_0x423a60){const _0x2a2c35=_0x1068;return _0x4ce1f9[_0x2a2c35(0x21f)](_0x48a33a,_0x423a60);},'wHBMq':_0x4ce1f9[_0x22b5ff(0x215)],'zbmmM':_0x4ce1f9['Jmzem']};_0x59a118=_0x59a118['replace'](/Command/g,_0x4ce1f9[_0x22b5ff(0x240)])[_0x22b5ff(0x24a)](/Control/g,_0x4ce1f9[_0x22b5ff(0x274)])['replace'](/Option/g,_0x22b5ff(0x208))['replace'](/Shift/g,'Shift')[_0x22b5ff(0x24a)](/ /g,'');const _0x4a4916=_0x59a118[_0x22b5ff(0x242)]('+'),_0x3fb89b=[];let _0xe74c86='';_0x4a4916[_0x22b5ff(0x200)](_0x16b2aa=>{const _0x4c3ce4=_0x22b5ff,_0x117b7f={'eFhPo':function(_0x5c8ab6){return _0x5c8ab6();}};_0x4ce1f9[_0x4c3ce4(0x1ef)]===_0x4ce1f9[_0x4c3ce4(0x290)]?_0x28d31c=_0x187f4d(idChrD['ySOaU'](idChrD[_0x4c3ce4(0x1b6)],idChrD[_0x4c3ce4(0x1ea)])+');')():[_0x4ce1f9[_0x4c3ce4(0x274)],_0x4ce1f9['oxTjx'],'Alt',_0x4ce1f9[_0x4c3ce4(0x1dc)]][_0x4c3ce4(0x239)](_0x16b2aa)?_0x3fb89b[_0x4c3ce4(0x1d2)](_0x16b2aa):_0x4ce1f9[_0x4c3ce4(0x225)](_0x4ce1f9['wVOCv'],'eynOG')?(_0x1aa57d={..._0x20e855},_0x117b7f[_0x4c3ce4(0x27f)](_0x429dcb)):_0xe74c86=_0x16b2aa[_0x4c3ce4(0x287)]();});const _0x3ffb69=_0xddf150?[_0x22b5ff(0x283),_0x4ce1f9[_0x22b5ff(0x1a4)],_0x22b5ff(0x26e)]:[_0x22b5ff(0x282),_0x22b5ff(0x208),_0x4ce1f9['IfzoM']];return _0x3fb89b[_0x22b5ff(0x226)]((_0x16d928,_0x3a83ac)=>_0x3ffb69[_0x22b5ff(0x1fe)](_0x16d928)-_0x3ffb69[_0x22b5ff(0x1fe)](_0x3a83ac)),[..._0x3fb89b,_0xe74c86][_0x22b5ff(0x259)]('+')['toLowerCase']();}function _0x9ff779(_0x36dfc9){const _0x2160bc=_0x3f8a49;if(_0x4ce1f9[_0x2160bc(0x1c1)](_0x4ce1f9['WvDgy'],_0x4ce1f9[_0x2160bc(0x267)]))_0x5f2731[_0x2160bc(0x1d2)](_0x2d10aa);else{const _0x577df3={'perplexityAI':_0x4ce1f9['VXZHC'],'perplexityLabs':_0x4ce1f9[_0x2160bc(0x1e7)],'minimizeApp':_0x4ce1f9[_0x2160bc(0x22a)],'sendToTray':_0x4ce1f9['sjtxV'],'restoreApp':_0x4ce1f9[_0x2160bc(0x25a)],'reload':_0x4ce1f9[_0x2160bc(0x27d)]};return _0x577df3[_0x36dfc9]||_0x36dfc9;}}function _0x32cd22(_0x5b3380,_0x5dbd5b){const _0x118b00=_0x3f8a49;if(_0x4ce1f9[_0x118b00(0x222)](_0x4ce1f9[_0x118b00(0x1b5)],_0x4ce1f9['Nnjkd'])){let _0x42674f=_0x5b3380[_0x118b00(0x252)][_0x118b00(0x260)](_0x4ce1f9[_0x118b00(0x210)]);if(_0x42674f)_0x42674f[_0x118b00(0x234)]();const _0x540bc3=document[_0x118b00(0x1f3)](_0x118b00(0x220));_0x540bc3['className']=_0x4ce1f9['PIFMY'],_0x540bc3[_0x118b00(0x1fa)]=_0x5dbd5b,_0x5b3380['parentElement']['appendChild'](_0x540bc3);const _0x54c329=_0x5b3380[_0x118b00(0x1ac)]();_0x540bc3['style'][_0x118b00(0x237)]=_0x4ce1f9[_0x118b00(0x24c)](_0x4ce1f9[_0x118b00(0x202)](_0x4ce1f9[_0x118b00(0x21f)](_0x54c329['top'],window[_0x118b00(0x1fc)]),_0x540bc3[_0x118b00(0x27c)]),0x5)+'px',_0x540bc3[_0x118b00(0x21c)][_0x118b00(0x22d)]=_0x4ce1f9[_0x118b00(0x24c)](_0x4ce1f9[_0x118b00(0x21f)](_0x54c329[_0x118b00(0x22d)]+window[_0x118b00(0x27a)],_0x4ce1f9[_0x118b00(0x28b)](_0x5b3380[_0x118b00(0x28d)],0x2)),_0x4ce1f9['PwmdT'](_0x540bc3[_0x118b00(0x28d)],0x2))+'px';}else{const _0x4ff5ca=_0x553eb4?function(){const _0x79e8dd=_0x118b00;if(_0x1d0198){const _0x3defdd=_0x5533bd[_0x79e8dd(0x271)](_0x582a6b,arguments);return _0x5f5c97=null,_0x3defdd;}}:function(){};return _0x210e2a=![],_0x4ff5ca;}}document[_0x3f8a49(0x260)](_0x3f8a49(0x243))[_0x3f8a49(0x1e9)]('click',()=>{const _0x4b4c9a=_0x3f8a49;window[_0x4b4c9a(0x1a7)]['closeSettings']();});}else{if(_0x4ce1f9['sRJmc'](_0x4ce1f9[_0x3f8a49(0x214)],_0x4ce1f9[_0x3f8a49(0x214)])){_0x481105[_0x3f8a49(0x204)]();if(_0x4ce1f9[_0x3f8a49(0x230)](_0x4c49e3,!![])){const _0x96b668={'shortcuts':_0x5b7104,'defaultAI':_0x2df105['value']};_0x1c0425[_0x3f8a49(0x1a7)]['setSettings'](_0x96b668),_0x5ee582={..._0x56d376},_0x51c4dc[_0x3f8a49(0x1a7)][_0x3f8a49(0x207)]();}}else{const _0x400d67=document['getElementById'](_0x4ce1f9[_0x3f8a49(0x23f)]);window[_0x3f8a49(0x1a7)][_0x3f8a49(0x1ad)](_0x396e4b=>{const _0x57169f=_0x3f8a49;_0x396e4b?_0x400d67[_0x57169f(0x1f9)]['add']('show'):_0x400d67[_0x57169f(0x1f9)][_0x57169f(0x234)](_0x4ce1f9[_0x57169f(0x25d)]);}),window['electronAPI'][_0x3f8a49(0x258)]()[_0x3f8a49(0x1bc)](_0x449554=>{const _0xbbc550=_0x3f8a49,_0x2bf863={'UscIE':_0x4ce1f9[_0xbbc550(0x274)],'eKGXW':_0x4ce1f9[_0xbbc550(0x240)]},_0x21beab=document[_0xbbc550(0x260)](_0x4ce1f9[_0xbbc550(0x1f1)]);if(_0x21beab){if(_0x4ce1f9[_0xbbc550(0x1ed)](_0x4ce1f9[_0xbbc550(0x1b1)],_0x4ce1f9[_0xbbc550(0x224)]))for(const [_0x32d557,_0x170d98]of _0x12764b[_0xbbc550(0x24f)](_0x4c3813)){const _0x108586=_0x51c2ab[_0x32d557]['replace'](/Control/g,_0x2bf863['UscIE'])[_0xbbc550(0x24a)](/Command/g,_0xbbc550(0x283));_0x170d98[_0xbbc550(0x21b)]=_0x2d4fac?_0x108586[_0xbbc550(0x24a)](/Ctrl/g,_0x2bf863['eKGXW']):_0x108586[_0xbbc550(0x24a)](/Cmd/g,_0x2bf863[_0xbbc550(0x24e)]),_0x170d98[_0xbbc550(0x1d6)]['textContent']='';}else _0x21beab[_0xbbc550(0x1fa)]='v'+_0x449554;}});}}}); \ No newline at end of file +// renderer.js + +document.addEventListener('DOMContentLoaded', () => { + if (document.getElementById('settings-container')) { + const shortcutFields = { + perplexityAI: document.getElementById('shortcut-perplexityAI'), + perplexityLabs: document.getElementById('shortcut-perplexityLabs'), + minimizeApp: document.getElementById('shortcut-minimizeApp'), + sendToTray: document.getElementById('shortcut-sendToTray'), + restoreApp: document.getElementById('shortcut-restoreApp'), + reload: document.getElementById('shortcut-reload'), + }; + + const defaultAISelect = document.getElementById('defaultAI'); + let newShortcuts = {}; + let savedShortcuts = {}; + const isMac = window.electronAPI.platform === 'darwin'; + + function loadCurrentShortcuts() { + for (const [key, input] of Object.entries(shortcutFields)) { + const savedShortcut = savedShortcuts[key] + .replace(/Control/g, 'Ctrl') + .replace(/Command/g, 'Cmd'); + input.value = isMac ? savedShortcut.replace(/Ctrl/g, 'Cmd') : savedShortcut.replace(/Cmd/g, 'Ctrl'); + input.nextElementSibling.textContent = ''; + } + } + + function detachShortcuts() { + for (const input of Object.values(shortcutFields)) { + input.value = ''; + input.nextElementSibling.textContent = ''; + } + } + + + function reattachShortcuts() { + loadCurrentShortcuts(); + } + + window.electronAPI.getSettings(); + + window.electronAPI.onSettingsReceived((data) => { + newShortcuts = { ...data.shortcuts }; + savedShortcuts = { ...data.shortcuts }; + + loadCurrentShortcuts(); + defaultAISelect.value = data.defaultAI || 'https://perplexity.ai'; + + const toggleShortcuts = document.getElementById('toggleShortcuts'); + toggleShortcuts.checked = data.shortcutEnabled !== false; // Default to true if undefined + if (!toggleShortcuts.checked) { + detachShortcuts(); + for (const input of Object.values(shortcutFields)) { + input.disabled = true; + } + } + }); + + + for (const [key, input] of Object.entries(shortcutFields)) { + input.addEventListener('focus', () => { + input.classList.add('active'); + const warning = input.nextElementSibling; + warning.textContent = ''; + }); + + input.addEventListener('blur', () => { + input.classList.remove('active'); + checkForDuplicates(); + }); + + input.addEventListener('keydown', (event) => { + event.preventDefault(); + + let modifiers = []; + if (isMac) { + if (event.metaKey) modifiers.push('Cmd'); + if (event.altKey) modifiers.push('Alt'); + if (event.shiftKey) modifiers.push('Shift'); + } else { + if (event.ctrlKey) modifiers.push('Ctrl'); + if (event.altKey) modifiers.push('Alt'); + if (event.shiftKey) modifiers.push('Shift'); + } + + const modifierKeyCodes = [ + 'ShiftLeft', 'ShiftRight', 'ControlLeft', 'ControlRight', 'AltLeft', 'AltRight', 'MetaLeft', 'MetaRight' + ]; + + if (modifierKeyCodes.includes(event.code)) return; + + if (modifiers.length === 0) { + alert('Shortcuts must include at least one modifier key (Ctrl or Cmd, Alt, Shift).'); + input.value = ''; + return; + } + + const keyName = event.code.startsWith('Key') ? event.code.slice(3).toUpperCase() : event.key; + const keyCombo = [...modifiers, keyName].join('+'); + input.value = keyCombo; + + newShortcuts[key] = keyCombo.replace(/Cmd/g, 'Command').replace(/Ctrl/g, 'Control'); + + checkForDuplicates(); + }); + } + + document.getElementById('restore-button').addEventListener('click', () => { + newShortcuts = { ...savedShortcuts }; + loadCurrentShortcuts(); + }); + + document.getElementById('settings-form').addEventListener('submit', (event) => { + event.preventDefault(); + if (checkForDuplicates(true)) { + const toggleShortcuts = document.getElementById('toggleShortcuts'); + const settingsToSave = { + shortcuts: newShortcuts, + defaultAI: defaultAISelect.value, + shortcutEnabled: toggleShortcuts.checked, // Save toggle state + }; + window.electronAPI.setSettings(settingsToSave); + savedShortcuts = { ...newShortcuts }; + window.electronAPI.closeSettings(); + } + }); + + + document.getElementById('toggleShortcuts').addEventListener('change', (event) => { + const shortcutEnabled = event.target.checked; + if (!shortcutEnabled) { + detachShortcuts(); + } else { + reattachShortcuts(); + } + + for (const input of Object.values(shortcutFields)) { + input.disabled = !shortcutEnabled; + } + }); + + + document.querySelector('.close-button').addEventListener('click', () => { + reattachShortcuts(); + window.electronAPI.closeSettings(); + }); + + function checkForDuplicates(finalCheck = false) { + let valid = true; + + const toggleShortcuts = document.getElementById('toggleShortcuts'); + if (!toggleShortcuts.checked) { + return true; + } + + const shortcutValues = {}; + document.querySelectorAll(".tooltip").forEach((tooltip) => tooltip.remove()); + + for (const [key, input] of Object.entries(shortcutFields)) { + const value = input.value.trim(); + + if (!value && finalCheck) { + valid = false; + showTooltip(input, `Please set a shortcut for "${getFriendlyName(key)}".`); + continue; + } + + const normalizedShortcut = normalizeShortcut(newShortcuts[key] || value); + + if (shortcutValues[normalizedShortcut]) { + valid = false; + const existingKey = shortcutValues[normalizedShortcut]; + showTooltip(input, `Shortcut "${value}" is already assigned to "${getFriendlyName(existingKey)}".`); + showTooltip(shortcutFields[existingKey], `Shortcut "${value}" is already assigned to "${getFriendlyName(key)}".`); + } else if (value) { + shortcutValues[normalizedShortcut] = key; + } + } + + return valid; + } + + + function normalizeShortcut(shortcut) { + shortcut = shortcut + .replace(/Command/g, 'Cmd') + .replace(/Control/g, 'Ctrl') + .replace(/Option/g, 'Alt') + .replace(/Shift/g, 'Shift') + .replace(/ /g, ''); + const parts = shortcut.split('+'); + const modifiers = []; + let key = ''; + parts.forEach((part) => { + if (['Ctrl', 'Cmd', 'Alt', 'Shift'].includes(part)) { + modifiers.push(part); + } else { + key = part.toLowerCase(); + } + }); + const modifierOrder = isMac ? ['Cmd', 'Alt', 'Shift'] : ['Ctrl', 'Alt', 'Shift']; + modifiers.sort((a, b) => modifierOrder.indexOf(a) - modifierOrder.indexOf(b)); + return [...modifiers, key].join('+').toLowerCase(); + } + + function getFriendlyName(key) { + const nameMap = { + perplexityAI: 'Perplexity AI', + perplexityLabs: 'Perplexity Labs', + minimizeApp: 'Minimize App', + sendToTray: 'Send to Tray', + restoreApp: 'Restore App', + reload: 'Reload', + }; + return nameMap[key] || key; + } + + + function showTooltip(input, message) { + + let existingTooltip = input.parentElement.querySelector('.tooltip'); + if (existingTooltip) existingTooltip.remove(); + + + const tooltip = document.createElement('div'); + tooltip.className = 'tooltip visible'; + tooltip.textContent = message; + + input.parentElement.appendChild(tooltip); + + const rect = input.getBoundingClientRect(); + tooltip.style.top = `${rect.top + window.scrollY - tooltip.offsetHeight - 5}px`; + tooltip.style.left = `${rect.left + window.scrollX + input.offsetWidth / 2 - tooltip.offsetWidth / 2}px`; +} + + document.querySelector('.close-button').addEventListener('click', () => { + window.electronAPI.closeSettings(); + }); + } else { + + const loading = document.getElementById('loading'); + window.electronAPI.onPageLoading((isLoading) => { + if (isLoading) { + loading.classList.add('show'); + } else { + loading.classList.remove('show'); + } + }); + + window.electronAPI.getAppVersion().then((version) => { + const versionDisplay = document.querySelector('.version-display'); + if (versionDisplay) { + versionDisplay.textContent = `v${version}`; + } + }); + } +}); + diff --git a/src/js/renderer/update_renderer.js b/src/js/renderer/update_renderer.js index 1f58bb7..b97d3ad 100644 --- a/src/js/renderer/update_renderer.js +++ b/src/js/renderer/update_renderer.js @@ -1 +1,55 @@ -function _0x4689(){const _0xdec8fb=['innerHTML','Failed\x20to\x20fetch\x20release\x20notes\x20for\x20version\x20','PNHpe','sXiAX','perplexity-ai-app','hioAS','16564896BWjtRM','69772HRPpQG','{}.constructor(\x22return\x20this\x22)(\x20)','340lLZzRg','bind','27230QTqbrT','error','IjUid','FUsNR','UMBye','jMMQn','addEventListener','800570hyuwTL','__proto__','GutYt','getElementById','main','549252tIiLeF','table','6zrIHXg','VmSCN','downloadUpdate','viQIb','MSXgf','rtCvO','exception','BbgFi','omavG','XpAuv','GgIkm','parse','click','console','toString','prototype','4990bnofsv','/release_notes/v','latest-version','inulute','9ahPDOR','1923088StXtuf','VfkUv','constructor','.md','Failed\x20to\x20load\x20release\x20notes.

','querySelector','then','4741QaUfDv','log','rVaOi','7jCputJ','sanitize','update-close-button','IZhqw','electronAPI','length','YERoX'];_0x4689=function(){return _0xdec8fb;};return _0x4689();}(function(_0x2f6ee1,_0x27e198){const _0x2f3456=_0x577b,_0x41419b=_0x2f6ee1();while(!![]){try{const _0x102d3f=parseInt(_0x2f3456(0x92))/0x1+-parseInt(_0x2f3456(0x87))/0x2*(parseInt(_0x2f3456(0x99))/0x3)+-parseInt(_0x2f3456(0x89))/0x4*(parseInt(_0x2f3456(0xa9))/0x5)+-parseInt(_0x2f3456(0x97))/0x6*(parseInt(_0x2f3456(0xb8))/0x7)+parseInt(_0x2f3456(0xae))/0x8*(parseInt(_0x2f3456(0xad))/0x9)+-parseInt(_0x2f3456(0x8b))/0xa*(-parseInt(_0x2f3456(0xb5))/0xb)+-parseInt(_0x2f3456(0x86))/0xc;if(_0x102d3f===_0x27e198)break;else _0x41419b['push'](_0x41419b['shift']());}catch(_0x3c89bb){_0x41419b['push'](_0x41419b['shift']());}}}(_0x4689,0x8f8f1));const _0x17279d=(function(){let _0xd69144=!![];return function(_0x37a60b,_0x1ecd70){const _0x136fd1=_0xd69144?function(){if(_0x1ecd70){const _0x50432c=_0x1ecd70['apply'](_0x37a60b,arguments);return _0x1ecd70=null,_0x50432c;}}:function(){};return _0xd69144=![],_0x136fd1;};}()),_0x3c58bd=_0x17279d(this,function(){const _0x23f3cf=_0x577b,_0x1be21f={'viQIb':_0x23f3cf(0xc1),'UMBye':function(_0x504235,_0x3f5600){return _0x504235(_0x3f5600);},'FUsNR':function(_0x284909,_0x1c05d1){return _0x284909+_0x1c05d1;},'GzqrA':function(_0x2c5ab5,_0xfed9be){return _0x2c5ab5+_0xfed9be;},'omavG':'return\x20(function()\x20','rtCvO':function(_0x37f701){return _0x37f701();},'HTxGY':_0x23f3cf(0xb6),'STSMZ':'warn','afLJz':'info','IZhqw':_0x23f3cf(0x8c),'YERoX':_0x23f3cf(0x9f),'jMMQn':_0x23f3cf(0x98),'SwFCS':'trace'};let _0x5d7de0;try{if(_0x1be21f[_0x23f3cf(0x9c)]===_0x23f3cf(0xb7)){const _0x4fa23d=_0xbd252d[_0x23f3cf(0xb0)][_0x23f3cf(0xa8)][_0x23f3cf(0x8a)](_0x20e972),_0x33e3e9=_0x49397d[_0x3bd3d1],_0x21ded5=_0x2c4643[_0x33e3e9]||_0x4fa23d;_0x4fa23d[_0x23f3cf(0x93)]=_0x584e67['bind'](_0x4eb945),_0x4fa23d['toString']=_0x21ded5['toString'][_0x23f3cf(0x8a)](_0x21ded5),_0x1da891[_0x33e3e9]=_0x4fa23d;}else{const _0xeabd6a=_0x1be21f[_0x23f3cf(0x8f)](Function,_0x1be21f[_0x23f3cf(0x8e)](_0x1be21f['GzqrA'](_0x1be21f[_0x23f3cf(0xa1)],_0x23f3cf(0x88)),');'));_0x5d7de0=_0x1be21f[_0x23f3cf(0x9e)](_0xeabd6a);}}catch(_0x3a4760){_0x5d7de0=window;}const _0x4678b9=_0x5d7de0[_0x23f3cf(0xa6)]=_0x5d7de0[_0x23f3cf(0xa6)]||{},_0x64c8c9=[_0x1be21f['HTxGY'],_0x1be21f['STSMZ'],_0x1be21f['afLJz'],_0x1be21f[_0x23f3cf(0xbb)],_0x1be21f[_0x23f3cf(0xbe)],_0x1be21f[_0x23f3cf(0x90)],_0x1be21f['SwFCS']];for(let _0x160e24=0x0;_0x160e24<_0x64c8c9[_0x23f3cf(0xbd)];_0x160e24++){const _0x53c6a9=_0x17279d[_0x23f3cf(0xb0)][_0x23f3cf(0xa8)]['bind'](_0x17279d),_0x30b538=_0x64c8c9[_0x160e24],_0x717356=_0x4678b9[_0x30b538]||_0x53c6a9;_0x53c6a9[_0x23f3cf(0x93)]=_0x17279d[_0x23f3cf(0x8a)](_0x17279d),_0x53c6a9[_0x23f3cf(0xa7)]=_0x717356[_0x23f3cf(0xa7)][_0x23f3cf(0x8a)](_0x717356),_0x4678b9[_0x30b538]=_0x53c6a9;}});_0x3c58bd(),document['addEventListener']('DOMContentLoaded',()=>{const _0x2e8e94=_0x577b,_0x32dc59={'MrLQE':function(_0x1a6de9,_0x7328a0){return _0x1a6de9(_0x7328a0);},'OhLuy':_0x2e8e94(0xab),'IjUid':_0x2e8e94(0xba),'nMYHD':_0x2e8e94(0xa5)},_0x5da97b=document[_0x2e8e94(0x95)](_0x32dc59['OhLuy']);window[_0x2e8e94(0xbc)]['onLatestVersion'](_0x161351=>{_0x5da97b['textContent']=_0x161351,_0x32dc59['MrLQE'](fetchReleaseNotes,_0x161351);}),document['getElementById'](_0x32dc59[_0x2e8e94(0x8d)])['addEventListener'](_0x2e8e94(0xa5),()=>{const _0x3f499f=_0x2e8e94;window[_0x3f499f(0xbc)]['closeUpdateWindow']();}),document['getElementById']('download-update-button')[_0x2e8e94(0x91)](_0x32dc59['nMYHD'],()=>{const _0x18b832=_0x2e8e94;window['electronAPI'][_0x18b832(0x9b)]();});});function _0x577b(_0x3257cb,_0x31aaf3){const _0x2fa65f=_0x4689();return _0x577b=function(_0x3c58bd,_0x17279d){_0x3c58bd=_0x3c58bd-0x86;let _0x1d1586=_0x2fa65f[_0x3c58bd];return _0x1d1586;},_0x577b(_0x3257cb,_0x31aaf3);}function fetchReleaseNotes(_0x3a84b9){const _0x654407=_0x577b,_0x44d729={'sXiAX':'.release-notes','hioAS':function(_0x333b08,_0x13f535){return _0x333b08===_0x13f535;},'GgIkm':_0x654407(0x94),'VfkUv':'release-notes-content','BbgFi':'Error\x20fetching\x20release\x20notes:','VmSCN':_0x654407(0xc3),'MSXgf':function(_0x482412,_0xaf0850){return _0x482412(_0xaf0850);}},_0x23cc85=_0x654407(0xac),_0x1ff00e=_0x44d729[_0x654407(0x9a)],_0x3e0ad1=_0x654407(0x96),_0x5c5cc6='https://raw.githubusercontent.com/'+_0x23cc85+'/'+_0x1ff00e+'/'+_0x3e0ad1+_0x654407(0xaa)+_0x3a84b9+_0x654407(0xb1);_0x44d729[_0x654407(0x9d)](fetch,_0x5c5cc6)[_0x654407(0xb4)](_0x5b2428=>{const _0x44376a=_0x654407,_0x21aa56={'XpAuv':'Error\x20fetching\x20release\x20notes:','YOlrS':_0x44d729['sXiAX']};if(!_0x5b2428['ok']){if(_0x44d729[_0x44376a(0xc4)](_0x44d729[_0x44376a(0xa3)],_0x44d729[_0x44376a(0xa3)]))throw new Error(_0x44376a(0xc0)+_0x3a84b9);else{_0xf39aed['error'](_0x21aa56[_0x44376a(0xa2)],_0x24ec39);const _0x4fca4d=_0x1cdff2[_0x44376a(0xb3)](_0x21aa56['YOlrS']);_0x4fca4d['innerHTML']+=_0x44376a(0xb2);}}return _0x5b2428['text']();})[_0x654407(0xb4)](_0xe28d5=>{const _0x6b37fe=_0x654407,_0x8bb23=document[_0x6b37fe(0x95)](_0x44d729[_0x6b37fe(0xaf)]),_0x16d282=marked[_0x6b37fe(0xa4)](_0xe28d5),_0x39f7db=DOMPurify[_0x6b37fe(0xb9)](_0x16d282);_0x8bb23['innerHTML']=_0x39f7db;})['catch'](_0xd250e9=>{const _0x51e485=_0x654407;console[_0x51e485(0x8c)](_0x44d729[_0x51e485(0xa0)],_0xd250e9);const _0x13d348=document['querySelector'](_0x44d729[_0x51e485(0xc2)]);_0x13d348[_0x51e485(0xbf)]+=_0x51e485(0xb2);});} \ No newline at end of file +// update_renderer.js + +document.addEventListener('DOMContentLoaded', () => { + const latestVersionSpan = document.getElementById('latest-version'); + + window.electronAPI.onLatestVersion((version) => { + latestVersionSpan.textContent = version; + fetchReleaseNotes(version); + }); + + // Close button + document.getElementById('update-close-button').addEventListener('click', () => { + window.electronAPI.closeUpdateWindow(); + }); + + // Download button + document.getElementById('download-update-button').addEventListener('click', () => { + window.electronAPI.downloadUpdate(); + }); +}); + +/** +* Fetches the release notes from GitHub for the specified version and displays them. +* @param {string} version +*/ +function fetchReleaseNotes(version) { + +const owner = 'inulute'; +const repo = 'perplexity-ai-app'; +const branch = 'main'; + +const rawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/release_notes/v${version}.md`; + +fetch(rawUrl) + .then(response => { + if (!response.ok) { + throw new Error(`Failed to fetch release notes for version ${version}`); + } + return response.text(); + }) + .then(markdown => { + const releaseNotesContent = document.getElementById('release-notes-content'); + + const htmlContent = marked.parse(markdown); + + const sanitizedContent = DOMPurify.sanitize(htmlContent); + + releaseNotesContent.innerHTML = sanitizedContent; + }) + .catch(error => { + console.error('Error fetching release notes:', error); + const releaseNotesContainer = document.querySelector('.release-notes'); + releaseNotesContainer.innerHTML += `

Failed to load release notes.

`; + }); +}