@web-to-figma/desktop 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(_0x892a8a,_0x12cf38){const _0x2343b0=_0x53d5,_0x53e101=_0x892a8a();while(!![]){try{const _0x3b926b=-parseInt(_0x2343b0(0xa1))/0x1*(parseInt(_0x2343b0(0xa5))/0x2)+parseInt(_0x2343b0(0xae))/0x3*(parseInt(_0x2343b0(0x86))/0x4)+parseInt(_0x2343b0(0x9f))/0x5+parseInt(_0x2343b0(0x99))/0x6+-parseInt(_0x2343b0(0x89))/0x7+-parseInt(_0x2343b0(0x98))/0x8+-parseInt(_0x2343b0(0x8d))/0x9*(-parseInt(_0x2343b0(0xab))/0xa);if(_0x3b926b===_0x12cf38)break;else _0x53e101['push'](_0x53e101['shift']());}catch(_0x12187f){_0x53e101['push'](_0x53e101['shift']());}}}(_0x12ae,0xe5f45));function _0x53d5(_0x5e8282,_0x28b7da){_0x5e8282=_0x5e8282-0x85;const _0x12ae4a=_0x12ae();let _0x53d507=_0x12ae4a[_0x5e8282];if(_0x53d5['BXbZDA']===undefined){var _0x36611f=function(_0x3c0a66){const _0x4cedf0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x519974='',_0x2ee022='';for(let _0x444d9e=0x0,_0x20386a,_0x44fcf0,_0x40ef8e=0x0;_0x44fcf0=_0x3c0a66['charAt'](_0x40ef8e++);~_0x44fcf0&&(_0x20386a=_0x444d9e%0x4?_0x20386a*0x40+_0x44fcf0:_0x44fcf0,_0x444d9e++%0x4)?_0x519974+=String['fromCharCode'](0xff&_0x20386a>>(-0x2*_0x444d9e&0x6)):0x0){_0x44fcf0=_0x4cedf0['indexOf'](_0x44fcf0);}for(let _0x196d92=0x0,_0x52e42e=_0x519974['length'];_0x196d92<_0x52e42e;_0x196d92++){_0x2ee022+='%'+('00'+_0x519974['charCodeAt'](_0x196d92)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2ee022);};_0x53d5['tplAxJ']=_0x36611f,_0x53d5['veSIhI']={},_0x53d5['BXbZDA']=!![];}const _0xeca55c=_0x12ae4a[0x0],_0x96cb50=_0x5e8282+_0xeca55c,_0x3cd6e6=_0x53d5['veSIhI'][_0x96cb50];return!_0x3cd6e6?(_0x53d507=_0x53d5['tplAxJ'](_0x53d507),_0x53d5['veSIhI'][_0x96cb50]=_0x53d507):_0x53d507=_0x3cd6e6,_0x53d507;}import _0x519974 from'crypto';function _0x12ae(){const _0x1dbf55=['C2vUzerLDLrVB2XZq29TBwfUza','mti5ovf6tfbtCa','BMfTzq','mtK2y3riCfvO','yM9VBgvHBG','C2vUzefUzeDLDerLDLrVB2XZq29TBwfUza','mteZmZqZndrNBwjcCKW','C3rYAw5NAwz5','C2fTzvnPDgu','zxH0zw5ZAw9UCW','mJiXnZm3odz1shj3tLy','C2vJDxjL','BwTKAxjtEw5J','tMv0D29YAY5LBMfIBgu','D3jPDgvgAwXLu3LUyW','BwfW','Aw5PDgLHBf9WCMvMzxjLBMnLCY5QC29U','CgLUBMvKx2v4DgvUC2LVBNm','BNvTyMvY','Ahr0Ce9UBhK','CM1tEw5J','nZu0nJG0me95s3viwG','ntGWmJK5meztBLzAAq','tMv0D29YAY5ZzxrdB29RAwvZ','CMvHzezPBgvtEw5J','zxHPC3rZu3LUyW','rgvMyxvSDa','zxHWAxjLCW','mtm2otC0mgLlrKL1rW','B2jQzwn0','muT3BK5UtW','y29VA2LLCW','tMv0D29YAY5NzxrbBgXdB29RAwvZ','Cgf0Aa','ndqZmJG4z3rUzhre','ChjPB3jPDhK','CMvHzgrPCLn5BMm','DMfSDwu','AM9PBG','AxnbCNjHEq','mtbwz2Hgz1C','AxneAxjLy3rVCNK'];_0x12ae=function(){return _0x1dbf55;};return _0x12ae();}import _0x2ee022 from'fs';import _0x444d9e from'path';import{parseJsonSafe}from'../utils.js';function asChromiumDriver(_0x20386a){return _0x20386a;}export function cleanupOrphanSessionDirs(_0x44fcf0){const _0x2c1a21=_0x53d5;if(!_0x2ee022[_0x2c1a21(0x9c)](_0x44fcf0))return;for(const _0x40ef8e of _0x2ee022[_0x2c1a21(0xa7)](_0x44fcf0,{'withFileTypes':!![]})){if(!_0x40ef8e[_0x2c1a21(0xac)]())continue;removeSessionDir(_0x444d9e[_0x2c1a21(0xa9)](_0x44fcf0,_0x40ef8e[_0x2c1a21(0x85)]));}}export function createHeadedSessionDir(_0x196d92){const _0x5199a3=_0x53d5;_0x2ee022[_0x5199a3(0x8f)](_0x196d92,{'recursive':!![]});const _0x52e42e=_0x444d9e[_0x5199a3(0xa9)](_0x196d92,_0x519974['randomUUID']());return _0x2ee022[_0x5199a3(0x8f)](_0x444d9e[_0x5199a3(0xa9)](_0x52e42e,_0x5199a3(0x9d)),{'recursive':!![]}),_0x52e42e;}export function seedPinnedExtensionPreferences(_0x5e2756,_0x56c214){const _0x29a67b=_0x53d5,_0x55247c=_0x444d9e['join'](_0x5e2756,_0x29a67b(0x9d),'Preferences'),_0x5504a7=parseJsonSafe(_0x2ee022[_0x29a67b(0x9c)](_0x55247c)?_0x2ee022[_0x29a67b(0x9b)](_0x55247c,'utf8'):null,{}),_0x468dff=parseJsonSafe(typeof _0x5504a7[_0x29a67b(0x8c)]===_0x29a67b(0xa0)&&_0x5504a7[_0x29a67b(0x8c)]!==null?JSON[_0x29a67b(0x8a)](_0x5504a7[_0x29a67b(0x8c)]):null,{});_0x468dff[_0x29a67b(0x94)]=[_0x56c214],_0x5504a7[_0x29a67b(0x8c)]=_0x468dff,_0x2ee022[_0x29a67b(0x91)](_0x55247c,JSON['stringify'](_0x5504a7));}export function createInitialPreferencesFile(_0x37168c,_0x11fa7b){const _0x381755=_0x53d5,_0x5dde04=_0x444d9e['join'](_0x37168c,_0x381755(0x93)),_0x3c1f15={'extensions':{'pinned_extensions':[_0x11fa7b]},'distribution':{'skip_first_run_ui':!![],'show_welcome_page':![]}};return _0x2ee022['writeFileSync'](_0x5dde04,JSON[_0x381755(0x8a)](_0x3c1f15)),_0x5dde04;}export function removeSessionDir(_0x2f5dec){const _0x6aa657=_0x53d5;try{_0x2ee022[_0x6aa657(0x97)](_0x2f5dec,{'recursive':!![],'force':!![]});}catch{}}function readPersistedCookies(_0x526269){const _0x3972d1=_0x53d5;if(!_0x2ee022[_0x3972d1(0x9c)](_0x526269))return[];const _0x85441=parseJsonSafe(_0x2ee022['readFileSync'](_0x526269,'utf8'),[]);return Array[_0x3972d1(0xaa)](_0x85441)?_0x85441:[];}function writePersistedCookies(_0x357e5f,_0x606cf2){const _0x3bf2de=_0x53d5;_0x2ee022[_0x3bf2de(0x8f)](_0x444d9e['dirname'](_0x357e5f),{'recursive':!![]}),_0x2ee022[_0x3bf2de(0x91)](_0x357e5f,JSON[_0x3bf2de(0x8a)](_0x606cf2,null,0x2)+'\x0a');}function toSetCookieParam(_0x24a6e1){const _0x3cc2dd=_0x53d5,_0x436f18={'name':_0x24a6e1[_0x3cc2dd(0x85)],'value':_0x24a6e1[_0x3cc2dd(0xa8)],'domain':_0x24a6e1['domain'],'path':_0x24a6e1[_0x3cc2dd(0xa4)]||'/'};return typeof _0x24a6e1[_0x3cc2dd(0x9e)]===_0x3cc2dd(0x95)&&_0x24a6e1[_0x3cc2dd(0x9e)]>0x0&&(_0x436f18[_0x3cc2dd(0x9e)]=_0x24a6e1[_0x3cc2dd(0x9e)]),typeof _0x24a6e1[_0x3cc2dd(0x96)]===_0x3cc2dd(0x87)&&(_0x436f18[_0x3cc2dd(0x96)]=_0x24a6e1[_0x3cc2dd(0x96)]),typeof _0x24a6e1['secure']===_0x3cc2dd(0x87)&&(_0x436f18['secure']=_0x24a6e1[_0x3cc2dd(0x8e)]),_0x24a6e1[_0x3cc2dd(0x8b)]&&(_0x436f18[_0x3cc2dd(0x8b)]=_0x24a6e1[_0x3cc2dd(0x8b)]),_0x24a6e1[_0x3cc2dd(0xa6)]&&(_0x436f18[_0x3cc2dd(0xa6)]=_0x24a6e1['priority']),_0x436f18;}export async function importPersistedCookies(_0x24b6ee,_0x2aa161){const _0x180271=_0x53d5,_0x23b8ec=readPersistedCookies(_0x2aa161);if(_0x23b8ec['length']===0x0)return;const _0x11a1bf=asChromiumDriver(_0x24b6ee);await _0x11a1bf[_0x180271(0xad)](_0x180271(0x90),{}),await _0x11a1bf['sendDevToolsCommand'](_0x180271(0x9a),{'cookies':_0x23b8ec[_0x180271(0x92)](toSetCookieParam)});}export async function exportPersistedCookies(_0x1ddcca,_0x326099){const _0x576881=_0x53d5,_0x10f24a=asChromiumDriver(_0x1ddcca);await _0x10f24a[_0x576881(0xad)](_0x576881(0x90),{});const _0x27e96a=await _0x10f24a[_0x576881(0x88)](_0x576881(0xa3),{}),_0x4f3434=Array['isArray'](_0x27e96a[_0x576881(0xa2)])?_0x27e96a['cookies']:[];writePersistedCookies(_0x326099,_0x4f3434);}export function resetHeadedBrowserState(_0x8b9954,_0x33a6d2){const _0x393bcd=_0x53d5;cleanupOrphanSessionDirs(_0x33a6d2),_0x2ee022[_0x393bcd(0x9c)](_0x8b9954)&&_0x2ee022[_0x393bcd(0x97)](_0x8b9954,{'recursive':!![],'force':!![]});}
1
+ (function(_0x2f1547,_0x3613b8){const _0x59f941=_0x28f9,_0x2870c3=_0x2f1547();while(!![]){try{const _0x5060d4=-parseInt(_0x59f941(0xfc))/0x1+-parseInt(_0x59f941(0x11e))/0x2+-parseInt(_0x59f941(0x10c))/0x3+-parseInt(_0x59f941(0x123))/0x4*(-parseInt(_0x59f941(0x114))/0x5)+parseInt(_0x59f941(0x112))/0x6+parseInt(_0x59f941(0xf9))/0x7+-parseInt(_0x59f941(0x107))/0x8;if(_0x5060d4===_0x3613b8)break;else _0x2870c3['push'](_0x2870c3['shift']());}catch(_0xd3cee4){_0x2870c3['push'](_0x2870c3['shift']());}}}(_0x3ed4,0x79845));import _0x476467 from'crypto';import _0x23bc17 from'fs';import _0xd39aef from'path';import{parseJsonSafe}from'../utils.js';function asChromiumDriver(_0x10f496){return _0x10f496;}export function cleanupOrphanSessionDirs(_0x5ea3e9){const _0x17bce6=_0x28f9;if(!_0x23bc17[_0x17bce6(0x121)](_0x5ea3e9))return;for(const _0x34e11f of _0x23bc17[_0x17bce6(0x116)](_0x5ea3e9,{'withFileTypes':!![]})){if(!_0x34e11f[_0x17bce6(0xfd)]())continue;removeSessionDir(_0xd39aef[_0x17bce6(0xff)](_0x5ea3e9,_0x34e11f['name']));}}export function createHeadedSessionDir(_0x3d84cb){const _0x27ffae=_0x28f9;_0x23bc17[_0x27ffae(0x102)](_0x3d84cb,{'recursive':!![]});const _0x253c42=_0xd39aef[_0x27ffae(0xff)](_0x3d84cb,_0x476467[_0x27ffae(0x10b)]());return _0x23bc17['mkdirSync'](_0xd39aef[_0x27ffae(0xff)](_0x253c42,_0x27ffae(0x124)),{'recursive':!![]}),_0x253c42;}export function seedPinnedExtensionPreferences(_0x15f82c,_0x4dfb76){const _0x15c2ae=_0x28f9,_0x187b4e=_0xd39aef[_0x15c2ae(0xff)](_0x15f82c,_0x15c2ae(0x124),_0x15c2ae(0x103)),_0x5d8f4e=parseJsonSafe(_0x23bc17['existsSync'](_0x187b4e)?_0x23bc17[_0x15c2ae(0x10e)](_0x187b4e,_0x15c2ae(0x110)):null,{}),_0x52e644=parseJsonSafe(typeof _0x5d8f4e[_0x15c2ae(0x11b)]===_0x15c2ae(0x109)&&_0x5d8f4e[_0x15c2ae(0x11b)]!==null?JSON['stringify'](_0x5d8f4e['extensions']):null,{});_0x52e644[_0x15c2ae(0x100)]=[_0x4dfb76],_0x5d8f4e['extensions']=_0x52e644,_0x23bc17[_0x15c2ae(0xfe)](_0x187b4e,JSON[_0x15c2ae(0x10d)](_0x5d8f4e));}export function createInitialPreferencesFile(_0x5899ce,_0x3e9260){const _0x386cde=_0x28f9,_0x3c42b2=_0xd39aef[_0x386cde(0xff)](_0x5899ce,_0x386cde(0x111)),_0xe11292={'extensions':{'pinned_extensions':[_0x3e9260]},'distribution':{'skip_first_run_ui':!![],'show_welcome_page':![]}};return _0x23bc17['writeFileSync'](_0x3c42b2,JSON[_0x386cde(0x10d)](_0xe11292)),_0x3c42b2;}export function removeSessionDir(_0xf82ec5){try{_0x23bc17['rmSync'](_0xf82ec5,{'recursive':!![],'force':!![]});}catch{}}function readPersistedCookies(_0x2bd5db){const _0x2c777f=_0x28f9;if(!_0x23bc17[_0x2c777f(0x121)](_0x2bd5db))return[];const _0x519964=parseJsonSafe(_0x23bc17['readFileSync'](_0x2bd5db,_0x2c777f(0x110)),[]);return Array[_0x2c777f(0x11c)](_0x519964)?_0x519964:[];}function writePersistedCookies(_0x2f16d1,_0x98ace0){const _0x45866d=_0x28f9;_0x23bc17[_0x45866d(0x102)](_0xd39aef['dirname'](_0x2f16d1),{'recursive':!![]}),_0x23bc17[_0x45866d(0xfe)](_0x2f16d1,JSON['stringify'](_0x98ace0,null,0x2)+'\x0a');}function _0x28f9(_0x2f209c,_0x35e80f){_0x2f209c=_0x2f209c-0xf9;const _0x3ed436=_0x3ed4();let _0x28f93d=_0x3ed436[_0x2f209c];if(_0x28f9['MIuvvh']===undefined){var _0x48dae4=function(_0x6ca542){const _0x4e2fe9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x476467='',_0x23bc17='';for(let _0xd39aef=0x0,_0x10f496,_0x5ea3e9,_0x34e11f=0x0;_0x5ea3e9=_0x6ca542['charAt'](_0x34e11f++);~_0x5ea3e9&&(_0x10f496=_0xd39aef%0x4?_0x10f496*0x40+_0x5ea3e9:_0x5ea3e9,_0xd39aef++%0x4)?_0x476467+=String['fromCharCode'](0xff&_0x10f496>>(-0x2*_0xd39aef&0x6)):0x0){_0x5ea3e9=_0x4e2fe9['indexOf'](_0x5ea3e9);}for(let _0x3d84cb=0x0,_0x253c42=_0x476467['length'];_0x3d84cb<_0x253c42;_0x3d84cb++){_0x23bc17+='%'+('00'+_0x476467['charCodeAt'](_0x3d84cb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x23bc17);};_0x28f9['nhwGwi']=_0x48dae4,_0x28f9['tUBFJi']={},_0x28f9['MIuvvh']=!![];}const _0x3ce34f=_0x3ed436[0x0],_0xe7a331=_0x2f209c+_0x3ce34f,_0x5ca76c=_0x28f9['tUBFJi'][_0xe7a331];return!_0x5ca76c?(_0x28f93d=_0x28f9['nhwGwi'](_0x28f93d),_0x28f9['tUBFJi'][_0xe7a331]=_0x28f93d):_0x28f93d=_0x5ca76c,_0x28f93d;}function toSetCookieParam(_0x3eff2e){const _0x5e9a96=_0x28f9,_0x3524c9={'name':_0x3eff2e[_0x5e9a96(0x101)],'value':_0x3eff2e['value'],'domain':_0x3eff2e[_0x5e9a96(0x106)],'path':_0x3eff2e[_0x5e9a96(0x117)]||'/'};return typeof _0x3eff2e[_0x5e9a96(0x118)]===_0x5e9a96(0x120)&&_0x3eff2e[_0x5e9a96(0x118)]>0x0&&(_0x3524c9[_0x5e9a96(0x118)]=_0x3eff2e['expires']),typeof _0x3eff2e[_0x5e9a96(0x11a)]===_0x5e9a96(0x105)&&(_0x3524c9[_0x5e9a96(0x11a)]=_0x3eff2e[_0x5e9a96(0x11a)]),typeof _0x3eff2e[_0x5e9a96(0xfb)]===_0x5e9a96(0x105)&&(_0x3524c9[_0x5e9a96(0xfb)]=_0x3eff2e[_0x5e9a96(0xfb)]),_0x3eff2e[_0x5e9a96(0x11f)]&&(_0x3524c9[_0x5e9a96(0x11f)]=_0x3eff2e[_0x5e9a96(0x11f)]),_0x3eff2e[_0x5e9a96(0x11d)]&&(_0x3524c9['priority']=_0x3eff2e[_0x5e9a96(0x11d)]),_0x3524c9;}export async function importPersistedCookies(_0x34b884,_0x1a9804){const _0xc9ee11=_0x28f9,_0x356f79=readPersistedCookies(_0x1a9804);if(_0x356f79[_0xc9ee11(0x108)]===0x0)return;const _0x1b4a58=asChromiumDriver(_0x34b884);await _0x1b4a58[_0xc9ee11(0x119)](_0xc9ee11(0x122),{}),await _0x1b4a58['sendDevToolsCommand'](_0xc9ee11(0x113),{'cookies':_0x356f79[_0xc9ee11(0x10a)](toSetCookieParam)});}export async function exportPersistedCookies(_0x1f41b3,_0x59a59f){const _0x17b990=_0x28f9,_0xdca102=asChromiumDriver(_0x1f41b3);await _0xdca102[_0x17b990(0x119)](_0x17b990(0x122),{});const _0x4977e3=await _0xdca102[_0x17b990(0x104)](_0x17b990(0xfa),{}),_0x54deed=Array['isArray'](_0x4977e3[_0x17b990(0x10f)])?_0x4977e3[_0x17b990(0x10f)]:[];writePersistedCookies(_0x59a59f,_0x54deed);}function _0x3ed4(){const _0x4c674f=['Cgf0Aa','zxHWAxjLCW','C2vUzerLDLrVB2XZq29TBwfUza','Ahr0Ce9UBhK','zxH0zw5ZAw9UCW','AxnbCNjHEq','ChjPB3jPDhK','mJe1mtG2quTLr2Xl','C2fTzvnPDgu','BNvTyMvY','zxHPC3rZu3LUyW','tMv0D29YAY5LBMfIBgu','nfn0zvfcDW','rgvMyxvSDa','nte1mJi0nuPTuvrxra','tMv0D29YAY5NzxrbBgXdB29RAwvZ','C2vJDxjL','nde2mdu0uLvbsNrA','AxneAxjLy3rVCNK','D3jPDgvgAwXLu3LUyW','AM9PBG','CgLUBMvKx2v4DgvUC2LVBNm','BMfTzq','BwTKAxjtEw5J','uhjLzMvYzw5Jzxm','C2vUzefUzeDLDerLDLrVB2XZq29TBwfUza','yM9VBgvHBG','zg9TywLU','mtyXnZi0og1JtwnIva','BgvUz3rO','B2jQzwn0','BwfW','CMfUzg9Tvvvjra','mJu2nJCXnNnhzLvWtG','C3rYAw5NAwz5','CMvHzezPBgvtEw5J','y29VA2LLCW','DxrMoa','Aw5PDgLHBf9WCMvMzxjLBMnLCY5QC29U','ndGZntuYmejbuNfesW','tMv0D29YAY5ZzxrdB29RAwvZ','mJy4ntC2nwHysKfxDa','CM1tEw5J','CMvHzgrPCLn5BMm'];_0x3ed4=function(){return _0x4c674f;};return _0x3ed4();}export function resetHeadedBrowserState(_0x3b18f8,_0x4d3d98){const _0x56b776=_0x28f9;cleanupOrphanSessionDirs(_0x4d3d98),_0x23bc17[_0x56b776(0x121)](_0x3b18f8)&&_0x23bc17[_0x56b776(0x115)](_0x3b18f8,{'recursive':!![],'force':!![]});}
@@ -1 +1 @@
1
- function _0x2fcc(_0x5d7417,_0x3aefc0){_0x5d7417=_0x5d7417-0xe6;const _0x2a5db6=_0x2a5d();let _0x2fcc6a=_0x2a5db6[_0x5d7417];if(_0x2fcc['WVnqjm']===undefined){var _0x1df3d5=function(_0x447ab7){const _0x4d0d95='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2bf59c='',_0x24e2fb='';for(let _0x53cc29=0x0,_0x53a602,_0x1b5b00,_0x17b0a2=0x0;_0x1b5b00=_0x447ab7['charAt'](_0x17b0a2++);~_0x1b5b00&&(_0x53a602=_0x53cc29%0x4?_0x53a602*0x40+_0x1b5b00:_0x1b5b00,_0x53cc29++%0x4)?_0x2bf59c+=String['fromCharCode'](0xff&_0x53a602>>(-0x2*_0x53cc29&0x6)):0x0){_0x1b5b00=_0x4d0d95['indexOf'](_0x1b5b00);}for(let _0x34c954=0x0,_0x4b5c5a=_0x2bf59c['length'];_0x34c954<_0x4b5c5a;_0x34c954++){_0x24e2fb+='%'+('00'+_0x2bf59c['charCodeAt'](_0x34c954)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x24e2fb);};_0x2fcc['OZxGyF']=_0x1df3d5,_0x2fcc['nWJWCd']={},_0x2fcc['WVnqjm']=!![];}const _0x5b17d1=_0x2a5db6[0x0],_0x4d0fb8=_0x5d7417+_0x5b17d1,_0x276c2d=_0x2fcc['nWJWCd'][_0x4d0fb8];return!_0x276c2d?(_0x2fcc6a=_0x2fcc['OZxGyF'](_0x2fcc6a),_0x2fcc['nWJWCd'][_0x4d0fb8]=_0x2fcc6a):_0x2fcc6a=_0x276c2d,_0x2fcc6a;}(function(_0x4a3b16,_0x489ae3){const _0x1e2521=_0x2fcc,_0x4e52c9=_0x4a3b16();while(!![]){try{const _0x2ea0c2=parseInt(_0x1e2521(0xe9))/0x1+-parseInt(_0x1e2521(0xe6))/0x2*(-parseInt(_0x1e2521(0xf3))/0x3)+parseInt(_0x1e2521(0xe8))/0x4*(parseInt(_0x1e2521(0xee))/0x5)+-parseInt(_0x1e2521(0xe7))/0x6+parseInt(_0x1e2521(0xeb))/0x7+-parseInt(_0x1e2521(0xea))/0x8+-parseInt(_0x1e2521(0xec))/0x9;if(_0x2ea0c2===_0x489ae3)break;else _0x4e52c9['push'](_0x4e52c9['shift']());}catch(_0x152e72){_0x4e52c9['push'](_0x4e52c9['shift']());}}}(_0x2a5d,0x4efab));function _0x2a5d(){const _0x26725c=['mtm1mJqWm2DeuvDtza','AgvHzgvKvw5WywnRzwrfEhrLBNnPB25eAxi','mJG1rNnOzvn4','D2fYBG','zgvIDwC','vw5WywnRzwqGAgvHzgvKigv4DgvUC2LVBIb3AxrOihn0ywjSzsbRzxK','AgvHzgvKq3j4ugf0Aa','m3HUtwzmwq','nZuXmdiWsffir3vj','mtGWnZG3oefxzhPtza','mJaZotjpsLvJrwW','nJKXnZLmvM5iDvC','mtaYmJaYnhbsu2Hbra','mte3mJG5oxfxt05fuW'];_0x2a5d=function(){return _0x26725c;};return _0x2a5d();}import _0x2bf59c from'fs';import{extensionIdFromCrx,shouldRefreshUnpackedExtension,unpackCrxWithStableKey}from'./crxUtils.js';export function ensureHeadedExtensionUnpacked(_0x24e2fb,_0x53cc29){const _0x1c68d7=_0x2fcc;if(!_0x2bf59c['existsSync'](_0x24e2fb[_0x1c68d7(0xf2)]))return _0x53cc29[_0x1c68d7(0xef)]({'crxPath':_0x24e2fb[_0x1c68d7(0xf2)]},'Headed\x20extension\x20CRX\x20missing'),null;const _0x53a602=_0x24e2fb[_0x1c68d7(0xed)];let _0x1b5b00;return shouldRefreshUnpackedExtension(_0x24e2fb[_0x1c68d7(0xf2)],_0x53a602)?(_0x1b5b00=unpackCrxWithStableKey(_0x24e2fb[_0x1c68d7(0xf2)],_0x53a602),_0x53cc29[_0x1c68d7(0xf0)]({'unpackedDir':_0x53a602,'extensionId':_0x1b5b00},_0x1c68d7(0xf1))):_0x1b5b00=extensionIdFromCrx(_0x24e2fb[_0x1c68d7(0xf2)]),{'extensionId':_0x1b5b00,'unpackedDir':_0x53a602};}
1
+ (function(_0x526cf4,_0x5e02fc){const _0x212eaf=_0x5a70,_0x5d6a2d=_0x526cf4();while(!![]){try{const _0x5ec0b2=-parseInt(_0x212eaf(0x70))/0x1+parseInt(_0x212eaf(0x78))/0x2*(-parseInt(_0x212eaf(0x7b))/0x3)+-parseInt(_0x212eaf(0x7f))/0x4*(parseInt(_0x212eaf(0x7c))/0x5)+-parseInt(_0x212eaf(0x72))/0x6*(-parseInt(_0x212eaf(0x77))/0x7)+-parseInt(_0x212eaf(0x75))/0x8+parseInt(_0x212eaf(0x74))/0x9*(-parseInt(_0x212eaf(0x7a))/0xa)+parseInt(_0x212eaf(0x73))/0xb;if(_0x5ec0b2===_0x5e02fc)break;else _0x5d6a2d['push'](_0x5d6a2d['shift']());}catch(_0x3897bd){_0x5d6a2d['push'](_0x5d6a2d['shift']());}}}(_0x1fd6,0xc63b8));import _0x5cf86f from'fs';import{extensionIdFromCrx,shouldRefreshUnpackedExtension,unpackCrxWithStableKey}from'./crxUtils.js';export function ensureHeadedExtensionUnpacked(_0x32f470,_0x5875d4){const _0xf82101=_0x5a70;if(!_0x5cf86f[_0xf82101(0x7e)](_0x32f470[_0xf82101(0x6f)]))return _0x5875d4['warn']({'crxPath':_0x32f470[_0xf82101(0x6f)]},_0xf82101(0x76)),null;const _0x12efd0=_0x32f470[_0xf82101(0x71)];let _0x184b6a;return shouldRefreshUnpackedExtension(_0x32f470[_0xf82101(0x6f)],_0x12efd0)?(_0x184b6a=unpackCrxWithStableKey(_0x32f470[_0xf82101(0x6f)],_0x12efd0),_0x5875d4[_0xf82101(0x79)]({'unpackedDir':_0x12efd0,'extensionId':_0x184b6a},_0xf82101(0x7d))):_0x184b6a=extensionIdFromCrx(_0x32f470['headedCrxPath']),{'extensionId':_0x184b6a,'unpackedDir':_0x12efd0};}function _0x5a70(_0xa8095f,_0x42c403){_0xa8095f=_0xa8095f-0x6f;const _0x1fd6b0=_0x1fd6();let _0x5a70d4=_0x1fd6b0[_0xa8095f];if(_0x5a70['kktnCH']===undefined){var _0xd996c6=function(_0x3bec0e){const _0x560b51='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x5cf86f='',_0x32f470='';for(let _0x5875d4=0x0,_0x12efd0,_0x184b6a,_0x4b71a6=0x0;_0x184b6a=_0x3bec0e['charAt'](_0x4b71a6++);~_0x184b6a&&(_0x12efd0=_0x5875d4%0x4?_0x12efd0*0x40+_0x184b6a:_0x184b6a,_0x5875d4++%0x4)?_0x5cf86f+=String['fromCharCode'](0xff&_0x12efd0>>(-0x2*_0x5875d4&0x6)):0x0){_0x184b6a=_0x560b51['indexOf'](_0x184b6a);}for(let _0xf90c82=0x0,_0x2a60bc=_0x5cf86f['length'];_0xf90c82<_0x2a60bc;_0xf90c82++){_0x32f470+='%'+('00'+_0x5cf86f['charCodeAt'](_0xf90c82)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x32f470);};_0x5a70['mAohcl']=_0xd996c6,_0x5a70['JNXtir']={},_0x5a70['kktnCH']=!![];}const _0x2036f2=_0x1fd6b0[0x0],_0x38c6cd=_0xa8095f+_0x2036f2,_0x4e2b51=_0x5a70['JNXtir'][_0x38c6cd];return!_0x4e2b51?(_0x5a70d4=_0x5a70['mAohcl'](_0x5a70d4),_0x5a70['JNXtir'][_0x38c6cd]=_0x5a70d4):_0x5a70d4=_0x4e2b51,_0x5a70d4;}function _0x1fd6(){const _0x775680=['mta5nda5mwHSBfnTBG','AgvHzgvKvw5WywnRzwrfEhrLBNnPB25eAxi','mtq1nZKXnM9ytvjpzq','ndq4nZeWmZvMwNHHuxy','nJaZA2f3wunT','otq5mJm0ng9ksefgzq','sgvHzgvKigv4DgvUC2LVBIbduLGGBwLZC2LUzW','n09pEffOva','mZGYv3vSsxbq','zgvIDwC','mZy1mgfpugTerG','mJG0mwvYCePlrW','mtG5nJC1uvLstK1x','vw5WywnRzwqGAgvHzgvKigv4DgvUC2LVBIb3AxrOihn0ywjSzsbRzxK','zxHPC3rZu3LUyW','mta4tu9Rwufz','AgvHzgvKq3j4ugf0Aa'];_0x1fd6=function(){return _0x775680;};return _0x1fd6();}
@@ -1 +1 @@
1
- (function(_0x52cca1,_0x5bebd1){const _0x33c4f7=_0x5761,_0x189b12=_0x52cca1();while(!![]){try{const _0x17d869=-parseInt(_0x33c4f7(0xd3))/0x1*(-parseInt(_0x33c4f7(0xda))/0x2)+-parseInt(_0x33c4f7(0xd2))/0x3*(parseInt(_0x33c4f7(0xd8))/0x4)+-parseInt(_0x33c4f7(0xdb))/0x5*(parseInt(_0x33c4f7(0xd9))/0x6)+-parseInt(_0x33c4f7(0xcf))/0x7+-parseInt(_0x33c4f7(0xd1))/0x8*(parseInt(_0x33c4f7(0xdc))/0x9)+-parseInt(_0x33c4f7(0xe1))/0xa+parseInt(_0x33c4f7(0xe0))/0xb;if(_0x17d869===_0x5bebd1)break;else _0x189b12['push'](_0x189b12['shift']());}catch(_0x2c8680){_0x189b12['push'](_0x189b12['shift']());}}}(_0xfdc0,0x50334));import{exportPersistedCookies,removeSessionDir}from'./headedBrowserState.js';const BROWSER_POLL_MS=0x1f4;function _0x5761(_0x4d6bd4,_0x5f8952){_0x4d6bd4=_0x4d6bd4-0xcf;const _0xfdc04c=_0xfdc0();let _0x5761e9=_0xfdc04c[_0x4d6bd4];if(_0x5761['TfXVrM']===undefined){var _0x174b90=function(_0x27a367){const _0x25f26a='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3749d2='',_0x3cd9e6='';for(let _0x1ade3b=0x0,_0x4af6ab,_0x2b8f7b,_0x38dd2a=0x0;_0x2b8f7b=_0x27a367['charAt'](_0x38dd2a++);~_0x2b8f7b&&(_0x4af6ab=_0x1ade3b%0x4?_0x4af6ab*0x40+_0x2b8f7b:_0x2b8f7b,_0x1ade3b++%0x4)?_0x3749d2+=String['fromCharCode'](0xff&_0x4af6ab>>(-0x2*_0x1ade3b&0x6)):0x0){_0x2b8f7b=_0x25f26a['indexOf'](_0x2b8f7b);}for(let _0x47f0b9=0x0,_0x5df450=_0x3749d2['length'];_0x47f0b9<_0x5df450;_0x47f0b9++){_0x3cd9e6+='%'+('00'+_0x3749d2['charCodeAt'](_0x47f0b9)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3cd9e6);};_0x5761['IiEhiv']=_0x174b90,_0x5761['qwdgQL']={},_0x5761['TfXVrM']=!![];}const _0xd78f7=_0xfdc04c[0x0],_0x113cd2=_0x4d6bd4+_0xd78f7,_0x227cc6=_0x5761['qwdgQL'][_0x113cd2];return!_0x227cc6?(_0x5761e9=_0x5761['IiEhiv'](_0x5761e9),_0x5761['qwdgQL'][_0x113cd2]=_0x5761e9):_0x5761e9=_0x227cc6,_0x5761e9;}function _0xfdc0(){const _0x126896=['Bg9N','z2v0','nhbcC1Phvq','mtq4mtG3nhL0EKzoBa','mZq0mZzlrvDpq2u','mtbjwxbftw0','mtaZnJC0nLLis0fLBG','Bgf1BMnOsgvHzgvK','CMvTB3zLtgLZDgvUzxi','z2v0qwXSv2LUzg93sgfUzgXLCW','mJqXodGWnJv0EeXXAK0','mtuYmZi5mfPTD3rjEG','mZKXmJKWmNf4rwr0Ca','u0Lhsu5u','ndb1DKHpD3O','mZe5mtCWtuHHyMXh','mxv4D2nLsq','u0Lhvevstq','q2HYB21Lig9Wzw5LzcbMB3iGBwfUDwfSignHChr1CMuUienSB3nLihrOzsbICM93C2vYihDOzw4GzMLUAxnOzwqU'];_0xfdc0=function(){return _0x126896;};return _0xfdc0();}async function waitForBrowserClosed(_0x3749d2){await new Promise(_0x3cd9e6=>{const _0x4b4a24=_0x5761;let _0x1ade3b=![];const _0x4af6ab=()=>{const _0x3e282f=_0x5761;if(_0x1ade3b)return;_0x1ade3b=!![],process[_0x3e282f(0xde)]('SIGINT',_0x2b8f7b),process[_0x3e282f(0xde)](_0x3e282f(0xd4),_0x2b8f7b),_0x3cd9e6();},_0x2b8f7b=()=>_0x4af6ab();process['on'](_0x4b4a24(0xd0),_0x2b8f7b),process['on']('SIGTERM',_0x2b8f7b);const _0x38dd2a=async()=>{try{const _0x47f0b9=await _0x3749d2();if(_0x47f0b9['length']===0x0){_0x4af6ab();return;}setTimeout(()=>void _0x38dd2a(),BROWSER_POLL_MS);}catch{_0x4af6ab();}};void _0x38dd2a();});}export async function launchHeadedCapture(_0x5df450,_0x27ae5b){const _0x278ac6=_0x5761,{driver:_0x3adc62,sessionDir:_0x5f5c7b,cookiesPath:_0x366063}=await _0x5df450[_0x278ac6(0xdd)]();try{_0x27ae5b&&await _0x3adc62[_0x278ac6(0xd7)](_0x27ae5b),console[_0x278ac6(0xd6)](_0x278ac6(0xd5)),await waitForBrowserClosed(()=>_0x3adc62[_0x278ac6(0xdf)]());}finally{try{await exportPersistedCookies(_0x3adc62,_0x366063);}catch{}await _0x5df450['release'](_0x3adc62),removeSessionDir(_0x5f5c7b);}}
1
+ (function(_0x2a4474,_0x106f7d){const _0x44259c=_0x2eb5,_0x10c9fa=_0x2a4474();while(!![]){try{const _0x52d7e3=-parseInt(_0x44259c(0x1a0))/0x1*(parseInt(_0x44259c(0x1a2))/0x2)+parseInt(_0x44259c(0x19c))/0x3*(parseInt(_0x44259c(0x1a1))/0x4)+-parseInt(_0x44259c(0x19a))/0x5*(parseInt(_0x44259c(0x1a7))/0x6)+parseInt(_0x44259c(0x199))/0x7*(parseInt(_0x44259c(0x1a8))/0x8)+parseInt(_0x44259c(0x19e))/0x9*(parseInt(_0x44259c(0x198))/0xa)+parseInt(_0x44259c(0x1a6))/0xb+-parseInt(_0x44259c(0x1a3))/0xc*(-parseInt(_0x44259c(0x1a4))/0xd);if(_0x52d7e3===_0x106f7d)break;else _0x10c9fa['push'](_0x10c9fa['shift']());}catch(_0x716653){_0x10c9fa['push'](_0x10c9fa['shift']());}}}(_0x238c,0x76000));import{exportPersistedCookies,removeSessionDir}from'./headedBrowserState.js';function _0x2eb5(_0x4c011e,_0x15c192){_0x4c011e=_0x4c011e-0x197;const _0x238c5d=_0x238c();let _0x2eb51e=_0x238c5d[_0x4c011e];if(_0x2eb5['gPGNoL']===undefined){var _0x5e40ce=function(_0x5a2ad1){const _0x1a09ab='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2d08aa='',_0xe1a9ae='';for(let _0x254ba3=0x0,_0x5ce39f,_0x550273,_0x3fbe66=0x0;_0x550273=_0x5a2ad1['charAt'](_0x3fbe66++);~_0x550273&&(_0x5ce39f=_0x254ba3%0x4?_0x5ce39f*0x40+_0x550273:_0x550273,_0x254ba3++%0x4)?_0x2d08aa+=String['fromCharCode'](0xff&_0x5ce39f>>(-0x2*_0x254ba3&0x6)):0x0){_0x550273=_0x1a09ab['indexOf'](_0x550273);}for(let _0x3a169b=0x0,_0x2ae65e=_0x2d08aa['length'];_0x3a169b<_0x2ae65e;_0x3a169b++){_0xe1a9ae+='%'+('00'+_0x2d08aa['charCodeAt'](_0x3a169b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xe1a9ae);};_0x2eb5['AFPjTz']=_0x5e40ce,_0x2eb5['EsGgli']={},_0x2eb5['gPGNoL']=!![];}const _0x162ef5=_0x238c5d[0x0],_0x5df58f=_0x4c011e+_0x162ef5,_0x5f123c=_0x2eb5['EsGgli'][_0x5df58f];return!_0x5f123c?(_0x2eb51e=_0x2eb5['AFPjTz'](_0x2eb51e),_0x2eb5['EsGgli'][_0x5df58f]=_0x2eb51e):_0x2eb51e=_0x5f123c,_0x2eb51e;}function _0x238c(){const _0x1c61e8=['mtGXmJy2nhPhCK11sq','nxnmruPfvG','z2v0','m3nkBgPvAG','z2v0qwXSv2LUzg93sgfUzgXLCW','owD3CNfPDq','BgvUz3rO','ngz5BLPSta','oti2mJm2qwrSr05m','ndq1otG4u0rmENz5','otz6swLfywC','mte1odGYzxnmvMzL','Bgf1BMnOsgvHzgvK','mZeZmdy3n2f1sNPqAa','odq2mZu0q3PNCMrU','mJrAwfDVDMe','u0Lhvevstq','CMvTB3zLtgLZDgvUzxi','u0Lhsu5u','mtuYmdi5mhrxANjewa'];_0x238c=function(){return _0x1c61e8;};return _0x238c();}const BROWSER_POLL_MS=0x1f4;async function waitForBrowserClosed(_0x2d08aa){await new Promise(_0xe1a9ae=>{const _0x3b6a1a=_0x2eb5;let _0x254ba3=![];const _0x5ce39f=()=>{const _0x4b6669=_0x2eb5;if(_0x254ba3)return;_0x254ba3=!![],process[_0x4b6669(0x1aa)](_0x4b6669(0x197),_0x550273),process[_0x4b6669(0x1aa)](_0x4b6669(0x1a9),_0x550273),_0xe1a9ae();},_0x550273=()=>_0x5ce39f();process['on'](_0x3b6a1a(0x197),_0x550273),process['on'](_0x3b6a1a(0x1a9),_0x550273);const _0x3fbe66=async()=>{const _0x52142c=_0x3b6a1a;try{const _0x3a169b=await _0x2d08aa();if(_0x3a169b[_0x52142c(0x19f)]===0x0){_0x5ce39f();return;}setTimeout(()=>void _0x3fbe66(),BROWSER_POLL_MS);}catch{_0x5ce39f();}};void _0x3fbe66();});}export async function launchHeadedCapture(_0x2ae65e,_0x10e45d){const _0x323e96=_0x2eb5,{driver:_0xa85bef,sessionDir:_0x743265,cookiesPath:_0x4279b5}=await _0x2ae65e[_0x323e96(0x1a5)]();try{_0x10e45d&&await _0xa85bef[_0x323e96(0x19b)](_0x10e45d),console['log']('Chrome\x20opened\x20for\x20manual\x20capture.\x20Close\x20the\x20browser\x20when\x20finished.'),await waitForBrowserClosed(()=>_0xa85bef[_0x323e96(0x19d)]());}finally{try{await exportPersistedCookies(_0xa85bef,_0x4279b5);}catch{}await _0x2ae65e['release'](_0xa85bef),removeSessionDir(_0x743265);}}
package/dist/cli.js CHANGED
@@ -9,14 +9,20 @@ async function runCliAction(action) {
9
9
  try {
10
10
  await action();
11
11
  }
12
- catch {
12
+ catch (err) {
13
+ if (err instanceof Error && err.message) {
14
+ console.error(err.message);
15
+ }
16
+ else {
17
+ console.error('Command failed.');
18
+ }
13
19
  process.exit(process.exitCode ?? 1);
14
20
  }
15
21
  }
16
22
  export function runCli() {
17
23
  loadDesktopEnv();
18
24
  const program = new Command();
19
- program.name('web-to-figma').description('Web to Figma Desktop local server');
25
+ program.name('web-to-figma').description('Web to Figma Desktop Application');
20
26
  program
21
27
  .command('start')
22
28
  .description('Start the desktop HTTP server')
@@ -33,7 +39,7 @@ export function runCli() {
33
39
  });
34
40
  program
35
41
  .command('capture')
36
- .description('Open headed Chrome for manual capture (server must be running)')
42
+ .description('Open headed Chrome for manual capture')
37
43
  .argument('[url]', 'Optional URL to open on launch')
38
44
  .option('--data-dir <path>', 'Data directory override')
39
45
  .option('--reset-browser-state', 'Clear saved headed-browser logins and session data')
@@ -46,7 +52,7 @@ export function runCli() {
46
52
  }));
47
53
  });
48
54
  program
49
- .command('doctor')
55
+ .command('doctor', { hidden: true })
50
56
  .description('Run environment diagnostics')
51
57
  .option('--data-dir <path>', 'Data directory override')
52
58
  .option('--update-chrome', 'Re-download Chrome for Testing binaries')
package/dist/index.js CHANGED
@@ -86,22 +86,17 @@ export async function startServer(options = {}) {
86
86
  chromePath: chrome.chromePath,
87
87
  chromedriverPath: chrome.chromedriverPath,
88
88
  });
89
+ let shuttingDown = false;
90
+ let shutdown;
89
91
  const updater = new UpdaterRuntime({
90
92
  currentVersion: PACKAGE_VERSION,
91
93
  port,
92
94
  paths: config.paths,
93
95
  verbose,
94
96
  isCaptureBusy,
97
+ shutdown: () => shutdown(),
95
98
  });
96
- await Promise.race([
97
- updater.checkNow(),
98
- new Promise((resolve) => setTimeout(resolve, 3000)),
99
- ]);
100
- await app.listen({ port, host: 'localhost' });
101
- updater.printBanner();
102
- updater.startBackgroundChecks();
103
- let shuttingDown = false;
104
- const shutdown = async () => {
99
+ shutdown = async () => {
105
100
  if (shuttingDown) {
106
101
  process.exit(1);
107
102
  return;
@@ -113,6 +108,13 @@ export async function startServer(options = {}) {
113
108
  await flushDesktopSentry();
114
109
  process.exit(0);
115
110
  };
111
+ await Promise.race([
112
+ updater.checkNow(),
113
+ new Promise((resolve) => setTimeout(resolve, 3000)),
114
+ ]);
115
+ await app.listen({ port, host: 'localhost' });
116
+ updater.printBanner();
117
+ updater.startBackgroundChecks();
116
118
  updater.attachKeyListener(() => {
117
119
  void shutdown();
118
120
  });
@@ -1 +1 @@
1
- (function(_0x22231e,_0x19e60b){const _0x321fa3=_0x8bfe,_0x55119e=_0x22231e();while(!![]){try{const _0x2c01e7=-parseInt(_0x321fa3(0x15d))/0x1*(parseInt(_0x321fa3(0x13e))/0x2)+-parseInt(_0x321fa3(0x137))/0x3+-parseInt(_0x321fa3(0x158))/0x4*(parseInt(_0x321fa3(0x154))/0x5)+parseInt(_0x321fa3(0x155))/0x6*(parseInt(_0x321fa3(0x15c))/0x7)+-parseInt(_0x321fa3(0x156))/0x8*(parseInt(_0x321fa3(0x13b))/0x9)+parseInt(_0x321fa3(0x144))/0xa+parseInt(_0x321fa3(0x14c))/0xb*(parseInt(_0x321fa3(0x145))/0xc);if(_0x2c01e7===_0x19e60b)break;else _0x55119e['push'](_0x55119e['shift']());}catch(_0x17a167){_0x55119e['push'](_0x55119e['shift']());}}}(_0x4618,0xbacf7));function _0x4618(){const _0x4eb867=['Bg9Nz2vY','BwvZC2fNzq','DMvYyM9Zzq','C3rYAw5N','zxjYB3i','D2vIlxrVlwzPz21HlwrLC2T0B3a','ue9tva','ndu0odK5mhHtrwTyDG','DMvYAwz5','Ec13DgyTzgvZA3rVCc1QD3q','zgvJB2rL','mJCXntnjuvr2rha','zgvZA3rVCeP3Dfn1yG','D2vIlxrVlwzPz21HlxbSDwDPBG','ngLst3nivW','BwLZC2LUz19QD3q','Aw52ywXPzf9QD3q','yxv0Af9MywLSzwq','B25szxf1zxn0','C3vI','otC1otGYmhzkrM5rDa','ntCZmJr2uNPfCKK','y29Kzq','l2fWAs9HCNrPzMfJDc9Jyxb0DxjLlxn0yxr1CW','AgvHzgvY','A2LK','Bwv0Ag9K','C2vUza','nJi1owf3sxnTsq','l2fWAs9HCNrPzMfJDc9Jyxb0DxjL','ywrKsg9VAW','l2zPBgvZlW','sfmYnty','C3bSAxq','l2HLywX0Aa','AgvHzgvYCW','mtbMrgTprvC','odu4ywDZqM52','mZGXnNPRy01zEa','w2f1DgHDig9Ria','mZCZntjWs1DxB24','Bg9N','DxjS','w2f1DgHDia','mJCZotfrC250y2G','mJu3mtGYywD1z1vj','vw5HDxrOB3jPEMvK','r0vu'];_0x4618=function(){return _0x4eb867;};return _0x4618();}import _0x2c57ee from'jsonwebtoken';import{getSecretForKid}from'../../auth/jwtSecret.js';import{redactRequestHeaders}from'../../security/redact.js';function requestPath(_0x4bca5b){const _0x5a42f3=_0x8bfe;return _0x4bca5b[_0x5a42f3(0x151)]('?')[0x0]??_0x4bca5b;}function _0x8bfe(_0x4627a4,_0xe0819b){_0x4627a4=_0x4627a4-0x12e;const _0x46188a=_0x4618();let _0x8bfec4=_0x46188a[_0x4627a4];if(_0x8bfe['KGHvvK']===undefined){var _0x52e049=function(_0xa49253){const _0x98d17f='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2c57ee='',_0x4bca5b='';for(let _0x4d6dc6=0x0,_0x14ca32,_0x42d4dc,_0x4ebf1a=0x0;_0x42d4dc=_0xa49253['charAt'](_0x4ebf1a++);~_0x42d4dc&&(_0x14ca32=_0x4d6dc6%0x4?_0x14ca32*0x40+_0x42d4dc:_0x42d4dc,_0x4d6dc6++%0x4)?_0x2c57ee+=String['fromCharCode'](0xff&_0x14ca32>>(-0x2*_0x4d6dc6&0x6)):0x0){_0x42d4dc=_0x98d17f['indexOf'](_0x42d4dc);}for(let _0x4dec51=0x0,_0x5580d2=_0x2c57ee['length'];_0x4dec51<_0x5580d2;_0x4dec51++){_0x4bca5b+='%'+('00'+_0x2c57ee['charCodeAt'](_0x4dec51)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4bca5b);};_0x8bfe['RNLpsD']=_0x52e049,_0x8bfe['STPheX']={},_0x8bfe['KGHvvK']=!![];}const _0x13d69c=_0x46188a[0x0],_0x2daac2=_0x4627a4+_0x13d69c,_0x33f0bb=_0x8bfe['STPheX'][_0x2daac2];return!_0x33f0bb?(_0x8bfec4=_0x8bfe['RNLpsD'](_0x8bfec4),_0x8bfe['STPheX'][_0x2daac2]=_0x8bfec4):_0x8bfec4=_0x33f0bb,_0x8bfec4;}function isPublicPath(_0x4d6dc6){const _0x5f4dbb=_0x8bfe;return _0x4d6dc6===_0x5f4dbb(0x152);}export function requiresJwt(_0x14ca32,_0x42d4dc){const _0x4d97a4=_0x8bfe;if(_0x14ca32===_0x4d97a4(0x12f)&&_0x42d4dc['startsWith'](_0x4d97a4(0x14f)))return![];if(_0x14ca32==='POST'&&_0x42d4dc===_0x4d97a4(0x14d))return!![];if(_0x14ca32==='GET'&&_0x42d4dc===_0x4d97a4(0x147))return!![];if(_0x14ca32===_0x4d97a4(0x136)&&_0x42d4dc==='/api/artifact/cancel-capture')return!![];return![];}function logAuthFailure(_0x4ebf1a,_0x4dec51,_0x5580d2,_0x33d5ca){const _0xebbbb2=_0x8bfe;_0x4ebf1a[_0xebbbb2(0x130)][_0xebbbb2(0x134)]({'reason':_0x4dec51,'path':_0x5580d2[_0xebbbb2(0x15a)][_0xebbbb2(0x151)]('?')[0x0],'headers':redactRequestHeaders(_0x5580d2[_0xebbbb2(0x153)]),'err':_0x33d5ca instanceof Error?_0x33d5ca[_0xebbbb2(0x131)]:_0x33d5ca},_0xebbbb2(0x141));if(_0x4ebf1a[_0xebbbb2(0x132)]){const _0x36dc64=_0x33d5ca instanceof Error?_0x33d5ca[_0xebbbb2(0x131)]:String(_0x33d5ca??'');console[_0xebbbb2(0x134)](_0xebbbb2(0x15b)+_0x4dec51+'\x20'+_0x5580d2[_0xebbbb2(0x15a)]+(_0x36dc64?':\x20'+_0x36dc64:''));}}function logAuthSuccess(_0x5b9d0a,_0x4637d8){const _0xe0a1ba=_0x8bfe;_0x5b9d0a[_0xe0a1ba(0x132)]&&console[_0xe0a1ba(0x159)](_0xe0a1ba(0x157)+_0x4637d8[_0xe0a1ba(0x14a)]+'\x20'+_0x4637d8[_0xe0a1ba(0x15a)]);}export function registerDesktopAuth(_0x1058ef,_0x2a91a5){const _0x48939c=_0x8bfe;_0x1058ef[_0x48939c(0x14e)](_0x48939c(0x142),async(_0x51f193,_0x1eaf86)=>{const _0xd8390b=_0x48939c;if(_0x51f193[_0xd8390b(0x14a)]==='OPTIONS')return;const _0x3b0682=requestPath(_0x51f193[_0xd8390b(0x15a)]);if(isPublicPath(_0x3b0682)||!requiresJwt(_0x51f193['method'],_0x3b0682))return;const _0x445928=_0x51f193[_0xd8390b(0x153)][_0xd8390b(0x139)];if(!_0x445928||typeof _0x445928!==_0xd8390b(0x133))return logAuthFailure(_0x2a91a5,_0xd8390b(0x13f),_0x51f193),_0x1eaf86[_0xd8390b(0x146)](0x191)[_0xd8390b(0x14b)]({'message':'Unauthorized'});try{const _0xd68d=_0x2c57ee[_0xd8390b(0x13a)](_0x445928,{'complete':!![]}),_0x21501c=_0xd68d&&typeof _0xd68d==='object'&&_0xd68d[_0xd8390b(0x148)]?_0xd68d[_0xd8390b(0x148)][_0xd8390b(0x149)]:undefined,_0x268e2c=_0x2c57ee[_0xd8390b(0x138)](_0x445928,getSecretForKid(_0x21501c),{'algorithms':[_0xd8390b(0x150)],'issuer':_0xd8390b(0x13d),'audience':_0xd8390b(0x135)});_0x51f193[_0xd8390b(0x13c)]=_0x268e2c[_0xd8390b(0x143)],logAuthSuccess(_0x2a91a5,_0x51f193);}catch(_0xc49024){return logAuthFailure(_0x2a91a5,_0xd8390b(0x140),_0x51f193,_0xc49024),_0x1eaf86['code'](0x191)[_0xd8390b(0x14b)]({'message':_0xd8390b(0x12e)});}});}
1
+ (function(_0x342596,_0x1288e2){const _0x42a88d=_0x1797,_0x4614eb=_0x342596();while(!![]){try{const _0x3dbbec=-parseInt(_0x42a88d(0xbd))/0x1*(-parseInt(_0x42a88d(0xab))/0x2)+-parseInt(_0x42a88d(0xce))/0x3+parseInt(_0x42a88d(0xa9))/0x4+parseInt(_0x42a88d(0xc7))/0x5+-parseInt(_0x42a88d(0xad))/0x6+parseInt(_0x42a88d(0xae))/0x7+parseInt(_0x42a88d(0xbc))/0x8;if(_0x3dbbec===_0x1288e2)break;else _0x4614eb['push'](_0x4614eb['shift']());}catch(_0x466505){_0x4614eb['push'](_0x4614eb['shift']());}}}(_0x3bd1,0xcb562));import _0x4abf97 from'jsonwebtoken';import{getSecretForKid}from'../../auth/jwtSecret.js';import{redactRequestHeaders}from'../../security/redact.js';function requestPath(_0x25238e){return _0x25238e['split']('?')[0x0]??_0x25238e;}function isPublicPath(_0x447524){const _0x5de2f5=_0x1797;return _0x447524===_0x5de2f5(0xc8);}export function requiresJwt(_0x1681a3,_0x4c5493){const _0x24d8d8=_0x1797;if(_0x1681a3===_0x24d8d8(0xcd)&&_0x4c5493['startsWith'](_0x24d8d8(0xbb)))return![];if(_0x1681a3==='POST'&&_0x4c5493===_0x24d8d8(0xb6))return!![];if(_0x1681a3===_0x24d8d8(0xcd)&&_0x4c5493===_0x24d8d8(0xc3))return!![];if(_0x1681a3==='POST'&&_0x4c5493==='/api/artifact/cancel-capture')return!![];return![];}function logAuthFailure(_0x3c7d8f,_0x57f2cb,_0x54eb17,_0x57d124){const _0x17b62f=_0x1797;_0x3c7d8f['logger']['error']({'reason':_0x57f2cb,'path':_0x54eb17[_0x17b62f(0xb4)][_0x17b62f(0xbe)]('?')[0x0],'headers':redactRequestHeaders(_0x54eb17['headers']),'err':_0x57d124 instanceof Error?_0x57d124[_0x17b62f(0xba)]:_0x57d124},'auth_failed');if(_0x3c7d8f[_0x17b62f(0xc5)]){const _0x57fc3a=_0x57d124 instanceof Error?_0x57d124['message']:String(_0x57d124??'');console[_0x17b62f(0xaf)](_0x17b62f(0xc1)+_0x57f2cb+'\x20'+_0x54eb17[_0x17b62f(0xb4)]+(_0x57fc3a?':\x20'+_0x57fc3a:''));}}function _0x3bd1(){const _0xc62cd6=['DMvYAwz5','mKjmvLjoyG','AgvHzgvY','nJm4odK4mfrltwzfsG','mJu0nZqXow9OzKDiyW','zxjYB3i','zgvZA3rVCeP3Dfn1yG','C3vI','sfmYnty','AgvHzgvYCW','DxjS','y29Kzq','l2fWAs9HCNrPzMfJDc9Jyxb0DxjL','vw5HDxrOB3jPEMvK','w2f1DgHDig9Ria','BwLZC2LUz19QD3q','BwvZC2fNzq','l2zPBgvZlW','mtaZntK3mtjQEwvhs1e','otqWn21SsK5gAa','C3bSAxq','t1busu9ouW','B25szxf1zxn0','w2f1DgHDia','Ec13DgyTzgvZA3rVCc1QD3q','l2fWAs9HCNrPzMfJDc9Jyxb0DxjLlxn0yxr1CW','C2vUza','DMvYyM9Zzq','Bwv0Ag9K','mZq2nZiXnvDYBM5bvq','l2HLywX0Aa','A2LK','Aw52ywXPzf9QD3q','C3rYAw5N','D2vIlxrVlwzPz21HlxbSDwDPBG','r0vu','mJq4odmZohDgwhLquG','mtq2mty0nffkDxPwCq'];_0x3bd1=function(){return _0xc62cd6;};return _0x3bd1();}function logAuthSuccess(_0x318952,_0x54306f){const _0xea8068=_0x1797;_0x318952[_0xea8068(0xc5)]&&console['log'](_0xea8068(0xb8)+_0x54306f[_0xea8068(0xc6)]+'\x20'+_0x54306f['url']);}function _0x1797(_0x200226,_0x428a64){_0x200226=_0x200226-0xa9;const _0x3bd147=_0x3bd1();let _0x179793=_0x3bd147[_0x200226];if(_0x1797['BZeTQc']===undefined){var _0x31e500=function(_0x135392){const _0x11ca66='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4abf97='',_0x25238e='';for(let _0x447524=0x0,_0x1681a3,_0x4c5493,_0x3c7d8f=0x0;_0x4c5493=_0x135392['charAt'](_0x3c7d8f++);~_0x4c5493&&(_0x1681a3=_0x447524%0x4?_0x1681a3*0x40+_0x4c5493:_0x4c5493,_0x447524++%0x4)?_0x4abf97+=String['fromCharCode'](0xff&_0x1681a3>>(-0x2*_0x447524&0x6)):0x0){_0x4c5493=_0x11ca66['indexOf'](_0x4c5493);}for(let _0x57f2cb=0x0,_0x54eb17=_0x4abf97['length'];_0x57f2cb<_0x54eb17;_0x57f2cb++){_0x25238e+='%'+('00'+_0x4abf97['charCodeAt'](_0x57f2cb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x25238e);};_0x1797['vOysuf']=_0x31e500,_0x1797['IkbcQN']={},_0x1797['BZeTQc']=!![];}const _0x5010df=_0x3bd147[0x0],_0x44bcee=_0x200226+_0x5010df,_0xf05f15=_0x1797['IkbcQN'][_0x44bcee];return!_0xf05f15?(_0x179793=_0x1797['vOysuf'](_0x179793),_0x1797['IkbcQN'][_0x44bcee]=_0x179793):_0x179793=_0xf05f15,_0x179793;}export function registerDesktopAuth(_0x5ecb9b,_0x560b5d){const _0x1146a3=_0x1797;_0x5ecb9b['addHook'](_0x1146a3(0xc0),async(_0x271cce,_0x1d3ae2)=>{const _0x3878a4=_0x1146a3;if(_0x271cce[_0x3878a4(0xc6)]===_0x3878a4(0xbf))return;const _0x5e952b=requestPath(_0x271cce['url']);if(isPublicPath(_0x5e952b)||!requiresJwt(_0x271cce['method'],_0x5e952b))return;const _0x391c61=_0x271cce[_0x3878a4(0xb3)][_0x3878a4(0xc2)];if(!_0x391c61||typeof _0x391c61!==_0x3878a4(0xcb))return logAuthFailure(_0x560b5d,_0x3878a4(0xb9),_0x271cce),_0x1d3ae2[_0x3878a4(0xb5)](0x191)[_0x3878a4(0xc4)]({'message':_0x3878a4(0xb7)});try{const _0x2edbcb=_0x4abf97['decode'](_0x391c61,{'complete':!![]}),_0x39503f=_0x2edbcb&&typeof _0x2edbcb==='object'&&_0x2edbcb[_0x3878a4(0xac)]?_0x2edbcb['header'][_0x3878a4(0xc9)]:undefined,_0x52ebb3=_0x4abf97[_0x3878a4(0xaa)](_0x391c61,getSecretForKid(_0x39503f),{'algorithms':[_0x3878a4(0xb2)],'issuer':_0x3878a4(0xcc),'audience':'web-to-figma-desktop'});_0x271cce[_0x3878a4(0xb0)]=_0x52ebb3[_0x3878a4(0xb1)],logAuthSuccess(_0x560b5d,_0x271cce);}catch(_0x2e248a){return logAuthFailure(_0x560b5d,_0x3878a4(0xca),_0x271cce,_0x2e248a),_0x1d3ae2[_0x3878a4(0xb5)](0x191)[_0x3878a4(0xc4)]({'message':'Unauthorized'});}});}
@@ -1,7 +1,5 @@
1
- import { execFile, execFileSync, spawn } from 'node:child_process';
2
- import { promisify } from 'node:util';
1
+ import { execFileSync, spawn } from 'node:child_process';
3
2
  import path from 'node:path';
4
- const execFileAsync = promisify(execFile);
5
3
  export function isGloballyInstalled() {
6
4
  try {
7
5
  const scriptPath = process.argv[1];
@@ -36,26 +34,4 @@ export async function installUpdate(latestVersion, verbose) {
36
34
  }
37
35
  });
38
36
  });
39
- respawnFromGlobalBin();
40
- }
41
- function respawnFromGlobalBin() {
42
- const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm';
43
- let binPath = 'web-to-figma';
44
- try {
45
- const resolved = execFileSync(npmCmd, ['bin', '-g', 'web-to-figma'], { encoding: 'utf8' }).trim();
46
- if (resolved) {
47
- binPath = resolved;
48
- }
49
- }
50
- catch {
51
- // fall back to PATH lookup
52
- }
53
- const args = process.argv.slice(2);
54
- const child = spawn(binPath, args.length > 0 ? args : ['start'], {
55
- stdio: 'inherit',
56
- detached: true,
57
- shell: process.platform === 'win32',
58
- });
59
- child.unref();
60
- process.exit(0);
61
37
  }
@@ -6,6 +6,7 @@ export type UpdaterOptions = {
6
6
  paths: ResolvedPaths;
7
7
  verbose: boolean;
8
8
  isCaptureBusy: () => boolean;
9
+ shutdown: () => Promise<void>;
9
10
  };
10
11
  export declare class UpdaterRuntime {
11
12
  private readonly options;
@@ -113,7 +113,16 @@ export class UpdaterRuntime {
113
113
  await installUpdate(latest, this.options.verbose);
114
114
  appendUpdateLog(this.options.paths, { event: 'update_completed', from, to: latest });
115
115
  console.log(`Updated to v${latest} successfully.`);
116
- console.log('Restarting...');
116
+ console.log('');
117
+ console.log('Restart the desktop server to run the new version:');
118
+ if (isGloballyInstalled()) {
119
+ console.log(' web-to-figma start');
120
+ }
121
+ else {
122
+ console.log(' npx @web-to-figma/desktop@latest start');
123
+ }
124
+ console.log('');
125
+ await this.options.shutdown();
117
126
  }
118
127
  catch (err) {
119
128
  const error = err instanceof Error ? err.message : 'Unknown error';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web-to-figma/desktop",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Web to Figma Desktop - Convert any website or HTML code to design",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",