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

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.esm.js CHANGED
@@ -1 +1 @@
1
- (function(stringArrayFunction,comparisonValue){function _0x34087f(_0x2af384,_0x518edd){return _0x4d5f(_0x2af384- -0x86,_0x518edd);}const stringArray=stringArrayFunction();while(!![]){try{const _0xd918e6=parseInt(_0x34087f(0xf7,0xab))/0x1*(parseInt(_0x34087f(0xff,0x99))/0x2)+parseInt(_0x34087f(0x5a,0x8e))/0x3+-parseInt(_0x34087f(0xfc,0x9e))/0x4+parseInt(_0x34087f(0xb2,0x107))/0x5+-parseInt(_0x34087f(0xb0,0xe0))/0x6*(-parseInt(_0x34087f(0xc2,0xf8))/0x7)+-parseInt(_0x34087f(0xed,0x111))/0x8+-parseInt(_0x34087f(0x7f,0xf6))/0x9*(parseInt(_0x34087f(0x7c,0x80))/0xa);if(_0xd918e6===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x57be6e){stringArray['push'](stringArray['shift']());}}}(_0x5714,0x2b128));import axios from'axios';import{io}from'socket.io-client';import _0x37dada from'eventemitter3';class EBaaSError extends Error{constructor(_0xde3a40,status=0x0,_0x170bb0){super(_0xde3a40),this[_0xf75ff4(0x261,0x1fa)]=_0xf75ff4(0x225,0x20c);function _0xf75ff4(_0x44dbb6,_0x95bd35){return _0x4d5f(_0x95bd35-0x157,_0x44dbb6);}this['status']=status,this[_0xf75ff4(0x273,0x2a1)]=_0x170bb0,Error[_0xf75ff4(0x1fd,0x243)]&&Error[_0xf75ff4(0x210,0x243)](this,EBaaSError);}['toJSON'](){function _0x43770e(_0x317e3a,_0x175f90){return _0x4d5f(_0x175f90- -0x248,_0x317e3a);}return{'name':this[_0x43770e(-0x200,-0x1a5)],'message':this[_0x43770e(-0x1de,-0x17e)],'status':this[_0x43770e(-0x92,-0xdf)],'details':this['details'],'stack':this[_0x43770e(-0x164,-0x176)]};}['toString'](){function _0x594607(_0x2fa6af,_0x8f9e9){return _0x4d5f(_0x2fa6af- -0x37,_0x8f9e9);}return this[_0x594607(0x6c,0x7f)]+':\x20'+this[_0x594607(0x93,0x3a)]+'\x20(Status:\x20'+this[_0x594607(0x132,0x152)]+')';}}class HttpClient{constructor(config){function _0x495cb5(_0x1c15b4,_0x58aaee){return _0x4d5f(_0x1c15b4-0x32b,_0x58aaee);}this['baseURL']=config[_0x495cb5(0x3f7,0x3d3)],this[_0x495cb5(0x46d,0x444)]=config[_0x495cb5(0x46d,0x47c)],this['client']=axios[_0x495cb5(0x43b,0x3f0)]({'baseURL':this[_0x495cb5(0x496,0x472)],'timeout':config[_0x495cb5(0x3fe,0x428)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this[_0x495cb5(0x420,0x462)]();}[_0x33e61d(-0x18f,-0x119)](){function _0x44691a(_0x3e30dc,_0x1d6373){return _0x4d5f(_0x3e30dc-0x267,_0x1d6373);}this[_0x44691a(0x3ab,0x340)][_0x44691a(0x3c8,0x40c)]['request'][_0x44691a(0x3f0,0x464)](config=>{return config;},_0x3c16db=>{function _0xc9c061(_0x6588e6,_0x5a2f80){return _0x4d5f(_0x6588e6-0x124,_0x5a2f80);}return Promise[_0xc9c061(0x24d,0x2ae)](new EBaaSError(_0xc9c061(0x228,0x1ec),0x0,_0x3c16db));}),this['client']['interceptors'][_0x44691a(0x30c,0x34e)][_0x44691a(0x3f0,0x38b)](response=>{return response;},_0x4008f0=>{function _0x436ce5(_0x506bc3,_0x11d4ce){return _0x4d5f(_0x11d4ce- -0x296,_0x506bc3);}const status=_0x4008f0[_0x436ce5(-0x267,-0x1f1)]?.['status']||0x0,_0x1dd54c=_0x4008f0[_0x436ce5(-0x1ea,-0x1f1)]?.[_0x436ce5(-0x159,-0x158)]?.['message']||_0x4008f0[_0x436ce5(-0x183,-0x1cc)]||'Unknown\x20error',_0x1df225=_0x4008f0['response']?.[_0x436ce5(-0x18c,-0x158)]||_0x4008f0;return Promise['reject'](new EBaaSError(_0x1dd54c,status,_0x1df225));});}async['get'](_0x3ee676,config){function _0x5e2a5e(_0x68bb71,_0x1a31d6){return _0x4d5f(_0x1a31d6- -0x1c3,_0x68bb71);}try{const response=await this[_0x5e2a5e(-0xba,-0x7f)]['get'](_0x3ee676,config);return{'data':response['data'],'status':response[_0x5e2a5e(-0xb2,-0x5a)],'statusText':response['statusText'],'headers':response[_0x5e2a5e(-0x77,-0xda)]};}catch(_0x3e940c){throw this['handleError'](_0x3e940c);}}async['post'](_0x55374b,data,config){function _0x12ed55(_0x4d5d46,_0xa9769){return _0x4d5f(_0xa9769-0xac,_0x4d5d46);}try{const response=await this['client']['post'](_0x55374b,data,config);return{'data':response[_0x12ed55(0x221,0x1ea)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x53b7e1){throw this[_0x12ed55(0x137,0x1a3)](_0x53b7e1);}}async[_0x33e61d(-0x195,-0x14e)](_0x594760,data,config){function _0x5cea4b(_0x4f7d86,_0x41dfde){return _0x4d5f(_0x4f7d86- -0x387,_0x41dfde);}try{const response=await this['client']['put'](_0x594760,data,config);return{'data':response[_0x5cea4b(-0x249,-0x2c3)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0xd4289f){throw this[_0x5cea4b(-0x290,-0x25e)](_0xd4289f);}}async['patch'](_0x5ed043,data,config){function _0x5bba27(_0x239a17,_0x495256){return _0x4d5f(_0x239a17-0x18f,_0x495256);}try{const response=await this['client'][_0x5bba27(0x2ff,0x2b0)](_0x5ed043,data,config);return{'data':response['data'],'status':response[_0x5bba27(0x2f8,0x2e6)],'statusText':response[_0x5bba27(0x299,0x283)],'headers':response['headers']};}catch(_0x40340d){throw this['handleError'](_0x40340d);}}async['delete'](_0x582e10,config){function _0x3d6c6c(_0x21244f,_0x1209aa){return _0x4d5f(_0x1209aa-0x1b7,_0x21244f);}try{const response=await this[_0x3d6c6c(0x32a,0x2fb)][_0x3d6c6c(0x2ab,0x309)](_0x582e10,config);return{'data':response[_0x3d6c6c(0x359,0x2f5)],'status':response['status'],'statusText':response[_0x3d6c6c(0x314,0x2c1)],'headers':response['headers']};}catch(_0x4f984d){throw this[_0x3d6c6c(0x29e,0x2ae)](_0x4f984d);}}['setAuthToken'](_0x253eff){function _0x4fe60c(_0x330c70,_0x9dfe30){return _0x4d5f(_0x330c70-0xc4,_0x9dfe30);}this[_0x4fe60c(0x208,0x26d)][_0x4fe60c(0x1cc,0x189)][_0x4fe60c(0x1ad,0x190)][_0x4fe60c(0x250,0x203)]['Authorization']=_0x4fe60c(0x1d3,0x1c9)+_0x253eff;}[_0x33e61d(-0x115,-0x161)](){function _0x187274(_0x2e8cdc,_0x2a35cb){return _0x4d5f(_0x2e8cdc-0x256,_0x2a35cb);}delete this['client'][_0x187274(0x35e,0x321)][_0x187274(0x33f,0x380)][_0x187274(0x3e2,0x373)]['Authorization'],this['client'][_0x187274(0x35e,0x374)]['headers'][_0x187274(0x3e2,0x3d2)]['Authorization']=_0x187274(0x365,0x363)+this['apiKey'];}[_0x33e61d(-0x179,-0x117)](_0xf88c9a){function _0x1f4da7(_0xb71ae0,_0x1ea03c){return _0x4d5f(_0x1ea03c- -0x210,_0xb71ae0);}if(_0xf88c9a instanceof EBaaSError)return _0xf88c9a;return new EBaaSError(_0xf88c9a['message']||'HTTP\x20request\x20failed',_0xf88c9a[_0x1f4da7(-0x7c,-0xa7)]||0x0,_0xf88c9a);}}class AuthClient{constructor(_0x284532){this[_0x1e79d4(-0x1d6,-0x178)]=null,this['httpClient']=_0x284532;function _0x1e79d4(_0x44d58f,_0x33b074){return _0x4d5f(_0x44d58f- -0x300,_0x33b074);}this[_0x1e79d4(-0x1a5,-0x1d6)]();}async['signUp'](data){function _0x2d573c(_0x388f94,_0x57df51){return _0x4d5f(_0x388f94-0x20,_0x57df51);}try{const response=await this[_0x2d573c(0x148,0x171)]['post'](_0x2d573c(0x121,0x147),data);return response[_0x2d573c(0x15e,0x13f)]['session']&&this['setSessionInternal'](response[_0x2d573c(0x15e,0x1c0)][_0x2d573c(0x11a,0xe4)]),response['data'];}catch(_0x15923e){throw this['handleAuthError'](_0x15923e);}}async['signIn'](data){function _0x16a941(_0x2e5ea8,_0x40f056){return _0x4d5f(_0x2e5ea8-0x32a,_0x40f056);}try{const response=await this[_0x16a941(0x452,0x462)][_0x16a941(0x479,0x493)]('/auth/v1/sdk/signin',data);return response['data']['session']&&this['setSessionInternal'](response[_0x16a941(0x468,0x461)]['session']),response['data'];}catch(_0x2c2ca4){throw this[_0x16a941(0x40f,0x3cc)](_0x2c2ca4);}}async[_0x33e61d(-0xee,-0xdc)](){function _0x163d15(_0x13838a,_0x14c24c){return _0x4d5f(_0x14c24c-0x2a8,_0x13838a);}try{await this['httpClient'][_0x163d15(0x3fa,0x3f7)](_0x163d15(0x3ec,0x407)),this[_0x163d15(0x310,0x357)]();}catch(_0x3ed4fc){this[_0x163d15(0x314,0x357)]();throw this['handleAuthError'](_0x3ed4fc);}}async['getUser'](){function _0x3fbafa(_0x434772,_0x44c3bb){return _0x4d5f(_0x434772-0x6a,_0x44c3bb);}if(!this[_0x3fbafa(0x194,0x179)]?.['access_token'])return null;try{const response=await this['httpClient'][_0x3fbafa(0x15b,0x17e)](_0x3fbafa(0x1af,0x153));return response['data']['user'];}catch(_0x1bc980){if(_0x1bc980 instanceof EBaaSError&&_0x1bc980[_0x3fbafa(0x1d3,0x196)]===0x191)return this[_0x3fbafa(0x119,0x122)](),null;throw this['handleAuthError'](_0x1bc980);}}async[_0x33e61d(-0xf7,-0x121)](){function _0x9073cd(_0x199080,_0x34eb40){return _0x4d5f(_0x199080- -0xac,_0x34eb40);}if(!this['currentSession']?.[_0x9073cd(0x95,0x45)])return null;try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this[_0x9073cd(0x7e,0x3c)][_0x9073cd(0x95,0x69)]});if(response['data'][_0x9073cd(0x4e,0x7b)])return this[_0x9073cd(0xd3,0x96)](response[_0x9073cd(0x92,0xf8)]['session']),response['data'][_0x9073cd(0x4e,0x76)];return null;}catch(_0x1af6e1){this['clearSession']();throw this[_0x9073cd(0x39,0xaf)](_0x1af6e1);}}async[_0x33e61d(-0xcc,-0x123)](_0x4e9b2e){function _0x3326dc(_0x1d26c4,_0x4d9940){return _0x4d5f(_0x1d26c4-0x282,_0x4d9940);}try{await this[_0x3326dc(0x3aa,0x39d)][_0x3326dc(0x3d1,0x37d)]('/auth/v1/reset-password',{'email':_0x4e9b2e});}catch(_0x1c559d){throw this[_0x3326dc(0x367,0x381)](_0x1c559d);}}async[_0x33e61d(-0xf4,-0xd3)](data){function _0x535d9b(_0x564383,_0x5136ed){return _0x4d5f(_0x564383- -0x225,_0x5136ed);}try{const response=await this[_0x535d9b(-0xfd,-0xbd)][_0x535d9b(-0x165,-0x16f)](_0x535d9b(-0xe0,-0x156),data);return response[_0x535d9b(-0xe7,-0x130)]['user'];}catch(_0x512bd6){throw this[_0x535d9b(-0x140,-0xc9)](_0x512bd6);}}['getSession'](){function _0x3cb291(_0x598bbb,_0x55ec9b){return _0x4d5f(_0x598bbb-0x2f1,_0x55ec9b);}return this[_0x3cb291(0x41b,0x42b)];}[_0x33e61d(-0xbe,-0x8f)](_0x57948d){function _0x396102(_0x1a5f01,_0x5ba7b1){return _0x4d5f(_0x1a5f01- -0x1d5,_0x5ba7b1);}this['currentSession']=_0x57948d,this['httpClient']['setAuthToken'](_0x57948d[_0x396102(-0x5e,-0x72)]),typeof localStorage!==_0x396102(-0xa9,-0x11a)&&localStorage['setItem']('ebaas.auth.session',JSON[_0x396102(-0xe3,-0x10a)](_0x57948d));}[_0x33e61d(-0xd7,-0x10f)](_0x349f2d){return()=>{};}['setSessionInternal'](_0xa09d17){this['currentSession']=_0xa09d17,this[_0x2dbf1a(0x1ae,0x1ea)][_0x2dbf1a(0x1a3,0x21e)](_0xa09d17[_0x2dbf1a(0x26a,0x239)]);function _0x2dbf1a(_0x446955,_0x5e72a8){return _0x4d5f(_0x5e72a8-0xc2,_0x446955);}typeof localStorage!=='undefined'&&localStorage[_0x2dbf1a(0x22f,0x240)](_0x2dbf1a(0x1a8,0x217),JSON[_0x2dbf1a(0x193,0x1b4)](_0xa09d17));}[_0x33e61d(-0xf2,-0x15f)](){this['currentSession']=null;function _0x43f10(_0x140d7b,_0x581c1f){return _0x4d5f(_0x140d7b- -0x155,_0x581c1f);}this[_0x43f10(-0x2d,0x24)][_0x43f10(-0xa8,-0x95)](),typeof localStorage!==_0x43f10(-0x29,0x23)&&localStorage[_0x43f10(-0x94,-0x4b)](_0x43f10(0x0,0x54));}[_0x33e61d(-0x9c,-0xb3)](){function _0x48f81a(_0x4d561f,_0x1d453c){return _0x4d5f(_0x4d561f- -0x4a,_0x1d453c);}if(typeof localStorage!==_0x48f81a(0xe2,0xcd)){const _0x25b55b=localStorage[_0x48f81a(0x116,0xb4)](_0x48f81a(0x10b,0x102));if(_0x25b55b)try{const _0x3e3c87=JSON[_0x48f81a(0xa0,0x28)](_0x25b55b);this[_0x48f81a(0xc7,0xfa)](_0x3e3c87);}catch(_0x51075e){this['clearSession']();}}}[_0x33e61d(-0x121,-0x129)](_0x3ed58b){if(_0x3ed58b instanceof EBaaSError)return _0x3ed58b;function _0x4b0a3c(_0x2d5c07,_0x5eaf1c){return _0x4d5f(_0x2d5c07-0x197,_0x5eaf1c);}return new EBaaSError(_0x3ed58b[_0x4b0a3c(0x261,0x275)]||_0x4b0a3c(0x29d,0x289),_0x3ed58b[_0x4b0a3c(0x300,0x344)]||0x0,_0x3ed58b);}}class QueryBuilder{constructor(_0x24bf80,_0x3b90d6,_0x496271,_0x4c69d2){this[_0x4edbfb(0x25b,0x260)]=_0x24bf80,this['table']=_0x3b90d6;function _0x4edbfb(_0x2401b9,_0x3cb814){return _0x4d5f(_0x3cb814-0x138,_0x2401b9);}this['schema']=_0x496271,this['workspaceId']=_0x4c69d2,this['query']={'filters':[]};}[_0x33e61d(-0x5b,-0x92)](_0x4b72e1='*',_0x271802){this[_0x313422(-0x286,-0x293)][_0x313422(-0x1cd,-0x214)]=_0x4b72e1;function _0x313422(_0x4697c5,_0x26559e){return _0x4d5f(_0x4697c5- -0x349,_0x26559e);}return this;}['insert'](data,_0x29492e){function _0x1880b9(_0x451d56,_0x5a6c84){return _0x4d5f(_0x5a6c84-0x77,_0x451d56);}return this['executeQuery']('POST',_0x1880b9(0xfe,0x177)+this[_0x1880b9(0x168,0x191)]+'?operation=insert',{'data':data,'options':_0x29492e});}['update'](data,_0xfab6e3){function _0x244cf2(_0x53e4a8,_0x3160a5){return _0x4d5f(_0x53e4a8- -0x184,_0x3160a5);}return this['executeQuery']('PATCH',_0x244cf2(-0x84,-0x4c)+this[_0x244cf2(-0x6a,-0xf)],{'data':data,'options':_0xfab6e3,'filters':this[_0x244cf2(-0xc1,-0x122)][_0x244cf2(-0xd8,-0xab)]});}[_0x33e61d(-0x155,-0xdb)](data,_0x5d31b4){function _0x2f8b0e(_0x37a389,_0x294df3){return _0x4d5f(_0x37a389- -0x1fb,_0x294df3);}return this['executeQuery']('POST','/sdk/v1/'+this[_0x2f8b0e(-0xe1,-0xc4)]+'?operation=upsert',{'data':data,'options':{..._0x5d31b4,'upsert':!![]}});}['delete'](_0x7c3fc2){function _0x2b991e(_0x590264,_0x5ee6c2){return _0x4d5f(_0x590264- -0x1cc,_0x5ee6c2);}return this[_0x2b991e(-0x48,-0x81)]('DELETE',_0x2b991e(-0xcc,-0xd3)+this[_0x2b991e(-0xb2,-0x75)]+_0x2b991e(-0xb7,-0xef),{'options':_0x7c3fc2,'filters':this['query'][_0x2b991e(-0x120,-0x17e)]});}['eq'](_0x5f574b,_0x1e7f57){this['query']['filters'][_0x1b79fe(0x34c,0x332)]({'column':_0x5f574b,'operator':'eq','value':_0x1e7f57});function _0x1b79fe(_0x3b45a2,_0x132972){return _0x4d5f(_0x132972-0x1ca,_0x3b45a2);}return this;}[_0x33e61d(-0x101,-0x8d)](_0x227d0f,_0x50a918){this['query']['filters']['push']({'column':_0x227d0f,'operator':_0x402edf(0x2d7,0x2fd),'value':_0x50a918});function _0x402edf(_0x28629e,_0x20260e){return _0x4d5f(_0x28629e-0x156,_0x20260e);}return this;}['gt'](_0x49884f,_0x7fd96b){function _0x3e7b5d(_0x4a08d0,_0x4c14b6){return _0x4d5f(_0x4a08d0- -0x2ef,_0x4c14b6);}return this[_0x3e7b5d(-0x22c,-0x217)][_0x3e7b5d(-0x243,-0x245)]['push']({'column':_0x49884f,'operator':'gt','value':_0x7fd96b}),this;}['gte'](_0x5913f7,_0x5b5705){function _0x5cb2e3(_0x353076,_0x9af62c){return _0x4d5f(_0x9af62c- -0x248,_0x353076);}return this[_0x5cb2e3(-0x13a,-0x185)]['filters'][_0x5cb2e3(-0x80,-0xe0)]({'column':_0x5913f7,'operator':_0x5cb2e3(-0xdb,-0x131),'value':_0x5b5705}),this;}['lt'](_0x57bd43,_0xc5a6a1){this['query'][_0x435ed7(0xa5,0xed)][_0x435ed7(0x16a,0x1a9)]({'column':_0x57bd43,'operator':'lt','value':_0xc5a6a1});function _0x435ed7(_0x4474dc,_0x165e86){return _0x4d5f(_0x165e86-0x41,_0x4474dc);}return this;}[_0x33e61d(-0x1b5,-0x13e)](_0x54eb2b,_0xdd7d0c){this['query']['filters'][_0x1c1218(0x37d,0x3b6)]({'column':_0x54eb2b,'operator':_0x1c1218(0x32e,0x31e),'value':_0xdd7d0c});function _0x1c1218(_0x50c4a3,_0x2fbfad){return _0x4d5f(_0x2fbfad-0x24e,_0x50c4a3);}return this;}[_0x33e61d(-0x17f,-0x139)](_0x4f3e87,_0x441432){function _0x139cff(_0x5e62bc,_0x1093c3){return _0x4d5f(_0x1093c3- -0x42,_0x5e62bc);}return this['query'][_0x139cff(0x50,0x6a)][_0x139cff(0x150,0x126)]({'column':_0x4f3e87,'operator':'like','value':_0x441432}),this;}[_0x33e61d(-0x156,-0x16f)](_0x452cb2,_0x35beea){return this['query']['filters']['push']({'column':_0x452cb2,'operator':'ilike','value':_0x35beea}),this;}['is'](_0x47f27e,_0x483d1d){this['query']['filters'][_0xd429dc(0x595,0x524)]({'column':_0x47f27e,'operator':'is','value':_0x483d1d});function _0xd429dc(_0x25e535,_0x598379){return _0x4d5f(_0x598379-0x3bc,_0x25e535);}return this;}['in'](_0x33354a,_0x270b7d){this[_0x127f2a(-0x2bd,-0x31b)]['filters']['push']({'column':_0x33354a,'operator':'in','value':_0x270b7d});function _0x127f2a(_0x5a75cc,_0x2828bd){return _0x4d5f(_0x5a75cc- -0x380,_0x2828bd);}return this;}[_0x33e61d(-0x18b,-0x15d)](_0x1eba7a,_0x4ab8c0){this['query']['filters'][_0x130129(0x20f,0x1a4)]({'column':_0x1eba7a,'operator':'contains','value':_0x4ab8c0});function _0x130129(_0x1ebca1,_0x276688){return _0x4d5f(_0x1ebca1-0xa7,_0x276688);}return this;}['match'](_0x966ce5){return Object['entries'](_0x966ce5)['forEach'](([_0x22d712,_0x438935])=>{this['eq'](_0x22d712,_0x438935);}),this;}[_0x33e61d(-0x194,-0x152)](_0x121259,_0x306658){function _0x509f10(_0x1f76b2,_0x5ef181){return _0x4d5f(_0x1f76b2-0x2be,_0x5ef181);}return!this[_0x509f10(0x381,0x3b7)]['order']&&(this[_0x509f10(0x381,0x3de)][_0x509f10(0x37a,0x308)]=[]),this['query'][_0x509f10(0x37a,0x359)][_0x509f10(0x426,0x407)]({'column':_0x121259,'ascending':_0x306658?.[_0x509f10(0x446,0x417)]!==![]}),this;}['limit'](count){function _0x2ecfc6(_0x4e3c35,_0x2e2c80){return _0x4d5f(_0x2e2c80- -0x3b,_0x4e3c35);}return this['query'][_0x2ecfc6(0x197,0x14c)]=count,this;}['range'](from,_0x200b02){function _0x578dd5(_0x3b235b,_0x4bd3ec){return _0x4d5f(_0x4bd3ec- -0x21e,_0x3b235b);}return this[_0x578dd5(-0x1d4,-0x15b)][_0x578dd5(-0xdf,-0xfb)]={'from':from,'to':_0x200b02},this;}async[_0x33e61d(-0x1a7,-0x140)](){function _0x57903d(_0x5c12e2,_0x24ee8a){return _0x4d5f(_0x5c12e2- -0x252,_0x24ee8a);}return this[_0x57903d(-0xce,-0x108)]('GET',_0x57903d(-0x152,-0x1ac)+this[_0x57903d(-0x138,-0xe2)]+'?operation=select',{'select':this['query']['select'],'filters':this[_0x57903d(-0x18f,-0x196)][_0x57903d(-0x1a6,-0x212)],'order':this['query']['order'],'limit':this[_0x57903d(-0x18f,-0x1a8)]['limit'],'range':this['query']['range']});}async[_0x33e61d(-0x123,-0x15c)](){this[_0x579c8d(0x257,0x209)](0x1);const result=await this[_0x579c8d(0x162,0x150)]();function _0x579c8d(_0x47e132,_0x43cc3e){return _0x4d5f(_0x43cc3e-0x82,_0x47e132);}return{'data':result['data']?.[0x0]||null,'error':result[_0x579c8d(0x14b,0x1a6)]};}async[_0x33e61d(-0x8f,-0x8a)](_0x5d283b,_0x1c08fe,_0x13c41d){function _0x73b9f8(_0x1cd32a,_0x125ea7){return _0x4d5f(_0x1cd32a- -0x233,_0x125ea7);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this[_0x73b9f8(-0x114,-0xf9)]);if(_0x5d283b==='GET'){const _0x5d228a=_0x1c08fe[_0x73b9f8(-0xd6,-0xba)]('?'),_0x4c5855=_0x5d228a[0x0],existingParams=new URLSearchParams(_0x5d228a[0x1]||'');if(_0x13c41d[_0x73b9f8(-0xb7,-0x92)])existingParams[_0x73b9f8(-0x13a,-0x19e)]('select',_0x13c41d['select']);_0x13c41d[_0x73b9f8(-0x187,-0x186)]?.['length']&&_0x13c41d['filters']['forEach'](filter=>{function _0x2e845d(_0x491f9b,_0x3aa6ea){return _0x4d5f(_0x491f9b- -0x1a8,_0x3aa6ea);}existingParams['append'](filter[_0x2e845d(-0x5d,-0xc8)],filter[_0x2e845d(-0x8d,-0x1e)]+'.'+filter[_0x2e845d(-0xeb,-0xc0)]);});if(_0x13c41d['order']?.[_0x73b9f8(-0x198,-0x16f)]){const orderStr=_0x13c41d['order']['map'](_0x2137ce=>''+_0x2137ce[_0x73b9f8(-0xe8,-0x113)]+(_0x2137ce[_0x73b9f8(-0xab,-0xa0)]?'.asc':'.desc'))[_0x73b9f8(-0x12a,-0x154)](',');existingParams['append'](_0x73b9f8(-0x177,-0x1ef),orderStr);}if(_0x13c41d[_0x73b9f8(-0xac,-0x56)])existingParams[_0x73b9f8(-0x13a,-0x126)](_0x73b9f8(-0xac,-0xa8),_0x13c41d['limit']['toString']());_0x13c41d[_0x73b9f8(-0x110,-0xa9)]&&(existingParams['append'](_0x73b9f8(-0x16d,-0x189),_0x13c41d[_0x73b9f8(-0x110,-0x11a)]['from'][_0x73b9f8(-0xcf,-0xee)]()),existingParams['append']('limit',(_0x13c41d['range']['to']-_0x13c41d['range']['from']+0x1)['toString']())),response=await this['httpClient']['get'](_0x4c5855+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x5d283b==='DELETE'){const _0x574b40=_0x1c08fe['split']('?'),_0x131e15=_0x574b40[0x0],existingParams=new URLSearchParams(_0x574b40[0x1]||'');!existingParams[_0x73b9f8(-0xe5,-0xa9)](_0x73b9f8(-0x15b,-0x119))&&existingParams[_0x73b9f8(-0x13a,-0xe8)](_0x73b9f8(-0x15b,-0x111),'delete');_0x13c41d[_0x73b9f8(-0x187,-0x119)]?.['length']&&_0x13c41d[_0x73b9f8(-0x187,-0x150)]['forEach'](filter=>{function _0x42a1b7(_0x4b3ad5,_0xbe7322){return _0x4d5f(_0xbe7322- -0x4c,_0x4b3ad5);}existingParams[_0x42a1b7(0x8f,0xad)](filter[_0x42a1b7(0x115,0xff)],filter[_0x42a1b7(0xc5,0xcf)]+'.'+filter['value']);});const deleteUrl=_0x131e15+'?'+existingParams[_0x73b9f8(-0xcf,-0x124)]();response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x5d283b==='PATCH'){const _0x14f26f=_0x1c08fe['split']('?'),_0x17eafd=_0x14f26f[0x0],existingParams=new URLSearchParams(_0x14f26f[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x73b9f8(-0x13a,-0xe8)](_0x73b9f8(-0x15b,-0x1a2),_0x73b9f8(-0x156,-0x15f));_0x13c41d['filters']?.[_0x73b9f8(-0x198,-0x139)]&&_0x13c41d['filters'][_0x73b9f8(-0xbf,-0xf0)](filter=>{function _0x586643(_0x18dd86,_0x5ce15b){return _0x4d5f(_0x5ce15b- -0x9e,_0x18dd86);}existingParams[_0x586643(-0xb,0x5b)](filter['column'],filter[_0x586643(0x22,0x7d)]+'.'+filter[_0x586643(0x97,0x1f)]);});_0x13c41d[_0x73b9f8(-0xc1,-0x12a)]?.['prefer']&&(headers[_0x73b9f8(-0xb3,-0x98)]=_0x13c41d['options'][_0x73b9f8(-0x11f,-0xf2)]);const updateUrl=_0x17eafd+'?'+existingParams['toString']();response=await this['httpClient']['patch'](updateUrl,_0x13c41d['data'],{'headers':headers});}else{let _0x5f3647=_0x13c41d['data'];!headers['Prefer']&&(headers[_0x73b9f8(-0xb3,-0x104)]='return=representation'),_0x13c41d['options']?.[_0x73b9f8(-0x100,-0xb8)]&&(headers['Prefer']='resolution=merge-duplicates,return=representation'),_0x13c41d[_0x73b9f8(-0x15f,-0x106)]&&(_0x5f3647=_0x13c41d[_0x73b9f8(-0x15f,-0x18a)]),response=await this['httpClient']['post'](_0x1c08fe,_0x5f3647,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x73b9f8(-0x14a,-0x12b)]?.['x-total-count']?parseInt(response[_0x73b9f8(-0x14a,-0x1bc)]['x-total-count']):undefined};}catch(_0x2020a4){return{'data':null,'error':_0x2020a4 instanceof EBaaSError?_0x2020a4:new EBaaSError(_0x2020a4 instanceof Error?_0x2020a4[_0x73b9f8(-0x169,-0x1d5)]:_0x73b9f8(-0xbb,-0x134),0x0,_0x2020a4)};}}}function _0x5714(){const _0x53e1ce=['Cg9ZDgDYzxneyxrHyMfZzq','AgvHCNrIzwf0','C2vHCMnO','DxbKyxrL','Dg9WAwm','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','odK2mta2zMrWvMLr','DgvZDen1C3rVBunVBM5Ly3rPB24','DhjHy2S','l2zPBgvZlW','y3vYCMvUDfnJAgvTyq','AgfUzgXLqxv0AevYCM9Y','C29JA2v0','BgLZDej1y2TLDhm','zw50CNLWB2LUDa','AgvHzgvYCW','CgfYC2u','CMvZzxrqyxnZD29Yza','y2fWDhvYzvn0ywnRvhjHy2u','CMvMCMvZAfnLC3nPB24','l2zPBgvZl2nVChK','Aw5KzxGUDhm','AgfZq3vZDg9Trgf0ywjHC2u','z2v0','C3rYAw5NAwz5','x3jLAM9PBG','y29UBMvJDgLVBLn0yxrL','C2v0DxbjBNrLCMnLChrVCNm','yNvJA2v0swq','AgfUzgXLrxjYB3i','C2v0','yxbWzw5K','C2vZC2LVBG','zxzLBNq','l3nPz24','l3n0B3jHz2uVDxnHz2u','Bgv2zwW','B25bDxrOu3rHDgvdAgfUz2u','l3nKAY92ms8','l2f1DgGVDJeVC2LNBNvW','mZmZntGYmhnSC2nXqq','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','uMvXDwvZDcbMywLSzwq','mtHivLr5DMm','qxv0AgvUDgLJyxrPB24GzMfPBgvK','CMvTB3zLq3vZDg9Trgf0ywjHC2u','zgvMyxvSDhm','AM9PBG','C3rHDhvZvgv4Da','ChjLC2vUy2u6','zw1PDa','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','qMvHCMvYia','y3jLyxrL','C2v0u2vZC2LVBKLUDgvYBMfS','y29WEq','y2fJAgvdB250CM9S','ChjLzMvY','p29WzxjHDgLVBJ1KzwXLDgu','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','z3rL','BwfRzvjLzG','B2zM','DgfIBgu','B3bLCMf0B3i','z2v0vxnHz2u','CMvJB25Uzwn0qxr0zw1WDhm','zMLSDgvY','D29YA3nWywnLswq','Aw52B2TL','CMvTB3zL','yxv0Aa','CMfUz2u','zxjYB3i','l2z1BMn0Aw9UCY92ms8','l2zPBgvZ','CMvJB25Uzwn0','Ahr0CenSAwvUDa','CMvQzwn0','y3vYCMvUDfnLC3nPB24','C3rVCMfNzq','Dw5KzwzPBMvK','zgv0zwn0zwrdB25MAwC','Bwv0ywrHDge','C3rYAw5N','C3vIC2nYAxb0Aw9UCW','BgLZDa','C2LNBK91Da','DxbZzxj0','DxbKyxrLqNvJA2v0','Dw50CMfJAW','nJm2A010v3Pp','DhjHBNnMB3jT','mtm2mdG5nxDsv3zTrq','yNvJA2v0','Aw1WB3j0twfW','DxbKyxrLvxnLCG','zgf0ywjHC2u','zgvSzxrLqNvJA2v0','zgf0yq','AM9PBMvKt25Jzq','DgvZDenVBM5Ly3rPB24','CMvMCMvZAf90B2TLBG','yxbPs2v5','igf0DgvTChrZoIa','y2XPzw50','l2f1DgGVDJeVDxnLCG','Dgv4Dc9WBgfPBG','C2nOzw1H','mtC1ndLLBMnyvwm','C3rHCNrZv2L0Aa','zgv0ywLSCW','y29SDw1U','z2v0qNvJA2v0','C2v0v29YA3nWywnLswq','AgfZ','Cg9ZDa','zMLSzq','yNjVywrJyxn0','zgvSzxrL','Cg9ZDgDYzxnFy2HHBMDLCZO','zNvUy3rPB25Z','zwjHyxmUyxv0Ac5ZzxnZAw9U','ms4WlJa','C29YDej5','Cg9ZDgDYzxniB3n0','DxbSB2fK','x2PVAw4','Bg9HzfnLC3nPB24','C2v0qxv0AfrVA2vU','C3bSAxq','y3jLzgvUDgLHBhm','l2f1DgGVDJeVC2LNBM91Da','z2v0sxrLBq','Aw50zxjJzxb0B3jZ','ChvIBgLJ','C3vIC3rYAw5N','Dg9tDhjPBMC','DMvYAwz5','AgvHCNrIzwf0sw50zxj2ywW','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','ChvZAa','C3rHDhvZ','y29UBMvJDgvK','yMfZzvvsta','z2v0q2HHBM5LBhm','CMvTB3zLq2HHBM5LBa','rMfPBgvKihrVihjLBw92zsbMAwXLCW','y2XVC2vK','Cgf0y2G','C3rHDgu','B3b0Aw9UCW','nJG5nZyWsNDkAM9Q','zM9YrwfJAa','z2v0twv0CMLJCW','yM9KEq','ywnJzxnZx3rVA2vU','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','z2v0v29YA3nWywnLswq','C2v0DxbizwfYDgjLyxq','C2vSzwn0','ntq2oePsvgLxDq','C2v0sxrLBq','C2v0u2vZC2LVBG','uhjLzMvY','BMvX','nti0mdeYB0HXseXK','CMvHBhrPBwu','zxHLy3v0zvf1zxj5','odjzrhr2tgu','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','BgLTAxq','yxnJzw5KAw5N','DxnL','yNjVywrJyxn0oG','ChjLC2vUy2u','y29TBw9U','q0Xpu0ve','y3jLyxrLqNvJA2v0','y3jLyxrLu2LNBMvKvxjS','BgvUz3rO','Dw5ZDwjZy3jPyMu','zw52','y2XLyxi','AwXPA2u','l3jWyY8','Aw5PDgLHBgL6zq','zgv0zwn0q3vZDg9Trgf0ywjHC2u','BMfTzq','rMfPBgvKihrVigXPC3qGzMLSzxm','CMvZCg9UC2u','Cg9ZDgDYzxnFy2HHBMDLCW','Ag9ZDa','zw50CMLLCW','z2v0u3rHDgu','BM93','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','zMLSDgvYCW','CMvTB3zLqxv0AfrVA2vU','CNbJ','y2XLyxjtzxnZAw9U','z2v0tg9NCW','y29UDgfPBNm','C2LUz2XL','BxvSDgLWyxj0l2zVCM0Tzgf0yq','B25qB3n0z3jLC0nOyw5Nzxm','rujHyvnfCNjVCG','x3rYAwDNzxi','C3nSrw5HyMXLza','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','y29UDgvUDfr5Cgu','zgLZy29UBMvJDa','l2LUzM8','B3jKzxi','DMfSDwu','CMfUzg9T','y2HHBM5LBhm','Chv0','CMvTB3zLsxrLBq','AM9PBMvK','CxvLCNK','zg93BMXVywq','y2HHBM5LBa','B2zMC2v0','l3n0B3jHz2uVyNvJA2v0CY8','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','y29UBMvJDa','BwvZC2fNzq','zgLZy29UBMvJDgvK','DxjS','y29Kzq','zxHLy3v0zq','CgvYAw9K','BhrL','Cgf0Aa','C3rHy2S','DgLTzw91Da','zgf0yufYCMf5','BgLRzq','zNjVBq','z2v0uhvIBgLJvxjS','B3bLCMf0Aw9U','y29UBMvJDf9LCNjVCG'];_0x5714=function(){return _0x53e1ce;};return _0x5714();}class CustomDatabaseManager{constructor(_0x2a4fe8,_0x3ebf7a){function _0x175afb(_0x5f0463,_0xd3c5ed){return _0x4d5f(_0x5f0463- -0x2a2,_0xd3c5ed);}this[_0x175afb(-0x17a,-0x14d)]=_0x2a4fe8,this['workspaceId']=_0x3ebf7a;}async['detectCustomDatabase'](){if(!this['workspaceId'])return{'hasCustomDatabase':![]};try{const response=await this[_0x2efa52(0x3a9,0x362)][_0x2efa52(0x372,0x37c)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x2efa52(0x3ea,0x45d)]===0xc8&&response[_0x2efa52(0x3bf,0x392)]?.['config']){const config=response[_0x2efa52(0x3bf,0x355)]['config'],_0x15a516={'host':config[_0x2efa52(0x3d9,0x3fa)],'port':config['postgresPort'],'database':config[_0x2efa52(0x35b,0x2fd)],'username':config['postgresUsername'],'password':'','schema':config['postgresSchema'],'sslEnabled':config[_0x2efa52(0x338,0x2e8)]};return this[_0x2efa52(0x3ae,0x382)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x15a516},this[_0x2efa52(0x3ae,0x387)];}}catch(_0x1689db){if(_0x1689db?.['status']===0x194)return this[_0x2efa52(0x3ae,0x334)]={'hasCustomDatabase':![]},this[_0x2efa52(0x3ae,0x3d1)];console['warn']('Failed to detect custom database configuration:',_0x1689db);}this['detectedConfig']={'hasCustomDatabase':![]};function _0x2efa52(_0x3e2411,_0x10fa11){return _0x4d5f(_0x3e2411-0x281,_0x10fa11);}return this['detectedConfig'];}async['testConnection'](_0x67f342){function _0x51b00b(_0x4e2577,_0x891375){return _0x4d5f(_0x891375- -0x32a,_0x4e2577);}try{const response=await this[_0x51b00b(-0x1c7,-0x202)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x67f342,{'headers':this[_0x51b00b(-0x1d2,-0x20b)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x35219c){return{'success':![],'message':_0x35219c?.[_0x51b00b(-0x1e6,-0x260)]||'Failed\x20to\x20test\x20connection'};}}async[_0x33e61d(-0x108,-0x101)](_0x7e8583){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x208f53(0xef,0x12b)][_0x208f53(0x116,0xf0)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x7e8583},{'headers':{'X-Workspace-ID':this[_0x208f53(0xe6,0xef)]}});function _0x208f53(_0x2c42ac,_0x580d62){return _0x4d5f(_0x2c42ac- -0x39,_0x580d62);}const config=response['data']['config'];return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x7e8583},config;}async['removeCustomDatabase'](){function _0x32521b(_0x4c2fc3,_0x40c05b){return _0x4d5f(_0x4c2fc3- -0x3a8,_0x40c05b);}if(!this[_0x32521b(-0x289,-0x24d)])throw new Error('Workspace ID is required to remove custom database');await this['httpClient'][_0x32521b(-0x256,-0x29d)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this[_0x32521b(-0x289,-0x2cd)]}}),this[_0x32521b(-0x27b,-0x2bc)]={'hasCustomDatabase':![]};}['getDetectedConfig'](){return this['detectedConfig'];}[_0x33e61d(-0x177,-0x11e)](){function _0xac3150(_0x1836c0,_0x3a0e71){return _0x4d5f(_0x3a0e71- -0x2cd,_0x1836c0);}return this['detectedConfig']?.[_0xac3150(-0x167,-0x1dd)]??![];}[_0x33e61d(-0x90,-0x10b)](){function _0x42e3a2(_0x1a373d,_0x269d06){return _0x4d5f(_0x1a373d- -0x111,_0x269d06);}return this[_0x42e3a2(0x1c,0x15)]?.['credentials'];}[_0x33e61d(-0xa3,-0xc1)](_0x1af08e){function _0x117d66(_0x414af6,_0x3f0855){return _0x4d5f(_0x414af6-0x378,_0x3f0855);}this[_0x117d66(0x497,0x4c7)]=_0x1af08e,this['detectedConfig']=undefined;}['getWorkspaceId'](){return this['workspaceId'];}['getStatus'](){function _0x4d38c1(_0x5b889e,_0x9ee29f){return _0x4d5f(_0x5b889e- -0x361,_0x9ee29f);}return{'workspaceId':this['workspaceId'],'hasConfig':this[_0x4d38c1(-0x271,-0x215)](),'configDetails':this[_0x4d38c1(-0x234,-0x1e1)]?.[_0x4d38c1(-0x203,-0x213)]?{'host':this[_0x4d38c1(-0x234,-0x241)][_0x4d38c1(-0x203,-0x278)][_0x4d38c1(-0x2ba,-0x2ef)],'port':this['detectedConfig'][_0x4d38c1(-0x203,-0x1a7)]['port'],'database':this['detectedConfig'][_0x4d38c1(-0x203,-0x278)]['database'],'schema':this['detectedConfig']['credentials'][_0x4d38c1(-0x21a,-0x1f2)]||_0x4d38c1(-0x1ff,-0x260),'sslEnabled':this[_0x4d38c1(-0x234,-0x21a)]['credentials']['sslEnabled']||![]}:undefined};}}function _0x4d5f(_0x199879,_0x190b03){const _0x571405=_0x5714();return _0x4d5f=function(_0x4d5f61,_0x4cbc55){_0x4d5f61=_0x4d5f61-0x9b;let _0x1d47a7=_0x571405[_0x4d5f61];if(_0x4d5f['yuiaUl']===undefined){var _0x2000a0=function(_0x37dada){const _0xde3a40='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x170bb0='',_0x3c16db='';for(let _0x4008f0=0x0,_0x1dd54c,_0x1df225,_0x3ee676=0x0;_0x1df225=_0x37dada['charAt'](_0x3ee676++);~_0x1df225&&(_0x1dd54c=_0x4008f0%0x4?_0x1dd54c*0x40+_0x1df225:_0x1df225,_0x4008f0++%0x4)?_0x170bb0+=String['fromCharCode'](0xff&_0x1dd54c>>(-0x2*_0x4008f0&0x6)):0x0){_0x1df225=_0xde3a40['indexOf'](_0x1df225);}for(let _0x3e940c=0x0,_0x55374b=_0x170bb0['length'];_0x3e940c<_0x55374b;_0x3e940c++){_0x3c16db+='%'+('00'+_0x170bb0['charCodeAt'](_0x3e940c)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3c16db);};_0x4d5f['hSyCPD']=_0x2000a0,_0x199879=arguments,_0x4d5f['yuiaUl']=!![];}const _0x5cac62=_0x571405[0x0],_0x44d525=_0x4d5f61+_0x5cac62,_0x462bd9=_0x199879[_0x44d525];return!_0x462bd9?(_0x1d47a7=_0x4d5f['hSyCPD'](_0x1d47a7),_0x199879[_0x44d525]=_0x1d47a7):_0x1d47a7=_0x462bd9,_0x1d47a7;},_0x4d5f(_0x199879,_0x190b03);}function _0x33e61d(_0x496710,_0x1e2a50){return _0x4d5f(_0x1e2a50- -0x20e,_0x496710);}class DatabaseClient{constructor(_0x56957c,_0x35df47){this['httpClient']=_0x56957c,this['customDatabaseManager']=new CustomDatabaseManager(_0x56957c,_0x35df47);}[_0x33e61d(-0x13f,-0x138)](_0x2143a4){function _0x19b574(_0x536034,_0x38e4c5){return _0x4d5f(_0x536034- -0x2c9,_0x38e4c5);}return new QueryBuilder(this['httpClient'],_0x2143a4,this[_0x19b574(-0x1e5,-0x1b5)],this[_0x19b574(-0x21e,-0x27d)][_0x19b574(-0x14f,-0xea)]());}[_0x33e61d(-0xf0,-0x160)](_0x31d2b2,_0x25a3f4){function _0x3becb2(_0xbbf2c8,_0x154f2b){return _0x4d5f(_0xbbf2c8- -0x3e7,_0x154f2b);}return this['httpClient']['post'](_0x3becb2(-0x347,-0x31a)+_0x31d2b2,_0x25a3f4);}['schema'](_0x34afc4){const _0x592d49=new DatabaseClient(this['httpClient'],this[_0x5c00f1(0x3d4,0x3b7)]['getWorkspaceId']());function _0x5c00f1(_0x20e863,_0x115c24){return _0x4d5f(_0x20e863-0x329,_0x115c24);}return _0x592d49['currentSchema']=_0x34afc4,_0x592d49['customDatabaseManager']=this[_0x5c00f1(0x3d4,0x3e0)],_0x592d49;}async[_0x33e61d(-0x12c,-0x16c)](){function _0x4feb4a(_0x3c37d9,_0x3503d0){return _0x4d5f(_0x3503d0- -0x310,_0x3c37d9);}return this[_0x4feb4a(-0x27c,-0x265)]['detectCustomDatabase']();}async[_0x33e61d(-0x137,-0x12d)](_0xa925fb){function _0x4d0c68(_0x2c0d3a,_0x23fb82){return _0x4d5f(_0x23fb82- -0x313,_0x2c0d3a);}return this[_0x4d0c68(-0x2b2,-0x268)][_0x4d0c68(-0x1ef,-0x1d3)](_0xa925fb);}async['configureCustomDatabase'](_0x428720){function _0x46f8ae(_0x1087b7,_0x4f10ee){return _0x4d5f(_0x1087b7-0x206,_0x4f10ee);}return this[_0x46f8ae(0x2b1,0x2cd)]['configureCustomDatabase'](_0x428720);}async[_0x33e61d(-0xe5,-0x107)](){function _0xcb985d(_0x281ccd,_0x73be9e){return _0x4d5f(_0x73be9e-0x211,_0x281ccd);}return this[_0xcb985d(0x251,0x2bc)][_0xcb985d(0x30d,0x318)]();}['isUsingCustomDatabase'](){function _0x46f6d4(_0xa202a1,_0x10b6e6){return _0x4d5f(_0x10b6e6- -0x2b0,_0xa202a1);}return this['customDatabaseManager'][_0x46f6d4(-0x148,-0x1c0)]();}['getCustomDatabaseStatus'](){function _0x35b69f(_0x11a691,_0x3fa23f){return _0x4d5f(_0x3fa23f- -0xc,_0x11a691);}return this[_0x35b69f(0x60,0x9f)]['getStatus']();}[_0x33e61d(-0x7e,-0xc1)](_0x13df7a){function _0x1f0d17(_0x309ae2,_0x166861){return _0x4d5f(_0x166861- -0x250,_0x309ae2);}this['customDatabaseManager'][_0x1f0d17(-0xb1,-0x103)](_0x13df7a);}async[_0x33e61d(-0x15e,-0x16d)](){try{await this['customDatabaseManager']['detectCustomDatabase']();}catch(_0x4d7d51){console['warn']('Failed to initialize custom database detection:',_0x4d7d51);}}}class StorageBucket{constructor(_0x161814,bucketId){this['httpClient']=_0x161814,this['bucketId']=bucketId;}async[_0x33e61d(-0x92,-0xb5)](_0x3021a1,_0x1f8ac7,_0x5379a9){function _0x2feeb9(_0x2da70c,_0x348299){return _0x4d5f(_0x348299-0x3a3,_0x2da70c);}try{const _0x3af037=new FormData();if(_0x1f8ac7 instanceof File)_0x3af037['append'](_0x2feeb9(0x52d,0x4f3),_0x1f8ac7);else{if(_0x1f8ac7 instanceof Blob)_0x3af037[_0x2feeb9(0x4e1,0x49c)]('file',_0x1f8ac7,_0x3021a1);else{if(_0x1f8ac7 instanceof ArrayBuffer)_0x3af037[_0x2feeb9(0x4c8,0x49c)](_0x2feeb9(0x49b,0x4f3),new Blob([_0x1f8ac7]),_0x3021a1);else typeof _0x1f8ac7===_0x2feeb9(0x513,0x4d2)&&_0x3af037['append'](_0x2feeb9(0x519,0x4f3),new Blob([_0x1f8ac7],{'type':'text/plain'}),_0x3021a1);}}_0x3af037['append'](_0x2feeb9(0x4b1,0x474),_0x3021a1);_0x5379a9?.['cacheControl']&&_0x3af037[_0x2feeb9(0x4e9,0x49c)](_0x2feeb9(0x526,0x4b6),_0x5379a9['cacheControl']);_0x5379a9?.[_0x2feeb9(0x41b,0x45c)]&&_0x3af037[_0x2feeb9(0x4e2,0x49c)]('contentType',_0x5379a9['contentType']);_0x5379a9?.[_0x2feeb9(0x471,0x4d1)]&&_0x3af037['append']('metadata',JSON[_0x2feeb9(0x4be,0x495)](_0x5379a9['metadata']));const _0x2f92d1=_0x2feeb9(0x42b,0x46a)+this['bucketId']+_0x2feeb9(0x4cc,0x4c9)+(_0x5379a9?.['upsert']?'?upsert=true':''),response=await this[_0x2feeb9(0x500,0x4cb)][_0x2feeb9(0x514,0x4f2)](_0x2f92d1,_0x3af037,{'headers':{'Content-Type':_0x2feeb9(0x44e,0x456)}});return{'data':response[_0x2feeb9(0x46f,0x4e1)],'error':null};}catch(_0x5e81f6){return{'data':null,'error':_0x5e81f6 instanceof EBaaSError?_0x5e81f6:new EBaaSError(_0x5e81f6 instanceof Error?_0x5e81f6[_0x2feeb9(0x438,0x46d)]:'Failed\x20to\x20upload\x20file',0x0,_0x5e81f6)};}}async[_0x33e61d(-0x171,-0x14a)](_0x388ca9,_0x1670a4){function _0x3cbc7c(_0x34f63a,_0x21e3eb){return _0x4d5f(_0x21e3eb- -0x18d,_0x34f63a);}try{const _0x258c26=new URLSearchParams();_0x1670a4?.[_0x3cbc7c(-0x58,-0x56)]&&Object[_0x3cbc7c(-0x127,-0xe5)](_0x1670a4[_0x3cbc7c(-0x8,-0x56)])['forEach'](([_0x1fccdf,_0x5bee12])=>{_0x5bee12!==undefined&&_0x258c26['append'](_0x1fccdf,String(_0x5bee12));});const _0x20e4c0=_0x3cbc7c(-0xe8,-0xc6)+this['bucketId']+_0x3cbc7c(-0x6f,-0xaa)+_0x388ca9+(_0x258c26['toString']()?'?'+_0x258c26['toString']():''),response=await this[_0x3cbc7c(-0x37,-0x65)]['get'](_0x20e4c0,{'responseType':'blob'});return{'data':response[_0x3cbc7c(-0xc9,-0x4f)],'error':null};}catch(_0x503fd1){return{'data':null,'error':_0x503fd1 instanceof EBaaSError?_0x503fd1:new EBaaSError(_0x503fd1 instanceof Error?_0x503fd1[_0x3cbc7c(-0x118,-0xc3)]:'Failed\x20to\x20download\x20file',0x0,_0x503fd1)};}}async[_0x33e61d(-0xbf,-0xdd)](_0x59464b,_0x244c91){function _0x1f9bcd(_0x179711,_0x120a34){return _0x4d5f(_0x179711- -0x353,_0x120a34);}try{const _0x304616=new URLSearchParams();_0x59464b&&_0x304616['append']('prefix',_0x59464b);_0x244c91?.[_0x1f9bcd(-0x1cc,-0x23a)]&&_0x304616[_0x1f9bcd(-0x25a,-0x269)](_0x1f9bcd(-0x1cc,-0x1fd),String(_0x244c91[_0x1f9bcd(-0x1cc,-0x1bc)]));_0x244c91?.[_0x1f9bcd(-0x28d,-0x2c3)]&&_0x304616[_0x1f9bcd(-0x25a,-0x2cd)]('offset',String(_0x244c91['offset']));_0x244c91?.['sortBy']&&_0x304616[_0x1f9bcd(-0x25a,-0x22b)](_0x1f9bcd(-0x1fc,-0x209),JSON['stringify'](_0x244c91['sortBy']));_0x244c91?.[_0x1f9bcd(-0x277,-0x236)]&&_0x304616[_0x1f9bcd(-0x25a,-0x234)](_0x1f9bcd(-0x277,-0x283),_0x244c91[_0x1f9bcd(-0x277,-0x271)]);const _0x2def02='/storage/buckets/'+this['bucketId']+'/files'+(_0x304616[_0x1f9bcd(-0x1ef,-0x263)]()?'?'+_0x304616[_0x1f9bcd(-0x1ef,-0x1c0)]():''),response=await this[_0x1f9bcd(-0x22b,-0x286)]['get'](_0x2def02);return{'data':response[_0x1f9bcd(-0x215,-0x270)],'error':null};}catch(_0x3a96d0){return{'data':null,'error':_0x3a96d0 instanceof EBaaSError?_0x3a96d0:new EBaaSError(_0x3a96d0 instanceof Error?_0x3a96d0[_0x1f9bcd(-0x289,-0x2e2)]:_0x1f9bcd(-0x2af,-0x27b),0x0,_0x3a96d0)};}}async[_0x33e61d(-0xf8,-0xed)](_0x4d92ec){function _0x35fe3f(_0x3c1b81,_0x324b30){return _0x4d5f(_0x324b30-0x230,_0x3c1b81);}try{const response=await this['httpClient']['delete'](_0x35fe3f(0x33f,0x2f7)+this[_0x35fe3f(0x37d,0x326)]+'/files',{'data':{'paths':_0x4d92ec}});return{'data':response['data'],'error':null};}catch(_0x3167f7){return{'data':null,'error':_0x3167f7 instanceof EBaaSError?_0x3167f7:new EBaaSError(_0x3167f7 instanceof Error?_0x3167f7[_0x35fe3f(0x2ba,0x2fa)]:_0x35fe3f(0x33c,0x39e),0x0,_0x3167f7)};}}async['move'](fromPath,_0x219356){function _0x138571(_0x30d762,_0x5ccf2f){return _0x4d5f(_0x5ccf2f-0x39b,_0x30d762);}try{const response=await this[_0x138571(0x51b,0x4c3)]['post']('/storage/buckets/'+this[_0x138571(0x496,0x491)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x219356});return{'data':response['data'],'error':null};}catch(_0x1e5a17){return{'data':null,'error':_0x1e5a17 instanceof EBaaSError?_0x1e5a17:new EBaaSError(_0x1e5a17 instanceof Error?_0x1e5a17['message']:'Failed\x20to\x20move\x20file',0x0,_0x1e5a17)};}}async[_0x33e61d(-0x126,-0xfc)](fromPath,_0x270cce){function _0x431040(_0x41ca94,_0x24d2a5){return _0x4d5f(_0x24d2a5- -0x2d7,_0x41ca94);}try{const response=await this['httpClient'][_0x431040(-0x14f,-0x188)]('/storage/buckets/'+this[_0x431040(-0x1e7,-0x1e1)]+_0x431040(-0x235,-0x1e9),{'sourceKey':fromPath,'destinationKey':_0x270cce});return{'data':response['data'],'error':null};}catch(_0x1aa4cd){return{'data':null,'error':_0x1aa4cd instanceof EBaaSError?_0x1aa4cd:new EBaaSError(_0x1aa4cd instanceof Error?_0x1aa4cd['message']:'Failed\x20to\x20copy\x20file',0x0,_0x1aa4cd)};}}async[_0x33e61d(-0x2a,-0x7f)](_0x167489,_0x5222d5,_0x1422bb){function _0x222413(_0x2aa98f,_0x141761){return _0x4d5f(_0x141761- -0x34f,_0x2aa98f);}try{const response=await this[_0x222413(-0x1b2,-0x227)]['post']('/storage/buckets/'+this[_0x222413(-0x20d,-0x259)]+'/files/'+_0x167489+_0x222413(-0x26c,-0x253),{'expiresIn':_0x5222d5,..._0x1422bb});return{'data':response[_0x222413(-0x1ab,-0x211)],'error':null};}catch(_0x37d77f){return{'data':null,'error':_0x37d77f instanceof EBaaSError?_0x37d77f:new EBaaSError(_0x37d77f instanceof Error?_0x37d77f['message']:'Failed\x20to\x20create\x20signed\x20URL',0x0,_0x37d77f)};}}[_0x33e61d(-0x1a0,-0x137)](_0x281cf3,_0x5caf0f){const _0x2676b4=new URLSearchParams();_0x5caf0f?.[_0x949cbf(0x403,0x3ae)]&&Object['entries'](_0x5caf0f[_0x949cbf(0x403,0x461)])[_0x949cbf(0x440,0x430)](([_0x54542f,_0x3bd79d])=>{function _0x4bc77c(_0x14f5fb,_0x2ed448){return _0x4d5f(_0x14f5fb-0x25a,_0x2ed448);}_0x3bd79d!==undefined&&_0x2676b4[_0x4bc77c(0x353,0x31f)](_0x54542f,String(_0x3bd79d));});const _0x4242ac=this[_0x949cbf(0x3f4,0x38b)]['baseURL']||'',_0x14ccd8=_0x4242ac+_0x949cbf(0x393,0x32b)+this['bucketId']+_0x949cbf(0x3af,0x3f2)+_0x281cf3+(_0x2676b4['toString']()?'?'+_0x2676b4['toString']():'');function _0x949cbf(_0x3e6b8d,_0x1dfee6){return _0x4d5f(_0x3e6b8d-0x2cc,_0x1dfee6);}return{'data':{'publicUrl':_0x14ccd8}};}async['getFileInfo'](_0x2f0a68){function _0x128b32(_0x3a512e,_0x280997){return _0x4d5f(_0x280997-0x31,_0x3a512e);}try{const response=await this[_0x128b32(0x17b,0x159)][_0x128b32(0x180,0x122)](_0x128b32(0xa0,0xf8)+this[_0x128b32(0x112,0x127)]+_0x128b32(0x10c,0x114)+_0x2f0a68+'/info');return{'data':response['data'],'error':null};}catch(_0x35337d){return{'data':null,'error':_0x35337d instanceof EBaaSError?_0x35337d:new EBaaSError(_0x35337d instanceof Error?_0x35337d[_0x128b32(0x88,0xfb)]:_0x128b32(0x10b,0x13f),0x0,_0x35337d)};}}async['updateFileMetadata'](_0x45fbd2,metadata){function _0x31e646(_0x3e578b,_0x440ff5){return _0x4d5f(_0x3e578b-0x363,_0x440ff5);}try{const response=await this['httpClient']['put']('/storage/buckets/'+this['bucketId']+_0x31e646(0x446,0x485)+_0x45fbd2+'/metadata',{'metadata':metadata});return{'data':response[_0x31e646(0x4a1,0x494)],'error':null};}catch(_0x13aaa7){return{'data':null,'error':_0x13aaa7 instanceof EBaaSError?_0x13aaa7:new EBaaSError(_0x13aaa7 instanceof Error?_0x13aaa7['message']:_0x31e646(0x42b,0x469),0x0,_0x13aaa7)};}}}class StorageClient{constructor(_0x1820aa){function _0x2b4b0e(_0x5eb2c5,_0x270256){return _0x4d5f(_0x5eb2c5-0x32f,_0x270256);}this[_0x2b4b0e(0x457,0x3de)]=_0x1820aa;}['from'](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async[_0x33e61d(-0x4d,-0x80)](_0x392290,_0x6f069f){function _0x4af232(_0x24c945,_0xaae031){return _0x4d5f(_0xaae031-0x27,_0x24c945);}try{const response=await this['httpClient'][_0x4af232(0x16f,0x176)]('/storage/buckets',{'id':_0x392290,..._0x6f069f});return{'data':response[_0x4af232(0x127,0x165)],'error':null};}catch(_0x229a60){return{'data':null,'error':_0x229a60 instanceof EBaaSError?_0x229a60:new EBaaSError(_0x229a60 instanceof Error?_0x229a60['message']:'Failed\x20to\x20create\x20bucket',0x0,_0x229a60)};}}async[_0x33e61d(-0x8e,-0xc2)](_0x31fe96){function _0x16cd0f(_0x375c17,_0x5ee53b){return _0x4d5f(_0x5ee53b- -0x39a,_0x375c17);}try{const response=await this['httpClient'][_0x16cd0f(-0x25d,-0x2a9)](_0x16cd0f(-0x262,-0x2d3)+_0x31fe96);return{'data':response['data'],'error':null};}catch(_0xc5d9c6){return{'data':null,'error':_0xc5d9c6 instanceof EBaaSError?_0xc5d9c6:new EBaaSError(_0xc5d9c6 instanceof Error?_0xc5d9c6[_0x16cd0f(-0x295,-0x2d0)]:'Failed\x20to\x20get\x20bucket',0x0,_0xc5d9c6)};}}async[_0x33e61d(-0x154,-0x127)](){function _0x27bef3(_0x55b872,_0x248f9a){return _0x4d5f(_0x55b872- -0x65,_0x248f9a);}try{const response=await this['httpClient'][_0x27bef3(0x8c,0xe3)]('/storage/buckets');return{'data':response[_0x27bef3(0xd9,0xc9)],'error':null};}catch(_0x36caa0){return{'data':null,'error':_0x36caa0 instanceof EBaaSError?_0x36caa0:new EBaaSError(_0x36caa0 instanceof Error?_0x36caa0['message']:_0x27bef3(0x121,0x18f),0x0,_0x36caa0)};}}async[_0x33e61d(-0x79,-0xda)](_0xaeb1ea,_0x36d63e){function _0x3aa1c5(_0x24a57e,_0x311335){return _0x4d5f(_0x24a57e- -0xbf,_0x311335);}try{const response=await this['httpClient'][_0x3aa1c5(0x1,0x29)](_0x3aa1c5(0x8,-0x1b)+_0xaeb1ea,_0x36d63e);return{'data':response['data'],'error':null};}catch(_0x10a8d4){return{'data':null,'error':_0x10a8d4 instanceof EBaaSError?_0x10a8d4:new EBaaSError(_0x10a8d4 instanceof Error?_0x10a8d4['message']:'Failed\x20to\x20update\x20bucket',0x0,_0x10a8d4)};}}async[_0x33e61d(-0x5d,-0xd1)](_0xe02352){function _0x2472ac(_0x382f23,_0x394342){return _0x4d5f(_0x382f23- -0x3ab,_0x394342);}try{const response=await this[_0x2472ac(-0x283,-0x2b3)]['delete'](_0x2472ac(-0x2e4,-0x2be)+_0xe02352);return{'data':response[_0x2472ac(-0x26d,-0x278)],'error':null};}catch(_0x53bdbe){return{'data':null,'error':_0x53bdbe instanceof EBaaSError?_0x53bdbe:new EBaaSError(_0x53bdbe instanceof Error?_0x53bdbe[_0x2472ac(-0x2e1,-0x318)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x53bdbe)};}}async[_0x33e61d(-0x11a,-0xf2)](){function _0x336626(_0x5505f1,_0x9f6e5b){return _0x4d5f(_0x5505f1- -0x18e,_0x9f6e5b);}try{const response=await this[_0x336626(-0x66,-0xa9)]['get'](_0x336626(-0x91,-0x18));return{'data':response[_0x336626(-0x50,-0xaa)],'error':null};}catch(_0x1a4563){return{'data':null,'error':_0x1a4563 instanceof EBaaSError?_0x1a4563:new EBaaSError(_0x1a4563 instanceof Error?_0x1a4563[_0x336626(-0xc4,-0x119)]:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x1a4563)};}}}class RealtimeChannel extends _0x37dada{constructor(_0x5b35bb,_0x35af49){super();function _0x5b36c8(_0x2c716d,_0x3f616a){return _0x4d5f(_0x2c716d-0x2fd,_0x3f616a);}this[_0x5b36c8(0x43c,0x3d7)]=![],this['state']=_0x5b36c8(0x46c,0x473),this['subscriptions']=new Map(),this['topic']=_0x5b35bb,this['socket']=_0x35af49;}['subscribe'](_0x1ee481){!this[_0x25939d(0x1fe,0x1d1)]&&(this['joinedOnce']=!![],this[_0x25939d(0x219,0x205)]());_0x1ee481&&this['on'](_0x25939d(0x228,0x255),_0x1ee481);function _0x25939d(_0x4e76d7,_0x26cf97){return _0x4d5f(_0x4e76d7-0xbf,_0x26cf97);}return this;}[_0x33e61d(-0x196,-0x15a)](filter,_0x38d75e){const _0x21ceec=_0x934eb0(0x4fe,0x4d6)+JSON['stringify'](filter);function _0x934eb0(_0xe93e87,_0x4408c8){return _0x4d5f(_0x4408c8-0x383,_0xe93e87);}super['on'](_0x21ceec,_0x38d75e);const _0x4d86c5={'unsubscribe':()=>{super[_0x10f379(-0x1ad,-0x227)](_0x21ceec,_0x38d75e);function _0x10f379(_0x15c858,_0xda9065){return _0x4d5f(_0x15c858- -0x2c6,_0xda9065);}this['subscriptions']['delete'](_0x21ceec);}};return this['subscriptions'][_0x934eb0(0x434,0x47b)](_0x21ceec,_0x4d86c5),this['socket']?.[_0x934eb0(0x513,0x4ed)]&&this['state']==='joined'&&this[_0x934eb0(0x46a,0x469)][_0x934eb0(0x4ce,0x48f)]('subscribe_postgres_changes',{'topic':this[_0x934eb0(0x4d6,0x461)],'filter':filter,'ref':this[_0x934eb0(0x49c,0x49b)]()}),_0x4d86c5;}['onBroadcast'](filter,_0x4985cd){const _0x311fd7=_0x3e1766(0x22e,0x201)+JSON[_0x3e1766(0x196,0x13d)](filter);super['on'](_0x311fd7,_0x4985cd);const _0x58256e={'unsubscribe':()=>{function _0x1224ef(_0x5cc8af,_0x2e2e41){return _0x4d5f(_0x5cc8af- -0x8f,_0x2e2e41);}super['off'](_0x311fd7,_0x4985cd),this['subscriptions'][_0x1224ef(0xc3,0x8c)](_0x311fd7);}};this[_0x3e1766(0x1d4,0x1d7)]['set'](_0x311fd7,_0x58256e);function _0x3e1766(_0x52e65d,_0x10bc97){return _0x4d5f(_0x52e65d-0xa4,_0x10bc97);}return _0x58256e;}['onPresence'](filter,_0x45f4da){const _0x1c0969='presence:'+JSON['stringify'](filter);super['on'](_0x1c0969,_0x45f4da);function _0x5d2513(_0x67bfdf,_0x4fb9d5){return _0x4d5f(_0x4fb9d5- -0xb7,_0x67bfdf);}const _0x5b7da4={'unsubscribe':()=>{function _0x3e2c5d(_0x3b57c3,_0x205f9){return _0x4d5f(_0x205f9- -0x38d,_0x3b57c3);}super[_0x3e2c5d(-0x23d,-0x274)](_0x1c0969,_0x45f4da),this['subscriptions'][_0x3e2c5d(-0x1f8,-0x23b)](_0x1c0969);}};return this[_0x5d2513(0x1b,0x79)]['set'](_0x1c0969,_0x5b7da4),_0x5b7da4;}['send'](_0x2daa9d){return new Promise(_0x5bafab=>{function _0x29792a(_0x29152f,_0x3997fd){return _0x4d5f(_0x29152f-0x35d,_0x3997fd);}this[_0x29792a(0x443,0x478)]?.[_0x29792a(0x4c7,0x4b0)]&&this[_0x29792a(0x4ce,0x4de)]===_0x29792a(0x41f,0x3d0)?(this['socket']['emit'](_0x29792a(0x4ae,0x503),{'topic':this['topic'],'event':_0x2daa9d[_0x29792a(0x458,0x424)],'payload':_0x2daa9d,'ref':this[_0x29792a(0x475,0x479)]()}),_0x5bafab('ok')):_0x5bafab(_0x29792a(0x481,0x4a4));});}['track'](_0x164376){return new Promise(_0x500921=>{function _0x1d0f87(_0x28e40d,_0xe5df7e){return _0x4d5f(_0x28e40d-0x32,_0xe5df7e);}this[_0x1d0f87(0x118,0xea)]?.[_0x1d0f87(0x19c,0x1b0)]&&this[_0x1d0f87(0x1a3,0x214)]==='joined'?(this['socket']['emit']('presence',{'topic':this[_0x1d0f87(0x110,0x151)],'event':_0x1d0f87(0x114,0x157),'payload':_0x164376,'ref':this['makeRef']()}),_0x500921('ok')):_0x500921('error');});}[_0x33e61d(-0xfe,-0xd9)](){return new Promise(_0x1b6b13=>{function _0x2e29e8(_0x12f367,_0x21158b){return _0x4d5f(_0x21158b- -0x1f,_0x12f367);}this[_0x2e29e8(0xc8,0xc7)]?.[_0x2e29e8(0xdb,0x14b)]&&this['state']===_0x2e29e8(0x88,0xa3)?(this[_0x2e29e8(0x84,0xc7)]['emit'](_0x2e29e8(0x106,0x16c),{'topic':this['topic'],'event':_0x2e29e8(0x142,0x116),'ref':this[_0x2e29e8(0xf9,0xf9)]()}),_0x1b6b13('ok')):_0x1b6b13('error');});}['unsubscribe'](){return new Promise(_0x22b59b=>{this[_0x8e0620(0x155,0x147)]='leaving';function _0x8e0620(_0x19ce9d,_0x5d26f6){return _0x4d5f(_0x5d26f6- -0x2a,_0x19ce9d);}this[_0x8e0620(0x102,0x106)]['forEach'](_0x4205e2=>{_0x4205e2['unsubscribe']();}),this['subscriptions'][_0x8e0620(0xb6,0x74)](),this['socket']?.['connected']&&this['socket']['emit']('leave',{'topic':this['topic'],'ref':this[_0x8e0620(0x119,0xee)]()}),this['state']=_0x8e0620(0xdc,0x145),this['removeAllListeners'](),_0x22b59b('ok');});}[_0x33e61d(-0x58,-0xb4)](){if(this['state']==='leaving')return;this['state']='joining';function _0x3d3314(_0x29f6eb,_0x19e468){return _0x4d5f(_0x29f6eb-0x286,_0x19e468);}this[_0x3d3314(0x36c,0x393)]?.['connected']&&(this[_0x3d3314(0x36c,0x3bc)]['emit'](_0x3d3314(0x38f,0x3d2),{'topic':this['topic'],'ref':this[_0x3d3314(0x39e,0x3e6)]()}),setTimeout(()=>{function _0x2d8569(_0x2d7604,_0x1bb6c5){return _0x4d5f(_0x2d7604-0x294,_0x1bb6c5);}this[_0x2d8569(0x405,0x452)]==='joining'&&(this[_0x2d8569(0x405,0x416)]='joined',this[_0x2d8569(0x3a0,0x3d4)](_0x2d8569(0x3fd,0x3d6),'SUBSCRIBED'));},0x64));}[_0x33e61d(-0xdf,-0x11b)](){function _0x3ed85d(_0x4ba353,_0x5caa29){return _0x4d5f(_0x5caa29-0x3e,_0x4ba353);}this['joinedOnce']&&(this['_join'](),this[_0x3ed85d(0x1d5,0x16e)]['forEach']((_0x1383ee,_0x582ad8)=>{function _0xc605d6(_0x8c0b7f,_0x40e95c){return _0x4d5f(_0x8c0b7f- -0x36b,_0x40e95c);}if(_0x582ad8[_0xc605d6(-0x222,-0x1f1)](_0xc605d6(-0x218,-0x1f9))){const filter=JSON[_0xc605d6(-0x281,-0x2d6)](_0x582ad8['replace'](_0xc605d6(-0x218,-0x1d5),''));this[_0xc605d6(-0x285,-0x287)]?.[_0xc605d6(-0x25f,-0x244)](_0xc605d6(-0x1f2,-0x20a),{'topic':this[_0xc605d6(-0x28d,-0x27e)],'filter':filter,'ref':this[_0xc605d6(-0x253,-0x253)]()});}}));}[_0x33e61d(-0x172,-0x158)](_0x3ac984,_0x109c50){function _0x2dca4e(_0x291f9d,_0x53d20d){return _0x4d5f(_0x291f9d- -0x68,_0x53d20d);}if(_0x3ac984===_0x2dca4e(0x3e,-0x29)){const _0x2f4917=_0x2dca4e(0xeb,0x97)+JSON['stringify'](_0x109c50[_0x2dca4e(0xb6,0x9d)]||{});this[_0x2dca4e(0xa4,0x5e)](_0x2f4917,_0x109c50);}else{if(_0x3ac984===_0x2dca4e(0xe9,0xb7)){const _0x1c2d56=_0x2dca4e(0x122,0xf9)+JSON['stringify']({'event':_0x109c50['event']});this['emit'](_0x1c2d56,_0x109c50);}else{if(_0x3ac984==='presence'){const _0xcbc7ee=_0x2dca4e(0xa3,0xe8)+JSON[_0x2dca4e(0x8a,0x5f)]({'event':_0x109c50['event']});this['emit'](_0xcbc7ee,_0x109c50);}}}this[_0x2dca4e(0xa4,0x43)](_0x3ac984,_0x109c50);}['_setState'](_0x1dea4){this[_0x193cc6(0x4cc,0x4da)]=_0x1dea4;function _0x193cc6(_0x1aa243,_0x11c063){return _0x4d5f(_0x1aa243-0x35b,_0x11c063);}let status;switch(_0x1dea4){case _0x193cc6(0x41d,0x445):status='SUBSCRIBED';break;case'errored':status='CHANNEL_ERROR';break;case _0x193cc6(0x4ca,0x4db):status=_0x193cc6(0x4e8,0x4b4);break;default:return;}this['emit']('status',status);}[_0x33e61d(-0x119,-0xf6)](){function _0x2cf69d(_0x168ec0,_0x4d40fa){return _0x4d5f(_0x4d40fa-0x199,_0x168ec0);}return Math[_0x2cf69d(0x26f,0x257)]()['toString'](0x24)[_0x2cf69d(0x34a,0x2fc)](0x2,0xf);}[_0x33e61d(-0x1dc,-0x165)](){function _0x10fdf6(_0x5d63d5,_0x308c22){return _0x4d5f(_0x5d63d5-0x23a,_0x308c22);}return this[_0x10fdf6(0x3ab,0x351)];}}class RealtimeClient{constructor(_0x37e39f,_0x712226,_0x4285ca={}){this[_0x48b781(0x329,0x2c4)]=null,this['channels']=new Map(),this['connectionState']='disconnected',this[_0x48b781(0x360,0x32d)]=0x0,this['maxReconnectAttempts']=0x5;function _0x48b781(_0x4cb121,_0xe3e360){return _0x4d5f(_0x4cb121-0x243,_0xe3e360);}this[_0x48b781(0x30f,0x314)]=_0x37e39f,this['apiKey']=_0x712226,this[_0x48b781(0x3b5,0x350)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x4285ca};}[_0x33e61d(-0x1aa,-0x145)](){return new Promise((_0x154e7b,_0x501877)=>{if(this['socket']?.['connected']){_0x154e7b();return;}this[_0x559299(0x2bc,0x2d2)]='connecting',this[_0x559299(0x33b,0x2c4)]=io(this[_0x559299(0x269,0x2aa)],{'auth':{'apikey':this['apiKey']},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this['options']['maxReconnectAttempts'],...this[_0x559299(0x3ae,0x350)]['socketOptions']}),this['socket']['on'](_0x559299(0x2ed,0x2a7),()=>{this['connectionState']=_0xf976d3(0xcb,0x115);function _0xf976d3(_0x54255c,_0x2031f9){return _0x4d5f(_0x54255c- -0x9f,_0x2031f9);}this['reconnectAttempts']=0x0,this[_0xf976d3(0xdc,0x81)](),_0x154e7b();}),this[_0x559299(0x27c,0x2c4)]['on'](_0x559299(0x2da,0x298),_0x52a170=>{this['connectionState']=_0x4fb39f(-0xc4,-0xa5);function _0x4fb39f(_0x4aec8d,_0xc6ad17){return _0x4d5f(_0x4aec8d- -0x18f,_0xc6ad17);}this['channels']['forEach'](channel=>{function _0x4b6636(_0x355ea1,_0x1796aa){return _0x4d5f(_0x355ea1- -0x47,_0x1796aa);}channel['_setState'](_0x4b6636(0x128,0xbf));});});function _0x559299(_0x1b3b09,_0x4e477b){return _0x4d5f(_0x4e477b-0x1de,_0x1b3b09);}this['socket']['on'](_0x559299(0x252,0x2b7),_0x17d1ea=>{function _0x5dea4d(_0x12721f,_0x12c03d){return _0x4d5f(_0x12721f- -0x3ae,_0x12c03d);}this[_0x5dea4d(-0x2ba,-0x242)]=_0x5dea4d(-0x28a,-0x27b),this['reconnectAttempts']++,this[_0x5dea4d(-0x291,-0x272)]>=this[_0x5dea4d(-0x247,-0x224)]&&_0x501877(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+_0x5dea4d(-0x26b,-0x2a7)+_0x17d1ea['message']));}),this['socket']['on'](_0x559299(0x2c3,0x305),()=>{this[_0x535672(0x3e2,0x3d6)]='connected';function _0x535672(_0x25310d,_0x5036dc){return _0x4d5f(_0x25310d-0x2ee,_0x5036dc);}this[_0x535672(0x40b,0x3e1)]=0x0,this['channels'][_0x535672(0x462,0x4db)](channel=>{function _0xa48489(_0x2bb3be,_0x5d1bab){return _0x4d5f(_0x2bb3be- -0x2c3,_0x5d1bab);}channel[_0xa48489(-0x1d0,-0x165)]();});}),this[_0x559299(0x30e,0x2c4)]['on']('postgres_changes',_0x23d88d=>{function _0xd9b4a3(_0x2d08d3,_0x19189f){return _0x4d5f(_0x2d08d3-0x2f5,_0x19189f);}const channel=this[_0xd9b4a3(0x3b4,0x357)][_0xd9b4a3(0x3e6,0x3fc)](_0x23d88d['topic']);channel&&channel['_trigger'](_0xd9b4a3(0x39b,0x3c5),_0x23d88d);}),this[_0x559299(0x279,0x2c4)]['on']('broadcast',_0x5197f9=>{const channel=this[_0x527f44(0x425,0x449)]['get'](_0x5197f9['topic']);function _0x527f44(_0x2f3b81,_0x4ec529){return _0x4d5f(_0x4ec529-0x38a,_0x2f3b81);}channel&&channel['_trigger']('broadcast',_0x5197f9);}),this['socket']['on']('presence',_0x2f1929=>{const channel=this['channels']['get'](_0x2f1929['topic']);channel&&channel['_trigger']('presence',_0x2f1929);});});}['disconnect'](){function _0x28e210(_0x57d50b,_0x558c33){return _0x4d5f(_0x558c33-0x325,_0x57d50b);}this['socket']&&(this[_0x28e210(0x3bd,0x40b)]['disconnect'](),this['socket']=null),this['connectionState']=_0x28e210(0x377,0x3f0),this['channels'][_0x28e210(0x398,0x3c3)]();}[_0x33e61d(-0x154,-0x149)](_0x45283c){if(this[_0x422a9a(-0xac,-0x88)]['has'](_0x45283c))return this[_0x422a9a(-0xff,-0x88)][_0x422a9a(-0x5a,-0x56)](_0x45283c);function _0x422a9a(_0x36f83a,_0x3dd564){return _0x4d5f(_0x3dd564- -0x147,_0x36f83a);}const channel=new RealtimeChannel(_0x45283c,this[_0x422a9a(-0xdc,-0x61)]);return this['channels']['set'](_0x45283c,channel),this['connectionState']==='connected'&&channel[_0x422a9a(0x4f,0x13)](),channel;}[_0x33e61d(-0x8a,-0xa1)](channel){const _0x357f5e=channel['topic'];function _0x551206(_0x488574,_0x469ead){return _0x4d5f(_0x469ead-0x339,_0x488574);}this['channels']['has'](_0x357f5e)&&(this[_0x551206(0x46a,0x3f8)][_0x551206(0x460,0x48b)](_0x357f5e),channel[_0x551206(0x35a,0x3d5)]());}['removeAllChannels'](){this['channels']['forEach'](channel=>{channel['unsubscribe']();});function _0x1c6c7c(_0x370c6f,_0x24c4e5){return _0x4d5f(_0x370c6f- -0x1b7,_0x24c4e5);}this[_0x1c6c7c(-0xf8,-0x120)][_0x1c6c7c(-0x119,-0xe2)]();}[_0x33e61d(-0xad,-0xa2)](){function _0x2147cf(_0x1418bb,_0x172730){return _0x4d5f(_0x1418bb- -0x2e6,_0x172730);}return Array[_0x2147cf(-0x210,-0x1a0)](this['channels']['values']());}['isConnected'](){function _0x53e432(_0x42737e,_0x396d43){return _0x4d5f(_0x42737e-0x3b,_0x396d43);}return this[_0x53e432(0x12f,0x11e)]==='connected'&&!!this['socket']?.['connected'];}['getConnectionState'](){return this['connectionState'];}['onConnectionStateChange'](_0x26ab83){const _0x41bcb6=()=>_0x26ab83(this['connectionState']);this['socket']&&(this['socket']['on']('connect',()=>{this['connectionState']='connected',_0x41bcb6();}),this[_0x40064b(0x49a,0x443)]['on']('disconnect',()=>{this['connectionState']=_0x5b9eee(-0xec,-0x87);function _0x5b9eee(_0x1cb644,_0x23739e){return _0x4d5f(_0x23739e- -0x152,_0x1cb644);}_0x41bcb6();}),this['socket']['on'](_0x40064b(0x46b,0x436),()=>{function _0x3f33cb(_0x5966ca,_0x238331){return _0x4d5f(_0x5966ca- -0x35d,_0x238331);}this[_0x3f33cb(-0x269,-0x284)]=_0x3f33cb(-0x239,-0x290),_0x41bcb6();}));function _0x40064b(_0x16d784,_0x55430a){return _0x4d5f(_0x55430a-0x35d,_0x16d784);}return()=>{function _0x5e9212(_0x386a91,_0x49107b){return _0x4d5f(_0x49107b-0x13c,_0x386a91);}this['socket']&&(this['socket']['off'](_0x5e9212(0x22c,0x205),_0x41bcb6),this['socket']['off']('disconnect',_0x41bcb6),this[_0x5e9212(0x290,0x222)]['off']('connect_error',_0x41bcb6));};}['setupHeartbeat'](){function _0x7be2a5(_0x2ccfe3,_0x30764a){return _0x4d5f(_0x30764a- -0x149,_0x2ccfe3);}if(!this['options'][_0x7be2a5(0x44,0x1d)]||!this['socket'])return;const interval=setInterval(()=>{function _0x197c7b(_0x39affe,_0x59c03d){return _0x4d5f(_0x39affe- -0x1a1,_0x59c03d);}this[_0x197c7b(-0xbb,-0x93)]?.['connected']?this[_0x197c7b(-0xbb,-0x82)]['emit'](_0x197c7b(-0xc6,-0x9e),{'timestamp':Date[_0x197c7b(-0xf7,-0xdb)]()}):clearInterval(interval);},this[_0x7be2a5(0x2e,0x29)]['heartbeatInterval']);}['_getSocket'](){function _0x1ac4fc(_0x3eadcf,_0x2db392){return _0x4d5f(_0x2db392- -0x28b,_0x3eadcf);}return this[_0x1ac4fc(-0x159,-0x1a5)];}}class FunctionsClient{constructor(_0x2ea593){this['httpClient']=_0x2ea593;}async['invoke'](_0x4ef68f,_0x257c02){function _0x391252(_0xd2eb17,_0x4fbe8d){return _0x4d5f(_0xd2eb17-0xd2,_0x4fbe8d);}try{const _0x5d06fe=_0x257c02?.['method']||'POST',headers={'Content-Type':'application/json',..._0x257c02?.[_0x391252(0x1bb,0x1cb)]};let response;const _0x89a5c5=_0x391252(0x1f7,0x1a5)+_0x4ef68f;switch(_0x5d06fe['toUpperCase']()){case'GET':response=await this[_0x391252(0x1fa,0x1d3)][_0x391252(0x1c3,0x1f5)](_0x89a5c5,{'headers':headers,'params':_0x257c02?.['body']});break;case'POST':response=await this[_0x391252(0x1fa,0x188)]['post'](_0x89a5c5,_0x257c02?.[_0x391252(0x248,0x271)],{'headers':headers});break;case'PUT':response=await this[_0x391252(0x1fa,0x22c)]['put'](_0x89a5c5,_0x257c02?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x391252(0x1fa,0x1b7)][_0x391252(0x242,0x22b)](_0x89a5c5,_0x257c02?.['body'],{'headers':headers});break;case'DELETE':response=await this['httpClient']['delete'](_0x89a5c5,{'headers':headers,'data':_0x257c02?.[_0x391252(0x248,0x22d)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x5d06fe,0x190);}return{'data':response['data'],'error':null};}catch(_0x45153d){return{'data':null,'error':_0x45153d instanceof EBaaSError?_0x45153d:new EBaaSError(_0x45153d instanceof Error?_0x45153d['message']:'Function\x20invocation\x20failed',0x0,_0x45153d)};}}async['list'](){function _0x4f9dfb(_0x49c745,_0x42f085){return _0x4d5f(_0x42f085-0x300,_0x49c745);}try{const response=await this[_0x4f9dfb(0x43c,0x428)][_0x4f9dfb(0x424,0x3f1)]('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x764ac){return{'data':null,'error':_0x764ac instanceof EBaaSError?_0x764ac:new EBaaSError(_0x764ac instanceof Error?_0x764ac['message']:'Failed\x20to\x20list\x20functions',0x0,_0x764ac)};}}async[_0x33e61d(-0x13a,-0x11d)](_0x1bea79){function _0xabbaca(_0x159de5,_0x5373bd){return _0x4d5f(_0x159de5- -0x196,_0x5373bd);}try{const response=await this['httpClient'][_0xabbaca(-0xa5,-0x5a)](_0xabbaca(-0x71,-0x2f)+_0x1bea79+_0xabbaca(-0xdb,-0x136));return{'data':response[_0xabbaca(-0x58,-0x5e)],'error':null};}catch(_0x3bc8ef){return{'data':null,'error':_0x3bc8ef instanceof EBaaSError?_0x3bc8ef:new EBaaSError(_0x3bc8ef instanceof Error?_0x3bc8ef[_0xabbaca(-0xcc,-0x12a)]:'Failed\x20to\x20get\x20function',0x0,_0x3bc8ef)};}}async['deploy'](_0x18f12e,_0x282eef){function _0x12f125(_0x37d343,_0x4927dc){return _0x4d5f(_0x4927dc-0x303,_0x37d343);}try{const _0x10bbd2=new FormData();if(_0x282eef[_0x12f125(0x3d4,0x3d0)]instanceof File)_0x10bbd2[_0x12f125(0x449,0x3fc)](_0x12f125(0x391,0x3d0),_0x282eef[_0x12f125(0x3e5,0x3d0)]);else typeof _0x282eef['code']===_0x12f125(0x486,0x432)&&_0x10bbd2['append'](_0x12f125(0x422,0x3d0),new Blob([_0x282eef[_0x12f125(0x42e,0x3d0)]],{'type':_0x12f125(0x455,0x449)}),_0x12f125(0x46c,0x3f2));_0x282eef['entrypoint']&&_0x10bbd2[_0x12f125(0x3bb,0x3fc)]('entrypoint',_0x282eef[_0x12f125(0x3c1,0x3eb)]);_0x282eef[_0x12f125(0x35e,0x3a0)]&&_0x10bbd2[_0x12f125(0x39b,0x3fc)]('env',JSON[_0x12f125(0x404,0x3f5)](_0x282eef[_0x12f125(0x418,0x3a0)]));_0x282eef['importMap']&&_0x10bbd2['append']('importMap',JSON[_0x12f125(0x3fd,0x3f5)](_0x282eef[_0x12f125(0x4b7,0x43d)]));_0x282eef[_0x12f125(0x4bd,0x468)]!==undefined&&_0x10bbd2[_0x12f125(0x433,0x3fc)]('verify',String(_0x282eef[_0x12f125(0x3f3,0x468)]));const response=await this['httpClient'][_0x12f125(0x439,0x452)]('/functions/v1/'+_0x18f12e+'/deploy',_0x10bbd2,{'headers':{'Content-Type':_0x12f125(0x37e,0x3b6)}});return{'data':response['data'],'error':null};}catch(_0x2d326d){return{'data':null,'error':_0x2d326d instanceof EBaaSError?_0x2d326d:new EBaaSError(_0x2d326d instanceof Error?_0x2d326d['message']:'Failed\x20to\x20deploy\x20function',0x0,_0x2d326d)};}}async[_0x33e61d(-0x9c,-0xbc)](_0x314d74){function _0x5cfb03(_0x4dac7a,_0x35a319){return _0x4d5f(_0x4dac7a-0x168,_0x35a319);}try{const response=await this[_0x5cfb03(0x290,0x279)]['delete'](_0x5cfb03(0x28d,0x2b9)+_0x314d74);return{'data':response[_0x5cfb03(0x2a6,0x300)],'error':null};}catch(_0x3b7d8f){return{'data':null,'error':_0x3b7d8f instanceof EBaaSError?_0x3b7d8f:new EBaaSError(_0x3b7d8f instanceof Error?_0x3b7d8f['message']:'Failed\x20to\x20delete\x20function',0x0,_0x3b7d8f)};}}async['updateEnv'](_0x516fe9,_0x1c70c3){function _0x46513f(_0x2f1807,_0xf4aa06){return _0x4d5f(_0xf4aa06-0xc7,_0x2f1807);}try{const response=await this[_0x46513f(0x23f,0x1ef)][_0x46513f(0x122,0x187)]('/functions/v1/'+_0x516fe9+'/env',{'env':_0x1c70c3});return{'data':response['data'],'error':null};}catch(_0x563d5f){return{'data':null,'error':_0x563d5f instanceof EBaaSError?_0x563d5f:new EBaaSError(_0x563d5f instanceof Error?_0x563d5f[_0x46513f(0x156,0x191)]:_0x46513f(0x132,0x17f),0x0,_0x563d5f)};}}async[_0x33e61d(-0x133,-0x15e)](_0x5d0f83,_0x5705f6){function _0x3e7436(_0x58fbcf,_0xda4c5){return _0x4d5f(_0xda4c5-0x75,_0x58fbcf);}try{const _0x434af8=new URLSearchParams();_0x5705f6?.['limit']&&_0x434af8['append']('limit',String(_0x5705f6['limit']));_0x5705f6?.['offset']&&_0x434af8[_0x3e7436(0x1e8,0x16e)](_0x3e7436(0x186,0x13b),String(_0x5705f6[_0x3e7436(0x19b,0x13b)]));_0x5705f6?.[_0x3e7436(0x19d,0x173)]&&_0x434af8['append']('level',_0x5705f6['level']);const _0x41a07e='/functions/v1/'+_0x5d0f83+'/logs'+(_0x434af8['toString']()?'?'+_0x434af8['toString']():''),response=await this[_0x3e7436(0x1ba,0x19d)]['get'](_0x41a07e);return{'data':response['data'],'error':null};}catch(_0x18a56a){return{'data':null,'error':_0x18a56a instanceof EBaaSError?_0x18a56a:new EBaaSError(_0x18a56a instanceof Error?_0x18a56a[_0x3e7436(0x178,0x13f)]:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x18a56a)};}}async[_0x33e61d(-0x49,-0x99)](_0x37d079,_0x32262d){function _0x12877a(_0x54f59a,_0x5ee199){return _0x4d5f(_0x54f59a- -0x3e0,_0x5ee199);}try{const _0x34fd30=new URLSearchParams();_0x32262d?.[_0x12877a(-0x311,-0x2af)]&&_0x34fd30['append'](_0x12877a(-0x311,-0x2e4),_0x32262d['period']);const _0x3ddc22='/functions/v1/'+_0x37d079+'/metrics'+(_0x34fd30['toString']()?'?'+_0x34fd30[_0x12877a(-0x27c,-0x2d2)]():''),response=await this['httpClient'][_0x12877a(-0x2ef,-0x333)](_0x3ddc22);return{'data':response[_0x12877a(-0x2a2,-0x26f)],'error':null};}catch(_0x3cc8a4){return{'data':null,'error':_0x3cc8a4 instanceof EBaaSError?_0x3cc8a4:new EBaaSError(_0x3cc8a4 instanceof Error?_0x3cc8a4['message']:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x3cc8a4)};}}}class EBaaSClient{constructor(_0x1eb47d,_0x14af17,_0x4e8616){this['options']=_0x4e8616,this[_0x5743a0(-0x68,-0x2b)]=new HttpClient({'url':_0x1eb47d,'apiKey':_0x14af17,'timeout':0x7530,'headers':_0x4e8616?.['global']?.[_0x5743a0(-0xdb,-0x6a)]}),this[_0x5743a0(0x11,-0x31)]=new AuthClient(this[_0x5743a0(0x5,-0x2b)]),this[_0x5743a0(-0x8a,-0x17)]=new DatabaseClient(this[_0x5743a0(-0x75,-0x2b)],_0x4e8616?.['database']?.['workspaceId']),this['storage']=new StorageClient(this[_0x5743a0(-0x24,-0x2b)]),this[_0x5743a0(0x33,0x30)]=new RealtimeClient(_0x1eb47d,_0x14af17,_0x4e8616?.[_0x5743a0(0x9b,0x30)]);function _0x5743a0(_0x36a8fa,_0x25050f){return _0x4d5f(_0x25050f- -0x153,_0x36a8fa);}this['functions']=new FunctionsClient(this['httpClient']),this['initializeCustomDatabase']();}['from'](_0x99acd4){function _0xe640b7(_0xe87703,_0x33302e){return _0x4d5f(_0x33302e- -0x4a,_0xe87703);}return this[_0xe640b7(0x10e,0xf2)]['from'](_0x99acd4);}[_0x33e61d(-0x14e,-0x160)](_0x1e415e,_0x155e0f){return this['database']['rpc'](_0x1e415e,_0x155e0f);}[_0x33e61d(-0x119,-0xd5)](_0x625b3c){function _0x1ca1f5(_0x176bae,_0x4f67a7){return _0x4d5f(_0x176bae-0x185,_0x4f67a7);}return this[_0x1ca1f5(0x2b0,0x328)]['from'](_0x625b3c);}['channel'](_0x30a96a){function _0x2a8dc9(_0x2cf07e,_0x98d942){return _0x4d5f(_0x2cf07e- -0x1d3,_0x98d942);}return this[_0x2a8dc9(-0x50,-0xaf)][_0x2a8dc9(-0x10e,-0x111)](_0x30a96a);}[_0x33e61d(-0x9a,-0xee)](_0x5414b3,_0x9a16f2){function _0x2c4727(_0x2bb682,_0x445692){return _0x4d5f(_0x445692-0x159,_0x2bb682);}return this[_0x2c4727(0x264,0x2ad)][_0x2c4727(0x22c,0x279)](_0x5414b3,_0x9a16f2);}async['initializeCustomDatabase'](){function _0x51fc3d(_0x21df57,_0x57f437){return _0x4d5f(_0x57f437- -0xaf,_0x21df57);}if(this['options']?.[_0x51fc3d(0x74,0x8d)]?.['autoDetectCustomDatabase'])try{await this[_0x51fc3d(0x85,0x8d)][_0x51fc3d(-0x58,-0xe)]();}catch(_0x4dfa5b){console['warn']('Failed to initialize custom database detection:',_0x4dfa5b);}}async['setWorkspaceId'](_0x4f4a73){function _0x3dfb28(_0x463482,_0x47a966){return _0x4d5f(_0x463482-0x349,_0x47a966);}this[_0x3dfb28(0x485,0x410)][_0x3dfb28(0x496,0x49d)](_0x4f4a73),this[_0x3dfb28(0x4bb,0x4b4)]?.['database']?.[_0x3dfb28(0x428,0x408)]&&await this['database']['initialize']();}async[_0x33e61d(-0x12a,-0x101)](_0x4a7338){await this['database']['configureCustomDatabase'](_0x4a7338);}[_0x33e61d(-0xd3,-0xf8)](){function _0x41712e(_0xe02a21,_0x55fe23){return _0x4d5f(_0xe02a21-0x220,_0x55fe23);}return this[_0x41712e(0x35c,0x306)]['getCustomDatabaseStatus']();}}function createClient(_0x1248c7,_0x3f83b4,_0x247705){return new EBaaSClient(_0x1248c7,_0x3f83b4,_0x247705);}const version=_0x33e61d(-0x91,-0xb8);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};
1
+ (function(stringArrayFunction,comparisonValue){function _0x3327a1(_0x491037,_0x311720){return _0xb456(_0x491037- -0x229,_0x311720);}const stringArray=stringArrayFunction();while(!![]){try{const _0x209489=parseInt(_0x3327a1(0x4a,0x2a))/0x1+parseInt(_0x3327a1(0x0,-0x1c))/0x2+-parseInt(_0x3327a1(0x86,0x5))/0x3*(-parseInt(_0x3327a1(-0x24,0x3d))/0x4)+parseInt(_0x3327a1(0xb3,0x124))/0x5*(-parseInt(_0x3327a1(0x6e,0xa2))/0x6)+parseInt(_0x3327a1(0x8e,0x66))/0x7*(-parseInt(_0x3327a1(0xa9,0xc9))/0x8)+parseInt(_0x3327a1(0xd,-0x67))/0x9*(-parseInt(_0x3327a1(0x7d,0x18))/0xa)+parseInt(_0x3327a1(-0x22,0xa))/0xb*(parseInt(_0x3327a1(-0x7,-0x41))/0xc);if(_0x209489===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x4de1bd){stringArray['push'](stringArray['shift']());}}}(_0x444b,0xbdf53));import axios from'axios';import{io}from'socket.io-client';import _0x471021 from'eventemitter3';function _0xb456(_0x1707ee,_0x566ec3){const _0x444b59=_0x444b();return _0xb456=function(_0xb456a3,_0x2de75a){_0xb456a3=_0xb456a3-0x1f2;let _0x1b5bde=_0x444b59[_0xb456a3];if(_0xb456['WGUbRY']===undefined){var _0xde9195=function(_0x471021){const _0x266276='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1a5bb7='',_0x22995e='';for(let _0x109e31=0x0,_0x39b0ce,_0x4579a1,_0x2f5f59=0x0;_0x4579a1=_0x471021['charAt'](_0x2f5f59++);~_0x4579a1&&(_0x39b0ce=_0x109e31%0x4?_0x39b0ce*0x40+_0x4579a1:_0x4579a1,_0x109e31++%0x4)?_0x1a5bb7+=String['fromCharCode'](0xff&_0x39b0ce>>(-0x2*_0x109e31&0x6)):0x0){_0x4579a1=_0x266276['indexOf'](_0x4579a1);}for(let _0x558fd0=0x0,_0x52255c=_0x1a5bb7['length'];_0x558fd0<_0x52255c;_0x558fd0++){_0x22995e+='%'+('00'+_0x1a5bb7['charCodeAt'](_0x558fd0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x22995e);};_0xb456['MLYMud']=_0xde9195,_0x1707ee=arguments,_0xb456['WGUbRY']=!![];}const _0xf710fe=_0x444b59[0x0],_0x5a3bbe=_0xb456a3+_0xf710fe,_0xbe9bfc=_0x1707ee[_0x5a3bbe];return!_0xbe9bfc?(_0x1b5bde=_0xb456['MLYMud'](_0x1b5bde),_0x1707ee[_0x5a3bbe]=_0x1b5bde):_0x1b5bde=_0xbe9bfc,_0x1b5bde;},_0xb456(_0x1707ee,_0x566ec3);}class EBaaSError extends Error{constructor(_0x266276,status=0x0,_0x1a5bb7){super(_0x266276),this['name']='EBaaSError';function _0x1cba4e(_0x49868e,_0x113d73){return _0xb456(_0x49868e-0xc4,_0x113d73);}this[_0x1cba4e(0x30a,0x2be)]=status,this[_0x1cba4e(0x393,0x39d)]=_0x1a5bb7,Error['captureStackTrace']&&Error[_0x1cba4e(0x3a3,0x403)](this,EBaaSError);}['toJSON'](){function _0x58ef3e(_0x2f73bf,_0x4474a2){return _0xb456(_0x4474a2- -0x25f,_0x2f73bf);}return{'name':this[_0x58ef3e(0x7f,0xa)],'message':this[_0x58ef3e(0x32,0x7b)],'status':this['status'],'details':this[_0x58ef3e(0xc3,0x70)],'stack':this[_0x58ef3e(-0x3,-0x7)]};}['toString'](){function _0x2ec923(_0x2ae3f7,_0x354e40){return _0xb456(_0x2ae3f7- -0x129,_0x354e40);}return this[_0x2ec923(0x140,0x184)]+':\x20'+this[_0x2ec923(0x1b1,0x17c)]+'\x20(Status:\x20'+this[_0x2ec923(0x11d,0xea)]+')';}}class HttpClient{constructor(config){this['baseURL']=config[_0x53bf54(-0x29,0x20)],this['apiKey']=config['apiKey'];function _0x53bf54(_0x25b322,_0x31f400){return _0xb456(_0x31f400- -0x283,_0x25b322);}this['client']=axios['create']({'baseURL':this['baseURL'],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x53bf54(0x30,0x5)],...config['headers']}}),this[_0x53bf54(0x10,0x27)]();}[_0x2dedf7(0x3e0,0x3df)](){function _0x7e7e8e(_0x475ec3,_0x1f9fcf){return _0xb456(_0x475ec3-0x85,_0x1f9fcf);}this[_0x7e7e8e(0x35d,0x315)][_0x7e7e8e(0x284,0x2b6)][_0x7e7e8e(0x2c1,0x276)][_0x7e7e8e(0x336,0x2b9)](config=>{return config;},_0x22995e=>{function _0x3133f0(_0x4ea013,_0x4e96e8){return _0xb456(_0x4e96e8-0x2c,_0x4ea013);}return Promise['reject'](new EBaaSError(_0x3133f0(0x245,0x22c),0x0,_0x22995e));}),this[_0x7e7e8e(0x35d,0x304)]['interceptors'][_0x7e7e8e(0x28f,0x283)]['use'](response=>{return response;},_0x109e31=>{const status=_0x109e31['response']?.['status']||0x0,_0x39b0ce=_0x109e31[_0x5234ef(0x360,0x3a2)]?.[_0x5234ef(0x387,0x397)]?.['message']||_0x109e31[_0x5234ef(0x430,0x462)]||'Unknown\x20error',_0x4579a1=_0x109e31['response']?.['data']||_0x109e31;function _0x5234ef(_0x2efafe,_0x182c92){return _0xb456(_0x2efafe-0x156,_0x182c92);}return Promise[_0x5234ef(0x44a,0x43a)](new EBaaSError(_0x39b0ce,status,_0x4579a1));});}async['get'](_0x2f5f59,config){function _0x3f478c(_0x3f51c8,_0xa58b37){return _0xb456(_0x3f51c8-0x343,_0xa58b37);}try{const response=await this[_0x3f478c(0x61b,0x5ca)][_0x3f478c(0x5ee,0x61d)](_0x2f5f59,config);return{'data':response[_0x3f478c(0x574,0x532)],'status':response['status'],'statusText':response['statusText'],'headers':response[_0x3f478c(0x558,0x5b2)]};}catch(_0x558fd0){throw this[_0x3f478c(0x5d1,0x654)](_0x558fd0);}}async['post'](_0x52255c,data,config){try{const response=await this['client']['post'](_0x52255c,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x569e03){throw this['handleError'](_0x569e03);}}async[_0x2dedf7(0x391,0x35b)](_0x4c98fa,data,config){function _0x4cd5a7(_0x1314a9,_0x2e3e82){return _0xb456(_0x2e3e82- -0x232,_0x1314a9);}try{const response=await this['client'][_0x4cd5a7(0x55,-0xc)](_0x4c98fa,data,config);return{'data':response['data'],'status':response[_0x4cd5a7(0x8c,0x14)],'statusText':response[_0x4cd5a7(-0x20,-0x20)],'headers':response[_0x4cd5a7(0x32,-0x1d)]};}catch(_0x1be4aa){throw this[_0x4cd5a7(0xae,0x5c)](_0x1be4aa);}}async['patch'](_0x271a,data,config){function _0xfac91e(_0x3b25ad,_0x1f2b51){return _0xb456(_0x3b25ad- -0x87,_0x1f2b51);}try{const response=await this[_0xfac91e(0x251,0x2c2)]['patch'](_0x271a,data,config);return{'data':response[_0xfac91e(0x1aa,0x19f)],'status':response['status'],'statusText':response[_0xfac91e(0x18b,0x152)],'headers':response['headers']};}catch(_0x100749){throw this['handleError'](_0x100749);}}async[_0x2dedf7(0x32f,0x354)](_0x1622fe,config){function _0x3f7994(_0x379620,_0x2238c6){return _0xb456(_0x379620-0xf2,_0x2238c6);}try{const response=await this[_0x3f7994(0x3ca,0x3e2)][_0x3f7994(0x311,0x320)](_0x1622fe,config);return{'data':response[_0x3f7994(0x323,0x2cf)],'status':response[_0x3f7994(0x338,0x30c)],'statusText':response[_0x3f7994(0x304,0x31b)],'headers':response[_0x3f7994(0x307,0x2a5)]};}catch(_0xa08fd6){throw this[_0x3f7994(0x380,0x3cb)](_0xa08fd6);}}[_0x2dedf7(0x42d,0x3bc)](_0x30dfcc){function _0x13f0da(_0x1f39fc,_0x1bdb0c){return _0xb456(_0x1bdb0c- -0x2ca,_0x1f39fc);}this[_0x13f0da(0x1d,0xe)][_0x13f0da(0x5b,0x17)]['headers'][_0x13f0da(-0x126,-0xd4)]['Authorization']='Bearer\x20'+_0x30dfcc;}['removeAuthToken'](){delete this['client']['defaults']['headers'][_0x407e56(0x122,0x190)]['Authorization'];function _0x407e56(_0x4651a0,_0x52520a){return _0xb456(_0x52520a- -0x66,_0x4651a0);}this['client'][_0x407e56(0x27e,0x27b)]['headers'][_0x407e56(0x151,0x190)]['Authorization']=_0x407e56(0x218,0x1ed)+this[_0x407e56(0x28a,0x222)];}[_0x2dedf7(0x3ee,0x3c3)](_0x2328e0){if(_0x2328e0 instanceof EBaaSError)return _0x2328e0;function _0x1dd18b(_0x4e2ca7,_0x4bd7d3){return _0xb456(_0x4bd7d3- -0x3ca,_0x4e2ca7);}return new EBaaSError(_0x2328e0[_0x1dd18b(-0xe6,-0xf0)]||'HTTP\x20request\x20failed',_0x2328e0[_0x1dd18b(-0x18d,-0x184)]||0x0,_0x2328e0);}}function _0x444b(){const _0x44df09=['l2z1BMn0Aw9UCY92ms8','C3rHDgu','CMvZzxrqyxnZD29Yza','Bg9N','q0HbtK5ftf9fuLjpuG','AgfUzgXLrxjYB3i','l2f1DgGVDJeVC2LNBM91Da','ChjLzML4','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','CMvJB25Uzwn0qxr0zw1WDhm','AgfUzgXLqxv0AevYCM9Y','DxbKyxrLrw52','Aw52B2TL','rMfPBgvKihrVigXPC3qGzMLSzxm','mtq4ofvurujVqq','C3rYAw5NAwz5','zgLZy29UBMvJDa','l3n0B3jHz2uVyNvJA2v0CW','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','DgvZDen1C3rVBunVBM5Ly3rPB24','l2zPBgvZ','Cg9ZDgDYzxnvC2vYBMfTzq','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','Aw1WB3j0twfW','y29Kzq','CNbJ','DxjS','Dgv4Dc9WBgfPBG','Ahr0CenSAwvUDa','mteZmhPoy2L1Da','q0Xpu0ve','BgvHDMu','lMfZyW','C2v0DxbjBNrLCMnLChrVCNm','z2v0','u1vcu0nssujfra','zg93BMXVywq','DMfSDwu','mJy1mJq1A3f6vLvf','z2XVyMfS','DxnL','B3jKzxi','AgvHCNrIzwf0sw50zxj2ywW','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','zxzLBNq','AM9PBMvKt25Jzq','n3z0whnQsa','Cgf0Aa','zxHLy3v0zvf1zxj5','ChvIBgLJ','y2XVC2vK','DxbKyxrLrgf0yq','AgfZq3vZDg9Trgf0ywjHC2u','z2v0q2HHBM5LBhm','CMvTB3zLqwXSq2HHBM5LBhm','AgvHCNrIzwf0','CMvMCMvZAfnLC3nPB24','y29UBMvJDf9LCNjVCG','p29WzxjHDgLVBJ11ChnLCNq','zw1PDa','x2DLDfnVy2TLDa','yxnJzw5KAw5N','z2v0tg9NCW','DMvYAwz5','rMfPBgvKihrVigrVD25SB2fKigzPBgu','zMLSDgvYCW','z2v0u3rHDhvZ','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','B3bLCMf0B3i','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','zgv0ywLSCW','BwfRzvjLzG','Dg9tDhjPBMC','mZG2mZK2ohv1yxzzua','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','l2LUzM8','C3vIC2nYAxb0Aw9UCW','Dw50CMfJAW','y2XPzw50','x3jLAM9PBG','BwvZC2fNzq','z2v0v29YA3nWywnLswq','mJqZntvhy2vHs3O','y2XLyxjtzxnZAw9U','AgfZ','y2fWDhvYzvn0ywnRvhjHy2u','uhjLzMvY','zgvMyxvSDhm','zgvSzxrLt3b0Aw9UCW','AM9PBMvK','CMvTB3zLq3vZDg9Trgf0ywjHC2u','C3bSAxq','BgvHDMLUzW','DxbKyxrLt3b0Aw9UCW','zMLSDgvY','y29UBMvJDa','l2f1DgGVDJeVC2rRl3nPz25PBG','z2v0twv0CMLJCW','C2v0DxbizwfYDgjLyxq','C2nOzw1H','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','C29YDej5','Bg9HzfnLC3nPB24','zxHLy3v0zq','Bw92zq','CxvLCNK','CMvQzwn0','y3vYCMvUDfnJAgvTyq','yM9KEq','C2v0v29YA3nWywnLswq','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','yNjVywrJyxn0','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','y29TBw9U','zgvWBg95','Dw5ZDwjZy3jPyMu','C29JA2v0t3b0Aw9UCW','D2fYBG','Dg9vChbLCKnHC2u','rMfPBgvKihrVihvWBg9HzcbMAwXL','zw50CNLWB2LUDa','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','Aw50zxjJzxb0B3jZ','uMvXDwvZDcbMywLSzwq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','y2HHBM5LBhm','AwXPA2u','Cg9ZDa','mJHrAKHbsLy','Bwv0ywrHDge','mJqYBgTtsgPU','y2fJAgvdB250CM9S','ChvZAa','CMvZCg9UC2u','zM9YrwfJAa','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','DgfIBgu','DgvZDenVBM5Ly3rPB24','yNvJA2v0swq','y3jLzgvUDgLHBhm','ChjLC2vUy2u','C3rHDhvZvgv4Da','BM93','DxbKyxrLqNvJA2v0','AgvHzgvYCW','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','C2vHCMnO','ywnJzxnZx3rVA2vU','z2v0qNvJA2v0','Dg9WAwm','Cgf0y2G','zgvSzxrLqNvJA2v0','y29UzMLN','Cg9ZDgDYzxneyxrHyMfZzq','zgvSzxrL','zgf0yufYCMf5','x3rYAwDNzxi','nJmYmJKYs2nKC3nc','l2rLCgXVEq','z2v0vxnHz2u','BgvUz3rO','Chv0','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','x2PVAw4','mJm1mJm1nLLxtvrVqG','CMvJB25Uzwn0','y2XLyxi','DMfSDwvZ','Dw5KzwzPBMvK','y29UBMvJDgvK','Ec10B3rHBc1JB3vUDa','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','zgf0yq','z2v0u2vZC2LVBG','C2vSzwn0','Cg9ZDgDYzxnFy2HHBMDLCW','y29UDgfPBNm','nZe4mtfLuK1pCMK','lMrLC2m','CMvJB25Uzwn0sw50zxj2ywW','D29YA3nWywnLswq','BhrL','CMvTB3zLqwXStgLZDgvUzxjZ','CMvXDwvZDa','B2zMC2v0','y3vYCMvUDfnLC3nPB24','zMLSzq','zNvUy3rPB25Z','zNjVBq','rMfPBgvKihrVihjLBw92zsbMAwXLCW','B3b0Aw9UCW','y29UBMvJDgLVBLn0yxrL','AM9PBMLUzW','C3rHDhvZ','y29SDw1U','AxndB25Uzwn0zwq','C2v0u2vZC2LVBKLUDgvYBMfS','p29WzxjHDgLVBJ1ZzwXLy3q','l3n0B3jHz2uVyNvJA2v0CY8','qxv0AgvUDgLJyxrPB24GzMfPBgvK','AxnezwXLDgu','Bgv2zwW','Ag9ZDa','B2zM','x3nLDfn0yxrL','DhjHy2S','qMvHCMvYia','C2v0sxrLBq','CgvYAw9K','BgLZDa','ChjLzMvY','C3rHy2S','C2LNBKLU','z3rL','Bwf0y2G','C29JA2v0','C2LNBLvW','zgv0zwn0zwrdB25MAwC','CMfUz2u','p29WzxjHDgLVBJ1KzwXLDgu','l2zPBgvZlW','z2v0rgv0zwn0zwrdB25MAwC','DhjHBNnMB3jT','C2vZC2LVBG','Cg9ZDgDYzxnqB3j0','BgLRzq','zxjYB3i','C3nSrw5HyMXLza','BMfTzq','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','Cg9ZDgDYzxnFy2HHBMDLCZO','y3jLyxrLqNvJA2v0','CMvTB3zLq2HHBM5LBa','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','l2zPBgvZl2nVChK','zgv0zwn0q3vZDg9Trgf0ywjHC2u','DxbZzxj0','y29UDgvUDfr5Cgu','nde2ndeZCMLyEwr1','DxbKyxrLvxnLCG','p29WzxjHDgLVBJ1PBNnLCNq','zgLZy29UBMvJDgvK','C2vUza','rMfPBgvKihrVignVChKGzMLSzq','y2HHBM5LBa','CMvHBhrPBwu','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','yxbWzw5K','CgfYC2u','DxbKyxrL','p3vWC2vYDd10CNvL','l2f1DgGVDJeVDxnLCG','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','BgLTAxq','zgf0ywjHC2u','z2v0uhvIBgLJvxjS','l3nKAY92ms8','zw52','C2v0qxv0AfrVA2vU','yxbPs2v5'];_0x444b=function(){return _0x44df09;};return _0x444b();}class AuthClient{constructor(_0xb499b2){this[_0x57e237(-0x17c,-0x1ae)]=null;function _0x57e237(_0x456936,_0x22dc65){return _0xb456(_0x456936- -0x3ba,_0x22dc65);}this['httpClient']=_0xb499b2,this['loadSession']();}async[_0x2dedf7(0x411,0x392)](data){function _0x47fec0(_0x495f95,_0x10c10b){return _0xb456(_0x10c10b- -0x253,_0x495f95);}try{const response=await this[_0x47fec0(0x97,0x52)]['post']('/auth/v1/signup',data);return response['data']['session']&&this['setSessionInternal'](response['data']['session']),response[_0x47fec0(-0xa0,-0x22)];}catch(_0x31190c){throw this[_0x47fec0(-0x37,0x40)](_0x31190c);}}async[_0x2dedf7(0x3f6,0x38e)](data){function _0x35d542(_0x22b06a,_0x348d23){return _0xb456(_0x348d23-0x2c4,_0x22b06a);}try{const response=await this[_0x35d542(0x577,0x569)]['post'](_0x35d542(0x57f,0x5ae),data);return response['data'][_0x35d542(0x4f8,0x528)]&&this[_0x35d542(0x49b,0x50d)](response['data']['session']),response['data'];}catch(_0x2a551d){throw this[_0x35d542(0x545,0x557)](_0x2a551d);}}async['signOut'](){function _0x399c6a(_0x108585,_0x5ad5eb){return _0xb456(_0x5ad5eb- -0x9d,_0x108585);}try{await this['httpClient']['post'](_0x399c6a(0x180,0x1f2)),this[_0x399c6a(0x1e0,0x240)]();}catch(_0x112c0c){this[_0x399c6a(0x298,0x240)]();throw this[_0x399c6a(0x1b3,0x1f6)](_0x112c0c);}}async['getUser'](){function _0x56d9fc(_0x121beb,_0x24f232){return _0xb456(_0x24f232- -0x2e9,_0x121beb);}if(!this['currentSession']?.['access_token'])return null;try{const response=await this['httpClient'][_0x56d9fc(-0x81,-0x3e)](_0x56d9fc(-0x95,-0x69));return response['data']['user'];}catch(_0x2fc137){if(_0x2fc137 instanceof EBaaSError&&_0x2fc137[_0x56d9fc(-0x116,-0xa3)]===0x191)return this[_0x56d9fc(0x51,-0xc)](),null;throw this['handleAuthError'](_0x2fc137);}}async[_0x2dedf7(0x397,0x3f6)](){if(!this['currentSession']?.['refresh_token'])return null;function _0x5ecc79(_0x44755d,_0x1a5973){return _0xb456(_0x44755d- -0x323,_0x1a5973);}try{const response=await this['httpClient'][_0x5ecc79(-0x11f,-0x118)]('/auth/v1/refresh',{'refresh_token':this['currentSession']['refresh_token']});if(response[_0x5ecc79(-0xf2,-0x167)]['session'])return this['setSession'](response['data'][_0x5ecc79(-0xbf,-0x11d)]),response[_0x5ecc79(-0xf2,-0xff)]['session'];return null;}catch(_0x3aecd3){this['clearSession']();throw this['handleAuthError'](_0x3aecd3);}}async[_0x2dedf7(0x3ea,0x3c0)](_0x265349){try{await this['httpClient']['post']('/auth/v1/reset-password',{'email':_0x265349});}catch(_0x299b90){throw this['handleAuthError'](_0x299b90);}}async[_0x2dedf7(0x405,0x3a9)](data){function _0x211c54(_0x29d973,_0x20d87d){return _0xb456(_0x20d87d-0x34b,_0x29d973);}try{const response=await this[_0x211c54(0x65f,0x5f0)][_0x211c54(0x507,0x571)]('/auth/v1/user',data);return response['data']['user'];}catch(_0x4a7006){throw this[_0x211c54(0x57b,0x5de)](_0x4a7006);}}[_0x2dedf7(0x390,0x367)](){function _0x27882b(_0xafe53e,_0x5a562e){return _0xb456(_0x5a562e- -0x189,_0xafe53e);}return this[_0x27882b(0xdc,0xb5)];}['setSession'](_0x104a61){this['currentSession']=_0x104a61;function _0x41f1c6(_0x481776,_0x4cd79f){return _0xb456(_0x4cd79f-0x2ab,_0x481776);}this['httpClient']['setAuthToken'](_0x104a61[_0x41f1c6(0x486,0x4c3)]),typeof localStorage!==_0x41f1c6(0x483,0x4d8)&&localStorage[_0x41f1c6(0x52b,0x4ff)]('ebaas.auth.session',JSON['stringify'](_0x104a61));}['onAuthStateChange'](_0x12d169){return()=>{};}[_0x2dedf7(0x35e,0x37e)](_0x22bec3){this['currentSession']=_0x22bec3,this[_0xac7fc8(0x292,0x25f)][_0xac7fc8(0x274,0x294)](_0x22bec3['access_token']);function _0xac7fc8(_0x3f17b0,_0x5d0605){return _0xb456(_0x3f17b0- -0x13,_0x5d0605);}typeof localStorage!=='undefined'&&localStorage[_0xac7fc8(0x241,0x220)]('ebaas.auth.session',JSON[_0xac7fc8(0x285,0x2f9)](_0x22bec3));}[_0x2dedf7(0x3b1,0x412)](){this[_0x329ecc(-0x107,-0x13a)]=null,this[_0x329ecc(-0x147,-0xd3)]['removeAuthToken']();function _0x329ecc(_0xafea27,_0x39158e){return _0xb456(_0x39158e- -0x378,_0xafea27);}typeof localStorage!=='undefined'&&localStorage['removeItem']('ebaas.auth.session');}[_0x2dedf7(0x444,0x425)](){function _0x4f1b87(_0x448bb1,_0xb46e46){return _0xb456(_0x448bb1- -0x20f,_0xb46e46);}if(typeof localStorage!==_0x4f1b87(0x1e,-0xa)){const _0x47dd29=localStorage['getItem']('ebaas.auth.session');if(_0x47dd29)try{const _0x52e405=JSON['parse'](_0x47dd29);this['setSessionInternal'](_0x52e405);}catch(_0x3f595b){this[_0x4f1b87(0xce,0xb2)]();}}}[_0x2dedf7(0x3b0,0x3c8)](_0x2750e8){function _0xd0237c(_0x403bfb,_0x1bfeb9){return _0xb456(_0x403bfb-0x20f,_0x1bfeb9);}if(_0x2750e8 instanceof EBaaSError)return _0x2750e8;return new EBaaSError(_0x2750e8['message']||_0xd0237c(0x45b,0x44b),_0x2750e8[_0xd0237c(0x455,0x441)]||0x0,_0x2750e8);}}class QueryBuilder{constructor(_0x58e77d,_0x147d27,_0x2a0f08,_0x51ffea){this['httpClient']=_0x58e77d,this['table']=_0x147d27,this['schema']=_0x2a0f08;function _0x21cdc7(_0x46c5cb,_0x11a34b){return _0xb456(_0x46c5cb-0x2c8,_0x11a34b);}this[_0x21cdc7(0x501,0x555)]=_0x51ffea,this['query']={'filters':[]};}[_0x2dedf7(0x33e,0x368)](_0x2162c3='*',_0x588f98){this['query'][_0x5774a6(-0x22,0x3)]=_0x2162c3;function _0x5774a6(_0x58a548,_0x376ebd){return _0xb456(_0x376ebd- -0x230,_0x58a548);}return this;}['insert'](data,_0x500fea){function _0x32f3a9(_0x5b4dae,_0x6973be){return _0xb456(_0x5b4dae-0x359,_0x6973be);}return this[_0x32f3a9(0x612,0x682)]('POST',_0x32f3a9(0x5de,0x566)+this['table']+_0x32f3a9(0x5ce,0x5f4),{'data':data,'options':_0x500fea});}[_0x2dedf7(0x3a4,0x3b3)](data,_0x3bd1ea){this[_0x431104(0x3ea,0x3fb)]['updateData']=data;function _0x431104(_0x1e51a8,_0x3a2363){return _0xb456(_0x1e51a8-0xf7,_0x3a2363);}return this['query'][_0x431104(0x3de,0x388)]=_0x3bd1ea,this;}[_0x2dedf7(0x402,0x3a6)](data,_0x2e5e6c){function _0x458c8c(_0x5e69db,_0x49fd13){return _0xb456(_0x5e69db-0x2f9,_0x49fd13);}return this[_0x458c8c(0x5b2,0x59d)]('POST','/sdk/v1/'+this[_0x458c8c(0x506,0x4a1)]+_0x458c8c(0x5bc,0x567),{'data':data,'options':{..._0x2e5e6c,'upsert':!![]}});}[_0x2dedf7(0x2f6,0x354)](_0x437004){function _0x19025b(_0x50108b,_0x35e5f5){return _0xb456(_0x50108b-0x305,_0x35e5f5);}return this['query'][_0x19025b(0x5e7,0x59d)]=_0x437004,this[_0x19025b(0x5f8,0x5a1)][_0x19025b(0x552,0x545)]=!![],this;}['eq'](_0x19c707,_0x53c659){this[_0x454745(0x56f,0x545)][_0x454745(0x57f,0x51c)][_0x454745(0x498,0x45b)]({'column':_0x19c707,'operator':'eq','value':_0x53c659});function _0x454745(_0x19ba8e,_0x523338){return _0xb456(_0x523338-0x252,_0x19ba8e);}return this;}['neq'](_0x1a65fb,_0x4aa29a){this[_0x433d5e(0xd4,0x5a)]['filters'][_0x433d5e(-0xa4,-0x90)]({'column':_0x1a65fb,'operator':'neq','value':_0x4aa29a});function _0x433d5e(_0x322103,_0x586d85){return _0xb456(_0x586d85- -0x299,_0x322103);}return this;}['gt'](_0x4a5ee2,_0x26efde){return this['query']['filters']['push']({'column':_0x4a5ee2,'operator':'gt','value':_0x26efde}),this;}[_0x2dedf7(0x320,0x38f)](_0xc3480c,_0x348cbb){this['query'][_0x5cbcda(0x25,-0x3c)]['push']({'column':_0xc3480c,'operator':_0x5cbcda(-0x6f,-0xac),'value':_0x348cbb});function _0x5cbcda(_0x11bce3,_0x2861d7){return _0xb456(_0x2861d7- -0x306,_0x11bce3);}return this;}['lt'](_0x459b7e,_0x7290fb){return this['query']['filters']['push']({'column':_0x459b7e,'operator':'lt','value':_0x7290fb}),this;}[_0x2dedf7(0x307,0x36f)](_0x346009,_0x2a0434){function _0x80916f(_0x2e4ac0,_0x41f615){return _0xb456(_0x41f615- -0x7c,_0x2e4ac0);}return this['query'][_0x80916f(0x25c,0x24e)][_0x80916f(0x139,0x18d)]({'column':_0x346009,'operator':_0x80916f(0x205,0x1be),'value':_0x2a0434}),this;}['like'](_0x37c50e,_0xedb85){this[_0x11f4bd(0x43c,0x3ba)][_0x11f4bd(0x413,0x3e2)][_0x11f4bd(0x352,0x3a4)]({'column':_0x37c50e,'operator':_0x11f4bd(0x3af,0x3c1),'value':_0xedb85});function _0x11f4bd(_0x220fde,_0x5e4824){return _0xb456(_0x220fde-0x149,_0x5e4824);}return this;}[_0x2dedf7(0x34e,0x338)](_0x37f5c2,_0x212f94){this[_0x413afd(0x16d,0xed)][_0x413afd(0xef,0xc4)]['push']({'column':_0x37f5c2,'operator':_0x413afd(0x22,-0x3),'value':_0x212f94});function _0x413afd(_0x3750b4,_0x2cfb30){return _0xb456(_0x2cfb30- -0x206,_0x3750b4);}return this;}['is'](_0x486914,_0x156c01){this['query'][_0x1e3a42(-0xca,-0xfc)]['push']({'column':_0x486914,'operator':'is','value':_0x156c01});function _0x1e3a42(_0x34c1ae,_0x45e617){return _0xb456(_0x34c1ae- -0x394,_0x45e617);}return this;}['in'](_0x377e9f,_0x1471b1){return this['query']['filters']['push']({'column':_0x377e9f,'operator':'in','value':_0x1471b1}),this;}['contains'](_0x4c8a71,_0xdf33c){function _0xa15dec(_0x3839c1,_0x490a0d){return _0xb456(_0x3839c1- -0x2eb,_0x490a0d);}return this[_0xa15dec(0x8,0x53)]['filters'][_0xa15dec(-0xe2,-0x67)]({'column':_0x4c8a71,'operator':_0xa15dec(-0xb6,-0x12b),'value':_0xdf33c}),this;}[_0x2dedf7(0x391,0x390)](_0x5c066b){function _0x2d6109(_0x4c1335,_0xbf678b){return _0xb456(_0x4c1335-0x327,_0xbf678b);}return Object['entries'](_0x5c066b)[_0x2d6109(0x532,0x50c)](([_0x5f4f41,_0x2c817c])=>{this['eq'](_0x5f4f41,_0x2c817c);}),this;}[_0x2dedf7(0x36d,0x3e7)](_0x2c457f,_0x363b19){function _0x14e4ba(_0x3167b8,_0x5a1792){return _0xb456(_0x5a1792- -0x1f1,_0x3167b8);}return!this[_0x14e4ba(0x87,0x102)][_0x14e4ba(0xfc,0xc1)]&&(this['query'][_0x14e4ba(0xb2,0xc1)]=[]),this[_0x14e4ba(0xbf,0x102)]['order']['push']({'column':_0x2c457f,'ascending':_0x363b19?.[_0x14e4ba(0x60,0xd5)]!==![]}),this;}['limit'](count){this['query'][_0x56cbbf(0x3c2,0x41c)]=count;function _0x56cbbf(_0x36e20d,_0x57adfd){return _0xb456(_0x36e20d-0x140,_0x57adfd);}return this;}['range'](from,_0x38967e){function _0x136e34(_0x56d216,_0x110fff){return _0xb456(_0x56d216-0xbc,_0x110fff);}return this[_0x136e34(0x3af,0x415)][_0x136e34(0x31b,0x310)]={'from':from,'to':_0x38967e},this;}async[_0x2dedf7(0x4a5,0x426)](){function _0x1f01c0(_0x57789d,_0x5a4f61){return _0xb456(_0x5a4f61-0x198,_0x57789d);}if(this['query']['updateData'])return this[_0x1f01c0(0x4be,0x451)]('PATCH','/sdk/v1/'+this[_0x1f01c0(0x33f,0x3a5)],{'data':this[_0x1f01c0(0x4a0,0x48b)][_0x1f01c0(0x3f8,0x454)],'options':this[_0x1f01c0(0x40c,0x48b)]['updateOptions'],'filters':this['query']['filters']});else return this['query']['isDelete']?this[_0x1f01c0(0x3e1,0x451)]('DELETE',_0x1f01c0(0x3c0,0x41d)+this[_0x1f01c0(0x3bf,0x3a5)]+_0x1f01c0(0x401,0x3f8),{'options':this[_0x1f01c0(0x479,0x48b)]['deleteOptions'],'filters':this[_0x1f01c0(0x436,0x48b)][_0x1f01c0(0x454,0x462)]}):this['executeQuery']('GET','/sdk/v1/'+this['table']+_0x1f01c0(0x3db,0x3e2),{'select':this[_0x1f01c0(0x422,0x48b)]['select'],'filters':this[_0x1f01c0(0x4ef,0x48b)]['filters'],'order':this[_0x1f01c0(0x48d,0x48b)][_0x1f01c0(0x422,0x44a)],'limit':this[_0x1f01c0(0x468,0x48b)][_0x1f01c0(0x43d,0x41a)],'range':this['query'][_0x1f01c0(0x411,0x3f7)]});}async['single'](){function _0x4bb36b(_0x4aa024,_0x561293){return _0xb456(_0x4aa024-0x10b,_0x561293);}this[_0x4bb36b(0x38d,0x40c)](0x1);const result=await this[_0x4bb36b(0x3fc,0x43e)]();return{'data':result[_0x4bb36b(0x33c,0x2ce)]?.[0x0]||null,'error':result['error']};}async['executeQuery'](_0x4f22de,_0x3a073f,_0x5678fd){function _0x4ed0eb(_0xe9d096,_0x4adaa2){return _0xb456(_0x4adaa2-0x2f5,_0xe9d096);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x4f22de==='GET'){const _0x2d75e5=_0x3a073f[_0x4ed0eb(0x5d3,0x5da)]('?'),_0x151f39=_0x2d75e5[0x0],existingParams=new URLSearchParams(_0x2d75e5[0x1]||'');if(_0x5678fd[_0x4ed0eb(0x54c,0x528)])existingParams[_0x4ed0eb(0x545,0x571)]('select',_0x5678fd['select']);_0x5678fd[_0x4ed0eb(0x5f1,0x5bf)]?.['length']&&_0x5678fd[_0x4ed0eb(0x62b,0x5bf)][_0x4ed0eb(0x510,0x500)](filter=>{function _0x305060(_0x43f635,_0x310486){return _0xb456(_0x310486-0x2dd,_0x43f635);}existingParams['append'](filter[_0x305060(0x4bd,0x524)],filter[_0x305060(0x5db,0x5aa)]+'.'+filter['value']);});if(_0x5678fd[_0x4ed0eb(0x5f9,0x5a7)]?.[_0x4ed0eb(0x58b,0x51a)]){const orderStr=_0x5678fd['order']['map'](_0x39080f=>''+_0x39080f['column']+(_0x39080f[_0x4ed0eb(0x594,0x5bb)]?_0x4ed0eb(0x563,0x59e):_0x4ed0eb(0x506,0x52c)))['join'](',');existingParams['append']('order',orderStr);}if(_0x5678fd['limit'])existingParams['append'](_0x4ed0eb(0x4fa,0x577),_0x5678fd[_0x4ed0eb(0x50d,0x577)][_0x4ed0eb(0x622,0x5c6)]());_0x5678fd['range']&&(existingParams['append'](_0x4ed0eb(0x4eb,0x532),_0x5678fd[_0x4ed0eb(0x5ad,0x554)]['from'][_0x4ed0eb(0x5d6,0x5c6)]()),existingParams[_0x4ed0eb(0x5e9,0x571)]('limit',(_0x5678fd[_0x4ed0eb(0x543,0x554)]['to']-_0x5678fd['range'][_0x4ed0eb(0x593,0x536)]+0x1)['toString']())),response=await this[_0x4ed0eb(0x551,0x59a)][_0x4ed0eb(0x527,0x5a0)](_0x151f39+'?'+existingParams[_0x4ed0eb(0x5a6,0x5c6)](),{'headers':headers});}else{if(_0x4f22de==='DELETE'){const _0x161a3d=_0x3a073f[_0x4ed0eb(0x5af,0x5da)]('?'),_0x122cce=_0x161a3d[0x0],existingParams=new URLSearchParams(_0x161a3d[0x1]||'');!existingParams['has']('operation')&&existingParams['append']('operation','delete');_0x5678fd[_0x4ed0eb(0x582,0x5bf)]?.['length']&&_0x5678fd[_0x4ed0eb(0x544,0x5bf)][_0x4ed0eb(0x521,0x500)](filter=>{function _0x14e227(_0x2c029d,_0xaf5158){return _0xb456(_0x2c029d-0xdf,_0xaf5158);}existingParams[_0x14e227(0x35b,0x2f3)](filter[_0x14e227(0x326,0x31c)],filter['operator']+'.'+filter[_0x14e227(0x38d,0x3d6)]);});const deleteUrl=_0x122cce+'?'+existingParams['toString']();console[_0x4ed0eb(0x559,0x581)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x4ed0eb(0x5c6,0x581)]('\uD83D\uDD27 DELETE headers:',headers),console['log']('\uD83D\uDD27 DELETE filtros originais:',_0x5678fd[_0x4ed0eb(0x5fe,0x5bf)]),response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x4f22de==='PATCH'){const _0x42c793=_0x3a073f[_0x4ed0eb(0x60c,0x5da)]('?'),_0xb71fae=_0x42c793[0x0],existingParams=new URLSearchParams(_0x42c793[0x1]||'');!existingParams['has']('operation')&&existingParams[_0x4ed0eb(0x578,0x571)]('operation',_0x4ed0eb(0x5f1,0x573));_0x5678fd['filters']?.['length']&&_0x5678fd['filters']['forEach'](filter=>{function _0x4c9edd(_0x2c421c,_0x32eed2){return _0xb456(_0x32eed2-0x1c8,_0x2c421c);}existingParams[_0x4c9edd(0x450,0x444)](filter[_0x4c9edd(0x42b,0x40f)],filter['operator']+'.'+filter[_0x4c9edd(0x481,0x476)]);});_0x5678fd['options']?.['prefer']&&(headers['Prefer']=_0x5678fd[_0x4ed0eb(0x534,0x538)][_0x4ed0eb(0x566,0x54c)]);const updateUrl=_0xb71fae+'?'+existingParams[_0x4ed0eb(0x5a3,0x5c6)]();response=await this['httpClient']['patch'](updateUrl,_0x5678fd['data'],{'headers':headers});}else{let _0x4ce7dc=_0x5678fd['data'];!headers[_0x4ed0eb(0x58f,0x5d5)]&&(headers[_0x4ed0eb(0x59c,0x5d5)]=_0x4ed0eb(0x4da,0x4f3)),_0x5678fd[_0x4ed0eb(0x59d,0x538)]?.[_0x4ed0eb(0x5a1,0x566)]&&(headers[_0x4ed0eb(0x5ec,0x5d5)]=_0x4ed0eb(0x521,0x4e8)),_0x5678fd[_0x4ed0eb(0x532,0x515)]&&(_0x4ce7dc=_0x5678fd[_0x4ed0eb(0x54f,0x515)]),response=await this[_0x4ed0eb(0x5b0,0x59a)][_0x4ed0eb(0x517,0x4f9)](_0x3a073f,_0x4ce7dc,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response['headers']?.[_0x4ed0eb(0x557,0x524)]?parseInt(response['headers']['x-total-count']):undefined};}catch(_0x2069b6){return{'data':null,'error':_0x2069b6 instanceof EBaaSError?_0x2069b6:new EBaaSError(_0x2069b6 instanceof Error?_0x2069b6['message']:'Database\x20operation\x20failed',0x0,_0x2069b6)};}}}class CustomDatabaseManager{constructor(_0x44a92c,_0x1e1977){function _0x48574c(_0x250a22,_0x339637){return _0xb456(_0x250a22- -0x2,_0x339637);}this['httpClient']=_0x44a92c,this[_0x48574c(0x237,0x256)]=_0x1e1977;}async['detectCustomDatabase'](){if(!this[_0x5af955(0x33b,0x378)])return{'hasCustomDatabase':![]};try{const response=await this[_0x5af955(0x37e,0x3e4)]['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x5af955(0x315,0x385)]===0xc8&&response['data']?.[_0x5af955(0x2f6,0x35c)]){const config=response[_0x5af955(0x368,0x370)]['config'],_0x57c74c={'host':config['postgresHost'],'port':config[_0x5af955(0x32c,0x3a4)],'database':config[_0x5af955(0x303,0x35d)],'username':config[_0x5af955(0x436,0x3dd)],'password':'','schema':config['postgresSchema'],'sslEnabled':config[_0x5af955(0x36d,0x3a7)]};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x57c74c},this['detectedConfig'];}}catch(_0x198c33){if(_0x198c33?.[_0x5af955(0x3c7,0x385)]===0x194)return this[_0x5af955(0x349,0x39d)]={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x198c33);}function _0x5af955(_0x22d04c,_0x17f31f){return _0xb456(_0x17f31f-0x13f,_0x22d04c);}return this[_0x5af955(0x3b4,0x39d)]={'hasCustomDatabase':![]},this['detectedConfig'];}async['testConnection'](_0xe23cc1){function _0x2de9fc(_0x5f1d94,_0x3cb018){return _0xb456(_0x3cb018- -0xa9,_0x5f1d94);}try{const response=await this[_0x2de9fc(0x1d5,0x1fc)][_0x2de9fc(0x1b8,0x15b)]('/admin/v1/workspace/custom-database/test-connection',_0xe23cc1,{'headers':this['workspaceId']?{'X-Workspace-ID':this[_0x2de9fc(0x195,0x190)]}:{}});return response[_0x2de9fc(0x1d8,0x188)];}catch(_0x3e416e){return{'success':![],'message':_0x3e416e?.[_0x2de9fc(0x2a7,0x231)]||'Failed\x20to\x20test\x20connection'};}}async[_0x2dedf7(0x375,0x365)](_0x1bc568){function _0x152b93(_0x116925,_0x40bd32){return _0xb456(_0x116925- -0x121,_0x40bd32);}if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this[_0x152b93(0x184,0x16a)][_0x152b93(0xe3,0xc5)]('/admin/v1/workspace/custom-database',{'workspaceId':this[_0x152b93(0x118,0x110)],..._0x1bc568},{'headers':{'X-Workspace-ID':this[_0x152b93(0x118,0xe5)]}}),config=response[_0x152b93(0x110,0x146)]['config'];return this[_0x152b93(0x13d,0x11b)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x1bc568},config;}async[_0x2dedf7(0x41c,0x419)](){if(!this[_0x4cd829(0x3e4,0x45f)])throw new Error('Workspace ID is required to remove custom database');function _0x4cd829(_0x60167a,_0x44ccf6){return _0xb456(_0x44ccf6-0x226,_0x60167a);}await this['httpClient'][_0x4cd829(0x499,0x445)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this[_0x4cd829(0x43c,0x45f)]}}),this['detectedConfig']={'hasCustomDatabase':![]};}[_0x2dedf7(0x3bb,0x397)](){return this['detectedConfig'];}[_0x2dedf7(0x463,0x3f2)](){function _0x16ddd2(_0x21fa6e,_0x4417e4){return _0xb456(_0x21fa6e-0x1a,_0x4417e4);}return this['detectedConfig']?.[_0x16ddd2(0x2d7,0x25a)]??![];}[_0x2dedf7(0x378,0x34b)](){function _0x43b7d7(_0x3b856e,_0x1a942d){return _0xb456(_0x3b856e- -0x2d5,_0x1a942d);}return this[_0x43b7d7(-0x77,-0x7f)]?.[_0x43b7d7(-0xc5,-0xae)];}['setWorkspaceId'](_0x14849a){this['workspaceId']=_0x14849a,this['detectedConfig']=undefined;}['getWorkspaceId'](){function _0x5c9584(_0x108c94,_0x296a6c){return _0xb456(_0x108c94-0x317,_0x296a6c);}return this[_0x5c9584(0x550,0x5a7)];}['getStatus'](){function _0x4dcab6(_0x25c79c,_0x573941){return _0xb456(_0x573941- -0xd0,_0x25c79c);}return{'workspaceId':this[_0x4dcab6(0x153,0x169)],'hasConfig':this['hasCustomDatabase'](),'configDetails':this[_0x4dcab6(0x1d4,0x18e)]?.[_0x4dcab6(0x13f,0x140)]?{'host':this['detectedConfig']['credentials'][_0x4dcab6(0x12f,0x17f)],'port':this[_0x4dcab6(0x15d,0x18e)]['credentials']['port'],'database':this['detectedConfig']['credentials'][_0x4dcab6(0x1cb,0x1b3)],'schema':this[_0x4dcab6(0x1ab,0x18e)]['credentials'][_0x4dcab6(0x1db,0x21d)]||_0x4dcab6(0x25a,0x1ea),'sslEnabled':this[_0x4dcab6(0x201,0x18e)]['credentials']['sslEnabled']||![]}:undefined};}}function _0x2dedf7(_0x4417f4,_0x53b2f2){return _0xb456(_0x53b2f2-0x135,_0x4417f4);}class DatabaseClient{constructor(_0x329973,_0x384d30){this[_0x1174a7(-0xce,-0x69)]=_0x329973;function _0x1174a7(_0x4d515a,_0x3cbe6c){return _0xb456(_0x3cbe6c- -0x30e,_0x4d515a);}this['customDatabaseManager']=new CustomDatabaseManager(_0x329973,_0x384d30);}['from'](_0x798f5){function _0x587864(_0x52546a,_0x50244c){return _0xb456(_0x50244c- -0x18c,_0x52546a);}return new QueryBuilder(this[_0x587864(0xe2,0x119)],_0x798f5,this[_0x587864(0x194,0x169)],this['customDatabaseManager'][_0x587864(0x17e,0x14f)]());}[_0x2dedf7(0x3d0,0x3d7)](_0x197e61,_0x32974e){function _0x2a719d(_0x47442e,_0x53903d){return _0xb456(_0x53903d- -0x1c7,_0x47442e);}return this['httpClient'][_0x2a719d(-0x39,0x3d)]('/rpc/'+_0x197e61,_0x32974e);}['schema'](_0x5a9600){function _0xd79e44(_0x9056df,_0x2d2b35){return _0xb456(_0x2d2b35- -0x356,_0x9056df);}const _0x48411b=new DatabaseClient(this[_0xd79e44(-0x58,-0xb1)],this['customDatabaseManager']['getWorkspaceId']());return _0x48411b['currentSchema']=_0x5a9600,_0x48411b[_0xd79e44(-0xe7,-0x155)]=this[_0xd79e44(-0x1d0,-0x155)],_0x48411b;}async['detectCustomDatabase'](){function _0x399d82(_0x393f81,_0x21ccc6){return _0xb456(_0x21ccc6- -0x111,_0x393f81);}return this['customDatabaseManager'][_0x399d82(0x157,0x15f)]();}async[_0x2dedf7(0x41f,0x3d1)](_0x1d91d1){function _0x14acda(_0x2484e,_0x1d2778){return _0xb456(_0x1d2778- -0x253,_0x2484e);}return this['customDatabaseManager'][_0x14acda(-0x32,-0x45)](_0x1d91d1);}async[_0x2dedf7(0x35b,0x365)](_0x153fa7){function _0x1f2db1(_0xae0318,_0x4107cb){return _0xb456(_0x4107cb- -0x2c,_0xae0318);}return this[_0x1f2db1(0x155,0x1d5)]['configureCustomDatabase'](_0x153fa7);}async['removeCustomDatabase'](){return this['customDatabaseManager']['removeCustomDatabase']();}['isUsingCustomDatabase'](){function _0x249f6d(_0x51053d,_0x341172){return _0xb456(_0x51053d- -0x3bc,_0x341172);}return this[_0x249f6d(-0x1bb,-0x198)]['hasCustomDatabase']();}['getCustomDatabaseStatus'](){function _0x368880(_0x1271fe,_0x5cc99f){return _0xb456(_0x1271fe-0x209,_0x5cc99f);}return this[_0x368880(0x40a,0x453)][_0x368880(0x4d4,0x486)]();}[_0x2dedf7(0x340,0x327)](_0x21566f){function _0x3569d5(_0x351ba7,_0x276f1d){return _0xb456(_0x351ba7- -0x19,_0x276f1d);}this[_0x3569d5(0x1e8,0x18d)][_0x3569d5(0x1d9,0x15c)](_0x21566f);}async['initialize'](){function _0x50ef93(_0x32cd18,_0x1a2665){return _0xb456(_0x1a2665- -0x36f,_0x32cd18);}try{await this[_0x50ef93(-0xee,-0x16e)]['detectCustomDatabase']();}catch(_0x12c8b5){console[_0x50ef93(-0x1ba,-0x175)]('Failed to initialize custom database detection:',_0x12c8b5);}}}class StorageBucket{constructor(_0x3d1255,bucketId){this['httpClient']=_0x3d1255,this['bucketId']=bucketId;}async['upload'](_0x74092a,_0xd6112e,_0x33fab8){function _0x2e356d(_0x5a6e14,_0x46f616){return _0xb456(_0x46f616- -0x19c,_0x5a6e14);}try{const _0x56b9ea=new FormData();if(_0xd6112e instanceof File)_0x56b9ea['append']('file',_0xd6112e);else{if(_0xd6112e instanceof Blob)_0x56b9ea[_0x2e356d(0x13e,0xe0)]('file',_0xd6112e,_0x74092a);else{if(_0xd6112e instanceof ArrayBuffer)_0x56b9ea[_0x2e356d(0x5d,0xe0)](_0x2e356d(0x73,0xa3),new Blob([_0xd6112e]),_0x74092a);else typeof _0xd6112e==='string'&&_0x56b9ea['append']('file',new Blob([_0xd6112e],{'type':'text/plain'}),_0x74092a);}}_0x56b9ea[_0x2e356d(0xc1,0xe0)](_0x2e356d(0xe1,0x11c),_0x74092a);_0x33fab8?.[_0x2e356d(0x1f,0x6c)]&&_0x56b9ea[_0x2e356d(0x134,0xe0)](_0x2e356d(0x42,0x6c),_0x33fab8['cacheControl']);_0x33fab8?.['contentType']&&_0x56b9ea['append'](_0x2e356d(0x5a,0xd6),_0x33fab8['contentType']);_0x33fab8?.[_0x2e356d(0x91,0x6a)]&&_0x56b9ea['append'](_0x2e356d(0xd,0x6a),JSON['stringify'](_0x33fab8[_0x2e356d(0xea,0x6a)]));const _0x485a6d=_0x2e356d(0x71,0xaf)+this[_0x2e356d(0xdb,0x73)]+_0x2e356d(0xa0,0x101)+(_0x33fab8?.['upsert']?_0x2e356d(0x12f,0xe3):''),response=await this[_0x2e356d(0x159,0x109)][_0x2e356d(0x3,0x68)](_0x485a6d,_0x56b9ea,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response['data'],'error':null};}catch(_0x4a8f1e){return{'data':null,'error':_0x4a8f1e instanceof EBaaSError?_0x4a8f1e:new EBaaSError(_0x4a8f1e instanceof Error?_0x4a8f1e['message']:_0x2e356d(0x7b,0x60),0x0,_0x4a8f1e)};}}async[_0x2dedf7(0x3c3,0x3e2)](_0x4c4ab4,_0x6239f8){function _0x5b6b68(_0x312e43,_0x4d0959){return _0xb456(_0x4d0959- -0x7e,_0x312e43);}try{const _0x4ae99b=new URLSearchParams();_0x6239f8?.['transform']&&Object['entries'](_0x6239f8[_0x5b6b68(0x209,0x1e5)])['forEach'](([_0x133bbd,_0x1d42af])=>{_0x1d42af!==undefined&&_0x4ae99b['append'](_0x133bbd,String(_0x1d42af));});const _0x5d2fce='/storage/buckets/'+this['bucketId']+'/files/'+_0x4c4ab4+(_0x4ae99b[_0x5b6b68(0x2cb,0x253)]()?'?'+_0x4ae99b['toString']():''),response=await this[_0x5b6b68(0x211,0x227)][_0x5b6b68(0x2ac,0x22d)](_0x5d2fce,{'responseType':'blob'});return{'data':response['data'],'error':null};}catch(_0xaf2ee4){return{'data':null,'error':_0xaf2ee4 instanceof EBaaSError?_0xaf2ee4:new EBaaSError(_0xaf2ee4 instanceof Error?_0xaf2ee4[_0x5b6b68(0x1fe,0x25c)]:_0x5b6b68(0x1d5,0x24b),0x0,_0xaf2ee4)};}}async[_0x2dedf7(0x320,0x38b)](_0xc81024,_0x34c91f){function _0x53b5c7(_0x458c84,_0x1472a7){return _0xb456(_0x458c84-0x58,_0x1472a7);}try{const _0x57c9c0=new URLSearchParams();_0xc81024&&_0x57c9c0[_0x53b5c7(0x2d4,0x34f)](_0x53b5c7(0x2e8,0x343),_0xc81024);_0x34c91f?.[_0x53b5c7(0x2da,0x2a2)]&&_0x57c9c0['append'](_0x53b5c7(0x2da,0x35a),String(_0x34c91f[_0x53b5c7(0x2da,0x25e)]));_0x34c91f?.[_0x53b5c7(0x295,0x273)]&&_0x57c9c0['append'](_0x53b5c7(0x295,0x28f),String(_0x34c91f['offset']));_0x34c91f?.[_0x53b5c7(0x347,0x35c)]&&_0x57c9c0[_0x53b5c7(0x2d4,0x2d1)]('sortBy',JSON['stringify'](_0x34c91f['sortBy']));_0x34c91f?.[_0x53b5c7(0x26f,0x226)]&&_0x57c9c0['append'](_0x53b5c7(0x26f,0x24e),_0x34c91f[_0x53b5c7(0x26f,0x280)]);const _0x5941f9=_0x53b5c7(0x2a3,0x2aa)+this['bucketId']+_0x53b5c7(0x2f5,0x2ff)+(_0x57c9c0['toString']()?'?'+_0x57c9c0['toString']():''),response=await this[_0x53b5c7(0x2fd,0x32e)]['get'](_0x5941f9);return{'data':response['data'],'error':null};}catch(_0x530879){return{'data':null,'error':_0x530879 instanceof EBaaSError?_0x530879:new EBaaSError(_0x530879 instanceof Error?_0x530879[_0x53b5c7(0x332,0x359)]:_0x53b5c7(0x2ee,0x2a1),0x0,_0x530879)};}}async['remove'](_0x346ca5){function _0x620759(_0x420213,_0xbe923e){return _0xb456(_0xbe923e- -0x319,_0x420213);}try{const response=await this[_0x620759(-0xdc,-0x74)][_0x620759(-0x15c,-0xfa)]('/storage/buckets/'+this[_0x620759(-0x13e,-0x10a)]+_0x620759(-0xf0,-0x7c),{'data':{'paths':_0x346ca5}});return{'data':response[_0x620759(-0x14f,-0xe8)],'error':null};}catch(_0x4a513a){return{'data':null,'error':_0x4a513a instanceof EBaaSError?_0x4a513a:new EBaaSError(_0x4a513a instanceof Error?_0x4a513a['message']:_0x620759(-0xcb,-0xd7),0x0,_0x4a513a)};}}async[_0x2dedf7(0x457,0x427)](fromPath,_0x421428){function _0x41670c(_0x2a08b5,_0x446a6e){return _0xb456(_0x2a08b5-0x2dc,_0x446a6e);}try{const response=await this['httpClient']['post'](_0x41670c(0x527,0x533)+this[_0x41670c(0x4eb,0x4e9)]+'/files/move',{'sourceKey':fromPath,'destinationKey':_0x421428});return{'data':response[_0x41670c(0x50d,0x494)],'error':null};}catch(_0x34692b){return{'data':null,'error':_0x34692b instanceof EBaaSError?_0x34692b:new EBaaSError(_0x34692b instanceof Error?_0x34692b[_0x41670c(0x5b6,0x60c)]:'Failed\x20to\x20move\x20file',0x0,_0x34692b)};}}async['copy'](fromPath,_0x1e1389){function _0x1f7d5b(_0x4c2b3c,_0x57440b){return _0xb456(_0x4c2b3c- -0x40,_0x57440b);}try{const response=await this['httpClient']['post']('/storage/buckets/'+this['bucketId']+_0x1f7d5b(0x22f,0x232),{'sourceKey':fromPath,'destinationKey':_0x1e1389});return{'data':response[_0x1f7d5b(0x1f1,0x209)],'error':null};}catch(_0x3c49bc){return{'data':null,'error':_0x3c49bc instanceof EBaaSError?_0x3c49bc:new EBaaSError(_0x3c49bc instanceof Error?_0x3c49bc[_0x1f7d5b(0x29a,0x24b)]:_0x1f7d5b(0x238,0x1c0),0x0,_0x3c49bc)};}}async['createSignedUrl'](_0x4c7f5d,_0x3ff4ce,_0x40bb8e){function _0x1d8ece(_0x4edc0d,_0x56b32b){return _0xb456(_0x4edc0d-0x3e5,_0x56b32b);}try{const response=await this[_0x1d8ece(0x68a,0x679)]['post'](_0x1d8ece(0x630,0x63c)+this['bucketId']+_0x1d8ece(0x646,0x680)+_0x4c7f5d+'/sign',{'expiresIn':_0x3ff4ce,..._0x40bb8e});return{'data':response['data'],'error':null};}catch(_0x3fe3e6){return{'data':null,'error':_0x3fe3e6 instanceof EBaaSError?_0x3fe3e6:new EBaaSError(_0x3fe3e6 instanceof Error?_0x3fe3e6[_0x1d8ece(0x6bf,0x705)]:_0x1d8ece(0x666,0x661),0x0,_0x3fe3e6)};}}[_0x2dedf7(0x34e,0x3b9)](_0x2b3871,_0x141544){const _0x7c0325=new URLSearchParams();_0x141544?.['transform']&&Object['entries'](_0x141544[_0x2a54d4(0x7e,0x96)])[_0x2a54d4(-0x16,0x3e)](([_0x1901c4,_0x15f52d])=>{function _0xb5d4b4(_0x65d81a,_0x12a9a2){return _0xb456(_0x65d81a- -0x1e4,_0x12a9a2);}_0x15f52d!==undefined&&_0x7c0325[_0xb5d4b4(0x98,0xdb)](_0x1901c4,String(_0x15f52d));});function _0x2a54d4(_0x53fb8a,_0x540e91){return _0xb456(_0x540e91- -0x1cd,_0x53fb8a);}const _0x16470c=this[_0x2a54d4(0xf6,0xd8)]['baseURL']||'',_0x8ef0f3=_0x16470c+_0x2a54d4(0xe4,0x7e)+this[_0x2a54d4(0x3d,0x42)]+_0x2a54d4(0x30,0x94)+_0x2b3871+(_0x7c0325['toString']()?'?'+_0x7c0325['toString']():'');return{'data':{'publicUrl':_0x8ef0f3}};}async['getFileInfo'](_0x521678){function _0xbaf3bf(_0x1347cc,_0x3f1401){return _0xb456(_0x3f1401- -0x33,_0x1347cc);}try{const response=await this[_0xbaf3bf(0x2ee,0x272)][_0xbaf3bf(0x26a,0x278)](_0xbaf3bf(0x1ee,0x218)+this['bucketId']+'/files/'+_0x521678+'/info');return{'data':response[_0xbaf3bf(0x1f2,0x1fe)],'error':null};}catch(_0xb68e48){return{'data':null,'error':_0xb68e48 instanceof EBaaSError?_0xb68e48:new EBaaSError(_0xb68e48 instanceof Error?_0xb68e48[_0xbaf3bf(0x24a,0x2a7)]:'Failed\x20to\x20get\x20file\x20info',0x0,_0xb68e48)};}}async['updateFileMetadata'](_0x4c0c59,metadata){function _0x3230fc(_0x31d70f,_0x2e9692){return _0xb456(_0x2e9692-0x133,_0x31d70f);}try{const response=await this[_0x3230fc(0x3a6,0x3d8)]['put'](_0x3230fc(0x35e,0x37e)+this[_0x3230fc(0x328,0x342)]+'/files/'+_0x4c0c59+'/metadata',{'metadata':metadata});return{'data':response[_0x3230fc(0x36f,0x364)],'error':null};}catch(_0x5149d4){return{'data':null,'error':_0x5149d4 instanceof EBaaSError?_0x5149d4:new EBaaSError(_0x5149d4 instanceof Error?_0x5149d4[_0x3230fc(0x484,0x40d)]:_0x3230fc(0x46d,0x406),0x0,_0x5149d4)};}}}class StorageClient{constructor(_0x44f486){function _0x2487ad(_0x26445d,_0xb89f57){return _0xb456(_0x26445d- -0x218,_0xb89f57);}this[_0x2487ad(0x8d,0x4c)]=_0x44f486;}['from'](bucketId){function _0x2b6082(_0x3f5b63,_0x250398){return _0xb456(_0x250398- -0x1c9,_0x3f5b63);}return new StorageBucket(this[_0x2b6082(0x11f,0xdc)],bucketId);}async[_0x2dedf7(0x36c,0x3a1)](_0x537c9e,_0x1c5e84){function _0x28e445(_0x3e9705,_0x558979){return _0xb456(_0x558979- -0x3c9,_0x3e9705);}try{const response=await this[_0x28e445(-0xf6,-0x124)][_0x28e445(-0x1cf,-0x1c5)]('/storage/buckets',{'id':_0x537c9e,..._0x1c5e84});return{'data':response[_0x28e445(-0x1f7,-0x198)],'error':null};}catch(_0x4c373c){return{'data':null,'error':_0x4c373c instanceof EBaaSError?_0x4c373c:new EBaaSError(_0x4c373c instanceof Error?_0x4c373c['message']:_0x28e445(-0x119,-0xfd),0x0,_0x4c373c)};}}async[_0x2dedf7(0x305,0x34e)](_0x192aa4){function _0x4b4499(_0x189606,_0x5203fd){return _0xb456(_0x5203fd- -0x366,_0x189606);}try{const response=await this['httpClient'][_0x4b4499(-0xb3,-0xbb)]('/storage/buckets/'+_0x192aa4);return{'data':response['data'],'error':null};}catch(_0x24d891){return{'data':null,'error':_0x24d891 instanceof EBaaSError?_0x24d891:new EBaaSError(_0x24d891 instanceof Error?_0x24d891['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x24d891)};}}async['listBuckets'](){function _0x208600(_0x26ce22,_0x44e90b){return _0xb456(_0x44e90b- -0x161,_0x26ce22);}try{const response=await this['httpClient']['get'](_0x208600(0x196,0x139));return{'data':response[_0x208600(0x11a,0xd0)],'error':null};}catch(_0x5dcf5c){return{'data':null,'error':_0x5dcf5c instanceof EBaaSError?_0x5dcf5c:new EBaaSError(_0x5dcf5c instanceof Error?_0x5dcf5c[_0x208600(0x17a,0x179)]:_0x208600(0x181,0x109),0x0,_0x5dcf5c)};}}async[_0x2dedf7(0x39c,0x349)](_0x7858af,_0x436cf2){function _0x568f67(_0x3a57bd,_0x52af87){return _0xb456(_0x3a57bd- -0x171,_0x52af87);}try{const response=await this['httpClient'][_0x568f67(0xb5,0xe0)]('/storage/buckets/'+_0x7858af,_0x436cf2);return{'data':response['data'],'error':null};}catch(_0x42fbfa){return{'data':null,'error':_0x42fbfa instanceof EBaaSError?_0x42fbfa:new EBaaSError(_0x42fbfa instanceof Error?_0x42fbfa['message']:'Failed\x20to\x20update\x20bucket',0x0,_0x42fbfa)};}}async[_0x2dedf7(0x312,0x351)](_0x50b33d){function _0x1e2889(_0xcc6212,_0x3d0bfc){return _0xb456(_0x3d0bfc- -0x1e5,_0xcc6212);}try{const response=await this['httpClient'][_0x1e2889(-0x3a,0x3a)]('/storage/buckets/'+_0x50b33d);return{'data':response[_0x1e2889(0x5f,0x4c)],'error':null};}catch(_0x1eeff2){return{'data':null,'error':_0x1eeff2 instanceof EBaaSError?_0x1eeff2:new EBaaSError(_0x1eeff2 instanceof Error?_0x1eeff2['message']:'Failed\x20to\x20delete\x20bucket',0x0,_0x1eeff2)};}}async[_0x2dedf7(0x352,0x359)](){function _0x4b0c5a(_0x3368af,_0x5edf75){return _0xb456(_0x3368af-0x3d8,_0x5edf75);}try{const response=await this['httpClient']['get']('/storage/usage');return{'data':response[_0x4b0c5a(0x609,0x65e)],'error':null};}catch(_0x31f445){return{'data':null,'error':_0x31f445 instanceof EBaaSError?_0x31f445:new EBaaSError(_0x31f445 instanceof Error?_0x31f445['message']:_0x4b0c5a(0x5e4,0x621),0x0,_0x31f445)};}}}class RealtimeChannel extends _0x471021{constructor(_0x215f54,_0x34ac3c){super(),this[_0x452c2f(-0x4a,-0x2f)]=![],this['state']='closed',this['subscriptions']=new Map(),this['topic']=_0x215f54;function _0x452c2f(_0x36a768,_0x51efd0){return _0xb456(_0x36a768- -0x300,_0x51efd0);}this[_0x452c2f(-0xa4,-0x123)]=_0x34ac3c;}['subscribe'](_0x3c337d){!this[_0x43e697(-0x39,-0x52)]&&(this[_0x43e697(-0x39,-0x98)]=!![],this[_0x43e697(-0xc7,-0xf2)]());function _0x43e697(_0x14bfb0,_0x442f06){return _0xb456(_0x14bfb0- -0x2ef,_0x442f06);}return _0x3c337d&&this['on']('status',_0x3c337d),this;}['onPostgresChanges'](filter,_0x5d8bbd){const _0x47812d='postgres_changes:'+JSON[_0x5a6d23(0x12c,0xd7)](filter);super['on'](_0x47812d,_0x5d8bbd);const _0x19f75a={'unsubscribe':()=>{super['off'](_0x47812d,_0x5d8bbd);function _0x115d9e(_0x53ecad,_0x496e4a){return _0xb456(_0x53ecad-0x1fe,_0x496e4a);}this['subscriptions'][_0x115d9e(0x41d,0x3d1)](_0x47812d);}};this[_0x5a6d23(0x14a,0x115)]['set'](_0x47812d,_0x19f75a);function _0x5a6d23(_0x7fb2fe,_0x4d15ff){return _0xb456(_0x4d15ff- -0x1c1,_0x7fb2fe);}return this[_0x5a6d23(0xef,0x9b)]?.[_0x5a6d23(0x69,0x6d)]&&this['state']==='joined'&&this[_0x5a6d23(0xf9,0x9b)][_0x5a6d23(0x132,0x103)](_0x5a6d23(0x101,0xd0),{'topic':this['topic'],'filter':filter,'ref':this[_0x5a6d23(0xdd,0x10f)]()}),_0x19f75a;}['onBroadcast'](filter,_0x329cea){const _0x35fc6f='broadcast:'+JSON['stringify'](filter);super['on'](_0x35fc6f,_0x329cea);function _0x1b41c5(_0x2e2fed,_0xf3f950){return _0xb456(_0x2e2fed- -0x10d,_0xf3f950);}const _0x18f656={'unsubscribe':()=>{function _0x323cb8(_0x2966ca,_0x429c9c){return _0xb456(_0x429c9c-0x13e,_0x2966ca);}super[_0x323cb8(0x3f9,0x38e)](_0x35fc6f,_0x329cea),this[_0x323cb8(0x3de,0x414)][_0x323cb8(0x388,0x35d)](_0x35fc6f);}};return this[_0x1b41c5(0x1c9,0x21e)]['set'](_0x35fc6f,_0x18f656),_0x18f656;}['onPresence'](filter,_0x4f347b){const _0x366375='presence:'+JSON['stringify'](filter);function _0x3816a5(_0x103b6c,_0x4b01b6){return _0xb456(_0x4b01b6- -0x131,_0x103b6c);}super['on'](_0x366375,_0x4f347b);const _0x385159={'unsubscribe':()=>{super[_0x5d7d09(0x29c,0x2c9)](_0x366375,_0x4f347b);function _0x5d7d09(_0x1866c2,_0x1de04e){return _0xb456(_0x1866c2-0x4c,_0x1de04e);}this['subscriptions'][_0x5d7d09(0x26b,0x20b)](_0x366375);}};return this[_0x3816a5(0x21f,0x1a5)]['set'](_0x366375,_0x385159),_0x385159;}[_0x2dedf7(0x418,0x3ac)](_0x51cafa){return new Promise(_0x271f64=>{function _0x4f1737(_0x11b221,_0x47a75f){return _0xb456(_0x11b221-0x2fa,_0x47a75f);}this[_0x4f1737(0x556,0x540)]?.['connected']&&this[_0x4f1737(0x584,0x572)]==='joined'?(this[_0x4f1737(0x556,0x583)]['emit']('broadcast',{'topic':this['topic'],'event':_0x51cafa['event'],'payload':_0x51cafa,'ref':this['makeRef']()}),_0x271f64('ok')):_0x271f64('error');});}['track'](_0x5b7655){return new Promise(_0x3c0051=>{function _0x3d86b3(_0x2e6562,_0x36af4c){return _0xb456(_0x36af4c- -0x201,_0x2e6562);}this[_0x3d86b3(0x6f,0x5b)]?.[_0x3d86b3(0x89,0x2d)]&&this['state']==='joined'?(this['socket'][_0x3d86b3(0x10e,0xc3)]('presence',{'topic':this[_0x3d86b3(-0x48,0x19)],'event':_0x3d86b3(-0x25,0x51),'payload':_0x5b7655,'ref':this['makeRef']()}),_0x3c0051('ok')):_0x3c0051(_0x3d86b3(0x18,0x66));});}[_0x2dedf7(0x3a3,0x40c)](){return new Promise(_0x193045=>{function _0x575c60(_0x1c99b4,_0x378ebe){return _0xb456(_0x1c99b4- -0xcf,_0x378ebe);}this[_0x575c60(0x18d,0x133)]?.[_0x575c60(0x15f,0xf6)]&&this['state']===_0x575c60(0x214,0x200)?(this[_0x575c60(0x18d,0x200)]['emit']('presence',{'topic':this[_0x575c60(0x14b,0xfb)],'event':'untrack','ref':this[_0x575c60(0x201,0x235)]()}),_0x193045('ok')):_0x193045('error');});}['unsubscribe'](){return new Promise(_0x524cc1=>{this['state']=_0x342516(0x143,0x18c),this[_0x342516(0x12e,0x17c)][_0x342516(0x98,0xb1)](_0x36840e=>{function _0x2bf783(_0x3b640c,_0x1faeb1){return _0xb456(_0x1faeb1-0x362,_0x3b640c);}_0x36840e[_0x2bf783(0x55a,0x55a)]();}),this['subscriptions'][_0x342516(0xbd,0xd1)]();this['socket']?.[_0x342516(0x132,0xd4)]&&this[_0x342516(0xa9,0x102)][_0x342516(0x10d,0x16a)](_0x342516(0x139,0x14e),{'topic':this[_0x342516(0x7f,0xc0)],'ref':this['makeRef']()});this[_0x342516(0x1ae,0x130)]=_0x342516(0x16e,0x161),this[_0x342516(0x154,0xe1)]();function _0x342516(_0x7a4c61,_0x2a3bc3){return _0xb456(_0x2a3bc3- -0x15a,_0x7a4c61);}_0x524cc1('ok');});}['_join'](){if(this[_0x1d681b(-0xc3,-0x58)]===_0x1d681b(-0x67,-0xcf))return;function _0x1d681b(_0x551308,_0x406e96){return _0xb456(_0x551308- -0x34d,_0x406e96);}this[_0x1d681b(-0xc3,-0x120)]=_0x1d681b(-0x108,-0x187),this[_0x1d681b(-0xf1,-0xb5)]?.[_0x1d681b(-0x11f,-0xc9)]&&(this[_0x1d681b(-0xf1,-0x112)][_0x1d681b(-0x89,-0xef)]('join',{'topic':this[_0x1d681b(-0x133,-0xe2)],'ref':this['makeRef']()}),setTimeout(()=>{function _0x1a747a(_0x21024,_0x5cfaf6){return _0xb456(_0x21024- -0x31d,_0x5cfaf6);}this['state']==='joining'&&(this['state']=_0x1a747a(-0x3a,-0x2),this[_0x1a747a(-0x59,-0x65)]('status',_0x1a747a(-0x71,-0x5f)));},0x64));}['_rejoin'](){function _0x5afe5c(_0x1af571,_0x30940d){return _0xb456(_0x30940d-0x359,_0x1af571);}this['joinedOnce']&&(this[_0x5afe5c(0x50f,0x581)](),this[_0x5afe5c(0x606,0x62f)][_0x5afe5c(0x586,0x564)]((_0x1da6e0,_0x477cf7)=>{function _0x2bea92(_0x315bda,_0x3176ef){return _0xb456(_0x3176ef-0x3a0,_0x315bda);}if(_0x477cf7['startsWith']('postgres_changes:')){const filter=JSON[_0x2bea92(0x683,0x61d)](_0x477cf7['replace'](_0x2bea92(0x66d,0x60b),''));this[_0x2bea92(0x598,0x5fc)]?.[_0x2bea92(0x67f,0x664)]('subscribe_postgres_changes',{'topic':this[_0x2bea92(0x5f3,0x5ba)],'filter':filter,'ref':this[_0x2bea92(0x6d8,0x670)]()});}}));}[_0x2dedf7(0x356,0x356)](_0x5e94a7,_0x1a74cb){if(_0x5e94a7==='postgres_changes'){const _0x23a610='postgres_changes:'+JSON[_0xcd06dc(0xd0,0x63)](_0x1a74cb[_0xcd06dc(0x120,0x13e)]||{});this[_0xcd06dc(0xfc,0xcd)](_0x23a610,_0x1a74cb);}else{if(_0x5e94a7==='broadcast'){const _0x210ed0='broadcast:'+JSON['stringify']({'event':_0x1a74cb['event']});this['emit'](_0x210ed0,_0x1a74cb);}else{if(_0x5e94a7===_0xcd06dc(0x49,0x34)){const _0x338c2c='presence:'+JSON['stringify']({'event':_0x1a74cb[_0xcd06dc(0xed,0x11e)]});this['emit'](_0x338c2c,_0x1a74cb);}}}function _0xcd06dc(_0x3d3828,_0xef8725){return _0xb456(_0x3d3828- -0x1c8,_0xef8725);}this[_0xcd06dc(0xfc,0x89)](_0x5e94a7,_0x1a74cb);}[_0x2dedf7(0x3c0,0x386)](_0x42f94e){this['state']=_0x42f94e;function _0x4d8b95(_0x410845,_0x3e0fdb){return _0xb456(_0x410845- -0x210,_0x3e0fdb);}let status;switch(_0x42f94e){case'joined':status=_0x4d8b95(0x9c,0x24);break;case'errored':status=_0x4d8b95(0x7d,-0x5);break;case'closed':status=_0x4d8b95(0x97,0x53);break;default:return;}this['emit'](_0x4d8b95(0x36,-0x2b),status);}['makeRef'](){function _0x5d642e(_0x1c949c,_0x5ae196){return _0xb456(_0x1c949c-0x1d9,_0x5ae196);}return Math['random']()[_0x5d642e(0x4aa,0x493)](0x24)['substring'](0x2,0xf);}['getState'](){return this['state'];}}class RealtimeClient{constructor(_0x35867a,_0x4643ae,_0x268fd9={}){this[_0x2809be(0x254,0x2b6)]=null,this[_0x2809be(0x1fa,0x213)]=new Map(),this[_0x2809be(0x23c,0x27f)]='disconnected',this['reconnectAttempts']=0x0,this['maxReconnectAttempts']=0x5;function _0x2809be(_0x470424,_0x38e52e){return _0xb456(_0x470424- -0x8,_0x38e52e);}this[_0x2809be(0x29b,0x318)]=_0x35867a,this['apiKey']=_0x4643ae,this[_0x2809be(0x23b,0x1de)]={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x268fd9};}[_0x2dedf7(0x3da,0x41e)](){return new Promise((_0x33bbe7,_0x3a3755)=>{if(this['socket']?.['connected']){_0x33bbe7();return;}function _0x10c35f(_0x2a8499,_0x2d84bc){return _0xb456(_0x2a8499-0x2f2,_0x2d84bc);}this['connectionState']='connecting',this[_0x10c35f(0x54e,0x582)]=io(this[_0x10c35f(0x595,0x514)],{'auth':{'apikey':this[_0x10c35f(0x57a,0x501)]},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this[_0x10c35f(0x535,0x500)][_0x10c35f(0x52a,0x4ed)],'reconnectionAttempts':this[_0x10c35f(0x535,0x5b5)][_0x10c35f(0x5a6,0x5e7)],...this['options'][_0x10c35f(0x4eb,0x508)]}),this[_0x10c35f(0x54e,0x526)]['on'](_0x10c35f(0x5db,0x59a),()=>{this[_0x2f09c4(0x579,0x56c)]=_0x2f09c4(0x575,0x556),this['reconnectAttempts']=0x0,this[_0x2f09c4(0x5cb,0x614)]();function _0x2f09c4(_0x508250,_0x4114d0){return _0xb456(_0x4114d0-0x328,_0x508250);}_0x33bbe7();}),this['socket']['on']('disconnect',_0x4579f5=>{this['connectionState']='disconnected';function _0x26fbe7(_0x16c5f0,_0x32a412){return _0xb456(_0x16c5f0- -0x202,_0x32a412);}this[_0x26fbe7(0x0,-0x5c)]['forEach'](channel=>{channel['_setState']('closed');});}),this['socket']['on']('connect_error',_0x2889a5=>{this[_0x4cdc49(0x259,0x2d5)]=_0x4cdc49(0x365,0x2f8);function _0x4cdc49(_0x4242b2,_0x5abdc8){return _0xb456(_0x5abdc8-0x91,_0x4242b2);}this['reconnectAttempts']++,this[_0x4cdc49(0x36a,0x323)]>=this[_0x4cdc49(0x37d,0x345)]&&_0x3a3755(new Error('Failed\x20to\x20connect\x20after\x20'+this[_0x4cdc49(0x367,0x345)]+'\x20attempts:\x20'+_0x2889a5[_0x4cdc49(0x3d5,0x36b)]));}),this[_0x10c35f(0x54e,0x5a7)]['on'](_0x10c35f(0x51c,0x503),()=>{this['connectionState']=_0xc4554d(0x485,0x406);function _0xc4554d(_0x2ea5b6,_0x16bdc8){return _0xb456(_0x2ea5b6-0x257,_0x16bdc8);}this['reconnectAttempts']=0x0,this['channels'][_0xc4554d(0x462,0x3e7)](channel=>{function _0x18c473(_0x57fa02,_0x4767e7){return _0xb456(_0x4767e7-0x324,_0x57fa02);}channel[_0x18c473(0x59e,0x5fd)]();});}),this['socket']['on'](_0x10c35f(0x526,0x59b),_0x422b77=>{const channel=this['channels'][_0x48c22e(-0x2e,0x36)](_0x422b77[_0x48c22e(-0xbf,-0xbd)]);function _0x48c22e(_0x18e51f,_0x15ff4c){return _0xb456(_0x18e51f- -0x2d9,_0x15ff4c);}channel&&channel['_trigger']('postgres_changes',_0x422b77);}),this[_0x10c35f(0x54e,0x52a)]['on'](_0x10c35f(0x4e6,0x4b2),_0x2aed57=>{function _0x5ef7e8(_0x6a539e,_0xb70f4e){return _0xb456(_0xb70f4e- -0x37b,_0x6a539e);}const channel=this['channels'][_0x5ef7e8(-0x14a,-0xd0)](_0x2aed57['topic']);channel&&channel[_0x5ef7e8(-0x112,-0x15a)]('broadcast',_0x2aed57);}),this[_0x10c35f(0x54e,0x598)]['on']('presence',_0x515af7=>{const channel=this[_0x54de6c(0x8b,0x41)][_0x54de6c(0x134,0x169)](_0x515af7['topic']);function _0x54de6c(_0x447dd7,_0x12bffa){return _0xb456(_0x447dd7- -0x177,_0x12bffa);}channel&&channel[_0x54de6c(0xaa,0xec)](_0x54de6c(0x9a,0xb1),_0x515af7);});});}[_0x2dedf7(0x3e7,0x3ce)](){this['socket']&&(this[_0x4a0a81(0x61f,0x5c6)]['disconnect'](),this[_0x4a0a81(0x604,0x5c6)]=null);this[_0x4a0a81(0x57e,0x5ae)]=_0x4a0a81(0x614,0x5e0);function _0x4a0a81(_0x2a49ca,_0x4fd527){return _0xb456(_0x4fd527-0x36a,_0x2a49ca);}this[_0x4a0a81(0x552,0x56c)]['clear']();}['channel'](_0xcac4e7){if(this['channels'][_0x2eee50(0x495,0x45b)](_0xcac4e7))return this[_0x2eee50(0x309,0x37f)]['get'](_0xcac4e7);const channel=new RealtimeChannel(_0xcac4e7,this['socket']);this['channels']['set'](_0xcac4e7,channel);this[_0x2eee50(0x3f7,0x3c1)]===_0x2eee50(0x3f8,0x3ab)&&channel['_join']();function _0x2eee50(_0x3dc6ce,_0x3b273a){return _0xb456(_0x3b273a-0x17d,_0x3dc6ce);}return channel;}[_0x2dedf7(0x36c,0x3a2)](channel){function _0x477ab4(_0x1f761e,_0x9d578a){return _0xb456(_0x1f761e- -0x73,_0x9d578a);}const _0xdd071c=channel['topic'];this[_0x477ab4(0x18f,0x1eb)][_0x477ab4(0x26b,0x24e)](_0xdd071c)&&(this[_0x477ab4(0x18f,0x139)][_0x477ab4(0x1ac,0x142)](_0xdd071c),channel[_0x477ab4(0x185,0x14e)]());}[_0x2dedf7(0x462,0x3f4)](){this['channels'][_0x236fbf(0x4ea,0x547)](channel=>{channel['unsubscribe']();});function _0x236fbf(_0x1a2a92,_0xdc3610){return _0xb456(_0x1a2a92-0x2df,_0xdc3610);}this[_0x236fbf(0x4e1,0x48c)][_0x236fbf(0x50a,0x565)]();}[_0x2dedf7(0x3d4,0x3f3)](){function _0x984efd(_0xc553c6,_0x157d96){return _0xb456(_0x157d96- -0x266,_0xc553c6);}return Array[_0x984efd(-0x77,-0x25)](this['channels'][_0x984efd(0x47,-0x3a)]());}[_0x2dedf7(0x3d7,0x37d)](){function _0xb0abb2(_0x3affb1,_0x462593){return _0xb456(_0x462593- -0x390,_0x3affb1);}return this[_0xb0abb2(-0x14c,-0x14c)]===_0xb0abb2(-0xe3,-0x162)&&!!this['socket']?.['connected'];}['getConnectionState'](){return this['connectionState'];}['onConnectionStateChange'](_0x3eb464){function _0x1fb0c1(_0x559af5,_0x2d3a8d){return _0xb456(_0x559af5- -0x209,_0x2d3a8d);}const _0x4d12ed=()=>_0x3eb464(this[_0x1fb0c1(0x3b,0x53)]);return this['socket']&&(this['socket']['on']('connect',()=>{this['connectionState']='connected',_0x4d12ed();}),this[_0x1fb0c1(0x53,0x4b)]['on'](_0x1fb0c1(0x90,0x97),()=>{this['connectionState']=_0x4f99fd(0xfc,0xc4);function _0x4f99fd(_0x21ec23,_0x4116c6){return _0xb456(_0x4116c6- -0x1b2,_0x21ec23);}_0x4d12ed();}),this[_0x1fb0c1(0x53,0x65)]['on']('connect_error',()=>{this['connectionState']='error',_0x4d12ed();})),()=>{function _0x1b7fde(_0x4417fc,_0x20d561){return _0xb456(_0x4417fc-0x2f4,_0x20d561);}this[_0x1b7fde(0x550,0x52f)]&&(this['socket']['off']('connect',_0x4d12ed),this[_0x1b7fde(0x550,0x53b)][_0x1b7fde(0x544,0x59a)](_0x1b7fde(0x58d,0x5ba),_0x4d12ed),this[_0x1b7fde(0x550,0x4f7)][_0x1b7fde(0x544,0x57d)](_0x1b7fde(0x5b6,0x576),_0x4d12ed));};}[_0x2dedf7(0x470,0x421)](){function _0xc94fd2(_0x41eb33,_0x30bf34){return _0xb456(_0x30bf34-0x28b,_0x41eb33);}if(!this['options'][_0xc94fd2(0x5a4,0x53e)]||!this['socket'])return;const interval=setInterval(()=>{function _0x9570ed(_0xe587e9,_0x2bb2d2){return _0xb456(_0xe587e9- -0x299,_0x2bb2d2);}this[_0x9570ed(-0x3d,-0xab)]?.[_0x9570ed(-0x6b,-0xe0)]?this[_0x9570ed(-0x3d,-0xa9)]['emit'](_0x9570ed(0x27,-0x35),{'timestamp':Date[_0x9570ed(-0x86,-0xb4)]()}):clearInterval(interval);},this[_0xc94fd2(0x46c,0x4ce)][_0xc94fd2(0x562,0x53e)]);}[_0x2dedf7(0x3cd,0x3fa)](){return this['socket'];}}class FunctionsClient{constructor(_0x2d2346){function _0x5aabc6(_0x396104,_0x4c9353){return _0xb456(_0x4c9353-0x1e0,_0x396104);}this[_0x5aabc6(0x47e,0x485)]=_0x2d2346;}async[_0x2dedf7(0x40d,0x3ca)](_0x17ec06,_0x218d6a){function _0x480f47(_0x262c32,_0x38b584){return _0xb456(_0x38b584-0xd3,_0x262c32);}try{const _0x2ee2bc=_0x218d6a?.['method']||'POST',headers={'Content-Type':'application/json',..._0x218d6a?.['headers']};let response;const _0x57f069=_0x480f47(0x35d,0x35c)+_0x17ec06;switch(_0x2ee2bc[_0x480f47(0x28a,0x2ce)]()){case'GET':response=await this[_0x480f47(0x329,0x378)][_0x480f47(0x3bb,0x37e)](_0x57f069,{'headers':headers,'params':_0x218d6a?.[_0x480f47(0x382,0x3c9)]});break;case'POST':response=await this[_0x480f47(0x3d9,0x378)]['post'](_0x57f069,_0x218d6a?.[_0x480f47(0x405,0x3c9)],{'headers':headers});break;case'PUT':response=await this[_0x480f47(0x2fd,0x378)]['put'](_0x57f069,_0x218d6a?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x480f47(0x307,0x378)][_0x480f47(0x2d2,0x2ee)](_0x57f069,_0x218d6a?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x480f47(0x3eb,0x378)][_0x480f47(0x2a6,0x2f2)](_0x57f069,{'headers':headers,'data':_0x218d6a?.['body']});break;default:throw new EBaaSError(_0x480f47(0x3cc,0x34e)+_0x2ee2bc,0x190);}return{'data':response[_0x480f47(0x30a,0x304)],'error':null};}catch(_0x53bd52){return{'data':null,'error':_0x53bd52 instanceof EBaaSError?_0x53bd52:new EBaaSError(_0x53bd52 instanceof Error?_0x53bd52[_0x480f47(0x3c2,0x3ad)]:'Function\x20invocation\x20failed',0x0,_0x53bd52)};}}async['list'](){function _0x3017c1(_0x3128fb,_0x513073){return _0xb456(_0x3128fb-0x386,_0x513073);}try{const response=await this[_0x3017c1(0x62b,0x5b3)]['get']('/functions/v1');return{'data':response[_0x3017c1(0x5b7,0x570)],'error':null};}catch(_0x94d2b5){return{'data':null,'error':_0x94d2b5 instanceof EBaaSError?_0x94d2b5:new EBaaSError(_0x94d2b5 instanceof Error?_0x94d2b5[_0x3017c1(0x660,0x662)]:'Failed\x20to\x20list\x20functions',0x0,_0x94d2b5)};}}async['get'](_0x21b556){function _0x716c5d(_0x38066a,_0x34a9f2){return _0xb456(_0x38066a- -0x357,_0x34a9f2);}try{const response=await this['httpClient']['get']('/functions/v1/'+_0x21b556+_0x716c5d(-0x82,-0x24));return{'data':response[_0x716c5d(-0x126,-0xc7)],'error':null};}catch(_0x1ec317){return{'data':null,'error':_0x1ec317 instanceof EBaaSError?_0x1ec317:new EBaaSError(_0x1ec317 instanceof Error?_0x1ec317[_0x716c5d(-0x7d,-0xf3)]:_0x716c5d(-0x162,-0x125),0x0,_0x1ec317)};}}async[_0x2dedf7(0x320,0x32c)](_0x343b64,_0x2e8794){function _0x2509aa(_0x3dff2e,_0x17e3a2){return _0xb456(_0x17e3a2- -0x6d,_0x3dff2e);}try{const _0x2c3d45=new FormData();if(_0x2e8794['code']instanceof File)_0x2c3d45['append']('code',_0x2e8794['code']);else typeof _0x2e8794['code']==='string'&&_0x2c3d45['append'](_0x2509aa(0x266,0x234),new Blob([_0x2e8794[_0x2509aa(0x26a,0x234)]],{'type':_0x2509aa(0x20d,0x237)}),'index.ts');_0x2e8794[_0x2509aa(0x1f7,0x190)]&&_0x2c3d45['append'](_0x2509aa(0x1e8,0x190),_0x2e8794['entrypoint']);_0x2e8794['env']&&_0x2c3d45['append']('env',JSON[_0x2509aa(0x253,0x22b)](_0x2e8794[_0x2509aa(0x21a,0x219)]));_0x2e8794[_0x2509aa(0x1df,0x233)]&&_0x2c3d45['append'](_0x2509aa(0x21f,0x233),JSON[_0x2509aa(0x1e1,0x22b)](_0x2e8794[_0x2509aa(0x1e6,0x233)]));_0x2e8794['verify']!==undefined&&_0x2c3d45['append'](_0x2509aa(0x2d3,0x25b),String(_0x2e8794[_0x2509aa(0x1fd,0x25b)]));const response=await this['httpClient'][_0x2509aa(0x157,0x197)](_0x2509aa(0x212,0x21c)+_0x343b64+_0x2509aa(0x22d,0x1b6),_0x2c3d45,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x2509aa(0x1ea,0x1c4)],'error':null};}catch(_0x405617){return{'data':null,'error':_0x405617 instanceof EBaaSError?_0x405617:new EBaaSError(_0x405617 instanceof Error?_0x405617[_0x2509aa(0x2a1,0x26d)]:_0x2509aa(0x21c,0x232),0x0,_0x405617)};}}async[_0x2dedf7(0x334,0x354)](_0x596c13){function _0x526322(_0x3621dc,_0xd73c01){return _0xb456(_0x3621dc-0x1c1,_0xd73c01);}try{const response=await this[_0x526322(0x466,0x48f)][_0x526322(0x3e0,0x41e)]('/functions/v1/'+_0x596c13);return{'data':response[_0x526322(0x3f2,0x3e6)],'error':null};}catch(_0x32abe6){return{'data':null,'error':_0x32abe6 instanceof EBaaSError?_0x32abe6:new EBaaSError(_0x32abe6 instanceof Error?_0x32abe6[_0x526322(0x49b,0x428)]:_0x526322(0x4af,0x4ef),0x0,_0x32abe6)};}}async[_0x2dedf7(0x382,0x3c9)](_0x2e379f,_0x386c08){function _0x30ec08(_0x126057,_0x523eb1){return _0xb456(_0x126057- -0xa4,_0x523eb1);}try{const response=await this[_0x30ec08(0x201,0x1c9)][_0x30ec08(0x182,0x16d)](_0x30ec08(0x1e5,0x1c3)+_0x2e379f+'/env',{'env':_0x386c08});return{'data':response[_0x30ec08(0x18d,0x1fb)],'error':null};}catch(_0x1ff1f6){return{'data':null,'error':_0x1ff1f6 instanceof EBaaSError?_0x1ff1f6:new EBaaSError(_0x1ff1f6 instanceof Error?_0x1ff1f6['message']:_0x30ec08(0x22a,0x1ee),0x0,_0x1ff1f6)};}}async[_0x2dedf7(0x477,0x3fc)](_0x3a9774,_0x4a403d){function _0x576194(_0x19d245,_0x4e0203){return _0xb456(_0x4e0203- -0x167,_0x19d245);}try{const _0x3d2031=new URLSearchParams();_0x4a403d?.[_0x576194(0x161,0x11b)]&&_0x3d2031[_0x576194(0x107,0x115)]('limit',String(_0x4a403d['limit']));_0x4a403d?.[_0x576194(0x11b,0xd6)]&&_0x3d2031[_0x576194(0x141,0x115)]('offset',String(_0x4a403d['offset']));_0x4a403d?.['level']&&_0x3d2031[_0x576194(0x18b,0x115)](_0x576194(0x12c,0xe7),_0x4a403d['level']);const _0x4adac2='/functions/v1/'+_0x3a9774+'/logs'+(_0x3d2031['toString']()?'?'+_0x3d2031[_0x576194(0x1b7,0x16a)]():''),response=await this[_0x576194(0x129,0x13e)][_0x576194(0x118,0x144)](_0x4adac2);return{'data':response['data'],'error':null};}catch(_0x94788f){return{'data':null,'error':_0x94788f instanceof EBaaSError?_0x94788f:new EBaaSError(_0x94788f instanceof Error?_0x94788f['message']:_0x576194(0x1cb,0x16d),0x0,_0x94788f)};}}async[_0x2dedf7(0x45c,0x420)](_0xc8fdf5,_0x539f30){function _0x1b36cd(_0x4df9a9,_0x17f614){return _0xb456(_0x17f614- -0x2b,_0x4df9a9);}try{const _0x435432=new URLSearchParams();_0x539f30?.['period']&&_0x435432[_0x1b36cd(0x2b4,0x251)](_0x1b36cd(0x269,0x22a),_0x539f30['period']);const _0x2e6065='/functions/v1/'+_0xc8fdf5+'/metrics'+(_0x435432['toString']()?'?'+_0x435432['toString']():''),response=await this['httpClient'][_0x1b36cd(0x2cf,0x280)](_0x2e6065);return{'data':response['data'],'error':null};}catch(_0x16b726){return{'data':null,'error':_0x16b726 instanceof EBaaSError?_0x16b726:new EBaaSError(_0x16b726 instanceof Error?_0x16b726[_0x1b36cd(0x256,0x2af)]:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x16b726)};}}}class EBaaSClient{constructor(_0xf32d8e,_0x173ee7,_0x43c5d6){this['options']=_0x43c5d6,this[_0x403e5(-0xab,-0x6e)]=new HttpClient({'url':_0xf32d8e,'apiKey':_0x173ee7,'timeout':0x7530,'headers':_0x43c5d6?.[_0x403e5(-0xa0,-0xc4)]?.['headers']}),this['auth']=new AuthClient(this[_0x403e5(-0xab,-0x88)]);function _0x403e5(_0x55b2b1,_0x508136){return _0xb456(_0x55b2b1- -0x350,_0x508136);}this[_0x403e5(-0xcd,-0x86)]=new DatabaseClient(this['httpClient'],_0x43c5d6?.[_0x403e5(-0xcd,-0x12d)]?.[_0x403e5(-0x117,-0x167)]),this['storage']=new StorageClient(this['httpClient']),this['realtime']=new RealtimeClient(_0xf32d8e,_0x173ee7,_0x43c5d6?.[_0x403e5(-0xd6,-0xcf)]),this[_0x403e5(-0x110,-0xec)]=new FunctionsClient(this[_0x403e5(-0xab,-0x80)]),this[_0x403e5(-0x129,-0x113)]();}[_0x2dedf7(0x3ab,0x376)](_0x323939){function _0x48ca4e(_0x36f549,_0x296871){return _0xb456(_0x36f549- -0x25c,_0x296871);}return this[_0x48ca4e(0x27,0x8b)][_0x48ca4e(-0x1b,0x1b)](_0x323939);}['rpc'](_0x2228c0,_0x4ec3d7){function _0x59e70f(_0x34ce69,_0x38cd2f){return _0xb456(_0x34ce69-0x2d4,_0x38cd2f);}return this['database'][_0x59e70f(0x576,0x538)](_0x2228c0,_0x4ec3d7);}['bucket'](_0x9c6188){return this['storage']['from'](_0x9c6188);}[_0x2dedf7(0x382,0x3ae)](_0x3ed258){function _0x57b6e4(_0x283168,_0x3bcee5){return _0xb456(_0x283168-0x146,_0x3bcee5);}return this[_0x57b6e4(0x3c0,0x342)][_0x57b6e4(0x3bf,0x3ef)](_0x3ed258);}['invoke'](_0x17170b,_0x1ae540){function _0x2ff4eb(_0x1f3363,_0x200efd){return _0xb456(_0x1f3363-0xf0,_0x200efd);}return this[_0x2ff4eb(0x330,0x320)][_0x2ff4eb(0x385,0x3ba)](_0x17170b,_0x1ae540);}async['initializeCustomDatabase'](){function _0x5af8e2(_0x28c47b,_0x197dce){return _0xb456(_0x28c47b-0x1,_0x197dce);}if(this['options']?.['database']?.[_0x5af8e2(0x29c,0x240)])try{await this[_0x5af8e2(0x284,0x21f)]['initialize']();}catch(_0x54fcca){console[_0x5af8e2(0x1fb,0x1a3)]('Failed to initialize custom database detection:',_0x54fcca);}}async['setWorkspaceId'](_0x2e7ed9){this['database']['setWorkspaceId'](_0x2e7ed9);function _0x32f016(_0x5574f6,_0x2bf583){return _0xb456(_0x2bf583-0x3c5,_0x5574f6);}this[_0x32f016(0x5c1,0x608)]?.[_0x32f016(0x5e4,0x648)]?.['autoDetectCustomDatabase']&&await this[_0x32f016(0x645,0x648)]['initialize']();}async['configureCustomDatabase'](_0x2e1930){function _0x3b153(_0x3228cf,_0xe87418){return _0xb456(_0xe87418-0x256,_0x3228cf);}await this[_0x3b153(0x4a7,0x4d9)][_0x3b153(0x413,0x486)](_0x2e1930);}[_0x2dedf7(0x3c9,0x3a3)](){function _0x2ab896(_0x307a6e,_0x2f83a3){return _0xb456(_0x307a6e- -0x11d,_0x2f83a3);}return this[_0x2ab896(0x166,0x16c)][_0x2ab896(0x151,0x169)]();}}function createClient(_0xa40f87,_0x2c54be,_0x5c8b43){return new EBaaSClient(_0xa40f87,_0x2c54be,_0x5c8b43);}const version='1.0.0';export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};