@e-techsolutions/e-baas-sdk 1.1.1 → 1.1.3

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.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x42f656(_0x9a6300,_0x4d051a){return _0x264b(_0x4d051a- -0x356,_0x9a6300);}while(!![]){try{const _0x57e265=-parseInt(_0x42f656(-0x154,-0x172))/0x1+-parseInt(_0x42f656(-0x216,-0x1e6))/0x2*(parseInt(_0x42f656(-0x1da,-0x1ca))/0x3)+-parseInt(_0x42f656(-0x1bd,-0x192))/0x4*(-parseInt(_0x42f656(-0x159,-0x127))/0x5)+-parseInt(_0x42f656(-0x210,-0x1d7))/0x6+-parseInt(_0x42f656(-0x166,-0x18b))/0x7+-parseInt(_0x42f656(-0x18b,-0x166))/0x8+parseInt(_0x42f656(-0xdc,-0x144))/0x9*(parseInt(_0x42f656(-0x1da,-0x1cc))/0xa);if(_0x57e265===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x5a92ef){stringArray['push'](stringArray['shift']());}}}(_0x29fc,0x5fa79));var axios=require('axios'),socket_ioClient=require(_0x514dba(0x5e5,0x5a0)),EventEmitter=require(_0x514dba(0x502,0x51a));class EBaaSError extends Error{constructor(_0x8d9878,status=0x0,_0xcf47cd){super(_0x8d9878),this['name']='EBaaSError',this['status']=status;function _0x768c89(_0x39edee,_0x2ca8d5){return _0x264b(_0x2ca8d5- -0xa0,_0x39edee);}this[_0x768c89(0x1c8,0x18c)]=_0xcf47cd,Error[_0x768c89(0xa0,0xe1)]&&Error[_0x768c89(0x120,0xe1)](this,EBaaSError);}[_0x514dba(0x5a0,0x5aa)](){function _0x49eb00(_0x3e7a3e,_0x1c4415){return _0x264b(_0x3e7a3e- -0x332,_0x1c4415);}return{'name':this['name'],'message':this[_0x49eb00(-0x1b7,-0x227)],'status':this[_0x49eb00(-0x177,-0x1a3)],'details':this['details'],'stack':this['stack']};}[_0x514dba(0x5c8,0x57e)](){function _0x77e0d7(_0x113cdc,_0x213116){return _0x264b(_0x113cdc- -0xe4,_0x213116);}return this['name']+':\x20'+this[_0x77e0d7(0x97,0xed)]+_0x77e0d7(0xa2,0xd0)+this['status']+')';}}function _0x514dba(_0x638ffd,_0x7693bd){return _0x264b(_0x7693bd-0x375,_0x638ffd);}class HttpClient{constructor(config){function _0x349d2c(_0x4d8703,_0xf9abd1){return _0x264b(_0xf9abd1-0x333,_0x4d8703);}this[_0x349d2c(0x4fd,0x512)]=config['url'],this[_0x349d2c(0x519,0x4c5)]=config['apiKey'],this[_0x349d2c(0x488,0x4e9)]=axios['create']({'baseURL':this[_0x349d2c(0x531,0x512)],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config[_0x349d2c(0x476,0x49f)]}}),this[_0x349d2c(0x562,0x51b)]();}['setupInterceptors'](){this['client']['interceptors'][_0x1edf11(0x1a7,0x1be)]['use'](config=>{return config;},_0x1713ec=>{function _0x33609a(_0x14c02e,_0x37924f){return _0x264b(_0x14c02e-0x10c,_0x37924f);}return Promise[_0x33609a(0x275,0x2b3)](new EBaaSError(_0x33609a(0x276,0x246),0x0,_0x1713ec));});function _0x1edf11(_0x680bfa,_0x2d282e){return _0x264b(_0x2d282e-0x31,_0x680bfa);}this[_0x1edf11(0x18a,0x1e7)]['interceptors']['response'][_0x1edf11(0x288,0x265)](response=>{return response;},_0x247bb0=>{const status=_0x247bb0[_0x38f39a(0x45e,0x47f)]?.[_0x38f39a(0x455,0x46d)]||0x0,_0x3c1962=_0x247bb0[_0x38f39a(0x4ef,0x47f)]?.['data']?.[_0x38f39a(0x428,0x42d)]||_0x247bb0['message']||_0x38f39a(0x4cc,0x4c5);function _0x38f39a(_0x1d5f53,_0x1847cd){return _0x264b(_0x1847cd-0x2b2,_0x1d5f53);}const _0xba38f=_0x247bb0['response']?.[_0x38f39a(0x4c2,0x45d)]||_0x247bb0;return Promise[_0x38f39a(0x3e1,0x41b)](new EBaaSError(_0x3c1962,status,_0xba38f));});}async['get'](_0x2583e0,config){function _0x34c9b4(_0x49ecb1,_0x4a001d){return _0x264b(_0x4a001d-0x12c,_0x49ecb1);}try{const response=await this['client']['get'](_0x2583e0,config);return{'data':response[_0x34c9b4(0x2c0,0x2d7)],'status':response[_0x34c9b4(0x354,0x2e7)],'statusText':response['statusText'],'headers':response[_0x34c9b4(0x22e,0x298)]};}catch(_0x4a1876){throw this[_0x34c9b4(0x3d6,0x364)](_0x4a1876);}}async[_0x514dba(0x471,0x4ca)](_0x492bdb,data,config){function _0x1bf1b9(_0x47457d,_0x487af9){return _0x264b(_0x487af9-0x55,_0x47457d);}try{const response=await this['client'][_0x1bf1b9(0x15a,0x1aa)](_0x492bdb,data,config);return{'data':response['data'],'status':response[_0x1bf1b9(0x211,0x210)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x1c8d2f){throw this['handleError'](_0x1c8d2f);}}async[_0x514dba(0x576,0x54c)](_0x38bb2e,data,config){function _0x4a3698(_0x522a15,_0x3f7180){return _0x264b(_0x522a15-0x18e,_0x3f7180);}try{const response=await this[_0x4a3698(0x344,0x339)][_0x4a3698(0x365,0x3c4)](_0x38bb2e,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x28cdac){throw this[_0x4a3698(0x3c6,0x42b)](_0x28cdac);}}async['patch'](_0x2e7253,data,config){function _0x50262d(_0x15eb72,_0xd46370){return _0x264b(_0xd46370- -0x1b7,_0x15eb72);}try{const response=await this[_0x50262d(-0x1b,-0x1)][_0x50262d(-0x65,-0x46)](_0x2e7253,data,config);return{'data':response[_0x50262d(-0xb,-0xc)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x1260e1){throw this['handleError'](_0x1260e1);}}async['delete'](_0x2d92fb,config){function _0xd7ca5e(_0x44cb45,_0x19176a){return _0x264b(_0x19176a-0xd5,_0x44cb45);}try{const response=await this['client'][_0xd7ca5e(0x2ad,0x259)](_0x2d92fb,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0xd7ca5e(0x2e7,0x311)],'headers':response[_0xd7ca5e(0x28a,0x241)]};}catch(_0x3f5f9c){throw this['handleError'](_0x3f5f9c);}}[_0x514dba(0x5f0,0x5b4)](_0x176b03){function _0x1dc28e(_0x36751a,_0xeaeabb){return _0x264b(_0x36751a-0x342,_0xeaeabb);}this['client']['defaults'][_0x1dc28e(0x4ae,0x470)]['common']['Authorization']='Bearer\x20'+_0x176b03;}[_0x514dba(0x4bd,0x52d)](){function _0x1a1094(_0x5279c9,_0x3d8f90){return _0x264b(_0x3d8f90-0x117,_0x5279c9);}delete this[_0x1a1094(0x2ff,0x2cd)][_0x1a1094(0x2e9,0x2f7)][_0x1a1094(0x212,0x283)]['common']['Authorization'],this['client'][_0x1a1094(0x2be,0x2f7)]['headers'][_0x1a1094(0x2d1,0x335)]['Authorization']='Bearer\x20'+this['apiKey'];}['handleError'](_0x26885c){if(_0x26885c instanceof EBaaSError)return _0x26885c;function _0x5c69d3(_0x3127e7,_0x4dd42f){return _0x264b(_0x4dd42f- -0x13f,_0x3127e7);}return new EBaaSError(_0x26885c['message']||_0x5c69d3(0x112,0xe0),_0x26885c['status']||0x0,_0x26885c);}}class AuthClient{constructor(_0x39e166){function _0x17495e(_0x5febd5,_0x21d5e9){return _0x264b(_0x21d5e9- -0x90,_0x5febd5);}this[_0x17495e(0x15b,0x127)]=null,this[_0x17495e(0x13e,0xf7)]=_0x39e166,this[_0x17495e(0xa9,0xf5)]();}async['signUp'](data){function _0x46aa6c(_0x19dcf6,_0x434435){return _0x264b(_0x19dcf6- -0xe3,_0x434435);}try{const response=await this['httpClient']['post']('/auth/v1/signup',data);return response['data'][_0x46aa6c(0x15e,0x160)]&&this['setSessionInternal'](response['data']['session']),response[_0x46aa6c(0xc8,0xf0)];}catch(_0x4baeab){throw this['handleAuthError'](_0x4baeab);}}async['signIn'](data){function _0xbc7418(_0x1b5e04,_0x5636fc){return _0x264b(_0x1b5e04-0x207,_0x5636fc);}try{const response=await this[_0xbc7418(0x38e,0x36c)]['post']('/auth/v1/sdk/signin',data);return response['data'][_0xbc7418(0x448,0x483)]&&this[_0xbc7418(0x3ed,0x427)](response['data'][_0xbc7418(0x448,0x418)]),response['data'];}catch(_0x59e05e){throw this[_0xbc7418(0x3f3,0x3f3)](_0x59e05e);}}async['signOut'](){function _0x8eb538(_0xa90fee,_0x2bafbd){return _0x264b(_0x2bafbd-0x199,_0xa90fee);}try{await this[_0x8eb538(0x2d2,0x320)]['post'](_0x8eb538(0x2d6,0x34a)),this['clearSession']();}catch(_0x46f8db){this[_0x8eb538(0x2a0,0x30c)]();throw this[_0x8eb538(0x3f0,0x385)](_0x46f8db);}}async['getUser'](){if(!this['currentSession']?.[_0x7c9c52(0xf7,0xd8)])return null;function _0x7c9c52(_0x34dd47,_0x19fea1){return _0x264b(_0x34dd47- -0xf8,_0x19fea1);}try{const response=await this['httpClient'][_0x7c9c52(0xd9,0x89)]('/auth/v1/user');return response[_0x7c9c52(0xb3,0x91)]['user'];}catch(_0x263900){if(_0x263900 instanceof EBaaSError&&_0x263900[_0x7c9c52(0xc3,0x100)]===0x191)return this['clearSession'](),null;throw this[_0x7c9c52(0xf4,0x107)](_0x263900);}}async[_0x514dba(0x5e7,0x580)](){function _0x1695af(_0x727fc8,_0x37ce94){return _0x264b(_0x37ce94- -0x33c,_0x727fc8);}if(!this['currentSession']?.['refresh_token'])return null;try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this['currentSession']['refresh_token']});if(response[_0x1695af(-0x1c8,-0x191)][_0x1695af(-0x14c,-0xfb)])return this['setSession'](response[_0x1695af(-0x156,-0x191)]['session']),response['data'][_0x1695af(-0x14c,-0xfb)];return null;}catch(_0x4563e1){this['clearSession']();throw this[_0x1695af(-0x18e,-0x150)](_0x4563e1);}}async['resetPassword'](_0x19a097){try{await this['httpClient']['post']('/auth/v1/reset-password',{'email':_0x19a097});}catch(_0x1f27ce){throw this['handleAuthError'](_0x1f27ce);}}async[_0x514dba(0x4c5,0x517)](data){function _0x35545a(_0x19a7df,_0x2708ef){return _0x264b(_0x2708ef-0xd5,_0x19a7df);}try{const response=await this['httpClient']['put'](_0x35545a(0x235,0x232),data);return response[_0x35545a(0x2d5,0x280)]['user'];}catch(_0x2503d3){throw this[_0x35545a(0x26c,0x2c1)](_0x2503d3);}}[_0x514dba(0x514,0x4d4)](){return this['currentSession'];}['setSession'](_0x2a99fa){function _0x41300b(_0x10ce69,_0x5c5150){return _0x264b(_0x5c5150- -0x2e7,_0x10ce69);}this['currentSession']=_0x2a99fa,this[_0x41300b(-0x18c,-0x160)]['setAuthToken'](_0x2a99fa['access_token']),typeof localStorage!==_0x41300b(-0x11f,-0x175)&&localStorage[_0x41300b(-0xb2,-0x10d)]('ebaas.auth.session',JSON[_0x41300b(-0x10d,-0xd2)](_0x2a99fa));}[_0x514dba(0x5a3,0x560)](_0x415623){return()=>{};}[_0x514dba(0x5a2,0x55b)](_0x3c520f){this['currentSession']=_0x3c520f,this[_0x18cb61(-0xcb,-0xf6)][_0x18cb61(-0x9b,-0x3e)](_0x3c520f[_0x18cb61(-0xc6,-0x8e)]);function _0x18cb61(_0x1c236c,_0x4f22cd){return _0x264b(_0x4f22cd- -0x27d,_0x1c236c);}typeof localStorage!==_0x18cb61(-0xca,-0x10b)&&localStorage[_0x18cb61(-0x50,-0xa3)]('ebaas.auth.session',JSON[_0x18cb61(-0xc6,-0x68)](_0x3c520f));}['clearSession'](){this[_0x140e6a(-0x128,-0x149)]=null,this[_0x140e6a(-0x14e,-0x179)][_0x140e6a(-0x117,-0x148)]();function _0x140e6a(_0x2d9466,_0x38a12f){return _0x264b(_0x38a12f- -0x300,_0x2d9466);}typeof localStorage!=='undefined'&&localStorage['removeItem'](_0x140e6a(-0xd6,-0x13f));}[_0x514dba(0x4fc,0x4fa)](){function _0x2d00b7(_0x38887e,_0x168392){return _0x264b(_0x168392- -0x196,_0x38887e);}if(typeof localStorage!==_0x2d00b7(0x4b,-0x24)){const _0x5cee82=localStorage['getItem'](_0x2d00b7(0x23,0x2b));if(_0x5cee82)try{const _0x517a88=JSON['parse'](_0x5cee82);this[_0x2d00b7(0x4a,0x50)](_0x517a88);}catch(_0x4212bf){this['clearSession']();}}}[_0x514dba(0x5a5,0x561)](_0x24b99e){function _0x3c93fc(_0x282847,_0x3638b){return _0x264b(_0x3638b-0x3e3,_0x282847);}if(_0x24b99e instanceof EBaaSError)return _0x24b99e;return new EBaaSError(_0x24b99e[_0x3c93fc(0x58d,0x55e)]||_0x3c93fc(0x584,0x5e8),_0x24b99e[_0x3c93fc(0x5a8,0x59e)]||0x0,_0x24b99e);}}class QueryBuilder{constructor(_0x3925a6,_0x950738,_0x1603d3,_0x24d8e2){this['httpClient']=_0x3925a6;function _0x1d2fd0(_0x132092,_0x521e09){return _0x264b(_0x132092- -0xd6,_0x521e09);}this[_0x1d2fd0(0xa6,0x118)]=_0x950738,this['schema']=_0x1603d3,this[_0x1d2fd0(0xc0,0x11d)]=_0x24d8e2,this[_0x1d2fd0(0x95,0xab)]={'filters':[]};}[_0x514dba(0x5ba,0x567)](_0x2069eb='*',_0x2214bd){this[_0x243c62(0x22,0x85)]['select']=_0x2069eb;function _0x243c62(_0x15749f,_0x38433d){return _0x264b(_0x38433d- -0xe6,_0x15749f);}return this;}['insert'](data,_0x244307){function _0x178508(_0xa2d0b3,_0x5802bc){return _0x264b(_0x5802bc-0x3cf,_0xa2d0b3);}return this[_0x178508(0x606,0x5b9)]('POST','/sdk/v1/'+this['table']+'?operation=insert',{'data':data,'options':_0x244307});}['update'](data,_0x297c33){function _0x42716f(_0x4a16f2,_0x37aa09){return _0x264b(_0x37aa09- -0x36d,_0x4a16f2);}return this[_0x42716f(-0x1f1,-0x183)]('PATCH','/sdk/v1/'+this[_0x42716f(-0x1dc,-0x1f1)],{'data':data,'options':_0x297c33,'filters':this['query']['filters']});}['upsert'](data,_0x12f525){function _0x55207b(_0x37fc48,_0x197746){return _0x264b(_0x197746- -0x314,_0x37fc48);}return this['executeQuery']('POST',_0x55207b(-0x11f,-0x16a)+this['table']+'?operation=upsert',{'data':data,'options':{..._0x12f525,'upsert':!![]}});}['delete'](_0x349274){function _0x4b30eb(_0xc4c346,_0x4d3d80){return _0x264b(_0x4d3d80- -0x7a,_0xc4c346);}return this[_0x4b30eb(0x183,0x170)]('DELETE','/sdk/v1/'+this[_0x4b30eb(0x156,0x102)]+_0x4b30eb(0x1ab,0x1c6),{'options':_0x349274,'filters':this[_0x4b30eb(0x83,0xf1)]['filters']});}['eq'](_0x5b7ade,_0x1d3d39){function _0x3af800(_0x4facc9,_0x43d086){return _0x264b(_0x4facc9- -0x7e,_0x43d086);}return this['query'][_0x3af800(0x140,0x130)]['push']({'column':_0x5b7ade,'operator':'eq','value':_0x1d3d39}),this;}[_0x514dba(0x5b1,0x58b)](_0x122b01,_0x2189c9){this[_0xa0f770(0x4f,0xc3)][_0xa0f770(0x18e,0x116)]['push']({'column':_0x122b01,'operator':'neq','value':_0x2189c9});function _0xa0f770(_0x5d6e31,_0x287328){return _0x264b(_0x287328- -0xa8,_0x5d6e31);}return this;}['gt'](_0x138399,_0x493994){this['query'][_0x4fc2e9(0x590,0x5df)][_0x4fc2e9(0x59a,0x57f)]({'column':_0x138399,'operator':'gt','value':_0x493994});function _0x4fc2e9(_0x1b8df7,_0x219275){return _0x264b(_0x1b8df7-0x3d2,_0x219275);}return this;}[_0x514dba(0x4e1,0x53f)](_0x18082e,_0x177626){this[_0x23b689(0x1a0,0x186)]['filters'][_0x23b689(0x1fd,0x1ef)]({'column':_0x18082e,'operator':'gte','value':_0x177626});function _0x23b689(_0x20c438,_0xc28d0c){return _0x264b(_0x20c438-0x35,_0xc28d0c);}return this;}['lt'](_0x367f28,_0x37e639){function _0x17b9a4(_0x2ea5e0,_0x30130a){return _0x264b(_0x30130a-0x1a1,_0x2ea5e0);}return this['query']['filters'][_0x17b9a4(0x3ab,0x369)]({'column':_0x367f28,'operator':'lt','value':_0x37e639}),this;}[_0x514dba(0x592,0x51d)](_0x5f1847,_0x4255d0){return this['query']['filters']['push']({'column':_0x5f1847,'operator':'lte','value':_0x4255d0}),this;}['like'](_0x473e82,_0x2a9041){function _0x2b1b51(_0x36f451,_0x2c897f){return _0x264b(_0x36f451- -0xff,_0x2c897f);}return this[_0x2b1b51(0x6c,0x4c)][_0x2b1b51(0xbf,0xf1)][_0x2b1b51(0xc9,0x114)]({'column':_0x473e82,'operator':_0x2b1b51(0xde,0x69),'value':_0x2a9041}),this;}[_0x514dba(0x5cc,0x56e)](_0x5ac40d,_0x59740b){function _0x32cb83(_0x38f9b5,_0x12683d){return _0x264b(_0x38f9b5-0x3a5,_0x12683d);}return this['query'][_0x32cb83(0x563,0x536)][_0x32cb83(0x56d,0x507)]({'column':_0x5ac40d,'operator':_0x32cb83(0x59e,0x58e),'value':_0x59740b}),this;}['is'](_0x3398ab,_0x5ee365){return this['query']['filters']['push']({'column':_0x3398ab,'operator':'is','value':_0x5ee365}),this;}['in'](_0x4a43db,_0x4d8aaa){this['query']['filters'][_0x267ab0(0x46e,0x482)]({'column':_0x4a43db,'operator':'in','value':_0x4d8aaa});function _0x267ab0(_0x340f9e,_0x461e98){return _0x264b(_0x340f9e-0x2a6,_0x461e98);}return this;}[_0x514dba(0x5b0,0x597)](_0x17ca8c,_0x41b321){function _0x261b01(_0x4b7366,_0x4329dc){return _0x264b(_0x4b7366-0x39a,_0x4329dc);}return this[_0x261b01(0x505,0x4e7)]['filters'][_0x261b01(0x562,0x4fa)]({'column':_0x17ca8c,'operator':'contains','value':_0x41b321}),this;}['match'](_0x368bad){function _0x263858(_0x45757e,_0x4c62de){return _0x264b(_0x4c62de- -0x3ca,_0x45757e);}return Object['entries'](_0x368bad)[_0x263858(-0x266,-0x265)](([_0xf20d55,_0xbdf281])=>{this['eq'](_0xf20d55,_0xbdf281);}),this;}[_0x514dba(0x4ab,0x4f8)](_0x209afe,_0x58d928){!this['query'][_0x2a5304(-0x40,0x13)]&&(this[_0x2a5304(-0x58,-0x3f)]['order']=[]);function _0x2a5304(_0x2d4dab,_0x48a4fc){return _0x264b(_0x2d4dab- -0x1c3,_0x48a4fc);}return this['query'][_0x2a5304(-0x40,-0x4f)][_0x2a5304(0x5,-0x3d)]({'column':_0x209afe,'ascending':_0x58d928?.[_0x2a5304(-0x46,-0x93)]!==![]}),this;}['limit'](count){this[_0x30b91b(0x6f,0x93)][_0x30b91b(0xe8,0xee)]=count;function _0x30b91b(_0x4e097e,_0x104920){return _0x264b(_0x104920- -0xd8,_0x4e097e);}return this;}[_0x514dba(0x51c,0x557)](from,_0xc506f3){this['query'][_0x281053(0x493,0x47c)]={'from':from,'to':_0xc506f3};function _0x281053(_0x28ba65,_0x578fcb){return _0x264b(_0x28ba65-0x2b1,_0x578fcb);}return this;}async['execute'](){function _0x497e3d(_0x2d800e,_0x5ab96b){return _0x264b(_0x5ab96b- -0x1b4,_0x2d800e);}return this['executeQuery']('GET','/sdk/v1/'+this['table']+'?operation=select',{'select':this['query'][_0x497e3d(-0x10,0x3e)],'filters':this[_0x497e3d(-0xa5,-0x49)]['filters'],'order':this['query']['order'],'limit':this['query'][_0x497e3d(0x44,0x12)],'range':this['query']['range']});}async['single'](){this['limit'](0x1);function _0x5f3b86(_0x2f30f4,_0x13aa62){return _0x264b(_0x2f30f4- -0x33a,_0x13aa62);}const result=await this[_0x5f3b86(-0x13d,-0xcc)]();return{'data':result['data']?.[0x0]||null,'error':result['error']};}async[_0x514dba(0x534,0x55f)](_0x1a50a9,_0x34f43e,_0x220cea){function _0x470fd7(_0x2c6fc1,_0x4164b4){return _0x264b(_0x4164b4-0x183,_0x2c6fc1);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x1a50a9==='GET'){const _0x3a6175=_0x34f43e[_0x470fd7(0x393,0x37f)]('?'),_0x5eaacd=_0x3a6175[0x0],existingParams=new URLSearchParams(_0x3a6175[0x1]||'');if(_0x220cea[_0x470fd7(0x36b,0x375)])existingParams[_0x470fd7(0x395,0x3b1)](_0x470fd7(0x35a,0x375),_0x220cea[_0x470fd7(0x3a4,0x375)]);_0x220cea[_0x470fd7(0x38e,0x341)]?.['length']&&_0x220cea[_0x470fd7(0x310,0x341)]['forEach'](filter=>{function _0x2fa4f1(_0xef54a,_0x2b88a1){return _0x264b(_0xef54a-0x36c,_0x2b88a1);}existingParams[_0x2fa4f1(0x59a,0x566)](filter['column'],filter[_0x2fa4f1(0x4d4,0x52c)]+'.'+filter[_0x2fa4f1(0x4d2,0x462)]);});if(_0x220cea[_0x470fd7(0x312,0x306)]?.[_0x470fd7(0x3af,0x351)]){const orderStr=_0x220cea['order'][_0x470fd7(0x3ea,0x397)](_0x519d8b=>''+_0x519d8b['column']+(_0x519d8b['ascending']?_0x470fd7(0x38d,0x35e):_0x470fd7(0x3d6,0x3c6)))[_0x470fd7(0x32c,0x2f1)](',');existingParams[_0x470fd7(0x417,0x3b1)]('order',orderStr);}if(_0x220cea[_0x470fd7(0x2f3,0x349)])existingParams[_0x470fd7(0x3e6,0x3b1)]('limit',_0x220cea['limit']['toString']());_0x220cea['range']&&(existingParams[_0x470fd7(0x41f,0x3b1)](_0x470fd7(0x302,0x2fb),_0x220cea[_0x470fd7(0x3ba,0x365)]['from']['toString']()),existingParams['append'](_0x470fd7(0x35a,0x349),(_0x220cea['range']['to']-_0x220cea[_0x470fd7(0x39f,0x365)][_0x470fd7(0x381,0x337)]+0x1)[_0x470fd7(0x31f,0x38c)]())),response=await this['httpClient'][_0x470fd7(0x2e7,0x354)](_0x5eaacd+'?'+existingParams[_0x470fd7(0x375,0x38c)](),{'headers':headers});}else{if(_0x1a50a9==='DELETE'){const _0x5e5af1=_0x34f43e[_0x470fd7(0x370,0x37f)]('?'),_0x3d97c9=_0x5e5af1[0x0],existingParams=new URLSearchParams(_0x5e5af1[0x1]||'');!existingParams['has']('operation')&&existingParams['append']('operation',_0x470fd7(0x36b,0x307));_0x220cea[_0x470fd7(0x37d,0x341)]?.['length']&&_0x220cea[_0x470fd7(0x367,0x341)][_0x470fd7(0x2a3,0x2e8)](filter=>{function _0x56f8d4(_0x4bb4b3,_0x4f459f){return _0x264b(_0x4bb4b3- -0x22b,_0x4f459f);}existingParams[_0x56f8d4(0x3,-0x34)](filter['column'],filter['operator']+'.'+filter[_0x56f8d4(-0xc5,-0x126)]);});const deleteUrl=_0x3d97c9+'?'+existingParams['toString']();response=await this['httpClient'][_0x470fd7(0x317,0x307)](deleteUrl,{'headers':headers});}else{if(_0x1a50a9==='PATCH'){const _0x4b1ba9=_0x34f43e[_0x470fd7(0x3ab,0x37f)]('?'),_0x484bec=_0x4b1ba9[0x0],existingParams=new URLSearchParams(_0x4b1ba9[0x1]||'');!existingParams[_0x470fd7(0x338,0x361)]('operation')&&existingParams['append'](_0x470fd7(0x28c,0x2f8),'update');_0x220cea[_0x470fd7(0x35c,0x341)]?.['length']&&_0x220cea['filters'][_0x470fd7(0x2e3,0x2e8)](filter=>{function _0x5bb04f(_0x34ea77,_0x1bba3c){return _0x264b(_0x1bba3c- -0x344,_0x34ea77);}existingParams[_0x5bb04f(-0xb7,-0x116)](filter[_0x5bb04f(-0x16b,-0x102)],filter['operator']+'.'+filter[_0x5bb04f(-0x1a7,-0x1de)]);});_0x220cea[_0x470fd7(0x42a,0x3b4)]?.['prefer']&&(headers['Prefer']=_0x220cea['options']['prefer']);const updateUrl=_0x484bec+'?'+existingParams[_0x470fd7(0x3ad,0x38c)]();response=await this[_0x470fd7(0x34a,0x30a)][_0x470fd7(0x356,0x2f4)](updateUrl,_0x220cea[_0x470fd7(0x2f6,0x32e)],{'headers':headers});}else{let _0x1888d6=_0x220cea[_0x470fd7(0x318,0x32e)];!headers[_0x470fd7(0x2cc,0x331)]&&(headers[_0x470fd7(0x390,0x331)]='return=representation'),_0x220cea['options']?.[_0x470fd7(0x345,0x2e7)]&&(headers[_0x470fd7(0x37a,0x331)]='resolution=merge-duplicates,return=representation'),_0x220cea[_0x470fd7(0x30c,0x323)]&&(_0x1888d6=_0x220cea[_0x470fd7(0x2d1,0x323)]),response=await this[_0x470fd7(0x379,0x30a)][_0x470fd7(0x272,0x2d8)](_0x34f43e,_0x1888d6,{'headers':headers});}}}return{'data':response[_0x470fd7(0x2c6,0x32e)],'error':null,'count':response['headers']?.[_0x470fd7(0x316,0x35b)]?parseInt(response['headers'][_0x470fd7(0x30b,0x35b)]):undefined};}catch(_0x5bc2a7){return{'data':null,'error':_0x5bc2a7 instanceof EBaaSError?_0x5bc2a7:new EBaaSError(_0x5bc2a7 instanceof Error?_0x5bc2a7[_0x470fd7(0x36e,0x2fe)]:'Database\x20operation\x20failed',0x0,_0x5bc2a7)};}}}class CustomDatabaseManager{constructor(_0x564c46,_0x3f5245){function _0x29a5e6(_0x2b5e13,_0x23fd70){return _0x264b(_0x23fd70-0x3de,_0x2b5e13);}this[_0x29a5e6(0x5a9,0x565)]=_0x564c46,this[_0x29a5e6(0x565,0x574)]=_0x3f5245;}async['detectCustomDatabase'](){if(!this[_0x529804(-0x227,-0x1eb)])return{'hasCustomDatabase':![]};function _0x529804(_0xb0c624,_0x28717e){return _0x264b(_0xb0c624- -0x3bd,_0x28717e);}try{const response=await this[_0x529804(-0x236,-0x277)]['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response['status']===0xc8&&response[_0x529804(-0x212,-0x20f)]?.[_0x529804(-0x1a1,-0x155)]){const config=response[_0x529804(-0x212,-0x1db)][_0x529804(-0x1a1,-0x13e)],_0x473a5e={'host':config['postgresHost'],'port':config['postgresPort'],'database':config[_0x529804(-0x219,-0x1f1)],'username':config['postgresUsername'],'password':'','schema':config[_0x529804(-0x235,-0x282)],'sslEnabled':config['sslEnabled']};return this[_0x529804(-0x1d6,-0x1a0)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x473a5e},this[_0x529804(-0x1d6,-0x24a)];}}catch(_0x2f474c){if(_0x2f474c?.[_0x529804(-0x202,-0x1fe)]===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x2f474c);}return this[_0x529804(-0x1d6,-0x23b)]={'hasCustomDatabase':![]},this[_0x529804(-0x1d6,-0x1d5)];}async['testConnection'](_0x2c4646){function _0x24e7c0(_0x24a992,_0x39d8c1){return _0x264b(_0x39d8c1- -0x5c,_0x24a992);}try{const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database/test-connection',_0x2c4646,{'headers':this['workspaceId']?{'X-Workspace-ID':this['workspaceId']}:{}});return response[_0x24e7c0(0x135,0x14f)];}catch(_0x4987cf){return{'success':![],'message':_0x4987cf?.[_0x24e7c0(0x156,0x11f)]||'Failed\x20to\x20test\x20connection'};}}async['configureCustomDatabase'](_0x240542){function _0x6db9b3(_0x521955,_0x4f4e3b){return _0x264b(_0x4f4e3b-0x79,_0x521955);}if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x6db9b3(0x1b7,0x200)]['post']('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x240542},{'headers':{'X-Workspace-ID':this['workspaceId']}}),config=response['data'][_0x6db9b3(0x286,0x295)];return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x240542},config;}async['removeCustomDatabase'](){function _0x5bf9a7(_0x3e10a9,_0x23c41b){return _0x264b(_0x23c41b-0x39c,_0x3e10a9);}if(!this[_0x5bf9a7(0x51d,0x532)])throw new Error('Workspace ID is required to remove custom database');await this['httpClient']['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this[_0x5bf9a7(0x5d8,0x583)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}[_0x514dba(0x5b3,0x549)](){function _0x4dba01(_0x20f00b,_0x3db89){return _0x264b(_0x20f00b- -0xca,_0x3db89);}return this[_0x4dba01(0x11d,0x16f)]?.['hasCustomDatabase']??![];}['getCustomCredentials'](){return this['detectedConfig']?.['credentials'];}[_0x514dba(0x58c,0x56c)](_0x455b7e){this[_0x344bcc(-0xc2,-0x95)]=_0x455b7e;function _0x344bcc(_0x48c11a,_0x3ccd05){return _0x264b(_0x48c11a- -0x258,_0x3ccd05);}this['detectedConfig']=undefined;}['getWorkspaceId'](){return this['workspaceId'];}['getStatus'](){function _0x14b78c(_0x1a300e,_0x588a46){return _0x264b(_0x1a300e- -0x238,_0x588a46);}return{'workspaceId':this[_0x14b78c(-0xa2,-0x33)],'hasConfig':this['hasCustomDatabase'](),'configDetails':this['detectedConfig']?.['credentials']?{'host':this['detectedConfig']['credentials']['host'],'port':this[_0x14b78c(-0x51,0x11)][_0x14b78c(-0xa9,-0xc7)][_0x14b78c(-0xe0,-0xd6)],'database':this['detectedConfig']['credentials']['database'],'schema':this[_0x14b78c(-0x51,-0x53)][_0x14b78c(-0xa9,-0xde)]['schema']||_0x14b78c(-0x9b,-0xfe),'sslEnabled':this['detectedConfig'][_0x14b78c(-0xa9,-0xf5)][_0x14b78c(-0x92,-0x43)]||![]}:undefined};}}function _0x264b(_0x33c647,_0x1f1de0){const _0x29fcdc=_0x29fc();return _0x264b=function(_0x264b9b,_0x142cfc){_0x264b9b=_0x264b9b-0x155;let _0x12e1b9=_0x29fcdc[_0x264b9b];if(_0x264b['DxnORT']===undefined){var _0x284152=function(_0x8d9878){const _0xcf47cd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1713ec='',_0x247bb0='';for(let _0x3c1962=0x0,_0xba38f,_0x2583e0,_0x4a1876=0x0;_0x2583e0=_0x8d9878['charAt'](_0x4a1876++);~_0x2583e0&&(_0xba38f=_0x3c1962%0x4?_0xba38f*0x40+_0x2583e0:_0x2583e0,_0x3c1962++%0x4)?_0x1713ec+=String['fromCharCode'](0xff&_0xba38f>>(-0x2*_0x3c1962&0x6)):0x0){_0x2583e0=_0xcf47cd['indexOf'](_0x2583e0);}for(let _0x492bdb=0x0,_0x1c8d2f=_0x1713ec['length'];_0x492bdb<_0x1c8d2f;_0x492bdb++){_0x247bb0+='%'+('00'+_0x1713ec['charCodeAt'](_0x492bdb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x247bb0);};_0x264b['wxuCCg']=_0x284152,_0x33c647=arguments,_0x264b['DxnORT']=!![];}const _0x10e22f=_0x29fcdc[0x0],_0x9668c2=_0x264b9b+_0x10e22f,_0x1acd40=_0x33c647[_0x9668c2];return!_0x1acd40?(_0x12e1b9=_0x264b['wxuCCg'](_0x12e1b9),_0x33c647[_0x9668c2]=_0x12e1b9):_0x12e1b9=_0x1acd40,_0x12e1b9;},_0x264b(_0x33c647,_0x1f1de0);}class DatabaseClient{constructor(_0xfccbde,_0x410459){this['httpClient']=_0xfccbde;function _0x1634f9(_0x4b9926,_0x3c111c){return _0x264b(_0x3c111c- -0x37a,_0x4b9926);}this[_0x1634f9(-0x186,-0x15a)]=new CustomDatabaseManager(_0xfccbde,_0x410459);}['from'](_0x304c7e){function _0x173e52(_0x43cf03,_0x3b52c9){return _0x264b(_0x43cf03- -0x25a,_0x3b52c9);}return new QueryBuilder(this[_0x173e52(-0xd3,-0x91)],_0x304c7e,this['currentSchema'],this[_0x173e52(-0x3a,-0x1f)][_0x173e52(-0x42,-0xa2)]());}['rpc'](_0x3a7d87,_0x5c1a32){function _0xcd7de(_0x233193,_0x2fb8ed){return _0x264b(_0x2fb8ed- -0x350,_0x233193);}return this[_0xcd7de(-0x194,-0x1c9)][_0xcd7de(-0x262,-0x1fb)]('/rpc/'+_0x3a7d87,_0x5c1a32);}['schema'](_0x4a80e7){const _0x53f9d8=new DatabaseClient(this[_0x4bdda9(-0x189,-0x1e5)],this[_0x4bdda9(-0x19b,-0x14c)][_0x4bdda9(-0xdb,-0x154)]());_0x53f9d8[_0x4bdda9(-0x166,-0x183)]=_0x4a80e7;function _0x4bdda9(_0x7aa0c7,_0x2345bc){return _0x264b(_0x2345bc- -0x36c,_0x7aa0c7);}return _0x53f9d8['customDatabaseManager']=this['customDatabaseManager'],_0x53f9d8;}async['detectCustomDatabase'](){function _0x422de6(_0x262d1e,_0x5003cf){return _0x264b(_0x262d1e-0x1bf,_0x5003cf);}return this['customDatabaseManager'][_0x422de6(0x3d0,0x3f1)]();}async['testCustomConnection'](_0x64460){function _0x3f7238(_0x41feb7,_0x50ebae){return _0x264b(_0x41feb7- -0x282,_0x50ebae);}return this[_0x3f7238(-0x62,-0x7)][_0x3f7238(-0x5e,-0x31)](_0x64460);}async[_0x514dba(0x597,0x55a)](_0x5afb25){return this['customDatabaseManager']['configureCustomDatabase'](_0x5afb25);}async['removeCustomDatabase'](){function _0x32818f(_0x1fce3d,_0xdfa6bd){return _0x264b(_0x1fce3d- -0x319,_0xdfa6bd);}return this['customDatabaseManager'][_0x32818f(-0x15c,-0xe6)]();}[_0x514dba(0x5ca,0x581)](){function _0x3298c1(_0x192ac0,_0x588fe1){return _0x264b(_0x588fe1-0xe5,_0x192ac0);}return this['customDatabaseManager'][_0x3298c1(0x28d,0x2b9)]();}[_0x514dba(0x4ca,0x4d3)](){function _0xebc694(_0x8d2dd7,_0x2c807d){return _0x264b(_0x8d2dd7-0x71,_0x2c807d);}return this[_0xebc694(0x291,0x2d0)][_0xebc694(0x1ca,0x163)]();}[_0x514dba(0x4f7,0x56c)](_0x2924d7){function _0x2cb8d7(_0x1cb873,_0xfd077a){return _0x264b(_0x1cb873-0x10f,_0xfd077a);}this['customDatabaseManager'][_0x2cb8d7(0x306,0x28d)](_0x2924d7);}async[_0x514dba(0x5d6,0x59d)](){function _0x484c14(_0x21b45e,_0x429f11){return _0x264b(_0x21b45e-0x17a,_0x429f11);}try{await this['customDatabaseManager'][_0x484c14(0x38b,0x31f)]();}catch(_0x26a12c){console['warn']('Failed to initialize custom database detection:',_0x26a12c);}}}class StorageBucket{constructor(_0x2e12f5,bucketId){function _0x2ec58a(_0x102a47,_0xca8f8a){return _0x264b(_0xca8f8a-0x4,_0x102a47);}this['httpClient']=_0x2e12f5,this[_0x2ec58a(0x19e,0x198)]=bucketId;}async[_0x514dba(0x4b8,0x508)](_0x96b67a,_0x521848,_0x503a59){function _0x1db947(_0x1ddbd0,_0x569e9f){return _0x264b(_0x569e9f-0x7d,_0x1ddbd0);}try{const _0x501cc6=new FormData();if(_0x521848 instanceof File)_0x501cc6['append']('file',_0x521848);else{if(_0x521848 instanceof Blob)_0x501cc6['append'](_0x1db947(0x1a3,0x1fd),_0x521848,_0x96b67a);else{if(_0x521848 instanceof ArrayBuffer)_0x501cc6['append'](_0x1db947(0x1d7,0x1fd),new Blob([_0x521848]),_0x96b67a);else typeof _0x521848===_0x1db947(0x1f8,0x230)&&_0x501cc6['append'](_0x1db947(0x242,0x1fd),new Blob([_0x521848],{'type':'text/plain'}),_0x96b67a);}}_0x501cc6[_0x1db947(0x263,0x2ab)]('path',_0x96b67a);_0x503a59?.[_0x1db947(0x2eb,0x287)]&&_0x501cc6[_0x1db947(0x2c8,0x2ab)]('cacheControl',_0x503a59['cacheControl']);_0x503a59?.['contentType']&&_0x501cc6['append']('contentType',_0x503a59['contentType']);_0x503a59?.[_0x1db947(0x2a1,0x29e)]&&_0x501cc6['append']('metadata',JSON[_0x1db947(0x219,0x292)](_0x503a59['metadata']));const _0x3ca9b3=_0x1db947(0x208,0x208)+this['bucketId']+'/files'+(_0x503a59?.['upsert']?'?upsert=true':''),response=await this['httpClient'][_0x1db947(0x161,0x1d2)](_0x3ca9b3,_0x501cc6,{'headers':{'Content-Type':_0x1db947(0x2b7,0x27e)}});return{'data':response[_0x1db947(0x1fa,0x228)],'error':null};}catch(_0x461409){return{'data':null,'error':_0x461409 instanceof EBaaSError?_0x461409:new EBaaSError(_0x461409 instanceof Error?_0x461409['message']:'Failed\x20to\x20upload\x20file',0x0,_0x461409)};}}async['download'](_0x57e878,_0x275b66){function _0x58c4fa(_0x93dad3,_0x234ccf){return _0x264b(_0x234ccf- -0xf4,_0x93dad3);}try{const _0xac3d9d=new URLSearchParams();_0x275b66?.['transform']&&Object[_0x58c4fa(0xe1,0x10f)](_0x275b66['transform'])['forEach'](([_0x57d961,_0x11841d])=>{function _0x24affc(_0x41ba90,_0x4c792d){return _0x264b(_0x41ba90-0x1ea,_0x4c792d);}_0x11841d!==undefined&&_0xac3d9d[_0x24affc(0x418,0x3cf)](_0x57d961,String(_0x11841d));});const _0x7fdd78='/storage/buckets/'+this['bucketId']+_0x58c4fa(0x12e,0x11c)+_0x57e878+(_0xac3d9d['toString']()?'?'+_0xac3d9d[_0x58c4fa(0x148,0x115)]():''),response=await this['httpClient'][_0x58c4fa(0x110,0xdd)](_0x7fdd78,{'responseType':_0x58c4fa(0x96,0xfd)});return{'data':response['data'],'error':null};}catch(_0x44ce77){return{'data':null,'error':_0x44ce77 instanceof EBaaSError?_0x44ce77:new EBaaSError(_0x44ce77 instanceof Error?_0x44ce77[_0x58c4fa(0x86,0x87)]:_0x58c4fa(0x115,0x145),0x0,_0x44ce77)};}}async[_0x514dba(0x582,0x513)](_0x10947d,_0x34cca0){function _0xd41580(_0x4fc190,_0x400812){return _0x264b(_0x400812-0xf4,_0x4fc190);}try{const _0x1e8bb4=new URLSearchParams();_0x10947d&&_0x1e8bb4[_0xd41580(0x363,0x322)]('prefix',_0x10947d);_0x34cca0?.['limit']&&_0x1e8bb4['append'](_0xd41580(0x2b2,0x2ba),String(_0x34cca0[_0xd41580(0x2cd,0x2ba)]));_0x34cca0?.['offset']&&_0x1e8bb4['append'](_0xd41580(0x2d8,0x26c),String(_0x34cca0[_0xd41580(0x1f4,0x26c)]));_0x34cca0?.['sortBy']&&_0x1e8bb4[_0xd41580(0x2d7,0x322)]('sortBy',JSON[_0xd41580(0x36e,0x309)](_0x34cca0[_0xd41580(0x37c,0x31b)]));_0x34cca0?.['search']&&_0x1e8bb4['append'](_0xd41580(0x292,0x29d),_0x34cca0[_0xd41580(0x2a1,0x29d)]);const _0x331b95=_0xd41580(0x239,0x27f)+this['bucketId']+_0xd41580(0x37d,0x30f)+(_0x1e8bb4['toString']()?'?'+_0x1e8bb4[_0xd41580(0x369,0x2fd)]():''),response=await this[_0xd41580(0x2ac,0x27b)]['get'](_0x331b95);return{'data':response[_0xd41580(0x25a,0x29f)],'error':null};}catch(_0x452d18){return{'data':null,'error':_0x452d18 instanceof EBaaSError?_0x452d18:new EBaaSError(_0x452d18 instanceof Error?_0x452d18['message']:_0xd41580(0x293,0x303),0x0,_0x452d18)};}}async[_0x514dba(0x56a,0x57d)](_0x475484){function _0xa98965(_0x56b665,_0x33e380){return _0x264b(_0x56b665- -0x229,_0x33e380);}try{const response=await this['httpClient']['delete'](_0xa98965(-0x9e,-0x90)+this['bucketId']+_0xa98965(-0xe,-0x65),{'data':{'paths':_0x475484}});return{'data':response['data'],'error':null};}catch(_0x4f0ac7){return{'data':null,'error':_0x4f0ac7 instanceof EBaaSError?_0x4f0ac7:new EBaaSError(_0x4f0ac7 instanceof Error?_0x4f0ac7['message']:_0xa98965(-0x56,-0x8d),0x0,_0x4f0ac7)};}}async[_0x514dba(0x4f1,0x4ef)](fromPath,_0x489034){function _0x3d8390(_0x154060,_0x9611f2){return _0x264b(_0x154060- -0x19,_0x9611f2);}try{const response=await this['httpClient'][_0x3d8390(0x13c,0x1b0)](_0x3d8390(0x172,0x18c)+this['bucketId']+_0x3d8390(0x15e,0x182),{'sourceKey':fromPath,'destinationKey':_0x489034});return{'data':response['data'],'error':null};}catch(_0x5b9db1){return{'data':null,'error':_0x5b9db1 instanceof EBaaSError?_0x5b9db1:new EBaaSError(_0x5b9db1 instanceof Error?_0x5b9db1['message']:_0x3d8390(0x183,0x151),0x0,_0x5b9db1)};}}async['copy'](fromPath,_0x3d9f92){function _0x259cc7(_0x5a4d14,_0x1ccf4e){return _0x264b(_0x5a4d14- -0x242,_0x1ccf4e);}try{const response=await this[_0x259cc7(-0xbb,-0x48)][_0x259cc7(-0xed,-0x12a)](_0x259cc7(-0xb7,-0x7a)+this[_0x259cc7(-0xae,-0xfe)]+_0x259cc7(-0x34,-0xa1),{'sourceKey':fromPath,'destinationKey':_0x3d9f92});return{'data':response[_0x259cc7(-0x97,-0x7c)],'error':null};}catch(_0x478311){return{'data':null,'error':_0x478311 instanceof EBaaSError?_0x478311:new EBaaSError(_0x478311 instanceof Error?_0x478311[_0x259cc7(-0xc7,-0xb8)]:_0x259cc7(-0x95,-0xaa),0x0,_0x478311)};}}async[_0x514dba(0x4e9,0x53c)](_0x30f65b,_0x2e7722,_0x2b946b){function _0x42ff65(_0x4babb5,_0x1bd307){return _0x264b(_0x1bd307- -0x123,_0x4babb5);}try{const response=await this['httpClient']['post']('/storage/buckets/'+this[_0x42ff65(0x98,0x71)]+_0x42ff65(0x7f,0xed)+_0x30f65b+'/sign',{'expiresIn':_0x2e7722,..._0x2b946b});return{'data':response[_0x42ff65(0xde,0x88)],'error':null};}catch(_0x546bcf){return{'data':null,'error':_0x546bcf instanceof EBaaSError?_0x546bcf:new EBaaSError(_0x546bcf instanceof Error?_0x546bcf[_0x42ff65(0x58,0x58)]:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x546bcf)};}}[_0x514dba(0x570,0x558)](_0x246843,_0x423ca1){function _0x296dd9(_0x52adc2,_0x5bdfe2){return _0x264b(_0x5bdfe2- -0x5d,_0x52adc2);}const _0x5464e4=new URLSearchParams();_0x423ca1?.[_0x296dd9(0x152,0x117)]&&Object['entries'](_0x423ca1['transform'])[_0x296dd9(0xc0,0x108)](([_0x46a4f9,_0x354086])=>{function _0x4c6b59(_0x22e0f0,_0x2f8eff){return _0x264b(_0x22e0f0- -0x2c1,_0x2f8eff);}_0x354086!==undefined&&_0x5464e4[_0x4c6b59(-0x93,-0xd7)](_0x46a4f9,String(_0x354086));});const _0x427f15=this['httpClient']['baseURL']||'',_0x5ef152=_0x427f15+'/storage/buckets/'+this[_0x296dd9(0x1aa,0x137)]+_0x296dd9(0x1e3,0x1b3)+_0x246843+(_0x5464e4[_0x296dd9(0x1e4,0x1ac)]()?'?'+_0x5464e4['toString']():'');return{'data':{'publicUrl':_0x5ef152}};}async['getFileInfo'](_0x2edf58){function _0x59c7cb(_0x334042,_0x3a8f9c){return _0x264b(_0x334042-0x315,_0x3a8f9c);}try{const response=await this['httpClient']['get'](_0x59c7cb(0x4a0,0x436)+this[_0x59c7cb(0x4a9,0x476)]+_0x59c7cb(0x525,0x567)+_0x2edf58+_0x59c7cb(0x509,0x573));return{'data':response['data'],'error':null};}catch(_0xf1d557){return{'data':null,'error':_0xf1d557 instanceof EBaaSError?_0xf1d557:new EBaaSError(_0xf1d557 instanceof Error?_0xf1d557['message']:'Failed\x20to\x20get\x20file\x20info',0x0,_0xf1d557)};}}async['updateFileMetadata'](_0x420b99,metadata){function _0x3f4033(_0x44aa05,_0x5353de){return _0x264b(_0x5353de- -0x4c,_0x44aa05);}try{const response=await this['httpClient']['put'](_0x3f4033(0x12d,0x13f)+this['bucketId']+_0x3f4033(0x226,0x1c4)+_0x420b99+_0x3f4033(0xb7,0x115),{'metadata':metadata});return{'data':response[_0x3f4033(0x1a2,0x15f)],'error':null};}catch(_0x357f8d){return{'data':null,'error':_0x357f8d instanceof EBaaSError?_0x357f8d:new EBaaSError(_0x357f8d instanceof Error?_0x357f8d[_0x3f4033(0x12f,0x12f)]:'Failed\x20to\x20update\x20file\x20metadata',0x0,_0x357f8d)};}}}class StorageClient{constructor(_0x275493){function _0x4ec070(_0x3598a2,_0xe8f5b2){return _0x264b(_0x3598a2-0x3cb,_0xe8f5b2);}this[_0x4ec070(0x552,0x55c)]=_0x275493;}[_0x514dba(0x57a,0x529)](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async[_0x514dba(0x4e2,0x4d7)](_0x51706b,_0x34b8e7){function _0x45175f(_0x224909,_0x45d2b0){return _0x264b(_0x224909- -0xcd,_0x45d2b0);}try{const response=await this['httpClient']['post'](_0x45175f(0xa2,0x3e),{'id':_0x51706b,..._0x34b8e7});return{'data':response[_0x45175f(0xde,0x99)],'error':null};}catch(_0x3b232b){return{'data':null,'error':_0x3b232b instanceof EBaaSError?_0x3b232b:new EBaaSError(_0x3b232b instanceof Error?_0x3b232b['message']:_0x45175f(0xbc,0x69),0x0,_0x3b232b)};}}async['getBucket'](_0x26afd7){function _0x15d288(_0x309cba,_0xfebc1c){return _0x264b(_0xfebc1c- -0x3bc,_0x309cba);}try{const response=await this['httpClient'][_0x15d288(-0x22c,-0x1eb)](_0x15d288(-0x1f2,-0x231)+_0x26afd7);return{'data':response['data'],'error':null};}catch(_0x1ddb4c){return{'data':null,'error':_0x1ddb4c instanceof EBaaSError?_0x1ddb4c:new EBaaSError(_0x1ddb4c instanceof Error?_0x1ddb4c[_0x15d288(-0x1d8,-0x241)]:'Failed\x20to\x20get\x20bucket',0x0,_0x1ddb4c)};}}async[_0x514dba(0x548,0x544)](){function _0x3297ed(_0x20ceca,_0x26f813){return _0x264b(_0x20ceca- -0x176,_0x26f813);}try{const response=await this[_0x3297ed(0x11,-0x4d)]['get']('/storage/buckets');return{'data':response['data'],'error':null};}catch(_0x4957b1){return{'data':null,'error':_0x4957b1 instanceof EBaaSError?_0x4957b1:new EBaaSError(_0x4957b1 instanceof Error?_0x4957b1['message']:'Failed\x20to\x20list\x20buckets',0x0,_0x4957b1)};}}async[_0x514dba(0x555,0x5a2)](_0x14cc26,_0x4dd2a0){function _0x119756(_0x180851,_0x3519d9){return _0x264b(_0x180851- -0x21a,_0x3519d9);}try{const response=await this['httpClient']['put']('/storage/buckets/'+_0x14cc26,_0x4dd2a0);return{'data':response[_0x119756(-0x6f,-0xd8)],'error':null};}catch(_0x1d5c9f){return{'data':null,'error':_0x1d5c9f instanceof EBaaSError?_0x1d5c9f:new EBaaSError(_0x1d5c9f instanceof Error?_0x1d5c9f[_0x119756(-0x9f,-0xda)]:'Failed\x20to\x20update\x20bucket',0x0,_0x1d5c9f)};}}async['deleteBucket'](_0x48cdb2){function _0x16877d(_0x5e278d,_0x573b0c){return _0x264b(_0x573b0c-0x202,_0x5e278d);}try{const response=await this['httpClient']['delete']('/storage/buckets/'+_0x48cdb2);return{'data':response[_0x16877d(0x400,0x3ad)],'error':null};}catch(_0x34ed63){return{'data':null,'error':_0x34ed63 instanceof EBaaSError?_0x34ed63:new EBaaSError(_0x34ed63 instanceof Error?_0x34ed63[_0x16877d(0x317,0x37d)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x34ed63)};}}async[_0x514dba(0x52b,0x54e)](){function _0x6c775b(_0x297880,_0x2dbdbe){return _0x264b(_0x297880-0x36d,_0x2dbdbe);}try{const response=await this[_0x6c775b(0x4f4,0x4d1)][_0x6c775b(0x53e,0x597)]('/storage/usage');return{'data':response[_0x6c775b(0x518,0x4e6)],'error':null};}catch(_0x17c5e4){return{'data':null,'error':_0x17c5e4 instanceof EBaaSError?_0x17c5e4:new EBaaSError(_0x17c5e4 instanceof Error?_0x17c5e4[_0x6c775b(0x4e8,0x53c)]:_0x6c775b(0x549,0x5a2),0x0,_0x17c5e4)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x5bb027,_0x5374d0){function _0x173fa2(_0x98254d,_0x4b99b1){return _0x264b(_0x4b99b1- -0x34b,_0x98254d);}super(),this[_0x173fa2(-0xcf,-0x114)]=![],this[_0x173fa2(-0x17a,-0x1eb)]=_0x173fa2(-0x117,-0x106),this['subscriptions']=new Map(),this['topic']=_0x5bb027,this[_0x173fa2(-0x153,-0x1a4)]=_0x5374d0;}[_0x514dba(0x5c0,0x573)](_0x5a9752){!this[_0x32fa6b(0xdc,0xe7)]&&(this[_0x32fa6b(0xdc,0xc2)]=!![],this[_0x32fa6b(0x7a,0x32)]());function _0x32fa6b(_0x547893,_0x247ad2){return _0x264b(_0x547893- -0x15b,_0x247ad2);}return _0x5a9752&&this['on'](_0x32fa6b(0x60,0x47),_0x5a9752),this;}['onPostgresChanges'](filter,_0x528ea4){const _0x22784a=_0x2f8e14(0x263,0x251)+JSON['stringify'](filter);super['on'](_0x22784a,_0x528ea4);const _0x462a32={'unsubscribe':()=>{super[_0x4a4d63(0x5aa,0x59c)](_0x22784a,_0x528ea4);function _0x4a4d63(_0xb3dcc4,_0x5a6b58){return _0x264b(_0x5a6b58-0x362,_0xb3dcc4);}this[_0x4a4d63(0x594,0x564)]['delete'](_0x22784a);}};this['subscriptions']['set'](_0x22784a,_0x462a32);function _0x2f8e14(_0xecb41f,_0x58db15){return _0x264b(_0x58db15-0x5b,_0xecb41f);}return this[_0x2f8e14(0x22c,0x202)]?.[_0x2f8e14(0x289,0x248)]&&this['state']==='joined'&&this['socket'][_0x2f8e14(0x266,0x1f5)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()}),_0x462a32;}['onBroadcast'](filter,_0x227864){const _0x93359f=_0x1a5387(0x28c,0x300)+JSON[_0x1a5387(0x2d9,0x31a)](filter);super['on'](_0x93359f,_0x227864);const _0x586a2b={'unsubscribe':()=>{super['off'](_0x93359f,_0x227864),this['subscriptions']['delete'](_0x93359f);}};function _0x1a5387(_0x32a45e,_0x26c210){return _0x264b(_0x26c210-0x105,_0x32a45e);}return this['subscriptions'][_0x1a5387(0x266,0x2bf)](_0x93359f,_0x586a2b),_0x586a2b;}['onPresence'](filter,_0x22a2d2){const _0x40b44d=_0x46b4cc(0x343,0x329)+JSON['stringify'](filter);function _0x46b4cc(_0x5185b2,_0x28565b){return _0x264b(_0x5185b2-0x1e0,_0x28565b);}super['on'](_0x40b44d,_0x22a2d2);const _0x198126={'unsubscribe':()=>{super['off'](_0x40b44d,_0x22a2d2);function _0x5a0c7e(_0x3ea5ed,_0x27646d){return _0x264b(_0x27646d-0x275,_0x3ea5ed);}this['subscriptions'][_0x5a0c7e(0x440,0x3f9)](_0x40b44d);}};return this['subscriptions'][_0x46b4cc(0x39a,0x33c)](_0x40b44d,_0x198126),_0x198126;}[_0x514dba(0x5c9,0x5ab)](_0x25ab2c){return new Promise(_0x416702=>{function _0x56f86a(_0x340afb,_0x737ae7){return _0x264b(_0x737ae7- -0x372,_0x340afb);}this[_0x56f86a(-0x23a,-0x1cb)]?.['connected']&&this['state']===_0x56f86a(-0x1b4,-0x16b)?(this['socket']['emit'](_0x56f86a(-0x13a,-0x134),{'topic':this['topic'],'event':_0x25ab2c['event'],'payload':_0x25ab2c,'ref':this['makeRef']()}),_0x416702('ok')):_0x416702('error');});}[_0x514dba(0x520,0x4eb)](_0x59fa3c){return new Promise(_0x252f61=>{function _0x54dac6(_0x1c476f,_0x412688){return _0x264b(_0x412688- -0x35b,_0x1c476f);}this[_0x54dac6(-0x1dd,-0x1b4)]?.[_0x54dac6(-0x161,-0x16e)]&&this[_0x54dac6(-0x20e,-0x1fb)]===_0x54dac6(-0x1b6,-0x154)?(this['socket']['emit'](_0x54dac6(-0x129,-0x131),{'topic':this[_0x54dac6(-0x169,-0x161)],'event':'track','payload':_0x59fa3c,'ref':this['makeRef']()}),_0x252f61('ok')):_0x252f61(_0x54dac6(-0x1f3,-0x201));});}['untrack'](){return new Promise(_0x561251=>{function _0x5524fc(_0x4dd97c,_0x2a68a3){return _0x264b(_0x2a68a3- -0x90,_0x4dd97c);}this[_0x5524fc(0x143,0x117)]?.['connected']&&this[_0x5524fc(0x8d,0xd0)]==='joined'?(this[_0x5524fc(0x13f,0x117)]['emit']('presence',{'topic':this[_0x5524fc(0x12f,0x16a)],'event':'untrack','ref':this['makeRef']()}),_0x561251('ok')):_0x561251(_0x5524fc(0x7f,0xca));});}['unsubscribe'](){return new Promise(_0x316656=>{this['state']=_0x20eef1(-0x1bd,-0x16d),this['subscriptions'][_0x20eef1(-0x1da,-0x186)](_0x1fcb60=>{function _0x83a49b(_0x1ed3dc,_0x2353a7){return _0x264b(_0x1ed3dc-0x1fd,_0x2353a7);}_0x1fcb60[_0x83a49b(0x416,0x405)]();});function _0x20eef1(_0x9a90b8,_0x36f8dd){return _0x264b(_0x36f8dd- -0x2eb,_0x9a90b8);}this['subscriptions'][_0x20eef1(-0x81,-0xa7)](),this[_0x20eef1(-0x12d,-0x144)]?.[_0x20eef1(-0x10a,-0xfe)]&&this['socket'][_0x20eef1(-0x196,-0x151)](_0x20eef1(-0x88,-0xeb),{'topic':this['topic'],'ref':this[_0x20eef1(-0x110,-0x12c)]()}),this[_0x20eef1(-0x1c5,-0x18b)]='closed',this['removeAllListeners'](),_0x316656('ok');});}['_join'](){if(this[_0x4397b3(0x34e,0x3c3)]==='leaving')return;this['state']='joining';function _0x4397b3(_0x43ea7f,_0x5d946d){return _0x264b(_0x5d946d-0x263,_0x43ea7f);}this['socket']?.[_0x4397b3(0x4b8,0x450)]&&(this['socket']['emit']('join',{'topic':this['topic'],'ref':this['makeRef']()}),setTimeout(()=>{function _0x2cb81f(_0x2d9b3e,_0x27a270){return _0x264b(_0x2d9b3e- -0x2d0,_0x27a270);}this[_0x2cb81f(-0x170,-0x190)]==='joining'&&(this['state']='joined',this['emit'](_0x2cb81f(-0x115,-0x104),'SUBSCRIBED'));},0x64));}[_0x514dba(0x5b7,0x59e)](){function _0x4a5816(_0x493941,_0x1b1e5b){return _0x264b(_0x493941-0xd0,_0x1b1e5b);}this[_0x4a5816(0x307,0x360)]&&(this[_0x4a5816(0x2a5,0x24d)](),this['subscriptions'][_0x4a5816(0x235,0x29a)]((_0x59a31b,_0x1aaeb1)=>{function _0x4f2e35(_0x5106ed,_0x2a4ad4){return _0x264b(_0x2a4ad4-0x36,_0x5106ed);}if(_0x1aaeb1[_0x4f2e35(0x2b7,0x259)]('postgres_changes:')){const filter=JSON['parse'](_0x1aaeb1[_0x4f2e35(0x23d,0x268)]('postgres_changes:',''));this['socket']?.['emit'](_0x4f2e35(0x19b,0x1f6),{'topic':this[_0x4f2e35(0x1d4,0x230)],'filter':filter,'ref':this[_0x4f2e35(0x23d,0x1f5)]()});}}));}['_trigger'](_0x3e1528,_0x89c16d){if(_0x3e1528===_0x182806(-0xca,-0x5e)){const _0x4b9543='postgres_changes:'+JSON[_0x182806(-0x54,-0xf)](_0x89c16d['filter']||{});this[_0x182806(-0xcf,-0x109)](_0x4b9543,_0x89c16d);}else{if(_0x3e1528==='broadcast'){const _0x3f5b00='broadcast:'+JSON[_0x182806(-0x54,-0x94)]({'event':_0x89c16d['event']});this['emit'](_0x3f5b00,_0x89c16d);}else{if(_0x3e1528==='presence'){const _0x31bd61='presence:'+JSON['stringify']({'event':_0x89c16d[_0x182806(-0x39,-0x63)]});this['emit'](_0x31bd61,_0x89c16d);}}}function _0x182806(_0xaa515f,_0x256ec5){return _0x264b(_0xaa515f- -0x269,_0x256ec5);}this['emit'](_0x3e1528,_0x89c16d);}[_0x514dba(0x576,0x506)](_0x11c75f){function _0x4e74e5(_0x5af6f2,_0x8397ec){return _0x264b(_0x5af6f2-0x21e,_0x8397ec);}this['state']=_0x11c75f;let status;switch(_0x11c75f){case _0x4e74e5(0x425,0x3ae):status='SUBSCRIBED';break;case'errored':status='CHANNEL_ERROR';break;case'closed':status='CLOSED';break;default:return;}this['emit']('status',status);}[_0x514dba(0x4cb,0x534)](){function _0x346885(_0x55f0a0,_0x1c139f){return _0x264b(_0x55f0a0- -0x371,_0x1c139f);}return Math['random']()['toString'](0x24)[_0x346885(-0x1c5,-0x1ac)](0x2,0xf);}['getState'](){function _0x14a6b6(_0x3e1e62,_0x1301cc){return _0x264b(_0x1301cc-0x13a,_0x3e1e62);}return this[_0x14a6b6(0x274,0x29a)];}}class RealtimeClient{constructor(_0x2aa981,_0x1e82fa,_0x15c81c={}){this[_0x25ea41(-0x21d,-0x293)]=null,this['channels']=new Map();function _0x25ea41(_0x108a66,_0x262130){return _0x264b(_0x108a66- -0x3c4,_0x262130);}this['connectionState']='disconnected',this[_0x25ea41(-0x1fb,-0x1e3)]=0x0,this['maxReconnectAttempts']=0x5,this[_0x25ea41(-0x1d6,-0x20e)]=_0x2aa981,this['apiKey']=_0x1e82fa,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x15c81c};}['connect'](){return new Promise((_0x4c7800,_0x45d71b)=>{if(this[_0x327fa3(0x262,0x252)]?.[_0x327fa3(0x24b,0x298)]){_0x4c7800();return;}this['connectionState']='connecting',this['socket']=socket_ioClient['io'](this[_0x327fa3(0x303,0x299)],{'auth':{'apikey':this[_0x327fa3(0x1e2,0x23d)]},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this[_0x327fa3(0x27c,0x2dc)][_0x327fa3(0x25e,0x28c)],'reconnectionAttempts':this[_0x327fa3(0x2b4,0x2dc)][_0x327fa3(0x2bc,0x2d0)],...this[_0x327fa3(0x300,0x2dc)][_0x327fa3(0x2ef,0x29e)]}),this['socket']['on']('connect',()=>{this['connectionState']='connected',this['reconnectAttempts']=0x0,this[_0x3dbe2d(-0x4b,-0xa4)]();function _0x3dbe2d(_0x435de2,_0x360e6f){return _0x264b(_0x435de2- -0x243,_0x360e6f);}_0x4c7800();}),this['socket']['on'](_0x327fa3(0x2a7,0x25a),_0x8ebdaf=>{this['connectionState']='disconnected',this['channels']['forEach'](channel=>{function _0x1bab89(_0x3da6aa,_0x57a534){return _0x264b(_0x57a534- -0x18f,_0x3da6aa);}channel['_setState'](_0x1bab89(0xe9,0xb6));});}),this['socket']['on']('connect_error',_0x11d7b5=>{this['connectionState']='error';function _0x15a9b2(_0x82e1e7,_0xe6cc2b){return _0x264b(_0xe6cc2b- -0x1ac,_0x82e1e7);}this[_0x15a9b2(-0x54,0x1d)]++,this[_0x15a9b2(0x49,0x1d)]>=this[_0x15a9b2(0x67,0x79)]&&_0x45d71b(new Error(_0x15a9b2(0x68,0x7a)+this['maxReconnectAttempts']+'\x20attempts:\x20'+_0x11d7b5['message']));}),this[_0x327fa3(0x283,0x252)]['on']('reconnect',()=>{function _0x14a795(_0x5daecd,_0x10c75a){return _0x264b(_0x5daecd-0x1fb,_0x10c75a);}this[_0x14a795(0x3cd,0x375)]=_0x14a795(0x3e8,0x44d),this['reconnectAttempts']=0x0,this[_0x14a795(0x374,0x372)][_0x14a795(0x360,0x3cc)](channel=>{function _0x39d7e4(_0x5428ef,_0x59e838){return _0x264b(_0x5428ef- -0x2b6,_0x59e838);}channel[_0x39d7e4(-0x8d,-0x105)]();});}),this[_0x327fa3(0x200,0x252)]['on'](_0x327fa3(0x26b,0x24a),_0x20269b=>{const channel=this[_0x4898d4(-0x2d3,-0x269)][_0x4898d4(-0x229,-0x211)](_0x20269b['topic']);function _0x4898d4(_0x21cb41,_0x5ef83e){return _0x264b(_0x5ef83e- -0x3e2,_0x21cb41);}channel&&channel['_trigger']('postgres_changes',_0x20269b);});function _0x327fa3(_0x1fd534,_0x417a0e){return _0x264b(_0x417a0e-0xab,_0x1fd534);}this[_0x327fa3(0x25b,0x252)]['on']('broadcast',_0x36dadf=>{function _0x5413a1(_0x274817,_0x2d33ec){return _0x264b(_0x274817- -0x29f,_0x2d33ec);}const channel=this[_0x5413a1(-0x126,-0x177)][_0x5413a1(-0xce,-0x9f)](_0x36dadf['topic']);channel&&channel['_trigger'](_0x5413a1(-0x61,-0x71),_0x36dadf);}),this[_0x327fa3(0x24b,0x252)]['on'](_0x327fa3(0x2bc,0x2d5),_0x30297e=>{const channel=this[_0x342d27(-0x11a,-0x189)][_0x342d27(-0xf8,-0x131)](_0x30297e['topic']);function _0x342d27(_0x4ae6a6,_0x3baeb0){return _0x264b(_0x3baeb0- -0x302,_0x4ae6a6);}channel&&channel[_0x342d27(-0x131,-0xf5)](_0x342d27(-0x7e,-0xd8),_0x30297e);});});}[_0x514dba(0x4ce,0x524)](){function _0xdda69d(_0x352bef,_0x2b89f6){return _0x264b(_0x2b89f6-0x38c,_0x352bef);}this[_0xdda69d(0x52e,0x533)]&&(this[_0xdda69d(0x4df,0x533)]['disconnect'](),this[_0xdda69d(0x507,0x533)]=null),this[_0xdda69d(0x5be,0x55e)]='disconnected',this['channels']['clear']();}['channel'](_0xa48bac){if(this[_0xcf74f3(-0xf4,-0x133)]['has'](_0xa48bac))return this[_0xcf74f3(-0xf4,-0xd1)]['get'](_0xa48bac);function _0xcf74f3(_0x36d96f,_0x10e02a){return _0x264b(_0x36d96f- -0x26d,_0x10e02a);}const channel=new RealtimeChannel(_0xa48bac,this['socket']);return this['channels'][_0xcf74f3(-0xb3,-0x10e)](_0xa48bac,channel),this['connectionState']===_0xcf74f3(-0x80,-0x29)&&channel['_join'](),channel;}['removeChannel'](channel){function _0x47fcab(_0x1df524,_0x3362a2){return _0x264b(_0x3362a2- -0x154,_0x1df524);}const _0x226fa0=channel[_0x47fcab(0x49,0xa6)];this['channels']['has'](_0x226fa0)&&(this[_0x47fcab(-0x9,0x25)][_0x47fcab(-0x15,0x30)](_0x226fa0),channel['unsubscribe']());}[_0x514dba(0x4e8,0x52a)](){function _0x146140(_0x12dc95,_0x5bb2ba){return _0x264b(_0x12dc95- -0x250,_0x5bb2ba);}this[_0x146140(-0xd7,-0xec)]['forEach'](channel=>{channel['unsubscribe']();}),this['channels'][_0x146140(-0xc,-0x56)]();}['getChannels'](){function _0x45ca78(_0x5e20dd,_0x3272e9){return _0x264b(_0x5e20dd- -0xbf,_0x3272e9);}return Array[_0x45ca78(0xf5,0xc9)](this[_0x45ca78(0xba,0xbb)][_0x45ca78(0xda,0x8f)]());}['isConnected'](){function _0x355c21(_0x49c898,_0x64c3d4){return _0x264b(_0x49c898-0x54,_0x64c3d4);}return this['connectionState']===_0x355c21(0x241,0x22f)&&!!this['socket']?.['connected'];}['getConnectionState'](){function _0xc9b118(_0x43b857,_0x1f44d2){return _0x264b(_0x1f44d2-0xc9,_0x43b857);}return this[_0xc9b118(0x22e,0x29b)];}['onConnectionStateChange'](_0x38d43f){function _0xf2c3ea(_0x56546e,_0xa8760){return _0x264b(_0xa8760- -0x1d2,_0x56546e);}const _0x3e287b=()=>_0x38d43f(this[_0xf2c3ea(0x6e,0x0)]);return this['socket']&&(this[_0xf2c3ea(-0x12,-0x2b)]['on']('connect',()=>{function _0x149072(_0x573c5c,_0x222389){return _0x264b(_0x222389- -0x330,_0x573c5c);}this['connectionState']=_0x149072(-0x17d,-0x143),_0x3e287b();}),this['socket']['on'](_0xf2c3ea(-0x19,-0x23),()=>{function _0x40c773(_0x4fc13a,_0x25aa3a){return _0x264b(_0x4fc13a- -0x340,_0x25aa3a);}this[_0x40c773(-0x16e,-0x165)]='disconnected',_0x3e287b();}),this['socket']['on'](_0xf2c3ea(0xbf,0x48),()=>{function _0x10afd0(_0x568468,_0x30fe5c){return _0x264b(_0x568468- -0x26e,_0x30fe5c);}this[_0x10afd0(-0x9c,-0xaf)]=_0x10afd0(-0x114,-0xe3),_0x3e287b();})),()=>{function _0x263eb5(_0x39e24d,_0x26fc2b){return _0x264b(_0x26fc2b- -0x195,_0x39e24d);}this[_0x263eb5(-0x7,0x12)]&&(this[_0x263eb5(0x1c,0x12)]['off'](_0x263eb5(-0x3d,-0x39),_0x3e287b),this['socket']['off']('disconnect',_0x3e287b),this['socket'][_0x263eb5(0xf2,0xa5)](_0x263eb5(0x45,0x85),_0x3e287b));};}[_0x514dba(0x4fd,0x56d)](){function _0x14c018(_0x2109ea,_0x265ffe){return _0x264b(_0x2109ea- -0x1f,_0x265ffe);}if(!this['options'][_0x14c018(0x179,0x159)]||!this['socket'])return;const interval=setInterval(()=>{function _0x2ebdd5(_0x3b8b0a,_0x529286){return _0x264b(_0x529286- -0x383,_0x3b8b0a);}this[_0x2ebdd5(-0x1d5,-0x1dc)]?.['connected']?this['socket']['emit']('heartbeat',{'timestamp':Date[_0x2ebdd5(-0x227,-0x1f5)]()}):clearInterval(interval);},this['options'][_0x14c018(0x179,0x14e)]);}[_0x514dba(0x59f,0x531)](){return this['socket'];}}class FunctionsClient{constructor(_0x586ea5){function _0x1c8df7(_0x400a8e,_0x31c7e8){return _0x264b(_0x400a8e- -0x186,_0x31c7e8);}this[_0x1c8df7(0x1,-0x1a)]=_0x586ea5;}async['invoke'](_0x1977fc,_0x233abb){function _0x49eea2(_0x4564ac,_0x1ee4d9){return _0x264b(_0x4564ac- -0xb6,_0x1ee4d9);}try{const _0x51c7f0=_0x233abb?.['method']||'POST',headers={'Content-Type':'application/json',..._0x233abb?.[_0x49eea2(0xb6,0xac)]};let response;const _0x21a5b4='/functions/v1/'+_0x1977fc;switch(_0x51c7f0['toUpperCase']()){case'GET':response=await this['httpClient']['get'](_0x21a5b4,{'headers':headers,'params':_0x233abb?.[_0x49eea2(0xa5,0x72)]});break;case'POST':response=await this[_0x49eea2(0xd1,0xe6)][_0x49eea2(0x9f,0xa4)](_0x21a5b4,_0x233abb?.[_0x49eea2(0xa5,0x98)],{'headers':headers});break;case'PUT':response=await this['httpClient'][_0x49eea2(0x121,0x13e)](_0x21a5b4,_0x233abb?.[_0x49eea2(0xa5,0xc2)],{'headers':headers});break;case'PATCH':response=await this[_0x49eea2(0xd1,0xa4)][_0x49eea2(0xbb,0x9e)](_0x21a5b4,_0x233abb?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x49eea2(0xd1,0x7e)][_0x49eea2(0xce,0xdc)](_0x21a5b4,{'headers':headers,'data':_0x233abb?.[_0x49eea2(0xa5,0x114)]});break;default:throw new EBaaSError(_0x49eea2(0x120,0x125)+_0x51c7f0,0x190);}return{'data':response['data'],'error':null};}catch(_0xf683c7){return{'data':null,'error':_0xf683c7 instanceof EBaaSError?_0xf683c7:new EBaaSError(_0xf683c7 instanceof Error?_0xf683c7['message']:_0x49eea2(0x161,0x119),0x0,_0xf683c7)};}}async['list'](){function _0x5d99e5(_0x5db6b3,_0x2e8c36){return _0x264b(_0x5db6b3- -0x204,_0x2e8c36);}try{const response=await this[_0x5d99e5(-0x7d,-0xa)][_0x5d99e5(-0x33,-0x26)](_0x5d99e5(-0x5,-0x7a));return{'data':response['data'],'error':null};}catch(_0x359f2c){return{'data':null,'error':_0x359f2c instanceof EBaaSError?_0x359f2c:new EBaaSError(_0x359f2c instanceof Error?_0x359f2c['message']:_0x5d99e5(-0x82,-0x54),0x0,_0x359f2c)};}}async['get'](_0x3f7541){function _0x4b699f(_0xfcb223,_0x1cdb06){return _0x264b(_0xfcb223-0x207,_0x1cdb06);}try{const response=await this[_0x4b699f(0x38e,0x351)][_0x4b699f(0x3d8,0x37e)](_0x4b699f(0x3b7,0x3c7)+_0x3f7541+'/info');return{'data':response['data'],'error':null};}catch(_0x2f02a1){return{'data':null,'error':_0x2f02a1 instanceof EBaaSError?_0x2f02a1:new EBaaSError(_0x2f02a1 instanceof Error?_0x2f02a1['message']:'Failed\x20to\x20get\x20function',0x0,_0x2f02a1)};}}async['deploy'](_0x21e389,_0x1a1092){function _0x17a6c9(_0x5784b6,_0x1ac324){return _0x264b(_0x5784b6-0x353,_0x1ac324);}try{const _0x44b460=new FormData();if(_0x1a1092[_0x17a6c9(0x4ba,0x503)]instanceof File)_0x44b460[_0x17a6c9(0x581,0x5e8)]('code',_0x1a1092[_0x17a6c9(0x4ba,0x4bb)]);else typeof _0x1a1092[_0x17a6c9(0x4ba,0x49d)]==='string'&&_0x44b460[_0x17a6c9(0x581,0x523)]('code',new Blob([_0x1a1092[_0x17a6c9(0x4ba,0x51c)]],{'type':_0x17a6c9(0x4a9,0x51c)}),'index.ts');_0x1a1092['entrypoint']&&_0x44b460[_0x17a6c9(0x581,0x57a)](_0x17a6c9(0x4f6,0x4e7),_0x1a1092[_0x17a6c9(0x4f6,0x51a)]);_0x1a1092[_0x17a6c9(0x4f4,0x511)]&&_0x44b460['append']('env',JSON['stringify'](_0x1a1092[_0x17a6c9(0x4f4,0x4c2)]));_0x1a1092[_0x17a6c9(0x515,0x509)]&&_0x44b460['append'](_0x17a6c9(0x515,0x576),JSON['stringify'](_0x1a1092['importMap']));_0x1a1092[_0x17a6c9(0x518,0x512)]!==undefined&&_0x44b460[_0x17a6c9(0x581,0x564)]('verify',String(_0x1a1092[_0x17a6c9(0x518,0x552)]));const response=await this[_0x17a6c9(0x4da,0x4f5)]['post'](_0x17a6c9(0x503,0x4dc)+_0x21e389+'/deploy',_0x44b460,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response['data'],'error':null};}catch(_0x29b340){return{'data':null,'error':_0x29b340 instanceof EBaaSError?_0x29b340:new EBaaSError(_0x29b340 instanceof Error?_0x29b340['message']:'Failed\x20to\x20deploy\x20function',0x0,_0x29b340)};}}async[_0x514dba(0x4ff,0x4f9)](_0x5a81ff){function _0x58a37c(_0x2c767b,_0x23cca6){return _0x264b(_0x23cca6- -0x2b8,_0x2c767b);}try{const response=await this[_0x58a37c(-0x14d,-0x131)][_0x58a37c(-0x135,-0x134)]('/functions/v1/'+_0x5a81ff);return{'data':response[_0x58a37c(-0x184,-0x10d)],'error':null};}catch(_0x101d02){return{'data':null,'error':_0x101d02 instanceof EBaaSError?_0x101d02:new EBaaSError(_0x101d02 instanceof Error?_0x101d02['message']:_0x58a37c(-0xed,-0x7d),0x0,_0x101d02)};}}async['updateEnv'](_0x41a388,_0x3b27c9){function _0x3e3a6b(_0x4bb371,_0x3cc141){return _0x264b(_0x3cc141-0x3,_0x4bb371);}try{const response=await this['httpClient']['put']('/functions/v1/'+_0x41a388+'/env',{'env':_0x3b27c9});return{'data':response[_0x3e3a6b(0x1b9,0x1ae)],'error':null};}catch(_0x1aca29){return{'data':null,'error':_0x1aca29 instanceof EBaaSError?_0x1aca29:new EBaaSError(_0x1aca29 instanceof Error?_0x1aca29['message']:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x1aca29)};}}async['getLogs'](_0x24c2ec,_0x3043de){function _0x4b9f48(_0x1949ca,_0x5579b9){return _0x264b(_0x5579b9-0x106,_0x1949ca);}try{const _0xaa384e=new URLSearchParams();_0x3043de?.[_0x4b9f48(0x30c,0x2cc)]&&_0xaa384e['append'](_0x4b9f48(0x2de,0x2cc),String(_0x3043de[_0x4b9f48(0x345,0x2cc)]));_0x3043de?.['offset']&&_0xaa384e['append'](_0x4b9f48(0x2cf,0x27e),String(_0x3043de[_0x4b9f48(0x208,0x27e)]));_0x3043de?.[_0x4b9f48(0x383,0x323)]&&_0xaa384e[_0x4b9f48(0x31e,0x334)]('level',_0x3043de['level']);const _0x4ec43c='/functions/v1/'+_0x24c2ec+'/logs'+(_0xaa384e[_0x4b9f48(0x323,0x30f)]()?'?'+_0xaa384e[_0x4b9f48(0x33d,0x30f)]():''),response=await this['httpClient'][_0x4b9f48(0x2cf,0x2d7)](_0x4ec43c);return{'data':response['data'],'error':null};}catch(_0x4c2d78){return{'data':null,'error':_0x4c2d78 instanceof EBaaSError?_0x4c2d78:new EBaaSError(_0x4c2d78 instanceof Error?_0x4c2d78[_0x4b9f48(0x21f,0x281)]:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x4c2d78)};}}async[_0x514dba(0x583,0x57b)](_0xe77493,_0x351002){function _0x1724c9(_0x18321b,_0x510cb6){return _0x264b(_0x510cb6-0x1e6,_0x18321b);}try{const _0x3a9fa3=new URLSearchParams();_0x351002?.[_0x1724c9(0x363,0x376)]&&_0x3a9fa3[_0x1724c9(0x461,0x414)](_0x1724c9(0x3af,0x376),_0x351002['period']);const _0x2d114e=_0x1724c9(0x3cd,0x396)+_0xe77493+_0x1724c9(0x325,0x398)+(_0x3a9fa3[_0x1724c9(0x3df,0x3ef)]()?'?'+_0x3a9fa3[_0x1724c9(0x410,0x3ef)]():''),response=await this['httpClient'][_0x1724c9(0x3c0,0x3b7)](_0x2d114e);return{'data':response['data'],'error':null};}catch(_0xce88bc){return{'data':null,'error':_0xce88bc instanceof EBaaSError?_0xce88bc:new EBaaSError(_0xce88bc instanceof Error?_0xce88bc['message']:_0x1724c9(0x3fe,0x3a9),0x0,_0xce88bc)};}}}function _0x29fc(){const _0x25d46d=['ChjLC2vUy2u6','DxbZzxj0','zM9YrwfJAa','DMfSDwu','y29Kzq','B3bLCMf0B3i','CMvQzwn0','uMvXDwvZDcbMywLSzwq','CxvLCNK','AgvHzgvYCW','zgf0ywjHC2u','AM9PBG','l3n0B3jHz2uVyNvJA2v0CW','mLndz1bQta','Cgf0y2G','Dw5KzwzPBMvK','y2XLyxjtzxnZAw9U','DhjHBNnMB3jT','B3bLCMf0Aw9U','DhjHy2S','l2zPBgvZl21VDMu','B2zMC2v0','y2HHBM5LBhm','Bw92zq','BwvZC2fNzq','DgfIBgu','yxnJzw5KAw5N','BgvHDMLUzW','ndi0nte4ments2jfyG','zMLSzq','y2fWDhvYzvn0ywnRvhjHy2u','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','B3jKzxi','zgvSzxrL','Bg9HzfnLC3nPB24','icHtDgf0Dxm6ia','Ahr0CenSAwvUDa','Cg9ZDgDYzxnty2HLBwe','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','ntC0meXyquf2Bq','l3n0B3jHz2uVyNvJA2v0CY8','mte4mZeWmxDdtxrYqq','CMvXDwvZDa','BM93','y3jLzgvUDgLHBhm','CgvYAw9K','x3nLDfn0yxrL','yxbPs2v5','DxbSB2fK','yNvJA2v0swq','uMvHBhrPBwvdAgfUBMvS','D29YA3nWywnLswq','shr0CenSAwvUDa','AgvHCNrIzwf0sw50zxj2ywW','DMfSDwvZ','zw1PDa','y3jLyxrLq2XPzw50','rMfPBgvKihrVig1VDMuGzMLSzq','ChvIBgLJ','BgLZDa','Cg9ZDgDYzxnFy2HHBMDLCW','zgf0yufYCMf5','zw52','DxbKyxrLvxnLCG','zw50CNLWB2LUDa','Cg9ZDgDYzxneyxrHyMfZzq','zxzLBNrLBwL0DgvYmW','C3nSrw5HyMXLza','C29JA2v0','BhrL','C2vHCMnO','l3nKAY92ms8','zgf0yq','C3vIC3rYAw5N','rMfPBgvKihrVignVChKGzMLSzq','uhjLzMvY','zgLZy29UBMvJDa','l2z1BMn0Aw9UCY92ms8','l2f1DgGVDJeVC2LNBM91Da','l21LDhjPy3m','C3rYAw5N','zNjVBq','CMvTB3zLqwXSq2HHBM5LBhm','y2XPzw50','y3vYCMvUDfnLC3nPB24','CMvTB3zLqxv0AfrVA2vU','CMvHBhrPBwu','C2v0','C3rHDhvZ','x2DLDfnVy2TLDa','CMvTB3zLq3vZDg9Trgf0ywjHC2u','zMLSDgvYCW','BwfRzvjLzG','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','zwjHyxmUyxv0Ac5ZzxnZAw9U','Aw1WB3j0twfW','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','mJy5nJu2tLvOrLHA','DMvYAwz5','BgLTAxq','y3jLyxrLu2LNBMvKvxjS','ChvZAa','CMvJB25Uzwn0qxr0zw1WDhm','z3rL','mZqWntiWnMn1DK90vG','rgf0ywjHC2vdBgLLBNq','CMvZCg9UC2u','BgvUz3rO','BgLZDej1y2TLDhm','DMvYC2LVBG','z2v0','y29UBMvJDgLVBLn0yxrL','rMfPBgvKihrVihjLBw92zsbMAwXLCW','AgfZq3vZDg9Trgf0ywjHC2u','x2PVAw4','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','Chv0','Ec10B3rHBc1JB3vUDa','z2v0vxnHz2u','C2v0sxrLBq','lMfZyW','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','BgLRzq','AgfZ','yMfZzvvsta','zgvMyxvSDhm','CMvJB25Uzwn0sw50zxj2ywW','CMfUz2u','z2v0uhvIBgLJvxjS','mJu3mZu0rhz4tMTw','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','C2v0u2vZC2LVBKLUDgvYBMfS','zgv0zwn0zwrdB25MAwC','C2v0DxbjBNrLCMnLChrVCNm','y3vYCMvUDfnJAgvTyq','zxHLy3v0zvf1zxj5','B25bDxrOu3rHDgvdAgfUz2u','AgfUzgXLqxv0AevYCM9Y','y29UBMvJDgvK','DxjS','ywnJzxnZx3rVA2vU','mti0mdKYogHSC1nbuq','yMXVyG','C2vSzwn0','C29JA2v0t3b0Aw9UCW','l2LUzM8','u3rVCMfNzuj1y2TLDa','Cg9ZDgDYzxnFy2HHBMDLCZO','C2v0v29YA3nWywnLswq','C2v0DxbizwfYDgjLyxq','AwXPA2u','Dg9WAwm','yNjVywrJyxn0oG','C3bSAxq','zxHLy3v0zq','C3vIC2nYAwjL','l2z1BMn0Aw9UCY92mq','BgvHDMu','BxvSDgLWyxj0l2zVCM0Tzgf0yq','C3vIC2nYAxb0Aw9UCW','zw50CMLLCW','zNvUy3rPB25Z','qxv0AgvUDgLJyxrPB24GzMfPBgvK','z2v0twv0CMLJCW','AM9PBMvK','CMvTB3zL','Dg9tDhjPBMC','y2fJAgvdB250CM9S','CMvMCMvZAfnLC3nPB24','AxnvC2LUz0n1C3rVBurHDgfIyxnL','x3rYAwDNzxi','l2zPBgvZl2nVChK','rMfPBgvKihrVigXPC3qGzMLSzxm','l2zPBgvZlW','zgv0zwn0q3vZDg9Trgf0ywjHC2u','mZqZndrfqK1Suu8','vw5RBM93BIbLCNjVCG','BwfW','C3rYAw5NAwz5','BMvX','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','z2v0v29YA3nWywnLswq','Dw5ZDwjZy3jPyMu','y29UBMvJDf9LCNjVCG','l2zPBgvZ','y29UzMLN','Bgv2zwW','y29TBw9U','sfruucbYzxf1zxn0igzHAwXLza','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','Bwv0ywrHDge','y29UDgfPBNm','C3rHCNrZv2L0Aa','DgvZDenVBM5Ly3rPB24','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','C29YDej5','Aw5PDgLHBgL6zq','x3jLAM9PBG','ChjLC2vUy2u','C29JA2v0lMLVlwnSAwvUDa','zgv0ywLSCW','DxbKyxrLqNvJA2v0','yxbWzw5K','mtvNCevgzMi','zxzLBNq','B3b0Aw9UCW','CMvWBgfJzq','C3rVCMfNzq','DxnL','Dg9ku09o','C2vUza','AM9PBMvKt25Jzq','AgfUzgXLrxjYB3i','rMfPBgvKihrVigrVD25SB2fKigzPBgu','B2zM','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','C3rHDhvZvgv4Da','CNbJ','yNjVywrJyxn0','C2v0qxv0AfrVA2vU','p29WzxjHDgLVBJ1KzwXLDgu','C2vZC2LVBG','y29SDw1U','lMrLC2m','y2XLyxi','y2XVC2vK','uxvLCNLcDwLSzgvY','Cg9ZDa','Dgv4Dc9WBgfPBG','rujHyvnfCNjVCG','Cg9YDa','z2v0u3rHDhvZ','zxjYB3i','yM9KEq','y29UBMvJDa','l2f1DgGVDJeVDxnLCG','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','z2v0u2vZC2LVBG','C3rHDgu','l21LDgfKyxrH','y3jLyxrLqNvJA2v0'];_0x29fc=function(){return _0x25d46d;};return _0x29fc();}class EBaaSClient{constructor(_0x405aff,_0x3af6c8,_0x40511c){this[_0x3b7b02(-0x51,-0xa1)]=_0x40511c,this[_0x3b7b02(-0xfb,-0xe1)]=new HttpClient({'url':_0x405aff,'apiKey':_0x3af6c8,'timeout':0x7530,'headers':_0x40511c?.['global']?.[_0x3b7b02(-0x116,-0xe4)]}),this['auth']=new AuthClient(this['httpClient']);function _0x3b7b02(_0x27c04d,_0x1aa73a){return _0x264b(_0x27c04d- -0x282,_0x1aa73a);}this['database']=new DatabaseClient(this['httpClient'],_0x40511c?.['database']?.[_0x3b7b02(-0xec,-0xed)]),this['storage']=new StorageClient(this['httpClient']),this['realtime']=new RealtimeClient(_0x405aff,_0x3af6c8,_0x40511c?.[_0x3b7b02(-0xc9,-0x101)]),this['functions']=new FunctionsClient(this[_0x3b7b02(-0xfb,-0x108)]),this['initializeCustomDatabase']();}[_0x514dba(0x574,0x529)](_0xe7bdd8){function _0x3f2c66(_0x55d818,_0x2326c3){return _0x264b(_0x2326c3- -0xa2,_0x55d818);}return this[_0x3f2c66(0x70,0xcb)]['from'](_0xe7bdd8);}['rpc'](_0x4f83b9,_0x9c0442){function _0x59c2e1(_0x16abe5,_0x1175f8){return _0x264b(_0x1175f8-0x2dd,_0x16abe5);}return this['database'][_0x59c2e1(0x574,0x51a)](_0x4f83b9,_0x9c0442);}['bucket'](_0x4d4971){function _0x3a2118(_0x3d9aa5,_0x4bc600){return _0x264b(_0x4bc600-0x277,_0x3d9aa5);}return this[_0x3a2118(0x4be,0x4aa)]['from'](_0x4d4971);}['channel'](_0x2d2f38){return this['realtime']['channel'](_0x2d2f38);}['invoke'](_0x63d314,_0x1cf200){function _0x461064(_0xc2787e,_0x53f60e){return _0x264b(_0xc2787e- -0x187,_0x53f60e);}return this[_0x461064(0x7d,0x88)]['invoke'](_0x63d314,_0x1cf200);}async['initializeCustomDatabase'](){function _0x1246cd(_0x6d52a3,_0x1f22e4){return _0x264b(_0x1f22e4- -0x1b0,_0x6d52a3);}if(this[_0x1246cd(0x68,0x81)]?.[_0x1246cd(-0x5a,-0x43)]?.['autoDetectCustomDatabase'])try{await this[_0x1246cd(-0xf,-0x43)]['initialize']();}catch(_0x4df644){console['warn']('Failed to initialize custom database detection:',_0x4df644);}}async['setWorkspaceId'](_0x4e247d){this['database']['setWorkspaceId'](_0x4e247d);function _0x165c1b(_0x3606dc,_0xaf2e5f){return _0x264b(_0x3606dc-0x2e1,_0xaf2e5f);}this[_0x165c1b(0x512,0x4cd)]?.[_0x165c1b(0x44e,0x3ef)]?.['autoDetectCustomDatabase']&&await this[_0x165c1b(0x44e,0x463)][_0x165c1b(0x509,0x51e)]();}async[_0x514dba(0x4e6,0x55a)](_0x53639c){await this['database']['configureCustomDatabase'](_0x53639c);}[_0x514dba(0x480,0x4d3)](){function _0x1c21a2(_0x458df7,_0x5c52cd){return _0x264b(_0x458df7- -0x397,_0x5c52cd);}return this[_0x1c21a2(-0x22a,-0x25c)]['getCustomDatabaseStatus']();}}function createClient(_0x55b67e,_0x1b66d6,_0x483b99){return new EBaaSClient(_0x55b67e,_0x1b66d6,_0x483b99);}const version='1.0.0';exports['AuthClient']=AuthClient,exports['CustomDatabaseManager']=CustomDatabaseManager,exports[_0x514dba(0x502,0x541)]=DatabaseClient,exports['EBaaSClient']=EBaaSClient,exports[_0x514dba(0x4db,0x4cc)]=EBaaSError,exports['FunctionsClient']=FunctionsClient,exports[_0x514dba(0x500,0x50c)]=HttpClient,exports[_0x514dba(0x626,0x5bb)]=QueryBuilder,exports[_0x514dba(0x4f4,0x50a)]=RealtimeChannel,exports['RealtimeClient']=RealtimeClient,exports[_0x514dba(0x55b,0x56a)]=StorageBucket,exports['StorageClient']=StorageClient,exports[_0x514dba(0x55a,0x510)]=createClient,exports[_0x514dba(0x590,0x545)]=version;
1
+ 'use strict';function _0x1cdf(){const _0x1bb639=['BgvHDMu','CMvJB25Uzwn0','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','z2v0twv0CMLJCW','y2XVC2vK','C2vSzwn0','zgLZy29UBMvJDa','y29UDgvUDfr5Cgu','Dw5KzwzPBMvK','C2v0sxrLBq','y29UDgfPBNm','B3b0Aw9UCW','DxnLCG','z2v0u3rHDgu','z3rL','zMLSDgvYCW','C3rHDhvZ','AgfZq3vZDg9Trgf0ywjHC2u','zgvMyxvSDhm','y2fJAgvdB250CM9S','ntaYodm5mgrYA0ztwa','CMvTB3zLqwXSq2HHBM5LBhm','DxbKyxrLrgf0yq','DgvZDen1C3rVBunVBM5Ly3rPB24','p3vWC2vYDd10CNvL','BwvZC2fNzq','p29WzxjHDgLVBJ11ChnLCNq','yNjVywrJyxn0','zwjHyxmUyxv0Ac5ZzxnZAw9U','zgf0ywjHC2u','y29UBMvJDf9LCNjVCG','y2fWDhvYzvn0ywnRvhjHy2u','y29Kzq','l3n0B3jHz2uVyNvJA2v0CY8','ms4WlJa','CMvTB3zL','CNbJ','Aw50zxjJzxb0B3jZ','mtrTtur2ENu','C2v0u2vZC2LVBKLUDgvYBMfS','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','zw50CNLWB2LUDa','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','lMfZyW','CMfUzg9T','CMvJB25Uzwn0qxr0zw1WDhm','ChjLC2vUy2u6','DxnL','Cg9ZDgDYzxnFy2HHBMDLCW','rMfPBgvKihrVig1VDMuGzMLSzq','BgvHDMLUzW','C2vUza','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','C3vIC2nYAxb0Aw9UCW','C2nOzw1H','y29UBMvJDa','B3bLCMf0Aw9U','CgfYC2u','CMvWBgfJzq','DxjS','Aw5KzxGUDhm','C2vHCMnO','Cg9ZDgDYzxnty2HLBwe','ChjLC2vUy2u','l2f1DgGVDJeVC2LNBNvW','y2HHBM5LBa','Cg9ZDgDYzxnvC2vYBMfTzq','vw5RBM93BIbLCNjVCG','C2v0qxv0AfrVA2vU','y3jLzgvUDgLHBhm','z2v0qNvJA2v0','lMrLC2m','BwfRzvjLzG','zgf0yq','AgfUzgXLrxjYB3i','AM9PBMvKt25Jzq','yNjVywrJyxn0oG','zw50CMLLCW','l3n0B3jHz2uVyNvJA2v0CW','yxv0Aa','yM9KEq','l2zPBgvZlW','z2v0vxnHz2u','BgLTAxq','C2vZC2LVBG','zxHLy3v0zvf1zxj5','l2zPBgvZl2nVChK','Dw50CMfJAW','BgLZDej1y2TLDhm','D2fYBG','AM9PBG','yNvJA2v0swq','B3bLCMf0B3i','rNvUy3rPB25Zq2XPzw50','DxbSB2fK','DhjHBNnMB3jT','AgfUzgXLqxv0AevYCM9Y','CMvJB25Uzwn0sw50zxj2ywW','Ahr0CenSAwvUDa','C2v0v29YA3nWywnLswq','CMvMCMvZAfnLC3nPB24','mtj0rw5hvMu','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','y3vYCMvUDfnJAgvTyq','D2vIC29JA2v0','y29SDw1U','y29UBMvJDgLUzW','yxbPs2v5','zgvSzxrLt3b0Aw9UCW','mtH6A1fhtK8','C2v0DxbjBNrLCMnLChrVCNm','B2zM','x3jLAM9PBG','zMLSDgvY','C29JA2v0','Aw1WB3j0twfW','C2v0DxbizwfYDgjLyxq','icHtDgf0Dxm6ia','Bwv0Ag9K','qxv0AenSAwvUDa','q0HbtK5ftf9fuLjpuG','BMvX','p29WzxjHDgLVBJ1KzwXLDgu','rgf0ywjHC2vdBgLLBNq','CMvZzxrqyxnZD29Yza','uMvHBhrPBwvdBgLLBNq','z2v0','y2HHBM5LBhm','C2v0','z2v0q2HHBM5LBhm','y2XLyxi','yxbWzw5K','y29UzMLN','mtmWmZm4nLffweHitq','Cgf0y2G','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','B3jKzxi','Dg9WAwm','Bwv0ywrHDge','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','l2LUzM8','D29YA3nWywnLswq','z2v0vxnLCG','Cg9ZDgDYzxnFy2HHBMDLCZO','Dgv4Dc9WBgfPBG','y3jLyxrLq2XPzw50','Cg9ZDgDYzxnqB3j0','BgvUz3rO','B2zMC2v0','CMfUz2u','y3jLyxrLu2LNBMvKvxjS','C3nSrw5HyMXLza','ywnJzxnZx3rVA2vU','zxjYB3jLza','zgv0zwn0zwrdB25MAwC','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','ChvIBgLJ','mty5ode2mfPWrKfeBW','y2XLyxjtzxnZAw9U','AxnezwXLDgu','CMvQzwn0','l2rLCgXVEq','zxzLBNq','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','ChvZAa','DMfSDwu','sfruucbYzxf1zxn0igzHAwXLza','y29UBMvJDgvK','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','CMvHBhrPBwu','yxnJzw5KAw5N','rMfPBgvKihrVigXPC3qGzMLSzxm','zMLSzq','zgvSzxrLqNvJA2v0','zw52','yNvJA2v0','DxbKyxrL','uhjLzMvY','rMfPBgvKihrVignVChKGzMLSzq','p29WzxjHDgLVBJ1PBNnLCNq','Cg9ZDgDYzxniB3n0','CMvZCg9UC2u','C3rHDgu','x3rYAwDNzxi','l2zPBgvZ','DxbZzxj0','Bw92zq','y3vYCMvUDfnLC3nPB24','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','AM9PBMvK','Cgf0Aa','AM9PBMLUzW','l3nKAY92ms8','DgLTzw91Da','CgvYAw9K','zM9YrwfJAa','l3jWyY8','uMvXDwvZDcbMywLSzwq','l2z1BMn0Aw9UCY92ms8','CMvTB3zLq3vZDg9Trgf0ywjHC2u','AgvHCNrIzwf0sw50zxj2ywW','Dg9tDhjPBMC','C3rHDhvZvgv4Da','y29UBMvJDgLVBLn0yxrL','z2v0tg9NCW','zgLZy29UBMvJDgvK','zgvSzxrL','zxHLy3v0zq','Dg9vChbLCKnHC2u','BgLRzq','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','DgfIBgu','Chv0','DhjHy2S','B25qCMvZzw5Jzq','l2f1DgGVDJeVDxnLCG','BxvSDgLWyxj0l2zVCM0Tzgf0yq','DgvZDenVBM5Ly3rPB24','Aw5PDgLHBgL6zq','mZi2mJmWwxrdvgXK','Cg9ZDa','BMfTzq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','ChjLzMvY','C29JA2v0lMLVlwnSAwvUDa','uxvLCNLcDwLSzgvY','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','AxndB25Uzwn0zwq','ndK2ntyXtNHcq3jP','x3nLDfn0yxrL','DMvYAwz5','C29YDej5','CxvLCNK','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','rujHyvnfCNjVCG','yMfZzvvsta','zgvWBg95','AxnvC2LUz0n1C3rVBurHDgfIyxnL','y3jLyxrLqNvJA2v0','Bg9N','rMfPBgvKihrVigDLDcbIDwnRzxq','mtm5nZaXuKTlC0rQ','BgLZDa','C3rYAw5NAwz5','zxjYB3i','DMvYC2LVBG','zxzLBNrLBwL0DgvYmW','x2PVAw4','DxbKyxrLt3b0Aw9UCW','AgvHzgvYCW','AgfZ','y2XPzw50','Ec10B3rHBc1JB3vUDa','nJCXmdeWs0HODKrv','zgv0zwn0q3vZDg9Trgf0ywjHC2u','qxv0AgvUDgLJyxrPB24GzMfPBgvK','C2LNBK91Da','Ag9ZDa','Bgv2zwW','Dw5ZDwjZy3jPyMu','zNjVBq','y29TBw9U','qMvHCMvYia','rujHyvndBgLLBNq','zw1PDa','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq'];_0x1cdf=function(){return _0x1bb639;};return _0x1cdf();}(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x4f66ae(_0x256fd2,_0x48318e){return _0x1e74(_0x256fd2- -0x26a,_0x48318e);}while(!![]){try{const _0x13d1e8=-parseInt(_0x4f66ae(-0x56,-0x3a))/0x1+-parseInt(_0x4f66ae(-0x5f,-0x41))/0x2+-parseInt(_0x4f66ae(-0x49,0x7))/0x3*(-parseInt(_0x4f66ae(0x36,0xaf))/0x4)+parseInt(_0x4f66ae(-0x1c,-0x11))/0x5+parseInt(_0x4f66ae(0x56,-0x1f))/0x6*(parseInt(_0x4f66ae(-0xa,-0x1d))/0x7)+-parseInt(_0x4f66ae(0x70,0x63))/0x8+parseInt(_0x4f66ae(0x3e,0x74))/0x9*(-parseInt(_0x4f66ae(-0x3d,-0x9a))/0xa);if(_0x13d1e8===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x9266a2){stringArray['push'](stringArray['shift']());}}}(_0x1cdf,0x8c0fd));var axios=require('axios'),socket_ioClient=require(_0x380dd0(-0xae,-0x8d)),EventEmitter=require(_0x380dd0(-0x98,-0x92));class EBaaSError extends Error{constructor(_0x2654f9,status=0x0,_0x50eccd){super(_0x2654f9),this[_0x118d84(0x324,0x318)]='EBaaSError',this['status']=status;function _0x118d84(_0x4a8c72,_0x4ca605){return _0x1e74(_0x4ca605-0x10b,_0x4a8c72);}this['details']=_0x50eccd,Error[_0x118d84(0x393,0x364)]&&Error['captureStackTrace'](this,EBaaSError);}['toJSON'](){function _0x1dfb17(_0x32cc28,_0x4775a2){return _0x1e74(_0x4775a2- -0x1c5,_0x32cc28);}return{'name':this['name'],'message':this[_0x1dfb17(0xb0,0x8e)],'status':this['status'],'details':this['details'],'stack':this['stack']};}[_0x380dd0(-0xc5,-0xf1)](){function _0x48c619(_0x38e0cd,_0x37b0e1){return _0x1e74(_0x38e0cd-0x268,_0x37b0e1);}return this[_0x48c619(0x475,0x4c0)]+':\x20'+this['message']+_0x48c619(0x518,0x4bb)+this[_0x48c619(0x4b2,0x4a3)]+')';}}class HttpClient{constructor(config){this[_0x39fb10(0x418,0x3e5)]=config[_0x39fb10(0x473,0x494)],this[_0x39fb10(0x4a3,0x4a8)]=config['apiKey'];function _0x39fb10(_0x216756,_0x25afa8){return _0x1e74(_0x216756-0x1fd,_0x25afa8);}this[_0x39fb10(0x428,0x3e9)]=axios['create']({'baseURL':this['baseURL'],'timeout':config[_0x39fb10(0x3ee,0x3b8)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x39fb10(0x4a3,0x43e)],...config[_0x39fb10(0x426,0x405)]}}),this[_0x39fb10(0x4a6,0x461)]();}[_0x380dd0(-0x15,0x69)](){this['client']['interceptors']['request'][_0x98f2bb(0x568,0x5ee)](config=>{return config;},_0x4b2024=>{function _0x5f0ba0(_0x2c32ec,_0x482e81){return _0x1e74(_0x2c32ec- -0x10a,_0x482e81);}return Promise['reject'](new EBaaSError(_0x5f0ba0(0xeb,0x155),0x0,_0x4b2024));});function _0x98f2bb(_0x3ee6d5,_0x26fed2){return _0x1e74(_0x3ee6d5-0x2ff,_0x26fed2);}this[_0x98f2bb(0x52a,0x4d7)][_0x98f2bb(0x55e,0x577)][_0x98f2bb(0x4e4,0x515)]['use'](response=>{return response;},_0x11a356=>{const status=_0x11a356[_0x4c438a(0x327,0x39b)]?.['status']||0x0;function _0x4c438a(_0x1a1cc8,_0x2c169b){return _0x1e74(_0x1a1cc8-0x142,_0x2c169b);}const _0xca3659=_0x11a356[_0x4c438a(0x327,0x38b)]?.['data']?.['message']||_0x11a356[_0x4c438a(0x395,0x3b8)]||_0x4c438a(0x3c0,0x3a8),_0x1fa99a=_0x11a356['response']?.['data']||_0x11a356;return Promise[_0x4c438a(0x41f,0x3a4)](new EBaaSError(_0xca3659,status,_0x1fa99a));});}async['get'](_0xc51147,config){function _0x5e07fa(_0x569e32,_0x3fa582){return _0x1e74(_0x3fa582-0x3e5,_0x569e32);}try{const response=await this[_0x5e07fa(0x681,0x610)][_0x5e07fa(0x6c5,0x69e)](_0xc51147,config);return{'data':response[_0x5e07fa(0x667,0x669)],'status':response[_0x5e07fa(0x61e,0x62f)],'statusText':response[_0x5e07fa(0x605,0x5df)],'headers':response['headers']};}catch(_0x401c05){throw this[_0x5e07fa(0x656,0x66a)](_0x401c05);}}async[_0x380dd0(-0xb2,-0x2d)](_0x97c3ba,data,config){function _0x30b989(_0x33e5cf,_0x45a35e){return _0x1e74(_0x45a35e-0x8f,_0x33e5cf);}try{const response=await this[_0x30b989(0x2db,0x2ba)]['post'](_0x97c3ba,data,config);return{'data':response[_0x30b989(0x32a,0x313)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x470896){throw this['handleError'](_0x470896);}}async['put'](_0x4ea524,data,config){function _0x37c625(_0x359196,_0x2bd2e3){return _0x1e74(_0x359196- -0x6f,_0x2bd2e3);}try{const response=await this[_0x37c625(0x1bc,0x1d7)]['put'](_0x4ea524,data,config);return{'data':response['data'],'status':response[_0x37c625(0x1db,0x172)],'statusText':response['statusText'],'headers':response[_0x37c625(0x1ba,0x180)]};}catch(_0x5b07c0){throw this['handleError'](_0x5b07c0);}}async['patch'](_0x420656,data,config){function _0x43c2cd(_0x31396a,_0x5afc88){return _0x1e74(_0x31396a-0x379,_0x5afc88);}try{const response=await this[_0x43c2cd(0x5a4,0x58f)]['patch'](_0x420656,data,config);return{'data':response['data'],'status':response[_0x43c2cd(0x5c3,0x552)],'statusText':response[_0x43c2cd(0x573,0x510)],'headers':response[_0x43c2cd(0x5a2,0x56b)]};}catch(_0x328d8e){throw this['handleError'](_0x328d8e);}}async[_0x380dd0(-0xc0,-0x147)](_0x5babd8,config){function _0x3bf06c(_0x1738c2,_0x3c741a){return _0x1e74(_0x1738c2-0x2e7,_0x3c741a);}try{const response=await this[_0x3bf06c(0x512,0x57f)]['delete'](_0x5babd8,config);return{'data':response['data'],'status':response[_0x3bf06c(0x531,0x589)],'statusText':response['statusText'],'headers':response[_0x3bf06c(0x510,0x549)]};}catch(_0x4de257){throw this['handleError'](_0x4de257);}}[_0x380dd0(-0x3f,0x38)](_0x2a17b4){function _0x133313(_0x3d92ca,_0x4262d8){return _0x1e74(_0x4262d8- -0x127,_0x3d92ca);}this['client'][_0x133313(0xc8,0x125)]['headers']['common']['Authorization']='Bearer\x20'+_0x2a17b4;}['removeAuthToken'](){function _0x55bdb8(_0xb7a370,_0xc92f29){return _0x1e74(_0xb7a370-0x233,_0xc92f29);}delete this['client'][_0x55bdb8(0x47f,0x451)]['headers'][_0x55bdb8(0x468,0x48d)]['Authorization'],this[_0x55bdb8(0x45e,0x481)][_0x55bdb8(0x47f,0x452)][_0x55bdb8(0x45c,0x462)]['common']['Authorization']=_0x55bdb8(0x469,0x458)+this[_0x55bdb8(0x4d9,0x515)];}['handleError'](_0x38f411){if(_0x38f411 instanceof EBaaSError)return _0x38f411;function _0x5e34e0(_0x7a1b29,_0xc014cb){return _0x1e74(_0x7a1b29- -0x345,_0xc014cb);}return new EBaaSError(_0x38f411['message']||_0x5e34e0(-0x62,-0x18),_0x38f411['status']||0x0,_0x38f411);}}class AuthClient{constructor(_0x2f1247,_0x1edd15){function _0x2ed0f0(_0x1b3aba,_0xb2513a){return _0x1e74(_0x1b3aba-0xdf,_0xb2513a);}this['currentSession']=null,this['httpClient']=_0x2f1247,this[_0x2ed0f0(0x3a9,0x37a)]=_0x1edd15,this['loadSession']();}async['signUp'](data){function _0x408713(_0x1ad798,_0x108ba1){return _0x1e74(_0x1ad798-0x1ef,_0x108ba1);}try{const response=await this[_0x408713(0x48c,0x40b)]['post'](_0x408713(0x46a,0x430),data);return response['data'][_0x408713(0x47e,0x46c)]&&this['setSessionInternal'](response[_0x408713(0x473,0x4e9)]['session']),response['data'];}catch(_0xc93c76){throw this['handleAuthError'](_0xc93c76);}}async['signIn'](data){function _0x5c9c62(_0x30297a,_0x15318){return _0x1e74(_0x15318-0x20b,_0x30297a);}try{const headers={};this['workspaceId']&&(headers['X-Workspace-ID']=this[_0x5c9c62(0x4c7,0x4d5)]);const response=await this[_0x5c9c62(0x516,0x4a8)][_0x5c9c62(0x400,0x417)]('/auth/v1/sdk/signin',data,{'headers':headers});return response[_0x5c9c62(0x4fd,0x48f)][_0x5c9c62(0x4f4,0x49a)]&&this['setSessionInternal'](response[_0x5c9c62(0x4cb,0x48f)][_0x5c9c62(0x508,0x49a)]),response['data'];}catch(_0x276771){throw this[_0x5c9c62(0x442,0x4a6)](_0x276771);}}async[_0x380dd0(-0x8e,-0x102)](){function _0x203d38(_0x47cef5,_0x4df059){return _0x1e74(_0x47cef5-0x2ba,_0x4df059);}try{await this['httpClient']['post']('/auth/v1/signout'),this[_0x203d38(0x595,0x55d)]();}catch(_0x199ca4){this[_0x203d38(0x595,0x5c3)]();throw this['handleAuthError'](_0x199ca4);}}async[_0x380dd0(0xd,-0x4f)](){function _0x563615(_0x47c697,_0x450224){return _0x1e74(_0x450224-0x121,_0x47c697);}if(!this['currentSession']?.['access_token'])return null;try{const response=await this['httpClient']['get'](_0x563615(0x335,0x328));return response['data'][_0x563615(0x2ff,0x367)];}catch(_0x3b8950){if(_0x3b8950 instanceof EBaaSError&&_0x3b8950['status']===0x191)return this['clearSession'](),null;throw this['handleAuthError'](_0x3b8950);}}async[_0x380dd0(-0x1f,-0x70)](){if(!this['currentSession']?.['refresh_token'])return null;function _0x2f4c4a(_0x28fbc9,_0x3e680a){return _0x1e74(_0x3e680a- -0x12b,_0x28fbc9);}try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this['currentSession']['refresh_token']});if(response[_0x2f4c4a(0x169,0x159)][_0x2f4c4a(0x161,0x164)])return this['setSession'](response[_0x2f4c4a(0x124,0x159)]['session']),response['data']['session'];return null;}catch(_0x128b30){this[_0x2f4c4a(0x1cf,0x1b0)]();throw this[_0x2f4c4a(0x192,0x170)](_0x128b30);}}async[_0x380dd0(-0x7,0x5)](_0x3967c2){function _0x4fffc0(_0x4ffdf9,_0xa51097){return _0x1e74(_0xa51097- -0x249,_0x4ffdf9);}try{await this[_0x4fffc0(0x9e,0x54)][_0x4fffc0(-0x4,-0x3d)](_0x4fffc0(0x25,-0x10),{'email':_0x3967c2});}catch(_0x4e67b7){throw this[_0x4fffc0(0xb0,0x52)](_0x4e67b7);}}async['updateUser'](data){function _0x4cbdd2(_0x2ed304,_0x243248){return _0x1e74(_0x2ed304-0x1fa,_0x243248);}try{const response=await this['httpClient'][_0x4cbdd2(0x3fe,0x468)]('/auth/v1/user',data);return response['data'][_0x4cbdd2(0x440,0x454)];}catch(_0x349ac9){throw this['handleAuthError'](_0x349ac9);}}['getSession'](){function _0x57573d(_0x57ed9d,_0x3be994){return _0x1e74(_0x57ed9d- -0xa1,_0x3be994);}return this[_0x57573d(0x14a,0x1c0)];}['setSession'](_0x4691ed){this['currentSession']=_0x4691ed,this['httpClient']['setAuthToken'](_0x4691ed[_0x4f703b(0x595,0x546)]);function _0x4f703b(_0x18a235,_0xc0f8ca){return _0x1e74(_0xc0f8ca-0x271,_0x18a235);}typeof localStorage!=='undefined'&&localStorage[_0x4f703b(0x485,0x4b4)](_0x4f703b(0x476,0x4c7),JSON[_0x4f703b(0x50c,0x494)](_0x4691ed));}['onAuthStateChange'](_0x171069){return()=>{};}['setWorkspaceId'](_0x30a24a){this['workspaceId']=_0x30a24a;}[_0x380dd0(-0x5d,-0xd4)](_0x599414){this[_0xeb45f5(0x357,0x2df)]=_0x599414,this[_0xeb45f5(0x409,0x465)]['setAuthToken'](_0x599414[_0xeb45f5(0x441,0x4ba)]);function _0xeb45f5(_0x3b973b,_0x45445b){return _0x1e74(_0x3b973b-0x16c,_0x45445b);}typeof localStorage!=='undefined'&&localStorage['setItem']('ebaas.auth.session',JSON[_0xeb45f5(0x38f,0x3cd)](_0x599414));}['clearSession'](){this['currentSession']=null;function _0x528c0e(_0x5c3082,_0x1be6ba){return _0x1e74(_0x1be6ba- -0x17,_0x5c3082);}this[_0x528c0e(0x21e,0x286)]['removeAuthToken'](),typeof localStorage!==_0x528c0e(0x211,0x22b)&&localStorage['removeItem'](_0x528c0e(0x25c,0x23f));}['loadSession'](){function _0x3854e0(_0x1d5c22,_0x1e6770){return _0x1e74(_0x1d5c22- -0x2ef,_0x1e6770);}if(typeof localStorage!==_0x3854e0(-0xad,-0xf0)){const _0x997318=localStorage['getItem'](_0x3854e0(-0x99,-0xd7));if(_0x997318)try{const _0x46bc4b=JSON['parse'](_0x997318);this['setSessionInternal'](_0x46bc4b);}catch(_0x4d73be){this[_0x3854e0(-0x14,-0x3e)]();}}}['handleAuthError'](_0xce5895){function _0x57e02e(_0x29058b,_0x1e0eae){return _0x1e74(_0x29058b- -0x249,_0x1e0eae);}if(_0xce5895 instanceof EBaaSError)return _0xce5895;return new EBaaSError(_0xce5895[_0x57e02e(0xa,0x4f)]||_0x57e02e(-0x1a,0x31),_0xce5895['status']||0x0,_0xce5895);}}class QueryBuilder{constructor(_0x379803,_0x3794dc,_0x5412a9,_0x2e4023){this[_0x20fbfb(0x3e0,0x411)]=_0x379803,this['table']=_0x3794dc,this['schema']=_0x5412a9;function _0x20fbfb(_0x178790,_0x5478b2){return _0x1e74(_0x178790-0x143,_0x5478b2);}this[_0x20fbfb(0x40d,0x3fd)]=_0x2e4023,this['query']={'filters':[]};}[_0x380dd0(-0x7f,-0x19)](_0x5f09e6='*',_0x144ea2){this[_0x255bd1(0xe3,0x5c)]['select']=_0x5f09e6;function _0x255bd1(_0x5c6675,_0x330d7c){return _0x1e74(_0x5c6675- -0x135,_0x330d7c);}return this;}['insert'](data,_0x46baa2){function _0x4cecd7(_0x46699e,_0x4c717b){return _0x1e74(_0x46699e- -0x12d,_0x4c717b);}return this[_0x4cecd7(0x163,0x1e5)]('POST',_0x4cecd7(0xc3,0x138)+this['table']+_0x4cecd7(0xb6,0x70),{'data':data,'options':_0x46baa2});}[_0x380dd0(-0xde,-0x6f)](data,_0x1cd1d1){this['query']['updateData']=data,this[_0x2c3245(0x3a2,0x363)][_0x2c3245(0x3c2,0x373)]=_0x1cd1d1;function _0x2c3245(_0x5b40d3,_0x8fa0ec){return _0x1e74(_0x8fa0ec-0x14b,_0x5b40d3);}return this;}[_0x380dd0(-0xd5,-0x80)](data,_0x98894b){function _0x21cf30(_0x483b93,_0x1cf16e){return _0x1e74(_0x1cf16e-0xf,_0x483b93);}return this[_0x21cf30(0x30d,0x29f)]('POST','/sdk/v1/'+this[_0x21cf30(0x23f,0x212)]+_0x21cf30(0x25e,0x263),{'data':data,'options':{..._0x98894b,'upsert':!![]}});}[_0x380dd0(-0xc0,-0x98)](_0x35ddef){this[_0x2cc66d(-0x57,-0x99)][_0x2cc66d(0x38,0x69)]=_0x35ddef,this['query'][_0x2cc66d(0x6d,0xde)]=!![];function _0x2cc66d(_0x102d23,_0x5969fb){return _0x1e74(_0x102d23- -0x26f,_0x5969fb);}return this;}['eq'](_0x3a1fce,_0x9295a7){function _0x32b9be(_0x3b5f53,_0x55d887){return _0x1e74(_0x3b5f53- -0xa2,_0x55d887);}return this['query'][_0x32b9be(0x1a7,0x1fc)]['push']({'column':_0x3a1fce,'operator':'eq','value':_0x9295a7}),this;}[_0x380dd0(-0xa,-0x69)](_0x4b0c3a,_0x4caf6c){function _0x3c6738(_0x43a98e,_0xd6ebaf){return _0x1e74(_0x43a98e- -0x367,_0xd6ebaf);}return this['query'][_0x3c6738(-0x11e,-0x136)][_0x3c6738(-0x86,-0x51)]({'column':_0x4b0c3a,'operator':_0x3c6738(-0xb3,-0x66),'value':_0x4caf6c}),this;}['gt'](_0x3b6af3,_0xf26bf8){this[_0x402258(0x3a1,0x421)]['filters']['push']({'column':_0x3b6af3,'operator':'gt','value':_0xf26bf8});function _0x402258(_0x472f90,_0x445069){return _0x1e74(_0x472f90-0x189,_0x445069);}return this;}['gte'](_0x3f2026,_0x4a5d2e){function _0x3e9d60(_0x354a67,_0x369593){return _0x1e74(_0x369593-0x2fe,_0x354a67);}return this[_0x3e9d60(0x4cc,0x516)]['filters'][_0x3e9d60(0x58e,0x5df)]({'column':_0x3f2026,'operator':_0x3e9d60(0x4c9,0x546),'value':_0x4a5d2e}),this;}['lt'](_0x5187f4,_0x2ee65e){function _0x350826(_0x1474ad,_0x24c87d){return _0x1e74(_0x1474ad-0x66,_0x24c87d);}return this[_0x350826(0x27e,0x227)][_0x350826(0x2af,0x247)][_0x350826(0x347,0x3b2)]({'column':_0x5187f4,'operator':'lt','value':_0x2ee65e}),this;}['lte'](_0x509314,_0x499ec6){function _0x5b1ca5(_0xb4cbce,_0x28fd07){return _0x1e74(_0xb4cbce- -0x49,_0x28fd07);}return this[_0x5b1ca5(0x1cf,0x1b5)]['filters'][_0x5b1ca5(0x298,0x24d)]({'column':_0x509314,'operator':'lte','value':_0x499ec6}),this;}[_0x380dd0(-0xbd,-0x13c)](_0x3f3baa,_0x32a124){return this['query']['filters']['push']({'column':_0x3f3baa,'operator':'like','value':_0x32a124}),this;}['ilike'](_0x2dc59d,_0x4d2aea){return this['query']['filters']['push']({'column':_0x2dc59d,'operator':'ilike','value':_0x4d2aea}),this;}['is'](_0x44c1a7,_0x543f62){function _0x3a8875(_0x6ea6a2,_0x189d07){return _0x1e74(_0x189d07-0x18a,_0x6ea6a2);}return this['query'][_0x3a8875(0x44f,0x3d3)][_0x3a8875(0x476,0x46b)]({'column':_0x44c1a7,'operator':'is','value':_0x543f62}),this;}['in'](_0x1d5c8a,_0x5b769f){function _0xfb10b4(_0x4ccb7f,_0xcd3d99){return _0x1e74(_0x4ccb7f-0x346,_0xcd3d99);}return this[_0xfb10b4(0x55e,0x511)]['filters']['push']({'column':_0x1d5c8a,'operator':'in','value':_0x5b769f}),this;}[_0x380dd0(-0x7a,-0x6a)](_0x1cdefe,_0x1e7c84){return this['query']['filters']['push']({'column':_0x1cdefe,'operator':'contains','value':_0x1e7c84}),this;}['match'](_0x24b0fc){return Object['entries'](_0x24b0fc)['forEach'](([_0x5e168e,_0x522e19])=>{this['eq'](_0x5e168e,_0x522e19);}),this;}[_0x380dd0(0x7,-0x4e)](_0x15d554,_0x319dad){!this['query']['order']&&(this['query'][_0xd7fbfa(0x2f1,0x326)]=[]);this['query']['order'][_0xd7fbfa(0x30d,0x303)]({'column':_0x15d554,'ascending':_0x319dad?.[_0xd7fbfa(0x206,0x184)]!==![]});function _0xd7fbfa(_0x3939ef,_0x1b004d){return _0x1e74(_0x3939ef-0x2c,_0x1b004d);}return this;}['limit'](count){function _0x33fba7(_0x383625,_0x3fe7fe){return _0x1e74(_0x383625-0x4e,_0x3fe7fe);}return this[_0x33fba7(0x266,0x20c)]['limit']=count,this;}[_0x380dd0(0x14,0x6d)](from,_0x259932){function _0x159327(_0x1ae9b9,_0x28f6fa){return _0x1e74(_0x1ae9b9-0x34c,_0x28f6fa);}return this['query'][_0x159327(0x61e,0x5b6)]={'from':from,'to':_0x259932},this;}async['execute'](){function _0x19b917(_0x497354,_0x46e759){return _0x1e74(_0x497354- -0x1be,_0x46e759);}if(this['query'][_0x19b917(0x92,0xe)])return this['executeQuery']('PATCH',_0x19b917(0x32,0xd)+this['table'],{'data':this['query'][_0x19b917(0x92,0x38)],'options':this[_0x19b917(0x5a,0x13)]['updateOptions'],'filters':this['query']['filters']});else return this[_0x19b917(0x5a,-0x26)]['isDelete']?this['executeQuery']('DELETE','/sdk/v1/'+this['table']+_0x19b917(0xf7,0x15d),{'options':this['query'][_0x19b917(0xe9,0xb4)],'filters':this[_0x19b917(0x5a,-0x22)][_0x19b917(0x8b,0x101)]}):this[_0x19b917(0xd2,0xbf)]('GET',_0x19b917(0x32,0x35)+this[_0x19b917(0x45,0xcb)]+'?operation=select',{'select':this['query']['select'],'filters':this[_0x19b917(0x5a,-0x17)]['filters'],'order':this[_0x19b917(0x5a,0x1d)][_0x19b917(0x107,0x11e)],'limit':this[_0x19b917(0x5a,0x69)]['limit'],'range':this['query'][_0x19b917(0x114,0x12b)]});}async['single'](){this['limit'](0x1);const result=await this[_0x2cfc93(0x2a6,0x26e)]();function _0x2cfc93(_0x55912a,_0xbb020d){return _0x1e74(_0x55912a-0xa7,_0xbb020d);}return{'data':result[_0x2cfc93(0x32b,0x39b)]?.[0x0]||null,'error':result[_0x2cfc93(0x2cb,0x32e)]};}async[_0x380dd0(-0x2e,-0x8b)](_0x374792,_0x2f3e6a,_0x26ad04){function _0x4d8075(_0x5f4661,_0x1086ad){return _0x1e74(_0x5f4661-0x353,_0x1086ad);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x374792==='GET'){const _0x9dfa56=_0x2f3e6a['split']('?'),_0x649cc9=_0x9dfa56[0x0],existingParams=new URLSearchParams(_0x9dfa56[0x1]||'');if(_0x26ad04['select'])existingParams['append']('select',_0x26ad04[_0x4d8075(0x592,0x53e)]);_0x26ad04['filters']?.[_0x4d8075(0x623,0x64c)]&&_0x26ad04['filters'][_0x4d8075(0x546,0x524)](filter=>{function _0x1a4b62(_0xdf0a21,_0x7d8e35){return _0x1e74(_0x7d8e35- -0x9f,_0xdf0a21);}existingParams[_0x1a4b62(0x25d,0x21f)](filter['column'],filter[_0x1a4b62(0x1ba,0x1f8)]+'.'+filter[_0x1a4b62(0x242,0x243)]);});if(_0x26ad04['order']?.[_0x4d8075(0x623,0x660)]){const orderStr=_0x26ad04['order']['map'](_0x4b6ea1=>''+_0x4b6ea1['column']+(_0x4b6ea1['ascending']?_0x4d8075(0x5b8,0x571):_0x4d8075(0x5d5,0x5e2)))[_0x4d8075(0x5e8,0x5a1)](',');existingParams['append']('order',orderStr);}if(_0x26ad04['limit'])existingParams[_0x4d8075(0x611,0x5d4)](_0x4d8075(0x5e1,0x58d),_0x26ad04['limit'][_0x4d8075(0x54c,0x58a)]());_0x26ad04['range']&&(existingParams['append']('offset',_0x26ad04['range']['from'][_0x4d8075(0x54c,0x5a9)]()),existingParams[_0x4d8075(0x611,0x651)]('limit',(_0x26ad04['range']['to']-_0x26ad04['range'][_0x4d8075(0x587,0x560)]+0x1)[_0x4d8075(0x54c,0x54a)]())),response=await this['httpClient'][_0x4d8075(0x60c,0x672)](_0x649cc9+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x374792==='DELETE'){const _0x14a26a=_0x2f3e6a['split']('?'),_0x515a6d=_0x14a26a[0x0],existingParams=new URLSearchParams(_0x14a26a[0x1]||'');!existingParams['has']('operation')&&existingParams['append'](_0x4d8075(0x5c6,0x5f2),'delete');_0x26ad04[_0x4d8075(0x59c,0x60b)]?.['length']&&_0x26ad04['filters']['forEach'](filter=>{function _0xfbc09e(_0x360554,_0x483d58){return _0x1e74(_0x360554- -0xdb,_0x483d58);}existingParams[_0xfbc09e(0x1e3,0x259)](filter[_0xfbc09e(0x1c9,0x1ad)],filter['operator']+'.'+filter['value']);});const deleteUrl=_0x515a6d+'?'+existingParams[_0x4d8075(0x54c,0x55b)]();console[_0x4d8075(0x572,0x58b)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x4d8075(0x572,0x5d0)]('\uD83D\uDD27 DELETE headers:',headers),console[_0x4d8075(0x572,0x51e)]('\uD83D\uDD27 DELETE filtros originais:',_0x26ad04['filters']),response=await this[_0x4d8075(0x5f0,0x63f)][_0x4d8075(0x551,0x539)](deleteUrl,{'headers':headers});}else{if(_0x374792==='PATCH'){const _0x3b03d8=_0x2f3e6a['split']('?'),_0x5bf148=_0x3b03d8[0x0],existingParams=new URLSearchParams(_0x3b03d8[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x4d8075(0x611,0x5a9)](_0x4d8075(0x5c6,0x5fc),'update');_0x26ad04[_0x4d8075(0x59c,0x58e)]?.[_0x4d8075(0x623,0x5bd)]&&_0x26ad04[_0x4d8075(0x59c,0x56e)][_0x4d8075(0x546,0x575)](filter=>{function _0x4f5c13(_0x2b0505,_0x1fc4c0){return _0x1e74(_0x2b0505- -0x103,_0x1fc4c0);}existingParams['append'](filter[_0x4f5c13(0x1a1,0x160)],filter['operator']+'.'+filter[_0x4f5c13(0x1df,0x1cd)]);});_0x26ad04[_0x4d8075(0x598,0x520)]?.['prefer']&&(headers['Prefer']=_0x26ad04[_0x4d8075(0x598,0x547)][_0x4d8075(0x562,0x552)]);const updateUrl=_0x5bf148+'?'+existingParams[_0x4d8075(0x54c,0x504)]();response=await this[_0x4d8075(0x5f0,0x5e5)][_0x4d8075(0x614,0x620)](updateUrl,_0x26ad04['data'],{'headers':headers});}else{let _0x5c4569=_0x26ad04['data'];!headers[_0x4d8075(0x534,0x51d)]&&(headers['Prefer']=_0x4d8075(0x633,0x676)),_0x26ad04[_0x4d8075(0x598,0x5a2)]?.[_0x4d8075(0x53c,0x5ae)]&&(headers[_0x4d8075(0x534,0x559)]=_0x4d8075(0x52b,0x4b6)),_0x26ad04['dataArray']&&(_0x5c4569=_0x26ad04['dataArray']),response=await this['httpClient'][_0x4d8075(0x55f,0x4dc)](_0x2f3e6a,_0x5c4569,{'headers':headers});}}}return{'data':response[_0x4d8075(0x5d7,0x61c)],'error':null,'count':response['headers']?.['x-total-count']?parseInt(response['headers'][_0x4d8075(0x57f,0x53a)]):undefined};}catch(_0x1e79d9){return{'data':null,'error':_0x1e79d9 instanceof EBaaSError?_0x1e79d9:new EBaaSError(_0x1e79d9 instanceof Error?_0x1e79d9[_0x4d8075(0x5a6,0x555)]:'Database\x20operation\x20failed',0x0,_0x1e79d9)};}}}class CustomDatabaseManager{constructor(_0x193e0b,_0x536553){function _0x35d0d6(_0x4cdff7,_0x491863){return _0x1e74(_0x4cdff7-0x383,_0x491863);}this[_0x35d0d6(0x620,0x64e)]=_0x193e0b,this['workspaceId']=_0x536553;}async['detectCustomDatabase'](){function _0x32d35d(_0x5796aa,_0x1eb300){return _0x1e74(_0x5796aa-0x14b,_0x1eb300);}if(!this['workspaceId'])return{'hasCustomDatabase':![]};try{const response=await this[_0x32d35d(0x3e8,0x3fe)][_0x32d35d(0x404,0x484)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x32d35d(0x395,0x3ba)]===0xc8&&response[_0x32d35d(0x3cf,0x3fe)]?.['config']){const config=response['data']['config'],_0x24a0e4={'host':config[_0x32d35d(0x32f,0x2e3)],'port':config[_0x32d35d(0x41a,0x422)],'database':config['postgresDatabase'],'username':config[_0x32d35d(0x3c8,0x3ff)],'password':'','schema':config[_0x32d35d(0x3c4,0x377)],'sslEnabled':config['sslEnabled']};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x24a0e4},this[_0x32d35d(0x422,0x3e5)];}}catch(_0x4996c9){if(_0x4996c9?.[_0x32d35d(0x395,0x406)]===0x194)return this[_0x32d35d(0x422,0x44e)]={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x4996c9);}return this[_0x32d35d(0x422,0x3ec)]={'hasCustomDatabase':![]},this[_0x32d35d(0x422,0x3f1)];}async['testConnection'](_0x2673cc){function _0x34b87b(_0x4f63cc,_0x4051c6){return _0x1e74(_0x4051c6-0x1ac,_0x4f63cc);}try{const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database/test-connection',_0x2673cc,{'headers':this[_0x34b87b(0x476,0x476)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response[_0x34b87b(0x487,0x430)];}catch(_0x2c1089){return{'success':![],'message':_0x2c1089?.[_0x34b87b(0x380,0x3ff)]||_0x34b87b(0x455,0x41a)};}}async[_0x380dd0(-0x5c,-0xaa)](_0x1264b4){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x1264b4},{'headers':{'X-Workspace-ID':this['workspaceId']}});function _0x3d9da6(_0x2e4431,_0x1aae6c){return _0x1e74(_0x2e4431-0x40,_0x1aae6c);}const config=response[_0x3d9da6(0x2c4,0x32e)][_0x3d9da6(0x2ff,0x2cd)];return this[_0x3d9da6(0x317,0x31a)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x1264b4},config;}async[_0x380dd0(-0xc7,-0xbc)](){function _0x27466e(_0x41b51d,_0x259212){return _0x1e74(_0x259212- -0x331,_0x41b51d);}if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');await this['httpClient']['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this[_0x27466e(0x1e,-0x5a)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}['hasCustomDatabase'](){function _0x25434e(_0xef13a3,_0x494c33){return _0x1e74(_0xef13a3- -0x39e,_0x494c33);}return this[_0x25434e(-0xc7,-0xfd)]?.['hasCustomDatabase']??![];}['getCustomCredentials'](){function _0x48f45b(_0x2ff8c3,_0x813406){return _0x1e74(_0x2ff8c3-0x4f,_0x813406);}return this['detectedConfig']?.[_0x48f45b(0x2cf,0x314)];}['setWorkspaceId'](_0x3e3006){function _0xb2b1a(_0x376713,_0x3750f3){return _0x1e74(_0x376713-0x0,_0x3750f3);}this[_0xb2b1a(0x2ca,0x2be)]=_0x3e3006,this[_0xb2b1a(0x2d7,0x2b9)]=undefined;}['getWorkspaceId'](){function _0xd71a44(_0x294244,_0x4e51b3){return _0x1e74(_0x294244- -0x5,_0x4e51b3);}return this[_0xd71a44(0x2c5,0x2d2)];}['getStatus'](){function _0x4afbba(_0x1e731a,_0x1195e7){return _0x1e74(_0x1e731a- -0x1ea,_0x1195e7);}return{'workspaceId':this[_0x4afbba(0xe0,0x65)],'hasConfig':this[_0x4afbba(0x61,0x60)](),'configDetails':this['detectedConfig']?.[_0x4afbba(0x96,0x102)]?{'host':this['detectedConfig'][_0x4afbba(0x96,0x41)][_0x4afbba(0x47,0x9d)],'port':this[_0x4afbba(0xed,0x8e)]['credentials']['port'],'database':this['detectedConfig'][_0x4afbba(0x96,0x23)][_0x4afbba(0x6d,0x31)],'schema':this[_0x4afbba(0xed,0xf8)][_0x4afbba(0x96,0x100)][_0x4afbba(0x87,0x83)]||_0x4afbba(0xef,0xc0),'sslEnabled':this[_0x4afbba(0xed,0x80)][_0x4afbba(0x96,0x58)][_0x4afbba(0xea,0xb7)]||![]}:undefined};}}class DatabaseClient{constructor(_0x3f2eb5,_0x49b496){this['httpClient']=_0x3f2eb5,this['customDatabaseManager']=new CustomDatabaseManager(_0x3f2eb5,_0x49b496);}[_0x380dd0(-0x8a,-0x37)](_0x33f185){function _0x2b33ee(_0x363720,_0x12c06f){return _0x1e74(_0x12c06f-0x125,_0x363720);}return new QueryBuilder(this[_0x2b33ee(0x3a4,0x3c2)],_0x33f185,this[_0x2b33ee(0x393,0x3c7)],this[_0x2b33ee(0x33c,0x333)]['getWorkspaceId']());}[_0x380dd0(-0x60,-0x5c)](_0x5abbe8,_0x344661){function _0x4d1465(_0x5a0979,_0x278928){return _0x1e74(_0x278928-0x1f0,_0x5a0979);}return this['httpClient']['post'](_0x4d1465(0x3be,0x3e4)+_0x5abbe8,_0x344661);}[_0x380dd0(-0x4d,-0x4b)](_0x379bfe){const _0x84d399=new DatabaseClient(this[_0x565ef8(0x177,0x102)],this['customDatabaseManager']['getWorkspaceId']());_0x84d399[_0x565ef8(0xd2,0x107)]=_0x379bfe,_0x84d399[_0x565ef8(0x57,0x73)]=this['customDatabaseManager'];function _0x565ef8(_0x2d1539,_0x248d6f){return _0x1e74(_0x248d6f- -0x19b,_0x2d1539);}return _0x84d399;}async['detectCustomDatabase'](){function _0x1dfcd8(_0x2df3b8,_0x10b120){return _0x1e74(_0x2df3b8- -0x249,_0x10b120);}return this[_0x1dfcd8(-0x3b,-0x49)][_0x1dfcd8(-0x1b,0x5b)]();}async[_0x380dd0(-0x6d,-0xba)](_0x4d7c4f){function _0x1d1eb0(_0x48a69d,_0x454ea9){return _0x1e74(_0x48a69d- -0x2ed,_0x454ea9);}return this[_0x1d1eb0(-0xdf,-0x110)][_0x1d1eb0(-0xe4,-0x86)](_0x4d7c4f);}async[_0x380dd0(-0x5c,-0x9b)](_0x51aed7){function _0x5bad61(_0x93c24a,_0x4dd569){return _0x1e74(_0x4dd569- -0x1ec,_0x93c24a);}return this[_0x5bad61(0x60,0x22)][_0x5bad61(0xc1,0x76)](_0x51aed7);}async[_0x380dd0(-0xc7,-0x50)](){return this['customDatabaseManager']['removeCustomDatabase']();}[_0x380dd0(-0xa1,-0x7c)](){function _0x1faf9b(_0x96d0d2,_0x76e4fa){return _0x1e74(_0x76e4fa-0x29a,_0x96d0d2);}return this[_0x1faf9b(0x4c3,0x4a8)]['hasCustomDatabase']();}[_0x380dd0(0x5,0x69)](){function _0x50ae12(_0x599435,_0x31d3d1){return _0x1e74(_0x599435-0x36c,_0x31d3d1);}return this[_0x50ae12(0x57a,0x5cc)]['getStatus']();}[_0x380dd0(-0x20,-0x2c)](_0x472451){function _0x14280b(_0x19d2e5,_0x295054){return _0x1e74(_0x19d2e5-0x234,_0x295054);}this[_0x14280b(0x442,0x473)][_0x14280b(0x4d2,0x4a5)](_0x472451);}async[_0x380dd0(-0xb4,-0x11a)](){function _0x4b104f(_0x42f64c,_0x57cebb){return _0x1e74(_0x57cebb- -0x2b6,_0x42f64c);}try{await this['customDatabaseManager']['detectCustomDatabase']();}catch(_0x48f9eb){console[_0x4b104f(-0x7f,-0x22)]('Failed to initialize custom database detection:',_0x48f9eb);}}}class StorageBucket{constructor(_0x180f47,bucketId){function _0x229303(_0x29d379,_0x21247e){return _0x1e74(_0x21247e- -0x357,_0x29d379);}this['httpClient']=_0x180f47,this[_0x229303(-0x93,-0xc1)]=bucketId;}async[_0x380dd0(-0x25,0x7)](_0x3cf555,_0x1ef64c,_0x269af9){function _0x3c6a10(_0x3526b5,_0x219d44){return _0x1e74(_0x219d44-0x158,_0x3526b5);}try{const _0x2d544a=new FormData();if(_0x1ef64c instanceof File)_0x2d544a[_0x3c6a10(0x3c2,0x416)](_0x3c6a10(0x2d7,0x334),_0x1ef64c);else{if(_0x1ef64c instanceof Blob)_0x2d544a['append'](_0x3c6a10(0x37e,0x334),_0x1ef64c,_0x3cf555);else{if(_0x1ef64c instanceof ArrayBuffer)_0x2d544a['append'](_0x3c6a10(0x399,0x334),new Blob([_0x1ef64c]),_0x3cf555);else typeof _0x1ef64c==='string'&&_0x2d544a['append']('file',new Blob([_0x1ef64c],{'type':'text/plain'}),_0x3cf555);}}_0x2d544a['append'](_0x3c6a10(0x2d1,0x346),_0x3cf555);_0x269af9?.[_0x3c6a10(0x3d8,0x3a5)]&&_0x2d544a['append']('cacheControl',_0x269af9['cacheControl']);_0x269af9?.['contentType']&&_0x2d544a[_0x3c6a10(0x3de,0x416)]('contentType',_0x269af9[_0x3c6a10(0x3e9,0x399)]);_0x269af9?.[_0x3c6a10(0x44e,0x41f)]&&_0x2d544a[_0x3c6a10(0x484,0x416)]('metadata',JSON['stringify'](_0x269af9['metadata']));const _0x12bd41=_0x3c6a10(0x40a,0x3b3)+this[_0x3c6a10(0x41b,0x3ee)]+'/files'+(_0x269af9?.['upsert']?_0x3c6a10(0x379,0x3aa):''),response=await this[_0x3c6a10(0x3da,0x3f5)][_0x3c6a10(0x350,0x364)](_0x12bd41,_0x2d544a,{'headers':{'Content-Type':_0x3c6a10(0x31f,0x360)}});return{'data':response[_0x3c6a10(0x3cc,0x3dc)],'error':null};}catch(_0x1a9214){return{'data':null,'error':_0x1a9214 instanceof EBaaSError?_0x1a9214:new EBaaSError(_0x1a9214 instanceof Error?_0x1a9214['message']:'Failed\x20to\x20upload\x20file',0x0,_0x1a9214)};}}async['download'](_0x12773b,_0x931d62){function _0x283aa4(_0x4475e0,_0x28d738){return _0x1e74(_0x28d738-0x320,_0x4475e0);}try{const _0x17133d=new URLSearchParams();_0x931d62?.['transform']&&Object[_0x283aa4(0x57f,0x5a8)](_0x931d62['transform'])['forEach'](([_0x12c9d5,_0x57ed27])=>{function _0x8449cb(_0xfada08,_0x1e28e0){return _0x1e74(_0xfada08-0x3e4,_0x1e28e0);}_0x57ed27!==undefined&&_0x17133d[_0x8449cb(0x6a2,0x69d)](_0x12c9d5,String(_0x57ed27));});const _0x4c832d='/storage/buckets/'+this[_0x283aa4(0x607,0x5b6)]+_0x283aa4(0x540,0x5ac)+_0x12773b+(_0x17133d[_0x283aa4(0x4a2,0x519)]()?'?'+_0x17133d[_0x283aa4(0x59b,0x519)]():''),response=await this['httpClient'][_0x283aa4(0x5fe,0x5d9)](_0x4c832d,{'responseType':'blob'});return{'data':response[_0x283aa4(0x5b9,0x5a4)],'error':null};}catch(_0x1c2331){return{'data':null,'error':_0x1c2331 instanceof EBaaSError?_0x1c2331:new EBaaSError(_0x1c2331 instanceof Error?_0x1c2331[_0x283aa4(0x5ee,0x573)]:'Failed\x20to\x20download\x20file',0x0,_0x1c2331)};}}async[_0x380dd0(-0x9c,-0x7c)](_0x55b0d9,_0x1caecb){function _0x2a9989(_0x20355c,_0x3ccaea){return _0x1e74(_0x3ccaea- -0x9b,_0x20355c);}try{const _0x42b467=new URLSearchParams();_0x55b0d9&&_0x42b467[_0x2a9989(0x1f7,0x223)]('prefix',_0x55b0d9);_0x1caecb?.[_0x2a9989(0x171,0x1f3)]&&_0x42b467['append'](_0x2a9989(0x18c,0x1f3),String(_0x1caecb[_0x2a9989(0x222,0x1f3)]));_0x1caecb?.['offset']&&_0x42b467['append'](_0x2a9989(0x2ae,0x236),String(_0x1caecb['offset']));_0x1caecb?.['sortBy']&&_0x42b467[_0x2a9989(0x1c7,0x223)](_0x2a9989(0x169,0x17c),JSON[_0x2a9989(0x1e2,0x188)](_0x1caecb[_0x2a9989(0x145,0x17c)]));_0x1caecb?.[_0x2a9989(0x25e,0x1dd)]&&_0x42b467['append']('search',_0x1caecb[_0x2a9989(0x1c7,0x1dd)]);const _0x5a9dcc=_0x2a9989(0x1a2,0x1c0)+this['bucketId']+_0x2a9989(0xe1,0x14d)+(_0x42b467['toString']()?'?'+_0x42b467[_0x2a9989(0x10c,0x15e)]():''),response=await this[_0x2a9989(0x1ea,0x202)]['get'](_0x5a9dcc);return{'data':response[_0x2a9989(0x22d,0x1e9)],'error':null};}catch(_0x17316b){return{'data':null,'error':_0x17316b instanceof EBaaSError?_0x17316b:new EBaaSError(_0x17316b instanceof Error?_0x17316b['message']:_0x2a9989(0x116,0x140),0x0,_0x17316b)};}}async[_0x380dd0(-0x61,-0x47)](_0x1999ff){function _0x38ed74(_0x56f3ff,_0x199b84){return _0x1e74(_0x56f3ff- -0x2cd,_0x199b84);}try{const response=await this['httpClient']['delete'](_0x38ed74(-0x72,-0xbb)+this[_0x38ed74(-0x37,-0xb7)]+_0x38ed74(-0xe5,-0x6b),{'data':{'paths':_0x1999ff}});return{'data':response[_0x38ed74(-0x49,-0x22)],'error':null};}catch(_0x2beaec){return{'data':null,'error':_0x2beaec instanceof EBaaSError?_0x2beaec:new EBaaSError(_0x2beaec instanceof Error?_0x2beaec['message']:'Failed\x20to\x20remove\x20files',0x0,_0x2beaec)};}}async[_0x380dd0(-0xd4,-0x76)](fromPath,_0x1b0294){function _0x48a39d(_0x56ebbe,_0x2f85da){return _0x1e74(_0x56ebbe- -0x1e1,_0x2f85da);}try{const response=await this[_0x48a39d(0xbc,0x138)]['post']('/storage/buckets/'+this[_0x48a39d(0xb5,0x13a)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x1b0294});return{'data':response['data'],'error':null};}catch(_0x3cf934){return{'data':null,'error':_0x3cf934 instanceof EBaaSError?_0x3cf934:new EBaaSError(_0x3cf934 instanceof Error?_0x3cf934[_0x48a39d(0x72,0x2)]:_0x48a39d(0x8a,0x56),0x0,_0x3cf934)};}}async['copy'](fromPath,_0x17affd){function _0x16cf16(_0x2780e0,_0xc88fff){return _0x1e74(_0x2780e0- -0x21,_0xc88fff);}try{const response=await this[_0x16cf16(0x27c,0x302)][_0x16cf16(0x1eb,0x1c3)]('/storage/buckets/'+this[_0x16cf16(0x275,0x250)]+_0x16cf16(0x270,0x256),{'sourceKey':fromPath,'destinationKey':_0x17affd});return{'data':response['data'],'error':null};}catch(_0x2c84f7){return{'data':null,'error':_0x2c84f7 instanceof EBaaSError?_0x2c84f7:new EBaaSError(_0x2c84f7 instanceof Error?_0x2c84f7[_0x16cf16(0x232,0x1e4)]:_0x16cf16(0x1c1,0x1a6),0x0,_0x2c84f7)};}}async[_0x380dd0(0x15,0x82)](_0x55459a,_0x1a15be,_0x4feebc){function _0x120ba9(_0x1bab40,_0x5e7c37){return _0x1e74(_0x1bab40- -0x109,_0x5e7c37);}try{const response=await this[_0x120ba9(0x194,0x172)]['post']('/storage/buckets/'+this[_0x120ba9(0x18d,0x1d1)]+_0x120ba9(0x183,0x165)+_0x55459a+'/sign',{'expiresIn':_0x1a15be,..._0x4feebc});return{'data':response['data'],'error':null};}catch(_0x348f63){return{'data':null,'error':_0x348f63 instanceof EBaaSError?_0x348f63:new EBaaSError(_0x348f63 instanceof Error?_0x348f63['message']:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x348f63)};}}['getPublicUrl'](_0x12de6f,_0x4ad2bf){const _0x769bb1=new URLSearchParams();_0x4ad2bf?.[_0x33a1ce(0x546,0x503)]&&Object[_0x33a1ce(0x534,0x4f0)](_0x4ad2bf['transform'])[_0x33a1ce(0x49f,0x4c5)](([_0x53736b,_0x5f36e1])=>{function _0x185521(_0x2b830e,_0x655f04){return _0x1e74(_0x655f04-0x114,_0x2b830e);}_0x5f36e1!==undefined&&_0x769bb1[_0x185521(0x42f,0x3d2)](_0x53736b,String(_0x5f36e1));});const _0x3b52d4=this['httpClient'][_0x33a1ce(0x4c7,0x444)]||'',_0x4dfb1f=_0x3b52d4+_0x33a1ce(0x507,0x520)+this['bucketId']+'/files/'+_0x12de6f+(_0x769bb1[_0x33a1ce(0x4a5,0x464)]()?'?'+_0x769bb1['toString']():'');function _0x33a1ce(_0x2ef0f0,_0x1cd8a7){return _0x1e74(_0x2ef0f0-0x2ac,_0x1cd8a7);}return{'data':{'publicUrl':_0x4dfb1f}};}async['getFileInfo'](_0xcc7b47){function _0x10a4a4(_0x3e4f44,_0x4b3019){return _0x1e74(_0x3e4f44- -0x24c,_0x4b3019);}try{const response=await this['httpClient']['get']('/storage/buckets/'+this['bucketId']+_0x10a4a4(0x40,0xe)+_0xcc7b47+_0x10a4a4(0x7d,0xda));return{'data':response[_0x10a4a4(0x38,0xe)],'error':null};}catch(_0x1c3bc3){return{'data':null,'error':_0x1c3bc3 instanceof EBaaSError?_0x1c3bc3:new EBaaSError(_0x1c3bc3 instanceof Error?_0x1c3bc3[_0x10a4a4(0x7,0x28)]:_0x10a4a4(-0x10,0x3d),0x0,_0x1c3bc3)};}}async['updateFileMetadata'](_0xd99093,metadata){function _0x4fd7a7(_0x5e2db5,_0x5c6c5a){return _0x1e74(_0x5e2db5-0x6c,_0x5c6c5a);}try{const response=await this['httpClient']['put']('/storage/buckets/'+this['bucketId']+_0x4fd7a7(0x2f8,0x295)+_0xd99093+'/metadata',{'metadata':metadata});return{'data':response[_0x4fd7a7(0x2f0,0x288)],'error':null};}catch(_0x433ca2){return{'data':null,'error':_0x433ca2 instanceof EBaaSError?_0x433ca2:new EBaaSError(_0x433ca2 instanceof Error?_0x433ca2['message']:_0x4fd7a7(0x344,0x36f),0x0,_0x433ca2)};}}}class StorageClient{constructor(_0x3070b6){this['httpClient']=_0x3070b6;}['from'](bucketId){function _0x3f6f89(_0x474c56,_0x5687e9){return _0x1e74(_0x5687e9-0x38d,_0x474c56);}return new StorageBucket(this[_0x3f6f89(0x5c5,0x62a)],bucketId);}async[_0x380dd0(-0xa0,-0xb2)](_0x5df0d2,_0x1ec910){function _0x1b2d76(_0x56b352,_0x41c1f6){return _0x1e74(_0x56b352- -0x3df,_0x41c1f6);}try{const response=await this['httpClient']['post'](_0x1b2d76(-0x156,-0xe8),{'id':_0x5df0d2,..._0x1ec910});return{'data':response['data'],'error':null};}catch(_0x5109e4){return{'data':null,'error':_0x5109e4 instanceof EBaaSError?_0x5109e4:new EBaaSError(_0x5109e4 instanceof Error?_0x5109e4['message']:_0x1b2d76(-0x11d,-0x16d),0x0,_0x5109e4)};}}async[_0x380dd0(-0x3d,-0x88)](_0x3b01d4){function _0x2daa24(_0x1678e2,_0x4dc882){return _0x1e74(_0x4dc882-0x7b,_0x1678e2);}try{const response=await this['httpClient']['get'](_0x2daa24(0x300,0x2d6)+_0x3b01d4);return{'data':response['data'],'error':null};}catch(_0x17c82e){return{'data':null,'error':_0x17c82e instanceof EBaaSError?_0x17c82e:new EBaaSError(_0x17c82e instanceof Error?_0x17c82e[_0x2daa24(0x263,0x2ce)]:_0x2daa24(0x31a,0x29b),0x0,_0x17c82e)};}}async[_0x380dd0(-0x2b,-0x8e)](){function _0x2d7453(_0x28733c,_0x4f3a5c){return _0x1e74(_0x28733c- -0x2f2,_0x4f3a5c);}try{const response=await this['httpClient'][_0x2d7453(-0x39,-0x1c)](_0x2d7453(-0x69,-0x66));return{'data':response[_0x2d7453(-0x6e,-0xea)],'error':null};}catch(_0x2ceaa2){return{'data':null,'error':_0x2ceaa2 instanceof EBaaSError?_0x2ceaa2:new EBaaSError(_0x2ceaa2 instanceof Error?_0x2ceaa2['message']:_0x2d7453(-0x51,-0x3f),0x0,_0x2ceaa2)};}}async['updateBucket'](_0x456389,_0x465eca){function _0x977caa(_0x157f1f,_0x42cb9d){return _0x1e74(_0x157f1f-0x73,_0x42cb9d);}try{const response=await this[_0x977caa(0x310,0x303)][_0x977caa(0x277,0x2bc)](_0x977caa(0x2ce,0x28d)+_0x456389,_0x465eca);return{'data':response['data'],'error':null};}catch(_0x2d7f98){return{'data':null,'error':_0x2d7f98 instanceof EBaaSError?_0x2d7f98:new EBaaSError(_0x2d7f98 instanceof Error?_0x2d7f98[_0x977caa(0x2c6,0x2f4)]:'Failed\x20to\x20update\x20bucket',0x0,_0x2d7f98)};}}async[_0x380dd0(-0xe1,-0xb1)](_0x44edbb){function _0x49a667(_0x5a1dec,_0x4943d7){return _0x1e74(_0x5a1dec- -0x22c,_0x4943d7);}try{const response=await this['httpClient']['delete']('/storage/buckets/'+_0x44edbb);return{'data':response[_0x49a667(0x58,0x31)],'error':null};}catch(_0x5349d6){return{'data':null,'error':_0x5349d6 instanceof EBaaSError?_0x5349d6:new EBaaSError(_0x5349d6 instanceof Error?_0x5349d6[_0x49a667(0x27,-0x1e)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x5349d6)};}}async[_0x380dd0(-0x31,0x4d)](){function _0x47443c(_0x9e2361,_0x212467){return _0x1e74(_0x212467- -0x341,_0x9e2361);}try{const response=await this[_0x47443c(-0x38,-0xa4)][_0x47443c(-0x5b,-0x88)]('/storage/usage');return{'data':response['data'],'error':null};}catch(_0x2bf1c0){return{'data':null,'error':_0x2bf1c0 instanceof EBaaSError?_0x2bf1c0:new EBaaSError(_0x2bf1c0 instanceof Error?_0x2bf1c0['message']:_0x47443c(-0xf2,-0x7d),0x0,_0x2bf1c0)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x17c49c,_0x4c9063){super(),this[_0x34b7e6(-0x50,-0x81)]=![],this['state']='closed',this[_0x34b7e6(-0x66,-0x33)]=new Map();function _0x34b7e6(_0x528147,_0x34bb04){return _0x1e74(_0x528147- -0x2d6,_0x34bb04);}this[_0x34b7e6(-0x10,-0x59)]=_0x17c49c,this[_0x34b7e6(-0x29,-0x8f)]=_0x4c9063;}['subscribe'](_0x210ffd){function _0x5efecf(_0x7ed5d2,_0x1d6bcc){return _0x1e74(_0x1d6bcc- -0xe2,_0x7ed5d2);}return!this['joinedOnce']&&(this['joinedOnce']=!![],this[_0x5efecf(0xeb,0x145)]()),_0x210ffd&&this['on']('status',_0x210ffd),this;}['onPostgresChanges'](filter,_0x348806){function _0xe4a9e4(_0xd13fdf,_0x349972){return _0x1e74(_0x349972-0x1f7,_0xd13fdf);}const _0x3f98a0=_0xe4a9e4(0x4d4,0x4c3)+JSON['stringify'](filter);super['on'](_0x3f98a0,_0x348806);const _0x4c569e={'unsubscribe':()=>{super['off'](_0x3f98a0,_0x348806);function _0x4a270c(_0x54dfd3,_0x3eb6f9){return _0x1e74(_0x3eb6f9- -0x2ce,_0x54dfd3);}this['subscriptions'][_0x4a270c(-0xdc,-0xd0)](_0x3f98a0);}};return this[_0xe4a9e4(0x439,0x467)]['set'](_0x3f98a0,_0x4c569e),this[_0xe4a9e4(0x521,0x4a4)]?.[_0xe4a9e4(0x435,0x3ce)]&&this[_0xe4a9e4(0x3ef,0x3dd)]===_0xe4a9e4(0x3f1,0x3e4)&&this[_0xe4a9e4(0x49d,0x4a4)][_0xe4a9e4(0x49f,0x42f)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()}),_0x4c569e;}['onBroadcast'](filter,_0x26b092){const _0x5f3fb0=_0x252ee3(0x381,0x308)+JSON['stringify'](filter);super['on'](_0x5f3fb0,_0x26b092);const _0x106d8e={'unsubscribe':()=>{super[_0x1e0bc4(-0x66,-0xa2)](_0x5f3fb0,_0x26b092);function _0x1e0bc4(_0x5c9e50,_0x249a6b){return _0x1e74(_0x5c9e50- -0x310,_0x249a6b);}this[_0x1e0bc4(-0xa0,-0x46)][_0x1e0bc4(-0x112,-0x176)](_0x5f3fb0);}};this['subscriptions']['set'](_0x5f3fb0,_0x106d8e);function _0x252ee3(_0x4c6bbe,_0x187cec){return _0x1e74(_0x187cec-0x81,_0x4c6bbe);}return _0x106d8e;}[_0x380dd0(-0xb8,-0x6d)](filter,_0x29228e){const _0x53d5f5=_0x19f246(-0x139,-0x126)+JSON['stringify'](filter);super['on'](_0x53d5f5,_0x29228e);const _0x50cfe3={'unsubscribe':()=>{super[_0x304c33(0x2e8,0x27a)](_0x53d5f5,_0x29228e);function _0x304c33(_0x567737,_0x57c69c){return _0x1e74(_0x57c69c- -0x30,_0x567737);}this[_0x304c33(0x231,0x240)][_0x304c33(0x1cc,0x1ce)](_0x53d5f5);}};function _0x19f246(_0x1c4f22,_0x27a505){return _0x1e74(_0x27a505- -0x38e,_0x1c4f22);}return this[_0x19f246(-0x172,-0x11e)]['set'](_0x53d5f5,_0x50cfe3),_0x50cfe3;}[_0x380dd0(-0x51,-0x23)](_0x4bdae8){return new Promise(_0x168abf=>{function _0x49ba36(_0x5005ac,_0x4a7cd7){return _0x1e74(_0x5005ac-0x2ee,_0x4a7cd7);}this[_0x49ba36(0x59b,0x54d)]?.[_0x49ba36(0x4c5,0x4cb)]&&this['state']==='joined'?(this['socket']['emit'](_0x49ba36(0x543,0x58b),{'topic':this['topic'],'event':_0x4bdae8[_0x49ba36(0x5cd,0x5a3)],'payload':_0x4bdae8,'ref':this['makeRef']()}),_0x168abf('ok')):_0x168abf('error');});}[_0x380dd0(-0xb9,-0x139)](_0x5d2c74){return new Promise(_0x2c1eeb=>{function _0x1081c7(_0x38f699,_0x511222){return _0x1e74(_0x38f699-0x384,_0x511222);}this[_0x1081c7(0x631,0x68d)]?.[_0x1081c7(0x55b,0x5da)]&&this['state']===_0x1081c7(0x571,0x506)?(this['socket']['emit']('presence',{'topic':this[_0x1081c7(0x64a,0x662)],'event':'track','payload':_0x5d2c74,'ref':this[_0x1081c7(0x607,0x62c)]()}),_0x2c1eeb('ok')):_0x2c1eeb(_0x1081c7(0x5a8,0x5ea));});}['untrack'](){return new Promise(_0x49d47a=>{function _0x41581e(_0x22cafb,_0x1b8545){return _0x1e74(_0x1b8545-0x242,_0x22cafb);}this['socket']?.[_0x41581e(0x3df,0x419)]&&this['state']===_0x41581e(0x48d,0x42f)?(this['socket'][_0x41581e(0x45e,0x47a)](_0x41581e(0x4b1,0x4bc),{'topic':this['topic'],'event':_0x41581e(0x547,0x4d4),'ref':this['makeRef']()}),_0x49d47a('ok')):_0x49d47a(_0x41581e(0x41d,0x466));});}[_0x380dd0(-0x8b,-0x14)](){return new Promise(_0x3661ea=>{function _0xfd222e(_0x2451eb,_0x57ecc1){return _0x1e74(_0x57ecc1-0x217,_0x2451eb);}this[_0xfd222e(0x42b,0x3fd)]='leaving',this[_0xfd222e(0x46d,0x487)][_0xfd222e(0x44b,0x40a)](_0x485c9d=>{function _0x5cb14b(_0x23bc9e,_0xb7b936){return _0x1e74(_0xb7b936- -0x37,_0x23bc9e);}_0x485c9d[_0x5cb14b(0x1c3,0x1fc)]();}),this[_0xfd222e(0x4b7,0x487)][_0xfd222e(0x4fc,0x4d4)](),this[_0xfd222e(0x536,0x4c4)]?.['connected']&&this[_0xfd222e(0x490,0x4c4)]['emit'](_0xfd222e(0x472,0x451),{'topic':this[_0xfd222e(0x498,0x4dd)],'ref':this[_0xfd222e(0x4ea,0x49a)]()}),this['state']=_0xfd222e(0x426,0x455),this['removeAllListeners'](),_0x3661ea('ok');});}['_join'](){if(this['state']===_0x1c9fcd(0x2c5,0x2d0))return;this[_0x1c9fcd(0x23f,0x2bf)]=_0x1c9fcd(0x248,0x1f5);function _0x1c9fcd(_0x34b36a,_0xb3bf91){return _0x1e74(_0x34b36a-0x59,_0xb3bf91);}this[_0x1c9fcd(0x306,0x303)]?.['connected']&&(this['socket']['emit'](_0x1c9fcd(0x2ee,0x2e3),{'topic':this['topic'],'ref':this[_0x1c9fcd(0x2dc,0x329)]()}),setTimeout(()=>{function _0x228d2b(_0x3e4bfb,_0x30c8ed){return _0x1e74(_0x3e4bfb- -0x24c,_0x30c8ed);}this['state']==='joining'&&(this[_0x228d2b(-0x66,0x1f)]='joined',this['emit'](_0x228d2b(-0x2,-0x81),'SUBSCRIBED'));},0x64));}[_0x380dd0(-0x13,-0x10)](){function _0x3bf1a2(_0x3c41e7,_0x59d6f3){return _0x1e74(_0x59d6f3- -0xba,_0x3c41e7);}this[_0x3bf1a2(0x1d1,0x1cc)]&&(this['_join'](),this[_0x3bf1a2(0x18f,0x1b6)][_0x3bf1a2(0x19e,0x139)]((_0x443d7f,_0x1bcbb9)=>{function _0x3d007b(_0x3a2db6,_0x3a4a00){return _0x1e74(_0x3a4a00- -0x24e,_0x3a2db6);}if(_0x1bcbb9['startsWith']('postgres_changes:')){const filter=JSON[_0x3d007b(-0x27,0x26)](_0x1bcbb9[_0x3d007b(0x51,0x27)](_0x3d007b(0x5a,0x7e),''));this['socket']?.[_0x3d007b(0x26,-0x16)]('subscribe_postgres_changes',{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()});}}));}[_0x380dd0(-0xd7,-0x77)](_0x58f321,_0x553f28){function _0x4fb701(_0x44e2fe,_0x361a32){return _0x1e74(_0x361a32- -0x216,_0x44e2fe);}if(_0x58f321===_0x4fb701(0x45,0x54)){const _0x86c8e4='postgres_changes:'+JSON['stringify'](_0x553f28[_0x4fb701(0x57,0x96)]||{});this[_0x4fb701(0x59,0x22)](_0x86c8e4,_0x553f28);}else{if(_0x58f321===_0x4fb701(0x8f,0x3f)){const _0x3cc6be=_0x4fb701(0xbc,0x71)+JSON[_0x4fb701(-0x35,0xd)]({'event':_0x553f28[_0x4fb701(0x88,0xc9)]});this['emit'](_0x3cc6be,_0x553f28);}else{if(_0x58f321===_0x4fb701(-0x9,0x64)){const _0x290e1c='presence:'+JSON['stringify']({'event':_0x553f28[_0x4fb701(0x87,0xc9)]});this[_0x4fb701(0x64,0x22)](_0x290e1c,_0x553f28);}}}this[_0x4fb701(0x16,0x22)](_0x58f321,_0x553f28);}['_setState'](_0x81c58f){this['state']=_0x81c58f;let status;switch(_0x81c58f){case'joined':status='SUBSCRIBED';break;case _0x78a67c(0x3c6,0x3d9):status=_0x78a67c(0x379,0x3b6);break;case _0x78a67c(0x2de,0x341):status='CLOSED';break;default:return;}function _0x78a67c(_0x33888c,_0x13fa78){return _0x1e74(_0x13fa78-0x103,_0x33888c);}this['emit'](_0x78a67c(0x30d,0x34d),status);}[_0x380dd0(-0x3b,-0xc1)](){function _0x206c4d(_0x4ec48c,_0x34db45){return _0x1e74(_0x34db45-0x310,_0x4ec48c);}return Math[_0x206c4d(0x5be,0x576)]()['toString'](0x24)['substring'](0x2,0xf);}[_0x380dd0(-0x77,-0xee)](){function _0x4817ba(_0x6e049b,_0x3e78c2){return _0x1e74(_0x6e049b-0x94,_0x3e78c2);}return this[_0x4817ba(0x27a,0x2ee)];}}class RealtimeClient{constructor(_0x541e78,_0x25ab69,_0x240560={}){this[_0x1a5fb8(0x56,0xac)]=null,this['channels']=new Map(),this[_0x1a5fb8(-0x5c,-0xe2)]='disconnected',this['reconnectAttempts']=0x0,this[_0x1a5fb8(0xd,-0x44)]=0x5,this['url']=_0x541e78;function _0x1a5fb8(_0x3bbac3,_0x1746f9){return _0x1e74(_0x3bbac3- -0x257,_0x1746f9);}this[_0x1a5fb8(0x4f,0xe)]=_0x25ab69,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x240560};}[_0x380dd0(-0x4c,-0x6a)](){return new Promise((_0x1b6be3,_0x372e6f)=>{if(this[_0x583fce(-0x44,-0xba)]?.[_0x583fce(-0x141,-0x190)]){_0x1b6be3();return;}this[_0x583fce(-0x10d,-0x16c)]=_0x583fce(-0x81,-0xc2);function _0x583fce(_0x199e1d,_0x266a62){return _0x1e74(_0x266a62- -0x367,_0x199e1d);}this['socket']=socket_ioClient['io'](this[_0x583fce(-0xc4,-0xf1)],{'auth':{'apikey':this['apiKey']},'transports':[_0x583fce(-0x6a,-0xc4)],'reconnection':!![],'reconnectionDelay':this['options'][_0x583fce(-0x79,-0xcb)],'reconnectionAttempts':this['options']['maxReconnectAttempts'],...this[_0x583fce(-0xfb,-0x122)]['socketOptions']}),this[_0x583fce(-0xff,-0xba)]['on']('connect',()=>{this[_0x5c10a9(-0x236,-0x1e4)]='connected',this['reconnectAttempts']=0x0;function _0x5c10a9(_0x5e115f,_0x38e87b){return _0x1e74(_0x38e87b- -0x3df,_0x5e115f);}this[_0x5c10a9(-0x124,-0x130)](),_0x1b6be3();}),this[_0x583fce(-0x4e,-0xba)]['on'](_0x583fce(-0x17e,-0x127),_0x216e0e=>{this[_0x476a12(0x3c6,0x3df)]='disconnected';function _0x476a12(_0x4a78f7,_0x53bb79){return _0x1e74(_0x53bb79-0x1e4,_0x4a78f7);}this['channels'][_0x476a12(0x391,0x3d7)](channel=>{function _0xd444e1(_0x49e87d,_0x11bac3){return _0x1e74(_0x11bac3-0x227,_0x49e87d);}channel[_0xd444e1(0x3c9,0x43c)]('closed');});}),this[_0x583fce(-0x133,-0xba)]['on']('connect_error',_0x17ee10=>{this[_0x6545f(-0x1ce,-0x1b6)]=_0x6545f(-0x1f4,-0x18d),this[_0x6545f(-0xdb,-0x14a)]++;function _0x6545f(_0x472dec,_0x222010){return _0x1e74(_0x222010- -0x3b1,_0x472dec);}this['reconnectAttempts']>=this[_0x6545f(-0x135,-0x14d)]&&_0x372e6f(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+'\x20attempts:\x20'+_0x17ee10['message']));}),this[_0x583fce(-0xb4,-0xba)]['on'](_0x583fce(-0x119,-0x12c),()=>{this['connectionState']='connected',this['reconnectAttempts']=0x0,this['channels']['forEach'](channel=>{function _0x33dbc1(_0xe1a2d,_0x3b2c2c){return _0x1e74(_0xe1a2d-0x215,_0x3b2c2c);}channel[_0x33dbc1(0x4c0,0x4fa)]();});}),this[_0x583fce(-0x97,-0xba)]['on']('postgres_changes',_0x402665=>{function _0x290734(_0x22f6a0,_0x4e6adf){return _0x1e74(_0x22f6a0-0x106,_0x4e6adf);}const channel=this[_0x290734(0x3c0,0x3db)]['get'](_0x402665['topic']);channel&&channel[_0x290734(0x2ed,0x370)](_0x290734(0x370,0x3a6),_0x402665);}),this[_0x583fce(-0xf9,-0xba)]['on']('broadcast',_0x59d7d4=>{const channel=this['channels'][_0x1b0c79(-0x80,-0x66)](_0x59d7d4[_0x1b0c79(-0x73,-0xec)]);function _0x1b0c79(_0x2476b8,_0x448082){return _0x1e74(_0x2476b8- -0x339,_0x448082);}channel&&channel['_trigger']('broadcast',_0x59d7d4);}),this['socket']['on']('presence',_0x3f5b2f=>{const channel=this['channels']['get'](_0x3f5b2f['topic']);function _0x2a90a2(_0x353c53,_0x151a12){return _0x1e74(_0x151a12- -0x22a,_0x353c53);}channel&&channel[_0x2a90a2(-0xb,-0x43)](_0x2a90a2(0x77,0x50),_0x3f5b2f);});});}['disconnect'](){function _0xc9f3c7(_0x153385,_0x21d1f2){return _0x1e74(_0x153385-0x297,_0x21d1f2);}this['socket']&&(this[_0xc9f3c7(0x544,0x5b3)]['disconnect'](),this[_0xc9f3c7(0x544,0x4f3)]=null),this[_0xc9f3c7(0x492,0x4b5)]='disconnected',this[_0xc9f3c7(0x551,0x5bc)]['clear']();}['channel'](_0x171a3f){if(this['channels'][_0x2b8c53(0x375,0x2ef)](_0x171a3f))return this['channels']['get'](_0x171a3f);const channel=new RealtimeChannel(_0x171a3f,this['socket']);function _0x2b8c53(_0x2db242,_0x5385c6){return _0x1e74(_0x5385c6-0xc5,_0x2db242);}return this[_0x2b8c53(0x34e,0x37f)][_0x2b8c53(0x354,0x380)](_0x171a3f,channel),this['connectionState']===_0x2b8c53(0x31e,0x29c)&&channel['_join'](),channel;}['removeChannel'](channel){const _0x410b92=channel['topic'];function _0x918fa7(_0x5b35c2,_0x3590a7){return _0x1e74(_0x3590a7- -0x2,_0x5b35c2);}this[_0x918fa7(0x26b,0x2b8)][_0x918fa7(0x231,0x228)](_0x410b92)&&(this[_0x918fa7(0x33e,0x2b8)]['delete'](_0x410b92),channel['unsubscribe']());}[_0x380dd0(-0x6f,-0x96)](){this['channels'][_0x4e1534(0x29d,0x2cc)](channel=>{channel['unsubscribe']();});function _0x4e1534(_0x4ad8ed,_0x1dbc14){return _0x1e74(_0x1dbc14-0xd9,_0x4ad8ed);}this[_0x4e1534(0x3ad,0x393)]['clear']();}[_0x380dd0(-0x2,0x10)](){function _0x58e7a7(_0x464506,_0x4f68db){return _0x1e74(_0x4f68db- -0x39c,_0x464506);}return Array[_0x58e7a7(-0x10d,-0x168)](this[_0x58e7a7(-0xc2,-0xe2)]['values']());}[_0x380dd0(-0xab,-0x12f)](){return this['connectionState']==='connected'&&!!this['socket']?.['connected'];}['getConnectionState'](){function _0x1607cc(_0x480d4e,_0x58610b){return _0x1e74(_0x58610b-0x21f,_0x480d4e);}return this[_0x1607cc(0x429,0x41a)];}['onConnectionStateChange'](_0x5346bf){const _0x369f9f=()=>_0x5346bf(this['connectionState']);function _0x393989(_0x2548e0,_0x549fa9){return _0x1e74(_0x2548e0- -0x310,_0x549fa9);}return this[_0x393989(-0x63,-0x63)]&&(this['socket']['on'](_0x393989(-0x9e,-0xa9),()=>{this[_0x43c679(-0x148,-0x11e)]=_0x43c679(-0x16c,-0x11d);function _0x43c679(_0x21eac7,_0x57cf82){return _0x1e74(_0x21eac7- -0x343,_0x57cf82);}_0x369f9f();}),this['socket']['on']('disconnect',()=>{this[_0x4f8f32(-0x121,-0x139)]=_0x4f8f32(-0xef,-0x137);function _0x4f8f32(_0x749bb1,_0x512d8d){return _0x1e74(_0x512d8d- -0x334,_0x749bb1);}_0x369f9f();}),this['socket']['on']('connect_error',()=>{this['connectionState']=_0x2a0757(0x507,0x48e);function _0x2a0757(_0x270470,_0x1037e9){return _0x1e74(_0x1037e9-0x26a,_0x270470);}_0x369f9f();})),()=>{function _0x5ccb08(_0x124d50,_0x2cba93){return _0x1e74(_0x124d50-0x326,_0x2cba93);}this[_0x5ccb08(0x5d3,0x573)]&&(this[_0x5ccb08(0x5d3,0x5ad)]['off']('connect',_0x369f9f),this['socket'][_0x5ccb08(0x5d0,0x5a5)]('disconnect',_0x369f9f),this[_0x5ccb08(0x5d3,0x5f6)][_0x5ccb08(0x5d0,0x592)](_0x5ccb08(0x57e,0x594),_0x369f9f));};}[_0x380dd0(-0xf,-0x4f)](){function _0x2c572d(_0xe62dd2,_0x1c0fa5){return _0x1e74(_0xe62dd2-0x1f9,_0x1c0fa5);}if(!this[_0x2c572d(0x43e,0x4be)]['heartbeatInterval']||!this['socket'])return;const interval=setInterval(()=>{function _0x469673(_0x4364ae,_0x3c6270){return _0x1e74(_0x3c6270-0x1c0,_0x4364ae);}this[_0x469673(0x41a,0x46d)]?.['connected']?this['socket']['emit']('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this['options'][_0x2c572d(0x3f1,0x446)]);}['_getSocket'](){return this['socket'];}}function _0x1e74(_0x576199,_0x307e20){const _0x1cdf35=_0x1cdf();return _0x1e74=function(_0x1e7434,_0x377c80){_0x1e7434=_0x1e7434-0x1d7;let _0x2d00db=_0x1cdf35[_0x1e7434];if(_0x1e74['Kkwdhz']===undefined){var _0x39163f=function(_0x2654f9){const _0x50eccd='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4b2024='',_0x11a356='';for(let _0xca3659=0x0,_0x1fa99a,_0xc51147,_0x401c05=0x0;_0xc51147=_0x2654f9['charAt'](_0x401c05++);~_0xc51147&&(_0x1fa99a=_0xca3659%0x4?_0x1fa99a*0x40+_0xc51147:_0xc51147,_0xca3659++%0x4)?_0x4b2024+=String['fromCharCode'](0xff&_0x1fa99a>>(-0x2*_0xca3659&0x6)):0x0){_0xc51147=_0x50eccd['indexOf'](_0xc51147);}for(let _0x97c3ba=0x0,_0x470896=_0x4b2024['length'];_0x97c3ba<_0x470896;_0x97c3ba++){_0x11a356+='%'+('00'+_0x4b2024['charCodeAt'](_0x97c3ba)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x11a356);};_0x1e74['azvcem']=_0x39163f,_0x576199=arguments,_0x1e74['Kkwdhz']=!![];}const _0x407ffb=_0x1cdf35[0x0],_0x7a429c=_0x1e7434+_0x407ffb,_0x1c7a90=_0x576199[_0x7a429c];return!_0x1c7a90?(_0x2d00db=_0x1e74['azvcem'](_0x2d00db),_0x576199[_0x7a429c]=_0x2d00db):_0x2d00db=_0x1c7a90,_0x2d00db;},_0x1e74(_0x576199,_0x307e20);}class FunctionsClient{constructor(_0x1629c0){this['httpClient']=_0x1629c0;}async['invoke'](_0x3b4074,_0x264aa6){function _0x13f270(_0x198c2b,_0x1d0b5d){return _0x1e74(_0x1d0b5d-0x1b0,_0x198c2b);}try{const _0x2d65df=_0x264aa6?.[_0x13f270(0x490,0x461)]||'POST',headers={'Content-Type':'application/json',..._0x264aa6?.['headers']};let response;const _0x337e9e='/functions/v1/'+_0x3b4074;switch(_0x2d65df[_0x13f270(0x392,0x3b0)]()){case'GET':response=await this['httpClient']['get'](_0x337e9e,{'headers':headers,'params':_0x264aa6?.['body']});break;case'POST':response=await this['httpClient'][_0x13f270(0x39f,0x3bc)](_0x337e9e,_0x264aa6?.[_0x13f270(0x3b6,0x43b)],{'headers':headers});break;case'PUT':response=await this['httpClient']['put'](_0x337e9e,_0x264aa6?.['body'],{'headers':headers});break;case'PATCH':response=await this['httpClient']['patch'](_0x337e9e,_0x264aa6?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x13f270(0x480,0x44d)]['delete'](_0x337e9e,{'headers':headers,'data':_0x264aa6?.[_0x13f270(0x468,0x43b)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x2d65df,0x190);}return{'data':response[_0x13f270(0x424,0x434)],'error':null};}catch(_0x3b678a){return{'data':null,'error':_0x3b678a instanceof EBaaSError?_0x3b678a:new EBaaSError(_0x3b678a instanceof Error?_0x3b678a[_0x13f270(0x3e9,0x403)]:'Function\x20invocation\x20failed',0x0,_0x3b678a)};}}async[_0x380dd0(-0x9c,-0x103)](){function _0x25869f(_0x51bedb,_0x35a14c){return _0x1e74(_0x35a14c- -0x345,_0x51bedb);}try{const response=await this[_0x25869f(-0x3c,-0xa8)][_0x25869f(-0x38,-0x8c)]('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x2810f3){return{'data':null,'error':_0x2810f3 instanceof EBaaSError?_0x2810f3:new EBaaSError(_0x2810f3 instanceof Error?_0x2810f3[_0x25869f(-0x109,-0xf2)]:'Failed\x20to\x20list\x20functions',0x0,_0x2810f3)};}}async[_0x380dd0(-0x5,-0x48)](_0xfb7c0e){function _0x925c95(_0x131bdf,_0x1bbc0d){return _0x1e74(_0x1bbc0d- -0x24a,_0x131bdf);}try{const response=await this[_0x925c95(0x4b,0x53)]['get']('/functions/v1/'+_0xfb7c0e+_0x925c95(0x76,0x7f));return{'data':response[_0x925c95(0x5a,0x3a)],'error':null};}catch(_0x410ae0){return{'data':null,'error':_0x410ae0 instanceof EBaaSError?_0x410ae0:new EBaaSError(_0x410ae0 instanceof Error?_0x410ae0[_0x925c95(-0x75,0x9)]:_0x925c95(0x45,0x7e),0x0,_0x410ae0)};}}async[_0x380dd0(-0xa2,-0x68)](_0x527668,_0x5b0c05){function _0x1d7014(_0x3fd432,_0x5a1e26){return _0x1e74(_0x3fd432-0x230,_0x5a1e26);}try{const _0x24d06d=new FormData();if(_0x5b0c05[_0x1d7014(0x48a,0x477)]instanceof File)_0x24d06d['append']('code',_0x5b0c05['code']);else typeof _0x5b0c05['code']==='string'&&_0x24d06d[_0x1d7014(0x4ee,0x559)](_0x1d7014(0x48a,0x472),new Blob([_0x5b0c05[_0x1d7014(0x48a,0x436)]],{'type':_0x1d7014(0x4fd,0x549)}),_0x1d7014(0x4a7,0x501));_0x5b0c05['entrypoint']&&_0x24d06d[_0x1d7014(0x4ee,0x55e)](_0x1d7014(0x493,0x489),_0x5b0c05[_0x1d7014(0x493,0x474)]);_0x5b0c05['env']&&_0x24d06d[_0x1d7014(0x4ee,0x471)](_0x1d7014(0x40e,0x40a),JSON['stringify'](_0x5b0c05[_0x1d7014(0x40e,0x40b)]));_0x5b0c05['importMap']&&_0x24d06d[_0x1d7014(0x4ee,0x520)](_0x1d7014(0x4de,0x4e9),JSON[_0x1d7014(0x453,0x3df)](_0x5b0c05[_0x1d7014(0x4de,0x457)]));_0x5b0c05['verify']!==undefined&&_0x24d06d['append']('verify',String(_0x5b0c05[_0x1d7014(0x446,0x45e)]));const response=await this['httpClient']['post'](_0x1d7014(0x426,0x4ab)+_0x527668+_0x1d7014(0x50e,0x48a),_0x24d06d,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x1d7014(0x4b4,0x4ec)],'error':null};}catch(_0x5c0fd5){return{'data':null,'error':_0x5c0fd5 instanceof EBaaSError?_0x5c0fd5:new EBaaSError(_0x5c0fd5 instanceof Error?_0x5c0fd5[_0x1d7014(0x483,0x4fc)]:_0x1d7014(0x449,0x473),0x0,_0x5c0fd5)};}}async[_0x380dd0(-0xc0,-0xc4)](_0x38c032){function _0x47bc32(_0x445d35,_0x39cc1d){return _0x1e74(_0x39cc1d- -0x376,_0x445d35);}try{const response=await this[_0x47bc32(-0xac,-0xd9)]['delete']('/functions/v1/'+_0x38c032);return{'data':response['data'],'error':null};}catch(_0x3382f2){return{'data':null,'error':_0x3382f2 instanceof EBaaSError?_0x3382f2:new EBaaSError(_0x3382f2 instanceof Error?_0x3382f2['message']:_0x47bc32(-0x1e9,-0x18a),0x0,_0x3382f2)};}}async['updateEnv'](_0x594b44,_0xe478){function _0x41c9b6(_0x4d9736,_0x5b1321){return _0x1e74(_0x5b1321- -0xdd,_0x4d9736);}try{const response=await this['httpClient']['put'](_0x41c9b6(0x112,0x119)+_0x594b44+'/env',{'env':_0xe478});return{'data':response['data'],'error':null};}catch(_0x57bc0f){return{'data':null,'error':_0x57bc0f instanceof EBaaSError?_0x57bc0f:new EBaaSError(_0x57bc0f instanceof Error?_0x57bc0f[_0x41c9b6(0x11e,0x176)]:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x57bc0f)};}}async[_0x380dd0(-0xc2,-0x5a)](_0x5e2b56,_0x453798){function _0x175ae8(_0x2cfb6a,_0x35485a){return _0x1e74(_0x35485a-0x1b7,_0x2cfb6a);}try{const _0x3a8bb9=new URLSearchParams();_0x453798?.['limit']&&_0x3a8bb9['append'](_0x175ae8(0x43d,0x445),String(_0x453798[_0x175ae8(0x463,0x445)]));_0x453798?.['offset']&&_0x3a8bb9['append'](_0x175ae8(0x4eb,0x488),String(_0x453798['offset']));_0x453798?.[_0x175ae8(0x3a6,0x3e9)]&&_0x3a8bb9[_0x175ae8(0x495,0x475)]('level',_0x453798[_0x175ae8(0x3a3,0x3e9)]);const _0x34f27b='/functions/v1/'+_0x5e2b56+'/logs'+(_0x3a8bb9['toString']()?'?'+_0x3a8bb9['toString']():''),response=await this['httpClient']['get'](_0x34f27b);return{'data':response['data'],'error':null};}catch(_0x20e6c7){return{'data':null,'error':_0x20e6c7 instanceof EBaaSError?_0x20e6c7:new EBaaSError(_0x20e6c7 instanceof Error?_0x20e6c7['message']:_0x175ae8(0x3d5,0x426),0x0,_0x20e6c7)};}}async[_0x380dd0(-0x81,-0x95)](_0x49e32e,_0x401668){function _0x37e201(_0x49a955,_0x50b610){return _0x1e74(_0x49a955- -0x59,_0x50b610);}try{const _0x4d7f4b=new URLSearchParams();_0x401668?.[_0x37e201(0x199,0x19e)]&&_0x4d7f4b['append']('period',_0x401668[_0x37e201(0x199,0x17e)]);const _0x487202='/functions/v1/'+_0x49e32e+'/metrics'+(_0x4d7f4b[_0x37e201(0x1a0,0x222)]()?'?'+_0x4d7f4b['toString']():''),response=await this[_0x37e201(0x244,0x1ff)]['get'](_0x487202);return{'data':response[_0x37e201(0x22b,0x258)],'error':null};}catch(_0x262438){return{'data':null,'error':_0x262438 instanceof EBaaSError?_0x262438:new EBaaSError(_0x262438 instanceof Error?_0x262438[_0x37e201(0x1fa,0x1ae)]:_0x37e201(0x1b9,0x169),0x0,_0x262438)};}}}class EBaaSClient{constructor(_0x2bd860,_0x5ac3c1,_0x410d79){this[_0x2759a4(0x42c,0x444)]=_0x410d79,this['httpClient']=new HttpClient({'url':_0x2bd860,'apiKey':_0x5ac3c1,'timeout':0x7530,'headers':_0x410d79?.['global']?.[_0x2759a4(0x404,0x428)]}),this[_0x2759a4(0x42d,0x489)]=new AuthClient(this[_0x2759a4(0x45f,0x49c)],_0x410d79?.['database']?.[_0x2759a4(0x516,0x4c9)]),this[_0x2759a4(0x3f3,0x456)]=new DatabaseClient(this['httpClient'],_0x410d79?.['database']?.[_0x2759a4(0x546,0x4c9)]),this['storage']=new StorageClient(this['httpClient']);function _0x2759a4(_0x23cadf,_0x14623e){return _0x1e74(_0x14623e-0x1ff,_0x23cadf);}this[_0x2759a4(0x38f,0x3d8)]=new RealtimeClient(_0x2bd860,_0x5ac3c1,_0x410d79?.[_0x2759a4(0x3a6,0x3d8)]),this['functions']=new FunctionsClient(this[_0x2759a4(0x47c,0x49c)]),this['initializeCustomDatabase']();}['from'](_0x4d73a4){function _0xcc23b2(_0x2953f8,_0x178c45){return _0x1e74(_0x178c45-0x1b3,_0x2953f8);}return this[_0xcc23b2(0x42f,0x40a)][_0xcc23b2(0x469,0x3e7)](_0x4d73a4);}[_0x380dd0(-0x60,-0xe2)](_0x3a45d0,_0x2d5682){function _0x1728d8(_0xc8d7ff,_0x1591ab){return _0x1e74(_0x1591ab-0xc1,_0xc8d7ff);}return this['database'][_0x1728d8(0x31c,0x31f)](_0x3a45d0,_0x2d5682);}[_0x380dd0(-0xdf,-0xd1)](_0x14b74c){function _0x3e6608(_0x563f61,_0x4adb5c){return _0x1e74(_0x563f61-0xc6,_0x4adb5c);}return this['storage'][_0x3e6608(0x2fa,0x2c0)](_0x14b74c);}['channel'](_0x438c0c){function _0x523d04(_0x291967,_0x37e2e2){return _0x1e74(_0x37e2e2-0x14,_0x291967);}return this[_0x523d04(0x174,0x1ed)][_0x523d04(0x2f0,0x290)](_0x438c0c);}['invoke'](_0x32662e,_0x41c7d2){return this['functions']['invoke'](_0x32662e,_0x41c7d2);}async[_0x380dd0(-0xbc,-0x79)](){function _0x42fae6(_0x2ac057,_0x2a6242){return _0x1e74(_0x2a6242- -0x25d,_0x2ac057);}if(this[_0x42fae6(-0xa,-0x18)]?.['database']?.['autoDetectCustomDatabase'])try{await this[_0x42fae6(-0x7c,-0x6)]['initialize']();}catch(_0x35c674){console['warn']('Failed to initialize custom database detection:',_0x35c674);}}async[_0x380dd0(-0x20,0x16)](_0xc135b1){function _0x53be49(_0x716094,_0x2c8b5f){return _0x1e74(_0x716094- -0x24a,_0x2c8b5f);}this['auth']['setWorkspaceId'](_0xc135b1),this[_0x53be49(0xd,-0x45)]['setWorkspaceId'](_0xc135b1),this['options']?.['database']?.['autoDetectCustomDatabase']&&await this[_0x53be49(0xd,0x60)]['initialize']();}async[_0x380dd0(-0x5c,-0x7f)](_0x17a54f){function _0x5bcb43(_0x8cbd1f,_0x362b8d){return _0x1e74(_0x8cbd1f-0x5f,_0x362b8d);}await this[_0x5bcb43(0x2b6,0x291)]['configureCustomDatabase'](_0x17a54f);}['getCustomDatabaseStatus'](){function _0x2ffb07(_0x40cf0c,_0x2e06ea){return _0x1e74(_0x40cf0c-0x1dd,_0x2e06ea);}return this['database'][_0x2ffb07(0x4a0,0x4d7)]();}}function createClient(_0x4ad928,_0x347026,_0x554284){return new EBaaSClient(_0x4ad928,_0x347026,_0x554284);}const version=_0x380dd0(-0x62,-0x62);exports[_0x380dd0(-0xc,0x20)]=AuthClient;function _0x380dd0(_0x3b5777,_0x578716){return _0x1e74(_0x3b5777- -0x2be,_0x578716);}exports['CustomDatabaseManager']=CustomDatabaseManager,exports[_0x380dd0(-0x8,-0x2e)]=DatabaseClient,exports[_0x380dd0(-0x87,-0x87)]=EBaaSClient,exports[_0x380dd0(-0xa4,-0x96)]=EBaaSError,exports[_0x380dd0(-0x26,-0x5)]=FunctionsClient,exports['HttpClient']=HttpClient,exports[_0x380dd0(-0xad,-0xa2)]=QueryBuilder,exports['RealtimeChannel']=RealtimeChannel,exports[_0x380dd0(-0x6,-0x39)]=RealtimeClient,exports['StorageBucket']=StorageBucket,exports['StorageClient']=StorageClient,exports[_0x380dd0(0x10,-0x50)]=createClient,exports[_0x380dd0(-0x99,-0x39)]=version;