@e-techsolutions/e-baas-sdk 1.1.0 → 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.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -8
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';(function(stringArrayFunction,comparisonValue){function _0x133926(_0x3f5cd8,_0x278663){return _0x13f2(_0x278663-0x3f,_0x3f5cd8);}const stringArray=stringArrayFunction();while(!![]){try{const _0x3c74c0=-parseInt(_0x133926(0x1e9,0x200))/0x1*(-parseInt(_0x133926(0x1d3,0x169))/0x2)+parseInt(_0x133926(0xd8,0x156))/0x3*(-parseInt(_0x133926(0x1c0,0x188))/0x4)+parseInt(_0x133926(0x1d2,0x1f9))/0x5+-parseInt(_0x133926(0x1a9,0x198))/0x6*(-parseInt(_0x133926(0x23f,0x245))/0x7)+parseInt(_0x133926(0x1bb,0x1e3))/0x8*(parseInt(_0x133926(0x1d6,0x1e5))/0x9)+-parseInt(_0x133926(0x223,0x1af))/0xa*(parseInt(_0x133926(0x233,0x20c))/0xb)+-parseInt(_0x133926(0x131,0x1ab))/0xc;if(_0x3c74c0===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0xd08b5){stringArray['push'](stringArray['shift']());}}}(_0x5b68,0x8422c));function _0x13f2(_0x3160c7,_0x37370c){const _0x5b6860=_0x5b68();return _0x13f2=function(_0x13f294,_0x21de52){_0x13f294=_0x13f294-0x109;let _0xb2a09c=_0x5b6860[_0x13f294];if(_0x13f2['aSVZjS']===undefined){var _0xca73fc=function(_0x44f6da){const _0x5271c0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3f8bd0='',_0x1356b5='';for(let _0x55ff0f=0x0,_0x47b9bf,_0x22f785,_0x32f2bb=0x0;_0x22f785=_0x44f6da['charAt'](_0x32f2bb++);~_0x22f785&&(_0x47b9bf=_0x55ff0f%0x4?_0x47b9bf*0x40+_0x22f785:_0x22f785,_0x55ff0f++%0x4)?_0x3f8bd0+=String['fromCharCode'](0xff&_0x47b9bf>>(-0x2*_0x55ff0f&0x6)):0x0){_0x22f785=_0x5271c0['indexOf'](_0x22f785);}for(let _0x2bc06a=0x0,_0x8370ba=_0x3f8bd0['length'];_0x2bc06a<_0x8370ba;_0x2bc06a++){_0x1356b5+='%'+('00'+_0x3f8bd0['charCodeAt'](_0x2bc06a)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1356b5);};_0x13f2['hyWHcG']=_0xca73fc,_0x3160c7=arguments,_0x13f2['aSVZjS']=!![];}const _0x2e2651=_0x5b6860[0x0],_0x25cb54=_0x13f294+_0x2e2651,_0x4b3b90=_0x3160c7[_0x25cb54];return!_0x4b3b90?(_0xb2a09c=_0x13f2['hyWHcG'](_0xb2a09c),_0x3160c7[_0x25cb54]=_0xb2a09c):_0xb2a09c=_0x4b3b90,_0xb2a09c;},_0x13f2(_0x3160c7,_0x37370c);}var axios=require('axios'),socket_ioClient=require(_0x29adf0(-0x1ce,-0x1f4));function _0x29adf0(_0x4df542,_0x35c002){return _0x13f2(_0x35c002- -0x324,_0x4df542);}var EventEmitter=require('eventemitter3');class EBaaSError extends Error{constructor(_0x44f6da,status=0x0,_0x5271c0){function _0x17dcfe(_0x183c8a,_0x1c706a){return _0x13f2(_0x183c8a-0x31e,_0x1c706a);}super(_0x44f6da),this[_0x17dcfe(0x462,0x4b0)]='EBaaSError',this[_0x17dcfe(0x49e,0x4ba)]=status,this['details']=_0x5271c0,Error['captureStackTrace']&&Error[_0x17dcfe(0x481,0x4ad)](this,EBaaSError);}[_0x29adf0(-0xad,-0x122)](){function _0x571665(_0x768bee,_0x1d48d4){return _0x13f2(_0x768bee- -0x255,_0x1d48d4);}return{'name':this['name'],'message':this[_0x571665(-0x54,-0xce)],'status':this[_0x571665(-0xd5,-0xa7)],'details':this['details'],'stack':this[_0x571665(-0x139,-0x1ad)]};}['toString'](){function _0x323646(_0x56391c,_0x5e9e8a){return _0x13f2(_0x56391c-0xf2,_0x5e9e8a);}return this['name']+':\x20'+this[_0x323646(0x2f3,0x29b)]+_0x323646(0x2e5,0x27c)+this['status']+')';}}class HttpClient{constructor(config){function _0x7dc872(_0xbf0ead,_0x54da97){return _0x13f2(_0x54da97-0x124,_0xbf0ead);}this['baseURL']=config[_0x7dc872(0x36b,0x2fd)],this[_0x7dc872(0x250,0x269)]=config['apiKey'],this['client']=axios['create']({'baseURL':this[_0x7dc872(0x2f9,0x2d1)],'timeout':config['timeout']||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this[_0x7dc872(0x2de,0x2f3)]();}['setupInterceptors'](){this['client']['interceptors'][_0x237955(-0x183,-0x1e4)]['use'](config=>{return config;},_0x3f8bd0=>{function _0x3839c4(_0xbfac31,_0x21040f){return _0x13f2(_0x21040f- -0x19f,_0xbfac31);}return Promise[_0x3839c4(-0xc0,-0x8a)](new EBaaSError('Request\x20failed',0x0,_0x3f8bd0));});function _0x237955(_0x57183a,_0x912f35){return _0x13f2(_0x57183a- -0x28d,_0x912f35);}this[_0x237955(-0xa5,-0x6c)]['interceptors'][_0x237955(-0xdc,-0x9b)][_0x237955(-0x15f,-0x1bf)](response=>{return response;},_0x1356b5=>{const status=_0x1356b5[_0xca2294(0x468,0x44f)]?.['status']||0x0,_0x55ff0f=_0x1356b5[_0xca2294(0x468,0x438)]?.['data']?.[_0xca2294(0x4b8,0x536)]||_0x1356b5['message']||'Unknown\x20error',_0x47b9bf=_0x1356b5[_0xca2294(0x468,0x447)]?.['data']||_0x1356b5;function _0xca2294(_0x4c1307,_0x4a7a0d){return _0x13f2(_0x4c1307-0x2b7,_0x4a7a0d);}return Promise['reject'](new EBaaSError(_0x55ff0f,status,_0x47b9bf));});}async['get'](_0x22f785,config){function _0x358715(_0x46ddeb,_0x1b4f67){return _0x13f2(_0x1b4f67-0x334,_0x46ddeb);}try{const response=await this['client'][_0x358715(0x411,0x487)](_0x22f785,config);return{'data':response[_0x358715(0x481,0x4ef)],'status':response[_0x358715(0x52e,0x4b4)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x32f2bb){throw this['handleError'](_0x32f2bb);}}async[_0x29adf0(-0x1e0,-0x1ef)](_0x2bc06a,data,config){function _0x400914(_0x505947,_0x148020){return _0x13f2(_0x148020-0x3d5,_0x505947);}try{const response=await this['client'][_0x400914(0x4eb,0x50a)](_0x2bc06a,data,config);return{'data':response[_0x400914(0x611,0x590)],'status':response[_0x400914(0x562,0x555)],'statusText':response[_0x400914(0x565,0x5a3)],'headers':response['headers']};}catch(_0x8370ba){throw this['handleError'](_0x8370ba);}}async[_0x29adf0(-0x225,-0x20c)](_0x51de56,data,config){function _0xab1038(_0x22622e,_0x59a339){return _0x13f2(_0x59a339- -0xdf,_0x22622e);}try{const response=await this[_0xab1038(0x182,0x109)]['put'](_0x51de56,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0xab1038(0x9a,0xef)],'headers':response['headers']};}catch(_0x4d720d){throw this['handleError'](_0x4d720d);}}async[_0x29adf0(-0x1ea,-0x1b1)](_0xe1a90,data,config){function _0x158391(_0x3b7a24,_0x302a22){return _0x13f2(_0x3b7a24- -0x1fd,_0x302a22);}try{const response=await this['client'][_0x158391(-0x8a,-0x84)](_0xe1a90,data,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x22c852){throw this['handleError'](_0x22c852);}}async[_0x29adf0(-0x117,-0x129)](_0xd582c5,config){function _0x5af0d0(_0x5baeda,_0x3379d8){return _0x13f2(_0x5baeda- -0x398,_0x3379d8);}try{const response=await this['client'][_0x5af0d0(-0x19d,-0x21b)](_0xd582c5,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x1ecb9e){throw this[_0x5af0d0(-0x1cd,-0x195)](_0x1ecb9e);}}[_0x29adf0(-0x284,-0x209)](_0x5df4fe){this['client']['defaults']['headers']['common']['Authorization']='Bearer\x20'+_0x5df4fe;}[_0x29adf0(-0x16e,-0x1cf)](){function _0xea934f(_0x5161c7,_0x3c35cf){return _0x13f2(_0x5161c7- -0x5a,_0x3c35cf);}delete this[_0xea934f(0x18e,0x1c2)]['defaults']['headers']['common']['Authorization'],this[_0xea934f(0x18e,0x1b4)][_0xea934f(0x15d,0x1df)]['headers'][_0xea934f(0x156,0x19a)]['Authorization']=_0xea934f(0xc8,0x7a)+this[_0xea934f(0xeb,0xf7)];}['handleError'](_0x3c7d11){if(_0x3c7d11 instanceof EBaaSError)return _0x3c7d11;function _0xed6f5a(_0x4e59d9,_0x15754a){return _0x13f2(_0x4e59d9- -0x3c4,_0x15754a);}return new EBaaSError(_0x3c7d11[_0xed6f5a(-0x1c3,-0x150)]||_0xed6f5a(-0x23e,-0x1d7),_0x3c7d11['status']||0x0,_0x3c7d11);}}class AuthClient{constructor(_0x1c4138){this['currentSession']=null,this['httpClient']=_0x1c4138,this['loadSession']();}async[_0x29adf0(-0x158,-0x146)](data){function _0x5e5683(_0x5b4eb7,_0x2817d0){return _0x13f2(_0x5b4eb7- -0x199,_0x2817d0);}try{const response=await this[_0x5e5683(0xf,0x58)][_0x5e5683(-0x64,-0xb5)](_0x5e5683(-0xe,0x6b),data);return response[_0x5e5683(0x22,0x81)][_0x5e5683(0x13,0x1c)]&&this['setSessionInternal'](response[_0x5e5683(0x22,0x76)][_0x5e5683(0x13,0x44)]),response['data'];}catch(_0x15532e){throw this['handleAuthError'](_0x15532e);}}async[_0x29adf0(-0x1a4,-0x138)](data){function _0x1707a5(_0x4c415c,_0x1fc566){return _0x13f2(_0x1fc566- -0xf,_0x4c415c);}try{const response=await this[_0x1707a5(0x1a0,0x199)][_0x1707a5(0x16b,0x126)]('/auth/v1/sdk/signin',data);return response[_0x1707a5(0x12b,0x1ac)]['session']&&this[_0x1707a5(0x1a4,0x181)](response['data'][_0x1707a5(0x168,0x19d)]),response[_0x1707a5(0x14a,0x1ac)];}catch(_0x7701){throw this[_0x1707a5(0x154,0x18f)](_0x7701);}}async[_0x29adf0(-0x152,-0x14c)](){function _0x40a37f(_0x2ff4d9,_0x59dbbf){return _0x13f2(_0x2ff4d9- -0x2e9,_0x59dbbf);}try{await this['httpClient']['post']('/auth/v1/signout'),this['clearSession']();}catch(_0x26efcb){this['clearSession']();throw this[_0x40a37f(-0x14b,-0x1b9)](_0x26efcb);}}async[_0x29adf0(-0x209,-0x1e7)](){function _0x14f9bf(_0x5930b3,_0x1932d8){return _0x13f2(_0x5930b3-0x1cf,_0x1932d8);}if(!this['currentSession']?.[_0x14f9bf(0x32c,0x2c9)])return null;try{const response=await this[_0x14f9bf(0x377,0x319)]['get'](_0x14f9bf(0x3b6,0x3f2));return response[_0x14f9bf(0x38a,0x386)]['user'];}catch(_0x390322){if(_0x390322 instanceof EBaaSError&&_0x390322[_0x14f9bf(0x34f,0x32d)]===0x191)return this['clearSession'](),null;throw this['handleAuthError'](_0x390322);}}async['refreshSession'](){function _0x2e67bc(_0x779d72,_0x2fbddc){return _0x13f2(_0x2fbddc-0x2de,_0x779d72);}if(!this['currentSession']?.['refresh_token'])return null;try{const response=await this[_0x2e67bc(0x411,0x486)]['post'](_0x2e67bc(0x46e,0x4a0),{'refresh_token':this[_0x2e67bc(0x446,0x3fc)][_0x2e67bc(0x3eb,0x3eb)]});if(response[_0x2e67bc(0x473,0x499)][_0x2e67bc(0x44d,0x48a)])return this[_0x2e67bc(0x3ef,0x44d)](response['data']['session']),response['data'][_0x2e67bc(0x43b,0x48a)];return null;}catch(_0x2864e0){this['clearSession']();throw this['handleAuthError'](_0x2864e0);}}async[_0x29adf0(-0x228,-0x1f2)](_0x38411f){function _0x177711(_0x5e2ebb,_0x13ac1e){return _0x13f2(_0x13ac1e- -0x2f5,_0x5e2ebb);}try{await this['httpClient']['post'](_0x177711(-0xbb,-0xec),{'email':_0x38411f});}catch(_0xf5f273){throw this[_0x177711(-0xef,-0x157)](_0xf5f273);}}async['updateUser'](data){function _0x29ca71(_0x5acc3d,_0x2fefda){return _0x13f2(_0x2fefda-0x300,_0x5acc3d);}try{const response=await this['httpClient']['put'](_0x29ca71(0x467,0x4e7),data);return response[_0x29ca71(0x51f,0x4bb)][_0x29ca71(0x46c,0x4af)];}catch(_0x574d12){throw this[_0x29ca71(0x458,0x49e)](_0x574d12);}}['getSession'](){return this['currentSession'];}[_0x29adf0(-0x168,-0x1b5)](_0x347cb3){function _0x329724(_0x43d0ec,_0x42946f){return _0x13f2(_0x42946f-0x18,_0x43d0ec);}this[_0x329724(0x126,0x136)]=_0x347cb3,this['httpClient']['setAuthToken'](_0x347cb3[_0x329724(0xfc,0x175)]),typeof localStorage!=='undefined'&&localStorage['setItem'](_0x329724(0x15b,0x1ce),JSON['stringify'](_0x347cb3));}[_0x29adf0(-0x178,-0x1a5)](_0xc8b17a){return()=>{};}['setSessionInternal'](_0x4e1f83){this[_0x417bd4(0x1d0,0x216)]=_0x4e1f83;function _0x417bd4(_0x6b3eef,_0x3bcef2){return _0x13f2(_0x6b3eef-0xb2,_0x3bcef2);}this['httpClient']['setAuthToken'](_0x4e1f83['access_token']),typeof localStorage!=='undefined'&&localStorage['setItem']('ebaas.auth.session',JSON['stringify'](_0x4e1f83));}['clearSession'](){this[_0x5078a5(-0x2bc,-0x254)]=null,this[_0x5078a5(-0x232,-0x249)][_0x5078a5(-0x285,-0x227)]();function _0x5078a5(_0x1ea122,_0x11f5f2){return _0x13f2(_0x1ea122- -0x3da,_0x11f5f2);}typeof localStorage!=='undefined'&&localStorage['removeItem']('ebaas.auth.session');}['loadSession'](){function _0x133aa1(_0x5f2538,_0x20c178){return _0x13f2(_0x5f2538-0x338,_0x20c178);}if(typeof localStorage!==_0x133aa1(0x543,0x4e5)){const _0x198695=localStorage[_0x133aa1(0x4d9,0x539)](_0x133aa1(0x4ee,0x565));if(_0x198695)try{const _0x55528b=JSON['parse'](_0x198695);this['setSessionInternal'](_0x55528b);}catch(_0x53fd75){this[_0x133aa1(0x4bc,0x4b7)]();}}}['handleAuthError'](_0x45a2bc){function _0x12fb60(_0x1abcbd,_0x4b3a16){return _0x13f2(_0x1abcbd-0x11c,_0x4b3a16);}if(_0x45a2bc instanceof EBaaSError)return _0x45a2bc;return new EBaaSError(_0x45a2bc['message']||'Authentication\x20failed',_0x45a2bc[_0x12fb60(0x29c,0x2b3)]||0x0,_0x45a2bc);}}class QueryBuilder{constructor(_0x3e72b5,_0x5e7c79,_0x58c58d,_0x5d8ca8){this['httpClient']=_0x3e72b5,this['table']=_0x5e7c79,this['schema']=_0x58c58d,this['workspaceId']=_0x5d8ca8,this['query']={'filters':[]};}[_0x29adf0(-0x19c,-0x18f)](_0x300007='*',_0x55cf2e){this['query'][_0x5b24d1(0x55d,0x56b)]=_0x300007;function _0x5b24d1(_0xb4d74e,_0x3e1c3c){return _0x13f2(_0x3e1c3c-0x3d6,_0xb4d74e);}return this;}[_0x29adf0(-0x191,-0x1a3)](data,_0x4250dc){function _0x48d2f9(_0x5b4a60,_0xbf72bb){return _0x13f2(_0x5b4a60-0x2bc,_0xbf72bb);}return this['executeQuery']('POST',_0x48d2f9(0x490,0x434)+this[_0x48d2f9(0x3f5,0x3d4)]+_0x48d2f9(0x3cb,0x41b),{'data':data,'options':_0x4250dc});}[_0x29adf0(-0x118,-0x12a)](data,_0x45ab69){function _0xc8f9d8(_0x3eb131,_0x4371ce){return _0x13f2(_0x3eb131- -0x24f,_0x4371ce);}return this[_0xc8f9d8(-0x75,-0x7c)]('PATCH','/sdk/v1/'+this[_0xc8f9d8(-0x116,-0xed)],{'data':data,'options':_0x45ab69,'filters':this[_0xc8f9d8(-0x6e,-0x5b)]['filters']});}['upsert'](data,_0x5bbfdb){function _0x573f45(_0x3ad3de,_0x448a72){return _0x13f2(_0x3ad3de- -0x3dd,_0x448a72);}return this[_0x573f45(-0x203,-0x187)]('POST',_0x573f45(-0x209,-0x1ed)+this['table']+'?operation=upsert',{'data':data,'options':{..._0x5bbfdb,'upsert':!![]}});}['delete'](_0x17d5bc){function _0x1d49f1(_0x46c875,_0x6f81c4){return _0x13f2(_0x6f81c4-0x2ca,_0x46c875);}return this[_0x1d49f1(0x50d,0x4a4)]('DELETE',_0x1d49f1(0x4ab,0x49e)+this[_0x1d49f1(0x431,0x403)],{'options':_0x17d5bc,'filters':this['query']['filters']});}['eq'](_0x1589ab,_0x275824){this['query'][_0x2ab695(-0x1e5,-0x1f4)]['push']({'column':_0x1589ab,'operator':'eq','value':_0x275824});function _0x2ab695(_0x1469b1,_0x12a873){return _0x13f2(_0x1469b1- -0x381,_0x12a873);}return this;}['neq'](_0x394558,_0x317b6c){this[_0x2e6452(-0x146,-0x121)][_0x2e6452(-0x18b,-0x11f)]['push']({'column':_0x394558,'operator':'neq','value':_0x317b6c});function _0x2e6452(_0x53104b,_0x727569){return _0x13f2(_0x53104b- -0x327,_0x727569);}return this;}['gt'](_0x494f56,_0x1a1d39){this[_0x1177fc(-0x2d,-0x90)]['filters']['push']({'column':_0x494f56,'operator':'gt','value':_0x1a1d39});function _0x1177fc(_0x240c84,_0x14e4b8){return _0x13f2(_0x240c84- -0x20e,_0x14e4b8);}return this;}['gte'](_0x13ca88,_0x508795){this['query'][_0x5a8399(-0xd6,-0x56)]['push']({'column':_0x13ca88,'operator':'gte','value':_0x508795});function _0x5a8399(_0x5e1e42,_0x8379b6){return _0x13f2(_0x5e1e42- -0x272,_0x8379b6);}return this;}['lt'](_0x2c77b7,_0x58f515){function _0x40629b(_0x1c3c62,_0x8680df){return _0x13f2(_0x1c3c62- -0x178,_0x8680df);}return this[_0x40629b(0x69,0x8f)]['filters']['push']({'column':_0x2c77b7,'operator':'lt','value':_0x58f515}),this;}['lte'](_0x30c7b7,_0x426a18){function _0x3e26a6(_0xa89bab,_0x2a652c){return _0x13f2(_0xa89bab-0x3cd,_0x2a652c);}return this[_0x3e26a6(0x5ae,0x5aa)][_0x3e26a6(0x569,0x5d0)][_0x3e26a6(0x5b1,0x540)]({'column':_0x30c7b7,'operator':_0x3e26a6(0x5ac,0x555),'value':_0x426a18}),this;}[_0x29adf0(-0x158,-0x1bd)](_0x5b961b,_0x2182e6){this[_0x83212a(0x3cc,0x381)][_0x83212a(0x387,0x376)]['push']({'column':_0x5b961b,'operator':'like','value':_0x2182e6});function _0x83212a(_0x6c3b96,_0x11f975){return _0x13f2(_0x6c3b96-0x1eb,_0x11f975);}return this;}[_0x29adf0(-0x1c0,-0x1bb)](_0x18b947,_0x498c09){this[_0x3ad533(0x167,0x166)][_0x3ad533(0x122,0x12f)][_0x3ad533(0x16a,0x113)]({'column':_0x18b947,'operator':'ilike','value':_0x498c09});function _0x3ad533(_0x1ce5b2,_0x39ce24){return _0x13f2(_0x1ce5b2- -0x7a,_0x39ce24);}return this;}['is'](_0x4991ab,_0x135b4a){function _0x1e2964(_0x42e908,_0x346433){return _0x13f2(_0x42e908- -0x31e,_0x346433);}return this['query'][_0x1e2964(-0x182,-0x14a)]['push']({'column':_0x4991ab,'operator':'is','value':_0x135b4a}),this;}['in'](_0x537fc7,_0x3a7fa5){this[_0x2e89a0(0x2c4,0x263)]['filters']['push']({'column':_0x537fc7,'operator':'in','value':_0x3a7fa5});function _0x2e89a0(_0x3410ec,_0x495b87){return _0x13f2(_0x3410ec-0xe3,_0x495b87);}return this;}['contains'](_0xfe9abf,_0xa7de50){this[_0x55c3b1(0x221,0x23b)][_0x55c3b1(0x1dc,0x25a)][_0x55c3b1(0x224,0x242)]({'column':_0xfe9abf,'operator':'contains','value':_0xa7de50});function _0x55c3b1(_0x24a6a8,_0x1f5ce6){return _0x13f2(_0x24a6a8-0x40,_0x1f5ce6);}return this;}[_0x29adf0(-0x179,-0x1f9)](_0x1921fc){Object[_0x3f95a7(0x3f6,0x3f7)](_0x1921fc)['forEach'](([_0x4ae8da,_0x375122])=>{this['eq'](_0x4ae8da,_0x375122);});function _0x3f95a7(_0x77ee2f,_0x1fc9d7){return _0x13f2(_0x1fc9d7-0x2bc,_0x77ee2f);}return this;}[_0x29adf0(-0x184,-0x142)](_0x37ca4a,_0x231c74){function _0x26372b(_0x582bd0,_0x48fe19){return _0x13f2(_0x48fe19-0x1ec,_0x582bd0);}return!this['query']['order']&&(this['query'][_0x26372b(0x3aa,0x3ce)]=[]),this['query'][_0x26372b(0x3bd,0x3ce)][_0x26372b(0x3e5,0x3d0)]({'column':_0x37ca4a,'ascending':_0x231c74?.[_0x26372b(0x3ac,0x34b)]!==![]}),this;}[_0x29adf0(-0x143,-0x190)](count){function _0x40fdda(_0x1099c0,_0x63e5d7){return _0x13f2(_0x63e5d7- -0x2eb,_0x1099c0);}return this[_0x40fdda(-0xa7,-0x10a)][_0x40fdda(-0x128,-0x157)]=count,this;}[_0x29adf0(-0x219,-0x1c3)](from,_0x5b77d7){return this['query']['range']={'from':from,'to':_0x5b77d7},this;}async['execute'](){function _0x2a9e25(_0xc8ad74,_0x504fa7){return _0x13f2(_0x504fa7-0x39e,_0xc8ad74);}return this['executeQuery']('GET',_0x2a9e25(0x56c,0x572)+this[_0x2a9e25(0x554,0x4d7)]+_0x2a9e25(0x52e,0x556),{'select':this['query']['select'],'filters':this[_0x2a9e25(0x545,0x57f)]['filters'],'order':this['query'][_0x2a9e25(0x5d6,0x580)],'limit':this['query'][_0x2a9e25(0x56a,0x532)],'range':this['query']['range']});}async[_0x29adf0(-0x1fa,-0x1d7)](){this[_0x2f42ca(0x494,0x46d)](0x1);const result=await this[_0x2f42ca(0x47f,0x4b4)]();function _0x2f42ca(_0x3ed2e3,_0x417f10){return _0x13f2(_0x417f10-0x2d9,_0x3ed2e3);}return{'data':result[_0x2f42ca(0x426,0x494)]?.[0x0]||null,'error':result['error']};}async[_0x29adf0(-0x11e,-0x14a)](_0x4eb741,_0x1fa524,_0x329fff){function _0x50edea(_0x44da68,_0x3c4fdd){return _0x13f2(_0x44da68- -0x31c,_0x3c4fdd);}try{let response;const headers={};this[_0x50edea(-0x1eb,-0x249)]&&(headers['x-workspace-id']=this[_0x50edea(-0x1eb,-0x198)]);if(_0x4eb741==='GET'){const _0x1d16df=_0x1fa524['split']('?'),_0x2cd042=_0x1d16df[0x0],existingParams=new URLSearchParams(_0x1d16df[0x1]||'');if(_0x329fff['select'])existingParams['append'](_0x50edea(-0x187,-0x15d),_0x329fff[_0x50edea(-0x187,-0x137)]);_0x329fff['filters']?.[_0x50edea(-0x183,-0x1ed)]&&_0x329fff[_0x50edea(-0x180,-0x126)]['forEach'](filter=>{function _0x4ab8e8(_0x132886,_0x558eb0){return _0x13f2(_0x558eb0-0x132,_0x132886);}existingParams['append'](filter[_0x4ab8e8(0x2ba,0x2bf)],filter[_0x4ab8e8(0x26d,0x2b9)]+'.'+filter[_0x4ab8e8(0x26b,0x2a8)]);});if(_0x329fff[_0x50edea(-0x13a,-0xc5)]?.['length']){const orderStr=_0x329fff['order']['map'](_0x2c9264=>''+_0x2c9264['column']+(_0x2c9264['ascending']?_0x50edea(-0x1d9,-0x182):'.desc'))[_0x50edea(-0x124,-0x116)](',');existingParams[_0x50edea(-0x1bc,-0x20c)]('order',orderStr);}if(_0x329fff[_0x50edea(-0x188,-0x192)])existingParams['append']('limit',_0x329fff['limit'][_0x50edea(-0x171,-0x13a)]());_0x329fff[_0x50edea(-0x1bb,-0x1c3)]&&(existingParams[_0x50edea(-0x1bc,-0x1f8)](_0x50edea(-0x18a,-0x107),_0x329fff['range']['from'][_0x50edea(-0x171,-0x1e6)]()),existingParams['append'](_0x50edea(-0x188,-0x20b),(_0x329fff[_0x50edea(-0x1bb,-0x16d)]['to']-_0x329fff[_0x50edea(-0x1bb,-0x1f0)][_0x50edea(-0x131,-0x137)]+0x1)['toString']())),response=await this[_0x50edea(-0x174,-0x145)]['get'](_0x2cd042+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x4eb741==='DELETE'){const _0x310259=_0x1fa524[_0x50edea(-0x1e9,-0x1bb)]('?'),_0x9c0218=_0x310259[0x0],existingParams=new URLSearchParams(_0x310259[0x1]||'');!existingParams['has'](_0x50edea(-0x1d1,-0x184))&&existingParams['append'](_0x50edea(-0x1d1,-0x22d),'delete');_0x329fff[_0x50edea(-0x180,-0x12d)]?.[_0x50edea(-0x183,-0x1ca)]&&_0x329fff['filters']['forEach'](filter=>{function _0x10c62a(_0x12f1b1,_0x48358c){return _0x13f2(_0x12f1b1- -0x3bb,_0x48358c);}existingParams['append'](filter[_0x10c62a(-0x22e,-0x289)],filter['operator']+'.'+filter[_0x10c62a(-0x245,-0x24e)]);});const deleteUrl=_0x9c0218+'?'+existingParams[_0x50edea(-0x171,-0x146)]();response=await this[_0x50edea(-0x174,-0x143)][_0x50edea(-0x121,-0xbd)](deleteUrl,{'headers':headers});}else{if(_0x4eb741==='PATCH'){const _0x3ffb1b=_0x1fa524[_0x50edea(-0x1e9,-0x20e)]('?'),_0x337ff1=_0x3ffb1b[0x0],existingParams=new URLSearchParams(_0x3ffb1b[0x1]||'');!existingParams[_0x50edea(-0x184,-0x195)]('operation')&&existingParams[_0x50edea(-0x1bc,-0x196)](_0x50edea(-0x1d1,-0x1d0),_0x50edea(-0x122,-0x11c));_0x329fff[_0x50edea(-0x180,-0x12c)]?.['length']&&_0x329fff[_0x50edea(-0x180,-0x12b)]['forEach'](filter=>{function _0xd75265(_0x235051,_0x2118bc){return _0x13f2(_0x2118bc-0x13e,_0x235051);}existingParams['append'](filter['column'],filter[_0xd75265(0x2dc,0x2c5)]+'.'+filter[_0xd75265(0x300,0x2b4)]);});_0x329fff['options']?.[_0x50edea(-0x119,-0x175)]&&(headers['Prefer']=_0x329fff['options']['prefer']);const updateUrl=_0x337ff1+'?'+existingParams[_0x50edea(-0x171,-0x140)]();response=await this['httpClient'][_0x50edea(-0x1a9,-0x1be)](updateUrl,_0x329fff['data'],{'headers':headers});}else{let _0x27438f=_0x329fff[_0x50edea(-0x161,-0x14f)];!headers[_0x50edea(-0x10f,-0xa7)]&&(headers[_0x50edea(-0x10f,-0x154)]=_0x50edea(-0x1a0,-0x12b)),_0x329fff['options']?.['upsert']&&(headers[_0x50edea(-0x10f,-0x8c)]='resolution=merge-duplicates,return=representation'),_0x329fff[_0x50edea(-0x14c,-0x138)]&&(_0x27438f=_0x329fff['dataArray']),response=await this['httpClient'][_0x50edea(-0x1e7,-0x249)](_0x1fa524,_0x27438f,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x50edea(-0x1de,-0x1b9)]?.['x-total-count']?parseInt(response[_0x50edea(-0x1de,-0x1fa)]['x-total-count']):undefined};}catch(_0x913ec7){return{'data':null,'error':_0x913ec7 instanceof EBaaSError?_0x913ec7:new EBaaSError(_0x913ec7 instanceof Error?_0x913ec7['message']:_0x50edea(-0x15f,-0x153),0x0,_0x913ec7)};}}}class CustomDatabaseManager{constructor(_0xbca462,_0x3adf70){this['httpClient']=_0xbca462,this['workspaceId']=_0x3adf70;}async['detectCustomDatabase'](){if(!this[_0x31edbc(0x9,-0x67)])return{'hasCustomDatabase':![]};try{const response=await this[_0x31edbc(-0x5d,0x10)][_0x31edbc(-0x19,-0x45)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this[_0x31edbc(-0x9a,-0x67)]}});if(response['status']===0xc8&&response[_0x31edbc(0x2d,0x23)]?.[_0x31edbc(-0x88,-0x44)]){const config=response['data'][_0x31edbc(-0x65,-0x44)],_0x2b177c={'host':config[_0x31edbc(-0x20,0x4b)],'port':config[_0x31edbc(-0x55,-0x6b)],'database':config['postgresDatabase'],'username':config['postgresUsername'],'password':'','schema':config['postgresSchema'],'sslEnabled':config[_0x31edbc(-0x29,-0x8c)]};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x2b177c},this['detectedConfig'];}}catch(_0x5981b9){if(_0x5981b9?.['status']===0x194)return this[_0x31edbc(0x53,-0x1d)]={'hasCustomDatabase':![]},this[_0x31edbc(-0x91,-0x1d)];console[_0x31edbc(-0x64,-0x52)]('Failed to detect custom database configuration:',_0x5981b9);}function _0x31edbc(_0x3a79bf,_0x254069){return _0x13f2(_0x254069- -0x198,_0x3a79bf);}return this['detectedConfig']={'hasCustomDatabase':![]},this[_0x31edbc(0x2a,-0x1d)];}async[_0x29adf0(-0x145,-0x1aa)](_0x97eb89){function _0x574f40(_0x1156d3,_0x115fb9){return _0x13f2(_0x115fb9- -0x23,_0x1156d3);}try{const response=await this['httpClient'][_0x574f40(0xbe,0x112)]('/admin/v1/workspace/custom-database/test-connection',_0x97eb89,{'headers':this[_0x574f40(0xa2,0x10e)]?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x47939b){return{'success':![],'message':_0x47939b?.[_0x574f40(0x1d5,0x1de)]||_0x574f40(0x1a4,0x12b)};}}async[_0x29adf0(-0x1c3,-0x182)](_0x547dd4){if(!this[_0x186c68(0x3a2,0x33e)])throw new Error('Workspace ID is required to configure custom database');function _0x186c68(_0xb0625c,_0x29d202){return _0x13f2(_0x29d202-0x20d,_0xb0625c);}const response=await this['httpClient']['post']('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x547dd4},{'headers':{'X-Workspace-ID':this[_0x186c68(0x39a,0x33e)]}}),config=response[_0x186c68(0x3fc,0x3c8)][_0x186c68(0x3ce,0x361)];return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x547dd4},config;}async[_0x29adf0(-0x14f,-0x1b0)](){if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');function _0x5ddeae(_0x4e6a27,_0x52bff7){return _0x13f2(_0x4e6a27-0x29,_0x52bff7);}await this['httpClient'][_0x5ddeae(0x224,0x24d)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this[_0x5ddeae(0x15a,0x1b3)]}}),this['detectedConfig']={'hasCustomDatabase':![]};}['getDetectedConfig'](){function _0x4707b4(_0x5dfc35,_0x3006ff){return _0x13f2(_0x5dfc35- -0xbb,_0x3006ff);}return this[_0x4707b4(0xc0,0xb1)];}[_0x29adf0(-0x190,-0x1cc)](){function _0x44ee0a(_0x5587fc,_0x3d6a7e){return _0x13f2(_0x3d6a7e-0x3a5,_0x5587fc);}return this['detectedConfig']?.[_0x44ee0a(0x53f,0x4fd)]??![];}['getCustomCredentials'](){function _0x4e91ba(_0x436aef,_0x4b7b9d){return _0x13f2(_0x4b7b9d-0x108,_0x436aef);}return this[_0x4e91ba(0x2d9,0x283)]?.['credentials'];}['setWorkspaceId'](_0x5aacf4){function _0x5986f6(_0x16da6e,_0x219e8b){return _0x13f2(_0x219e8b-0x1be,_0x16da6e);}this[_0x5986f6(0x336,0x2ef)]=_0x5aacf4,this[_0x5986f6(0x336,0x339)]=undefined;}['getWorkspaceId'](){function _0x102200(_0x57dd17,_0x445a7a){return _0x13f2(_0x57dd17-0x29f,_0x445a7a);}return this[_0x102200(0x3d0,0x3d0)];}['getStatus'](){function _0x3f97d8(_0x126248,_0x2803ed){return _0x13f2(_0x2803ed-0x110,_0x126248);}return{'workspaceId':this[_0x3f97d8(0x2aa,0x241)],'hasConfig':this['hasCustomDatabase'](),'configDetails':this[_0x3f97d8(0x25c,0x28b)]?.['credentials']?{'host':this['detectedConfig'][_0x3f97d8(0x2ef,0x2d4)]['host'],'port':this[_0x3f97d8(0x213,0x28b)]['credentials']['port'],'database':this['detectedConfig'][_0x3f97d8(0x2dd,0x2d4)]['database'],'schema':this['detectedConfig']['credentials'][_0x3f97d8(0x29f,0x252)]||'public','sslEnabled':this[_0x3f97d8(0x2f1,0x28b)]['credentials'][_0x3f97d8(0x20d,0x21c)]||![]}:undefined};}}class DatabaseClient{constructor(_0x3af563,_0x3cc7a1){this[_0xe57a23(-0x6b,-0x9c)]=_0x3af563;function _0xe57a23(_0x514e4e,_0x4a4776){return _0x13f2(_0x4a4776- -0x244,_0x514e4e);}this['customDatabaseManager']=new CustomDatabaseManager(_0x3af563,_0x3cc7a1);}[_0x29adf0(-0x137,-0x139)](_0x39761f){function _0x1dbfa6(_0x1355fb,_0x3e5da3){return _0x13f2(_0x3e5da3- -0x3e7,_0x1355fb);}return new QueryBuilder(this[_0x1dbfa6(-0x295,-0x23f)],_0x39761f,this[_0x1dbfa6(-0x235,-0x224)],this[_0x1dbfa6(-0x264,-0x1f8)][_0x1dbfa6(-0x26f,-0x221)]());}[_0x29adf0(-0x175,-0x196)](_0x425874,_0x5359b5){function _0x1369da(_0x222a4c,_0x24bf02){return _0x13f2(_0x222a4c-0x332,_0x24bf02);}return this['httpClient']['post'](_0x1369da(0x497,0x462)+_0x425874,_0x5359b5);}[_0x29adf0(-0x1bd,-0x1e2)](_0x1b6aae){function _0x193524(_0x7cabf6,_0x332163){return _0x13f2(_0x7cabf6- -0x38b,_0x332163);}const _0x323a59=new DatabaseClient(this[_0x193524(-0x1e3,-0x25f)],this['customDatabaseManager'][_0x193524(-0x1c5,-0x1ae)]());return _0x323a59['currentSchema']=_0x1b6aae,_0x323a59[_0x193524(-0x19c,-0x179)]=this['customDatabaseManager'],_0x323a59;}async['detectCustomDatabase'](){function _0x3de0d9(_0x4887f2,_0x58b839){return _0x13f2(_0x58b839-0x16a,_0x4887f2);}return this[_0x3de0d9(0x2f8,0x359)][_0x3de0d9(0x331,0x31d)]();}async[_0x29adf0(-0x184,-0x147)](_0x46ffcc){function _0x29414d(_0x5654ea,_0x548f75){return _0x13f2(_0x548f75- -0x32,_0x5654ea);}return this[_0x29414d(0x1e9,0x1bd)]['testConnection'](_0x46ffcc);}async['configureCustomDatabase'](_0x1534a5){return this['customDatabaseManager']['configureCustomDatabase'](_0x1534a5);}async[_0x29adf0(-0x1e7,-0x1b0)](){function _0x2e90fb(_0x1622f2,_0x3ba98a){return _0x13f2(_0x1622f2-0x272,_0x3ba98a);}return this[_0x2e90fb(0x461,0x4c6)][_0x2e90fb(0x3e6,0x3c2)]();}['isUsingCustomDatabase'](){return this['customDatabaseManager']['hasCustomDatabase']();}['getCustomDatabaseStatus'](){function _0xc6b9a0(_0x1e5092,_0x1eda42){return _0x13f2(_0x1e5092-0x2c5,_0x1eda42);}return this['customDatabaseManager'][_0xc6b9a0(0x405,0x3be)]();}['setWorkspaceId'](_0x290d64){function _0x260972(_0x204b14,_0x305b1c){return _0x13f2(_0x305b1c-0x16a,_0x204b14);}this[_0x260972(0x303,0x359)][_0x260972(0x3a9,0x33b)](_0x290d64);}async[_0x29adf0(-0xf5,-0x165)](){function _0x59af37(_0x3a9533,_0x23168c){return _0x13f2(_0x3a9533- -0x3d2,_0x23168c);}try{await this[_0x59af37(-0x1e3,-0x1b7)][_0x59af37(-0x21f,-0x1e6)]();}catch(_0x51cf07){console[_0x59af37(-0x28c,-0x238)]('Failed to initialize custom database detection:',_0x51cf07);}}}class StorageBucket{constructor(_0x443c52,bucketId){function _0x5c20fb(_0x1707b4,_0x5924f4){return _0x13f2(_0x5924f4- -0x360,_0x1707b4);}this[_0x5c20fb(-0x17e,-0x1b8)]=_0x443c52,this['bucketId']=bucketId;}async['upload'](_0x243337,_0x423df0,_0x2b0236){function _0x4a8417(_0xbc0edb,_0x27cf87){return _0x13f2(_0xbc0edb- -0x19a,_0x27cf87);}try{const _0x505920=new FormData();if(_0x423df0 instanceof File)_0x505920['append'](_0x4a8417(-0x8c,-0x29),_0x423df0);else{if(_0x423df0 instanceof Blob)_0x505920[_0x4a8417(-0x3a,-0x70)](_0x4a8417(-0x8c,-0xc3),_0x423df0,_0x243337);else{if(_0x423df0 instanceof ArrayBuffer)_0x505920[_0x4a8417(-0x3a,-0x82)](_0x4a8417(-0x8c,-0x9d),new Blob([_0x423df0]),_0x243337);else typeof _0x423df0==='string'&&_0x505920[_0x4a8417(-0x3a,-0xbb)](_0x4a8417(-0x8c,-0xe5),new Blob([_0x423df0],{'type':'text/plain'}),_0x243337);}}_0x505920['append']('path',_0x243337);_0x2b0236?.[_0x4a8417(0x24,-0xa)]&&_0x505920['append']('cacheControl',_0x2b0236['cacheControl']);_0x2b0236?.[_0x4a8417(-0xb,-0x6f)]&&_0x505920['append']('contentType',_0x2b0236['contentType']);_0x2b0236?.['metadata']&&_0x505920[_0x4a8417(-0x3a,-0x39)]('metadata',JSON['stringify'](_0x2b0236['metadata']));const _0x5253c1='/storage/buckets/'+this[_0x4a8417(-0x50,-0xc9)]+_0x4a8417(0x10,-0x63)+(_0x2b0236?.['upsert']?'?upsert=true':''),response=await this['httpClient']['post'](_0x5253c1,_0x505920,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x4a8417(0x21,0x59)],'error':null};}catch(_0x446e77){return{'data':null,'error':_0x446e77 instanceof EBaaSError?_0x446e77:new EBaaSError(_0x446e77 instanceof Error?_0x446e77['message']:'Failed\x20to\x20upload\x20file',0x0,_0x446e77)};}}async[_0x29adf0(-0x211,-0x210)](_0x869c6b,_0x445868){function _0x3077c4(_0x2f34ab,_0x2f1450){return _0x13f2(_0x2f34ab- -0x1bf,_0x2f1450);}try{const _0x2a38db=new URLSearchParams();_0x445868?.['transform']&&Object['entries'](_0x445868[_0x3077c4(0x41,-0x1d)])[_0x3077c4(-0x4d,-0x6b)](([_0x46822f,_0x2a2ee5])=>{_0x2a2ee5!==undefined&&_0x2a38db['append'](_0x46822f,String(_0x2a2ee5));});const _0x4110e5='/storage/buckets/'+this['bucketId']+'/files/'+_0x869c6b+(_0x2a38db[_0x3077c4(-0x14,0x60)]()?'?'+_0x2a38db[_0x3077c4(-0x14,0x46)]():''),response=await this[_0x3077c4(-0x17,0x3e)]['get'](_0x4110e5,{'responseType':_0x3077c4(-0x1f,-0x42)});return{'data':response[_0x3077c4(-0x4,-0x64)],'error':null};}catch(_0x17a8a4){return{'data':null,'error':_0x17a8a4 instanceof EBaaSError?_0x17a8a4:new EBaaSError(_0x17a8a4 instanceof Error?_0x17a8a4[_0x3077c4(0x42,-0x1e)]:_0x3077c4(-0x55,-0x14),0x0,_0x17a8a4)};}}async['list'](_0x35769f,_0x3d4329){function _0x4aa0e6(_0x5be3fb,_0x47b185){return _0x13f2(_0x5be3fb-0x3e4,_0x47b185);}try{const _0x532540=new URLSearchParams();_0x35769f&&_0x532540['append'](_0x4aa0e6(0x530,0x50f),_0x35769f);_0x3d4329?.['limit']&&_0x532540[_0x4aa0e6(0x544,0x4e9)](_0x4aa0e6(0x578,0x554),String(_0x3d4329['limit']));_0x3d4329?.['offset']&&_0x532540[_0x4aa0e6(0x544,0x55a)]('offset',String(_0x3d4329[_0x4aa0e6(0x576,0x5df)]));_0x3d4329?.[_0x4aa0e6(0x5d8,0x59d)]&&_0x532540[_0x4aa0e6(0x544,0x53f)]('sortBy',JSON[_0x4aa0e6(0x504,0x483)](_0x3d4329['sortBy']));_0x3d4329?.['search']&&_0x532540[_0x4aa0e6(0x544,0x538)]('search',_0x3d4329['search']);const _0x3c6556='/storage/buckets/'+this['bucketId']+_0x4aa0e6(0x58e,0x589)+(_0x532540[_0x4aa0e6(0x58f,0x561)]()?'?'+_0x532540['toString']():''),response=await this[_0x4aa0e6(0x58c,0x5a3)][_0x4aa0e6(0x537,0x4d2)](_0x3c6556);return{'data':response[_0x4aa0e6(0x59f,0x5e8)],'error':null};}catch(_0x2442ad){return{'data':null,'error':_0x2442ad instanceof EBaaSError?_0x2442ad:new EBaaSError(_0x2442ad instanceof Error?_0x2442ad['message']:_0x4aa0e6(0x55b,0x4d8),0x0,_0x2442ad)};}}async[_0x29adf0(-0x184,-0x181)](_0x3940a5){function _0x2f5ad1(_0x5351ce,_0x2042c6){return _0x13f2(_0x5351ce- -0x1e4,_0x2042c6);}try{const response=await this['httpClient'][_0x2f5ad1(0x17,-0x5f)]('/storage/buckets/'+this['bucketId']+'/files',{'data':{'paths':_0x3940a5}});return{'data':response[_0x2f5ad1(-0x29,-0x1d)],'error':null};}catch(_0x58e725){return{'data':null,'error':_0x58e725 instanceof EBaaSError?_0x58e725:new EBaaSError(_0x58e725 instanceof Error?_0x58e725[_0x2f5ad1(0x1d,0x6e)]:'Failed\x20to\x20remove\x20files',0x0,_0x58e725)};}}async[_0x29adf0(-0x1cb,-0x19c)](fromPath,_0x1d510f){function _0x189efd(_0x1aed21,_0x36061c){return _0x13f2(_0x36061c-0x22e,_0x1aed21);}try{const response=await this['httpClient'][_0x189efd(0x2ed,0x363)]('/storage/buckets/'+this[_0x189efd(0x3e9,0x378)]+_0x189efd(0x358,0x380),{'sourceKey':fromPath,'destinationKey':_0x1d510f});return{'data':response[_0x189efd(0x389,0x3e9)],'error':null};}catch(_0x18686f){return{'data':null,'error':_0x18686f instanceof EBaaSError?_0x18686f:new EBaaSError(_0x18686f instanceof Error?_0x18686f['message']:_0x189efd(0x443,0x43c),0x0,_0x18686f)};}}async[_0x29adf0(-0x261,-0x219)](fromPath,_0x2ae6f4){function _0x53fc81(_0x3e3619,_0x3cc4bb){return _0x13f2(_0x3e3619-0x1b3,_0x3cc4bb);}try{const response=await this[_0x53fc81(0x35b,0x2e8)][_0x53fc81(0x2e8,0x27e)](_0x53fc81(0x30d,0x2bb)+this['bucketId']+'/files/copy',{'sourceKey':fromPath,'destinationKey':_0x2ae6f4});return{'data':response['data'],'error':null};}catch(_0x339422){return{'data':null,'error':_0x339422 instanceof EBaaSError?_0x339422:new EBaaSError(_0x339422 instanceof Error?_0x339422['message']:_0x53fc81(0x2c9,0x248),0x0,_0x339422)};}}async[_0x29adf0(-0x184,-0x19a)](_0x2b7002,_0x1c101e,_0x2a3bd0){function _0x3b8688(_0x3d725d,_0x45de99){return _0x13f2(_0x45de99- -0x24e,_0x3d725d);}try{const response=await this[_0x3b8688(-0x9b,-0xa6)]['post'](_0x3b8688(-0x16c,-0xf4)+this['bucketId']+'/files/'+_0x2b7002+_0x3b8688(-0x121,-0xa0),{'expiresIn':_0x1c101e,..._0x2a3bd0});return{'data':response['data'],'error':null};}catch(_0x17e6ee){return{'data':null,'error':_0x17e6ee instanceof EBaaSError?_0x17e6ee:new EBaaSError(_0x17e6ee instanceof Error?_0x17e6ee[_0x3b8688(-0x77,-0x4d)]:_0x3b8688(-0x138,-0x126),0x0,_0x17e6ee)};}}[_0x29adf0(-0x1bc,-0x201)](_0x3c5dc3,_0x5542f6){const _0x924b3e=new URLSearchParams();function _0x16ca25(_0x3e5ff4,_0x46802e){return _0x13f2(_0x46802e- -0x215,_0x3e5ff4);}_0x5542f6?.[_0x16ca25(-0x98,-0x15)]&&Object['entries'](_0x5542f6['transform'])[_0x16ca25(-0x90,-0xa3)](([_0xcdf67f,_0x3c18f6])=>{_0x3c18f6!==undefined&&_0x924b3e['append'](_0xcdf67f,String(_0x3c18f6));});const _0x3e9f4b=this['httpClient']['baseURL']||'',_0x2e9a6b=_0x3e9f4b+_0x16ca25(-0x131,-0xbb)+this[_0x16ca25(-0xc3,-0xcb)]+_0x16ca25(-0xb7,-0x61)+_0x3c5dc3+(_0x924b3e['toString']()?'?'+_0x924b3e[_0x16ca25(-0x49,-0x6a)]():'');return{'data':{'publicUrl':_0x2e9a6b}};}async[_0x29adf0(-0x12a,-0x12b)](_0x19f97d){function _0x48d820(_0x421cf3,_0x435f34){return _0x13f2(_0x421cf3- -0x21d,_0x435f34);}try{const response=await this['httpClient']['get']('/storage/buckets/'+this['bucketId']+'/files/'+_0x19f97d+_0x48d820(-0x2b,-0x85));return{'data':response['data'],'error':null};}catch(_0x25a1e9){return{'data':null,'error':_0x25a1e9 instanceof EBaaSError?_0x25a1e9:new EBaaSError(_0x25a1e9 instanceof Error?_0x25a1e9[_0x48d820(-0x1c,-0x1c)]:_0x48d820(-0x83,-0x2),0x0,_0x25a1e9)};}}async['updateFileMetadata'](_0x384c2f,metadata){function _0x3f09f9(_0x189267,_0x216214){return _0x13f2(_0x216214-0x20c,_0x189267);}try{const response=await this[_0x3f09f9(0x42a,0x3b4)][_0x3f09f9(0x2b1,0x324)](_0x3f09f9(0x364,0x366)+this[_0x3f09f9(0x2f1,0x356)]+_0x3f09f9(0x396,0x3c0)+_0x384c2f+_0x3f09f9(0x324,0x39f),{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x3a8f35){return{'data':null,'error':_0x3a8f35 instanceof EBaaSError?_0x3a8f35:new EBaaSError(_0x3a8f35 instanceof Error?_0x3a8f35['message']:'Failed\x20to\x20update\x20file\x20metadata',0x0,_0x3a8f35)};}}}class StorageClient{constructor(_0x5860f9){this['httpClient']=_0x5860f9;}[_0x29adf0(-0x155,-0x139)](bucketId){function _0x1555f4(_0x5900b6,_0x4af29c){return _0x13f2(_0x5900b6- -0x19f,_0x4af29c);}return new StorageBucket(this[_0x1555f4(0x9,0x22)],bucketId);}async['createBucket'](_0xed2c28,_0x1908b8){function _0x436b0d(_0x41ea04,_0x25e0eb){return _0x13f2(_0x25e0eb-0x370,_0x41ea04);}try{const response=await this[_0x436b0d(0x51a,0x518)][_0x436b0d(0x477,0x4a5)]('/storage/buckets',{'id':_0xed2c28,..._0x1908b8});return{'data':response['data'],'error':null};}catch(_0x1fb3ca){return{'data':null,'error':_0x1fb3ca instanceof EBaaSError?_0x1fb3ca:new EBaaSError(_0x1fb3ca instanceof Error?_0x1fb3ca[_0x436b0d(0x505,0x571)]:_0x436b0d(0x540,0x4f2),0x0,_0x1fb3ca)};}}async['getBucket'](_0x20ff7e){function _0x434691(_0x45536f,_0x10d977){return _0x13f2(_0x10d977-0x3d4,_0x45536f);}try{const response=await this['httpClient'][_0x434691(0x50a,0x527)]('/storage/buckets/'+_0x20ff7e);return{'data':response['data'],'error':null};}catch(_0x335d7d){return{'data':null,'error':_0x335d7d instanceof EBaaSError?_0x335d7d:new EBaaSError(_0x335d7d instanceof Error?_0x335d7d['message']:_0x434691(0x5ff,0x5c2),0x0,_0x335d7d)};}}async['listBuckets'](){function _0x8dc430(_0x34735e,_0x31d40c){return _0x13f2(_0x34735e-0x74,_0x31d40c);}try{const response=await this[_0x8dc430(0x21c,0x1de)][_0x8dc430(0x1c7,0x144)]('/storage/buckets');return{'data':response[_0x8dc430(0x22f,0x1d6)],'error':null};}catch(_0x18f941){return{'data':null,'error':_0x18f941 instanceof EBaaSError?_0x18f941:new EBaaSError(_0x18f941 instanceof Error?_0x18f941['message']:'Failed\x20to\x20list\x20buckets',0x0,_0x18f941)};}}async['updateBucket'](_0x37a3f7,_0xd8768a){function _0x4e2509(_0x2f0305,_0x51d3d4){return _0x13f2(_0x51d3d4- -0x33c,_0x2f0305);}try{const response=await this[_0x4e2509(-0x167,-0x194)]['put'](_0x4e2509(-0x172,-0x1e2)+_0x37a3f7,_0xd8768a);return{'data':response['data'],'error':null};}catch(_0x4384bd){return{'data':null,'error':_0x4384bd instanceof EBaaSError?_0x4384bd:new EBaaSError(_0x4384bd instanceof Error?_0x4384bd['message']:_0x4e2509(-0x1cb,-0x1a5),0x0,_0x4384bd)};}}async[_0x29adf0(-0x1f0,-0x211)](_0x4f1cf8){function _0x1925fb(_0x4c272f,_0x5cae6e){return _0x13f2(_0x4c272f- -0x273,_0x5cae6e);}try{const response=await this[_0x1925fb(-0xcb,-0x9e)][_0x1925fb(-0x78,0x1)](_0x1925fb(-0x119,-0xcf)+_0x4f1cf8);return{'data':response['data'],'error':null};}catch(_0x52f006){return{'data':null,'error':_0x52f006 instanceof EBaaSError?_0x52f006:new EBaaSError(_0x52f006 instanceof Error?_0x52f006['message']:'Failed\x20to\x20delete\x20bucket',0x0,_0x52f006)};}}async['getUsage'](){function _0x57f066(_0xfc2f2a,_0x3604fb){return _0x13f2(_0xfc2f2a- -0x16a,_0x3604fb);}try{const response=await this['httpClient']['get'](_0x57f066(0xb,0x81));return{'data':response['data'],'error':null};}catch(_0x593c0c){return{'data':null,'error':_0x593c0c instanceof EBaaSError?_0x593c0c:new EBaaSError(_0x593c0c instanceof Error?_0x593c0c[_0x57f066(0x97,0x102)]:_0x57f066(-0x43,-0xa7),0x0,_0x593c0c)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x545082,_0x4862e9){super(),this[_0x1db0cf(0x43e,0x3e2)]=![];function _0x1db0cf(_0x33de31,_0x30d115){return _0x13f2(_0x30d115-0x27e,_0x33de31);}this[_0x1db0cf(0x3f0,0x45e)]='closed',this['subscriptions']=new Map(),this[_0x1db0cf(0x3d8,0x437)]=_0x545082,this[_0x1db0cf(0x480,0x450)]=_0x4862e9;}[_0x29adf0(-0x1a2,-0x1ec)](_0x185a70){!this['joinedOnce']&&(this['joinedOnce']=!![],this[_0x39835d(0x2eb,0x270)]());function _0x39835d(_0x3c95e0,_0x37c001){return _0x13f2(_0x3c95e0-0x1d2,_0x37c001);}return _0x185a70&&this['on'](_0x39835d(0x352,0x3b4),_0x185a70),this;}[_0x29adf0(-0x27b,-0x20a)](filter,_0x89d9ac){function _0x11320e(_0x29eede,_0x4d795e){return _0x13f2(_0x4d795e-0x16b,_0x29eede);}const _0x21984a=_0x11320e(0x2eb,0x2dc)+JSON[_0x11320e(0x251,0x28b)](filter);super['on'](_0x21984a,_0x89d9ac);const _0x1a6862={'unsubscribe':()=>{function _0x1948eb(_0x565843,_0x353ed6){return _0x13f2(_0x353ed6-0x1b4,_0x565843);}super[_0x1948eb(0x3e0,0x35d)](_0x21984a,_0x89d9ac),this['subscriptions'][_0x1948eb(0x39a,0x3af)](_0x21984a);}};return this['subscriptions']['set'](_0x21984a,_0x1a6862),this[_0x11320e(0x34a,0x33d)]?.['connected']&&this[_0x11320e(0x36c,0x34b)]===_0x11320e(0x25b,0x2c1)&&this[_0x11320e(0x30b,0x33d)]['emit'](_0x11320e(0x2bd,0x2f7),{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()}),_0x1a6862;}[_0x29adf0(-0x11a,-0x12d)](filter,_0x1f912a){const _0xdb95ab='broadcast:'+JSON['stringify'](filter);function _0x1fff31(_0x477d51,_0x4c4bdb){return _0x13f2(_0x4c4bdb-0x4b,_0x477d51);}super['on'](_0xdb95ab,_0x1f912a);const _0x3f0577={'unsubscribe':()=>{function _0x371e47(_0x3b12df,_0x1fca42){return _0x13f2(_0x3b12df-0x14c,_0x1fca42);}super[_0x371e47(0x2f5,0x28d)](_0xdb95ab,_0x1f912a),this['subscriptions']['delete'](_0xdb95ab);}};return this[_0x1fff31(0x156,0x15c)]['set'](_0xdb95ab,_0x3f0577),_0x3f0577;}[_0x29adf0(-0x236,-0x1c6)](filter,_0x18b51a){const _0x3db30f=_0x1a6640(-0x209,-0x186)+JSON['stringify'](filter);super['on'](_0x3db30f,_0x18b51a);const _0x3ea84c={'unsubscribe':()=>{super[_0x584799(0x6d,0x3b)](_0x3db30f,_0x18b51a);function _0x584799(_0x1a3ec8,_0x2f09ad){return _0x13f2(_0x1a3ec8- -0x13c,_0x2f09ad);}this[_0x584799(-0x2b,-0x2a)][_0x584799(0xbf,0x7f)](_0x3db30f);}};function _0x1a6640(_0xbf493c,_0x4a3110){return _0x13f2(_0x4a3110- -0x35c,_0xbf493c);}return this['subscriptions']['set'](_0x3db30f,_0x3ea84c),_0x3ea84c;}['send'](_0x47bc4f){return new Promise(_0x50832a=>{function _0x552d0d(_0x155b1a,_0x2c6421){return _0x13f2(_0x155b1a-0x1dc,_0x2c6421);}this['socket']?.[_0x552d0d(0x377,0x3ca)]&&this['state']===_0x552d0d(0x332,0x36f)?(this['socket'][_0x552d0d(0x3b8,0x3be)]('broadcast',{'topic':this['topic'],'event':_0x47bc4f[_0x552d0d(0x3b1,0x401)],'payload':_0x47bc4f,'ref':this[_0x552d0d(0x365,0x3c5)]()}),_0x50832a('ok')):_0x50832a('error');});}[_0x29adf0(-0xcd,-0x13e)](_0x4a139b){return new Promise(_0x2c1feb=>{function _0x5cb0b4(_0x55b5dc,_0x18ffec){return _0x13f2(_0x55b5dc-0x3d2,_0x18ffec);}this[_0x5cb0b4(0x5a4,0x5b3)]?.['connected']&&this['state']==='joined'?(this[_0x5cb0b4(0x5a4,0x605)][_0x5cb0b4(0x5ae,0x5dd)](_0x5cb0b4(0x506,0x54e),{'topic':this['topic'],'event':'track','payload':_0x4a139b,'ref':this['makeRef']()}),_0x2c1feb('ok')):_0x2c1feb('error');});}[_0x29adf0(-0xc4,-0x125)](){return new Promise(_0x4bae83=>{function _0x4ff738(_0x5efdeb,_0x5835bc){return _0x13f2(_0x5efdeb-0x4e,_0x5835bc);}this['socket']?.[_0x4ff738(0x1e9,0x1bd)]&&this[_0x4ff738(0x22e,0x213)]==='joined'?(this[_0x4ff738(0x220,0x1cd)][_0x4ff738(0x22a,0x1cd)]('presence',{'topic':this[_0x4ff738(0x207,0x1a4)],'event':_0x4ff738(0x24d,0x29c),'ref':this[_0x4ff738(0x1d7,0x163)]()}),_0x4bae83('ok')):_0x4bae83(_0x4ff738(0x233,0x299));});}['unsubscribe'](){return new Promise(_0x3b9097=>{this['state']=_0x12a40a(-0x140,-0x11b),this[_0x12a40a(-0x22c,-0x23d)][_0x12a40a(-0x1cb,-0x20d)](_0x454763=>{function _0x40b172(_0x103391,_0x3f8c73){return _0x13f2(_0x3f8c73-0x1f5,_0x103391);}_0x454763[_0x40b172(0x37a,0x2fe)]();}),this[_0x12a40a(-0x22c,-0x299)]['clear']();function _0x12a40a(_0x2793a2,_0x16e6fa){return _0x13f2(_0x2793a2- -0x33d,_0x16e6fa);}this[_0x12a40a(-0x16b,-0x118)]?.['connected']&&this['socket']['emit']('leave',{'topic':this[_0x12a40a(-0x184,-0x15e)],'ref':this[_0x12a40a(-0x1b4,-0x1a4)]()}),this[_0x12a40a(-0x15d,-0x1ba)]=_0x12a40a(-0x203,-0x284),this['removeAllListeners'](),_0x3b9097('ok');});}[_0x29adf0(-0x1c3,-0x20b)](){function _0x13fdb8(_0x32c1ec,_0xf2de9d){return _0x13f2(_0xf2de9d-0x2a4,_0x32c1ec);}if(this[_0x13fdb8(0x485,0x484)]===_0x13fdb8(0x44c,0x4a1))return;this[_0x13fdb8(0x41e,0x484)]=_0x13fdb8(0x435,0x469),this[_0x13fdb8(0x41e,0x476)]?.['connected']&&(this['socket'][_0x13fdb8(0x44e,0x480)](_0x13fdb8(0x504,0x49c),{'topic':this['topic'],'ref':this[_0x13fdb8(0x3d9,0x42d)]()}),setTimeout(()=>{function _0x463339(_0x15d1c4,_0x2ade8b){return _0x13f2(_0x2ade8b-0x2d2,_0x15d1c4);}this['state']==='joining'&&(this[_0x463339(0x4f7,0x4b2)]='joined',this['emit']('status',_0x463339(0x3bd,0x3fe)));},0x64));}[_0x29adf0(-0x1aa,-0x164)](){function _0x5a73cf(_0xac7b40,_0x5c013e){return _0x13f2(_0xac7b40- -0x373,_0x5c013e);}this[_0x5a73cf(-0x20f,-0x21c)]&&(this[_0x5a73cf(-0x25a,-0x24f)](),this[_0x5a73cf(-0x262,-0x200)][_0x5a73cf(-0x201,-0x26b)]((_0x2a38dd,_0x54e9f8)=>{function _0x5b1810(_0x20b04e,_0x26c15e){return _0x13f2(_0x26c15e- -0xb3,_0x20b04e);}if(_0x54e9f8['startsWith']('postgres_changes:')){const filter=JSON[_0x5b1810(0xb7,0x7c)](_0x54e9f8[_0x5b1810(0x16e,0x114)](_0x5b1810(0x76,0xbe),''));this[_0x5b1810(0x142,0x11f)]?.[_0x5b1810(0xc2,0x129)](_0x5b1810(0x69,0xd9),{'topic':this['topic'],'filter':filter,'ref':this[_0x5b1810(0xdd,0xd6)]()});}}));}[_0x29adf0(-0x16d,-0x11c)](_0x25ab0f,_0x4cd802){if(_0x25ab0f==='postgres_changes'){const _0x419a='postgres_changes:'+JSON[_0x22bfe2(-0x4c,0x3)](_0x4cd802[_0x22bfe2(-0x25,0x58)]||{});this['emit'](_0x419a,_0x4cd802);}else{if(_0x25ab0f===_0x22bfe2(0x90,0xfb)){const _0x4bd8d6=_0x22bfe2(-0x46,-0x16)+JSON[_0x22bfe2(-0x4c,-0x6f)]({'event':_0x4cd802['event']});this['emit'](_0x4bd8d6,_0x4cd802);}else{if(_0x25ab0f===_0x22bfe2(-0x38,0x28)){const _0x1cbdac=_0x22bfe2(0x6a,0xa5)+JSON[_0x22bfe2(-0x4c,0x21)]({'event':_0x4cd802['event']});this[_0x22bfe2(0x70,0x3)](_0x1cbdac,_0x4cd802);}}}function _0x22bfe2(_0x4b4b0b,_0x4a34b8){return _0x13f2(_0x4b4b0b- -0x16c,_0x4a34b8);}this[_0x22bfe2(0x70,0x1b)](_0x25ab0f,_0x4cd802);}['_setState'](_0x3b431b){function _0x4c7640(_0x9e5028,_0x32dd21){return _0x13f2(_0x32dd21-0x3c2,_0x9e5028);}this['state']=_0x3b431b;let status;switch(_0x3b431b){case _0x4c7640(0x549,0x518):status=_0x4c7640(0x52a,0x4ee);break;case _0x4c7640(0x5d6,0x5ce):status=_0x4c7640(0x527,0x50a);break;case'closed':status='CLOSED';break;default:return;}this[_0x4c7640(0x618,0x59e)](_0x4c7640(0x4bf,0x542),status);}['makeRef'](){function _0x3f4613(_0x5f175b,_0x33f81b){return _0x13f2(_0x33f81b-0x327,_0x5f175b);}return Math[_0x3f4613(0x423,0x44b)]()[_0x3f4613(0x4e5,0x4d2)](0x24)['substring'](0x2,0xf);}['getState'](){function _0x35a3dc(_0x8bc149,_0x34552f){return _0x13f2(_0x8bc149-0x3cc,_0x34552f);}return this[_0x35a3dc(0x5ac,0x59d)];}}class RealtimeClient{constructor(_0x1cd1dc,_0x11ad29,_0x335fc1={}){this['socket']=null,this['channels']=new Map();function _0x415ef4(_0x56e633,_0x3f63fe){return _0x13f2(_0x56e633-0x17d,_0x3f63fe);}this[_0x415ef4(0x2be,0x28c)]=_0x415ef4(0x2d4,0x2e2),this['reconnectAttempts']=0x0,this['maxReconnectAttempts']=0x5,this[_0x415ef4(0x356,0x372)]=_0x1cd1dc,this[_0x415ef4(0x2c2,0x323)]=_0x11ad29,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x335fc1};}[_0x29adf0(-0x182,-0x1c2)](){return new Promise((_0x338d06,_0x18a637)=>{if(this['socket']?.['connected']){_0x338d06();return;}this[_0x5d2e08(-0x14a,-0x15d)]=_0x5d2e08(-0xe5,-0x126),this['socket']=socket_ioClient['io'](this[_0x5d2e08(-0x67,-0xc5)],{'auth':{'apikey':this[_0x5d2e08(-0x131,-0x159)]},'transports':[_0x5d2e08(-0xf5,-0x10d)],'reconnection':!![],'reconnectionDelay':this[_0x5d2e08(-0x137,-0xb4)]['reconnectInterval'],'reconnectionAttempts':this[_0x5d2e08(-0x6d,-0xb4)]['maxReconnectAttempts'],...this[_0x5d2e08(-0x9d,-0xb4)][_0x5d2e08(-0x12a,-0x136)]}),this[_0x5d2e08(-0xdd,-0xcc)]['on'](_0x5d2e08(-0xdb,-0x13c),()=>{function _0x1796c5(_0x24908f,_0x4b4604){return _0x13f2(_0x4b4604- -0xf5,_0x24908f);}this['connectionState']=_0x1796c5(0x70,0xa6),this['reconnectAttempts']=0x0,this['setupHeartbeat'](),_0x338d06();});function _0x5d2e08(_0x50166b,_0x280d9c){return _0x13f2(_0x280d9c- -0x29e,_0x50166b);}this[_0x5d2e08(-0xc9,-0xcc)]['on'](_0x5d2e08(-0x74,-0x99),_0x275cad=>{this[_0x4ed0ba(-0x26d,-0x2b6)]='disconnected';function _0x4ed0ba(_0x305c49,_0x5d70fb){return _0x13f2(_0x305c49- -0x3ae,_0x5d70fb);}this[_0x4ed0ba(-0x1e4,-0x223)]['forEach'](channel=>{function _0x1435f8(_0x2c6c5d,_0x1e619b){return _0x13f2(_0x1e619b- -0xf6,_0x2c6c5d);}channel[_0x1435f8(0xb4,0xd6)]('closed');});}),this['socket']['on']('connect_error',_0x15e806=>{function _0x344f72(_0x2910bf,_0x17ae74){return _0x13f2(_0x2910bf-0x3e0,_0x17ae74);}this['connectionState']='error',this['reconnectAttempts']++,this['reconnectAttempts']>=this['maxReconnectAttempts']&&_0x18a637(new Error('Failed\x20to\x20connect\x20after\x20'+this[_0x344f72(0x5d0,0x589)]+_0x344f72(0x501,0x4bb)+_0x15e806['message']));}),this[_0x5d2e08(-0x144,-0xcc)]['on']('reconnect',()=>{this[_0x9bd2fa(0x213,0x234)]='connected',this[_0x9bd2fa(0x2e3,0x261)]=0x0;function _0x9bd2fa(_0x12c4ca,_0x4e3050){return _0x13f2(_0x4e3050-0xf3,_0x12c4ca);}this[_0x9bd2fa(0x32e,0x2bd)]['forEach'](channel=>{function _0x329ada(_0xf3472a,_0x289b97){return _0x13f2(_0xf3472a- -0x18,_0x289b97);}channel[_0x329ada(0x1a8,0x1b8)]();});}),this[_0x5d2e08(-0x10f,-0xcc)]['on']('postgres_changes',_0x1d6700=>{const channel=this['channels']['get'](_0x1d6700['topic']);channel&&channel['_trigger']('postgres_changes',_0x1d6700);}),this[_0x5d2e08(-0xb4,-0xcc)]['on'](_0x5d2e08(-0x4f,-0xa2),_0x2c2f46=>{const channel=this[_0x20e38a(0x99,0xb0)]['get'](_0x2c2f46[_0x20e38a(0x82,0x9f)]);function _0x20e38a(_0x572e3a,_0x3d51f9){return _0x13f2(_0x3d51f9- -0x11a,_0x572e3a);}channel&&channel[_0x20e38a(0xa6,0xee)]('broadcast',_0x2c2f46);}),this[_0x5d2e08(-0x121,-0xcc)]['on']('presence',_0x540209=>{const channel=this['channels'][_0x158a8e(0x4c4,0x4b0)](_0x540209['topic']);function _0x158a8e(_0x564831,_0x51b9d5){return _0x13f2(_0x564831-0x371,_0x51b9d5);}channel&&channel[_0x158a8e(0x579,0x4f9)](_0x158a8e(0x4a5,0x4b9),_0x540209);});});}[_0x29adf0(-0x10b,-0x11f)](){this['socket']&&(this[_0x39a86d(0x174,0x1b9)]['disconnect'](),this[_0x39a86d(0x20d,0x1b9)]=null);this[_0x39a86d(0x156,0x128)]='disconnected';function _0x39a86d(_0x355ed4,_0x2b8f92){return _0x13f2(_0x2b8f92- -0x19,_0x355ed4);}this[_0x39a86d(0x1eb,0x1b1)][_0x39a86d(0x217,0x199)]();}['channel'](_0x52ad68){if(this[_0x14fa1d(0x38d,0x3b7)]['has'](_0x52ad68))return this[_0x14fa1d(0x38d,0x336)]['get'](_0x52ad68);const channel=new RealtimeChannel(_0x52ad68,this[_0x14fa1d(0x395,0x388)]);function _0x14fa1d(_0x16998c,_0x38667a){return _0x13f2(_0x16998c-0x1c3,_0x38667a);}return this['channels']['set'](_0x52ad68,channel),this[_0x14fa1d(0x304,0x303)]==='connected'&&channel['_join'](),channel;}['removeChannel'](channel){const _0x14e481=channel['topic'];function _0x4a8bc6(_0x4d44b1,_0x4c32f2){return _0x13f2(_0x4c32f2- -0x329,_0x4d44b1);}this['channels']['has'](_0x14e481)&&(this[_0x4a8bc6(-0x19d,-0x15f)][_0x4a8bc6(-0x139,-0x12e)](_0x14e481),channel[_0x4a8bc6(-0x1fe,-0x220)]());}['removeAllChannels'](){function _0x416dc5(_0x548326,_0x43debd){return _0x13f2(_0x548326- -0x10c,_0x43debd);}this['channels']['forEach'](channel=>{function _0x598d86(_0xd87745,_0x47d0a8){return _0x13f2(_0x47d0a8-0x3e7,_0xd87745);}channel[_0x598d86(0x498,0x4f0)]();}),this['channels'][_0x416dc5(0xa6,0x6c)]();}['getChannels'](){function _0x257f2f(_0x43e83e,_0x30f3b9){return _0x13f2(_0x43e83e-0x2e8,_0x30f3b9);}return Array[_0x257f2f(0x4d3,0x49e)](this[_0x257f2f(0x4b2,0x50b)]['values']());}[_0x29adf0(-0x193,-0x17d)](){function _0x433a6e(_0x1fc375,_0x291f09){return _0x13f2(_0x1fc375-0x28b,_0x291f09);}return this['connectionState']===_0x433a6e(0x426,0x4a0)&&!!this['socket']?.[_0x433a6e(0x426,0x42b)];}[_0x29adf0(-0x1ba,-0x1b9)](){function _0x2398a6(_0x879a5e,_0x320692){return _0x13f2(_0x879a5e-0x1fc,_0x320692);}return this[_0x2398a6(0x33d,0x32e)];}['onConnectionStateChange'](_0x4448cc){const _0x1fe762=()=>_0x4448cc(this['connectionState']);function _0x5e30e6(_0x3a3f39,_0x27a627){return _0x13f2(_0x3a3f39-0x2e9,_0x27a627);}return this['socket']&&(this['socket']['on'](_0x5e30e6(0x44b,0x49f),()=>{function _0x319797(_0x42ed7b,_0x123aa0){return _0x13f2(_0x42ed7b-0x20c,_0x123aa0);}this[_0x319797(0x34d,0x362)]='connected',_0x1fe762();}),this['socket']['on']('disconnect',()=>{this['connectionState']='disconnected',_0x1fe762();}),this['socket']['on']('connect_error',()=>{this['connectionState']='error',_0x1fe762();})),()=>{function _0x271cae(_0x2b7886,_0x4ea8e3){return _0x13f2(_0x4ea8e3-0x32e,_0x2b7886);}this['socket']&&(this[_0x271cae(0x561,0x500)]['off']('connect',_0x1fe762),this['socket']['off']('disconnect',_0x1fe762),this['socket']['off'](_0x271cae(0x4cd,0x489),_0x1fe762));};}[_0x29adf0(-0x105,-0x137)](){if(!this[_0x4aa5c1(-0x1aa,-0x1c5)]['heartbeatInterval']||!this[_0x4aa5c1(-0x16f,-0x1dd)])return;function _0x4aa5c1(_0x3679c4,_0x5f01cd){return _0x13f2(_0x5f01cd- -0x3af,_0x3679c4);}const interval=setInterval(()=>{function _0x4fa2c2(_0x4d2cf1,_0x2d5740){return _0x13f2(_0x4d2cf1-0x10b,_0x2d5740);}this['socket']?.[_0x4fa2c2(0x2a6,0x264)]?this[_0x4fa2c2(0x2dd,0x320)]['emit']('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x4aa5c1(-0x1cc,-0x1c5)][_0x4aa5c1(-0x21b,-0x1ab)]);}['_getSocket'](){return this['socket'];}}class FunctionsClient{constructor(_0x177100){function _0x5748ec(_0x2b2e45,_0x131014){return _0x13f2(_0x2b2e45-0xd1,_0x131014);}this[_0x5748ec(0x279,0x2bb)]=_0x177100;}async['invoke'](_0x354897,_0xb61967){function _0x5564f2(_0x53cd3d,_0x591a22){return _0x13f2(_0x53cd3d- -0x269,_0x591a22);}try{const _0x234ea1=_0xb61967?.[_0x5564f2(-0x80,-0xe)]||'POST',headers={'Content-Type':'application/json',..._0xb61967?.[_0x5564f2(-0x12b,-0xe1)]};let response;const _0x58fa5c='/functions/v1/'+_0x354897;switch(_0x234ea1[_0x5564f2(-0x133,-0x17d)]()){case'GET':response=await this['httpClient'][_0x5564f2(-0x116,-0xc2)](_0x58fa5c,{'headers':headers,'params':_0xb61967?.['body']});break;case'POST':response=await this['httpClient'][_0x5564f2(-0x134,-0xd8)](_0x58fa5c,_0xb61967?.[_0x5564f2(-0xca,-0xea)],{'headers':headers});break;case'PUT':response=await this[_0x5564f2(-0xc1,-0x109)]['put'](_0x58fa5c,_0xb61967?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x5564f2(-0xc1,-0x133)]['patch'](_0x58fa5c,_0xb61967?.['body'],{'headers':headers});break;case'DELETE':response=await this[_0x5564f2(-0xc1,-0x11f)]['delete'](_0x58fa5c,{'headers':headers,'data':_0xb61967?.[_0x5564f2(-0xca,-0x70)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x234ea1,0x190);}return{'data':response['data'],'error':null};}catch(_0x29c4f0){return{'data':null,'error':_0x29c4f0 instanceof EBaaSError?_0x29c4f0:new EBaaSError(_0x29c4f0 instanceof Error?_0x29c4f0[_0x5564f2(-0x68,-0x8)]:_0x5564f2(-0x92,-0x108),0x0,_0x29c4f0)};}}async['list'](){function _0x51bd8f(_0x5f19eb,_0xc4b11){return _0x13f2(_0xc4b11- -0xcf,_0x5f19eb);}try{const response=await this[_0x51bd8f(0x63,0xd9)][_0x51bd8f(0x3a,0x84)]('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x16f986){return{'data':null,'error':_0x16f986 instanceof EBaaSError?_0x16f986:new EBaaSError(_0x16f986 instanceof Error?_0x16f986[_0x51bd8f(0xb6,0x132)]:_0x51bd8f(0x3c,0xae),0x0,_0x16f986)};}}async[_0x29adf0(-0x171,-0x1d1)](_0x4dd399){function _0x2557d8(_0x449cd3,_0x2e3244){return _0x13f2(_0x2e3244-0x12e,_0x449cd3);}try{const response=await this[_0x2557d8(0x29a,0x2d6)]['get'](_0x2557d8(0x26e,0x28a)+_0x4dd399+_0x2557d8(0x37e,0x320));return{'data':response['data'],'error':null};}catch(_0x235441){return{'data':null,'error':_0x235441 instanceof EBaaSError?_0x235441:new EBaaSError(_0x235441 instanceof Error?_0x235441[_0x2557d8(0x350,0x32f)]:_0x2557d8(0x36c,0x301),0x0,_0x235441)};}}async['deploy'](_0xc82576,_0x535459){function _0x4dbb27(_0x59ae63,_0x39b086){return _0x13f2(_0x59ae63- -0x140,_0x39b086);}try{const _0x4122fd=new FormData();if(_0x535459['code']instanceof File)_0x4122fd[_0x4dbb27(0x20,0x71)](_0x4dbb27(0xb6,0x9f),_0x535459['code']);else typeof _0x535459[_0x4dbb27(0xb6,0xd5)]==='string'&&_0x4122fd['append'](_0x4dbb27(0xb6,0xa2),new Blob([_0x535459[_0x4dbb27(0xb6,0x9e)]],{'type':_0x4dbb27(0x7c,0x4f)}),'index.ts');_0x535459['entrypoint']&&_0x4122fd['append'](_0x4dbb27(0x5d,0x40),_0x535459['entrypoint']);_0x535459['env']&&_0x4122fd[_0x4dbb27(0x20,0x86)](_0x4dbb27(0x3e,-0x3f),JSON['stringify'](_0x535459[_0x4dbb27(0x3e,-0x13)]));_0x535459[_0x4dbb27(-0x9,0xa)]&&_0x4122fd['append'](_0x4dbb27(-0x9,0x48),JSON[_0x4dbb27(-0x20,-0x48)](_0x535459[_0x4dbb27(-0x9,-0x24)]));_0x535459[_0x4dbb27(0x39,0x29)]!==undefined&&_0x4122fd['append']('verify',String(_0x535459[_0x4dbb27(0x39,0x4e)]));const response=await this[_0x4dbb27(0x68,0x1b)]['post']('/functions/v1/'+_0xc82576+'/deploy',_0x4122fd,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x4dbb27(0x7b,0x2a)],'error':null};}catch(_0x14a139){return{'data':null,'error':_0x14a139 instanceof EBaaSError?_0x14a139:new EBaaSError(_0x14a139 instanceof Error?_0x14a139[_0x4dbb27(0xc1,0x57)]:_0x4dbb27(0xca,0xcb),0x0,_0x14a139)};}}async['delete'](_0x4743e9){function _0xb78b89(_0x365bed,_0x142b1c){return _0x13f2(_0x142b1c-0x3ad,_0x365bed);}try{const response=await this['httpClient'][_0xb78b89(0x627,0x5a8)](_0xb78b89(0x53c,0x509)+_0x4743e9);return{'data':response[_0xb78b89(0x502,0x568)],'error':null};}catch(_0x24e640){return{'data':null,'error':_0x24e640 instanceof EBaaSError?_0x24e640:new EBaaSError(_0x24e640 instanceof Error?_0x24e640[_0xb78b89(0x5db,0x5ae)]:'Failed\x20to\x20delete\x20function',0x0,_0x24e640)};}}async[_0x29adf0(-0x199,-0x11d)](_0x304db1,_0x108e00){function _0x2aa9a3(_0x3ae0fa,_0x2a35a5){return _0x13f2(_0x3ae0fa- -0x271,_0x2a35a5);}try{const response=await this[_0x2aa9a3(-0xc9,-0xe9)]['put'](_0x2aa9a3(-0x115,-0x97)+_0x304db1+'/env',{'env':_0x108e00});return{'data':response['data'],'error':null};}catch(_0x314e6c){return{'data':null,'error':_0x314e6c instanceof EBaaSError?_0x314e6c:new EBaaSError(_0x314e6c instanceof Error?_0x314e6c['message']:_0x2aa9a3(-0x121,-0x11a),0x0,_0x314e6c)};}}async['getLogs'](_0x2b59a7,_0x203ec5){function _0x5475e6(_0x5e9822,_0x3a9899){return _0x13f2(_0x5e9822- -0x1ec,_0x3a9899);}try{const _0x1ad54a=new URLSearchParams();_0x203ec5?.['limit']&&_0x1ad54a['append'](_0x5475e6(-0x58,0x2b),String(_0x203ec5['limit']));_0x203ec5?.[_0x5475e6(-0x5a,-0xbe)]&&_0x1ad54a[_0x5475e6(-0x8c,-0x3a)]('offset',String(_0x203ec5['offset']));_0x203ec5?.[_0x5475e6(-0x56,-0x6b)]&&_0x1ad54a[_0x5475e6(-0x8c,-0x103)]('level',_0x203ec5[_0x5475e6(-0x56,-0xa1)]);const _0x22d8ab=_0x5475e6(-0x90,-0xe)+_0x2b59a7+'/logs'+(_0x1ad54a['toString']()?'?'+_0x1ad54a['toString']():''),response=await this[_0x5475e6(-0x44,-0xad)]['get'](_0x22d8ab);return{'data':response[_0x5475e6(-0x31,-0x1d)],'error':null};}catch(_0x5b7285){return{'data':null,'error':_0x5b7285 instanceof EBaaSError?_0x5b7285:new EBaaSError(_0x5b7285 instanceof Error?_0x5b7285[_0x5475e6(0x15,-0x66)]:_0x5475e6(-0xda,-0x73),0x0,_0x5b7285)};}}async['getMetrics'](_0x542555,_0x3bdda9){function _0x29aa11(_0x2b23e9,_0x44f945){return _0x13f2(_0x44f945- -0x21a,_0x2b23e9);}try{const _0x496d22=new URLSearchParams();_0x3bdda9?.[_0x29aa11(-0xd6,-0x65)]&&_0x496d22[_0x29aa11(-0x87,-0xba)]('period',_0x3bdda9['period']);const _0x30814e=_0x29aa11(-0xd3,-0xbe)+_0x542555+'/metrics'+(_0x496d22['toString']()?'?'+_0x496d22[_0x29aa11(-0x7c,-0x6f)]():''),response=await this[_0x29aa11(0x8,-0x72)]['get'](_0x30814e);return{'data':response['data'],'error':null};}catch(_0x40ff8e){return{'data':null,'error':_0x40ff8e instanceof EBaaSError?_0x40ff8e:new EBaaSError(_0x40ff8e instanceof Error?_0x40ff8e['message']:'Failed\x20to\x20get\x20function\x20metrics',0x0,_0x40ff8e)};}}}class EBaaSClient{constructor(_0x4d438d,_0x2dd9fa,_0x3786ce){function _0x812d1f(_0x1d9192,_0x47cc62){return _0x13f2(_0x47cc62-0x199,_0x1d9192);}this[_0x812d1f(0x311,0x383)]=_0x3786ce,this['httpClient']=new HttpClient({'url':_0x4d438d,'apiKey':_0x2dd9fa,'timeout':0x7530,'headers':_0x3786ce?.[_0x812d1f(0x31b,0x2be)]?.['headers']}),this[_0x812d1f(0x337,0x2d5)]=new AuthClient(this['httpClient']),this[_0x812d1f(0x319,0x2b8)]=new DatabaseClient(this['httpClient'],_0x3786ce?.[_0x812d1f(0x333,0x2b8)]?.[_0x812d1f(0x256,0x2ca)]),this[_0x812d1f(0x411,0x38e)]=new StorageClient(this['httpClient']),this[_0x812d1f(0x35b,0x2d8)]=new RealtimeClient(_0x4d438d,_0x2dd9fa,_0x3786ce?.['realtime']),this['functions']=new FunctionsClient(this[_0x812d1f(0x2ef,0x341)]),this[_0x812d1f(0x253,0x2c2)]();}[_0x29adf0(-0x113,-0x139)](_0x516426){function _0x50cde5(_0x5b3baa,_0x2bec39){return _0x13f2(_0x5b3baa-0x212,_0x2bec39);}return this['database'][_0x50cde5(0x3fd,0x432)](_0x516426);}['rpc'](_0x1d3ee2,_0x5c0541){function _0x4289be(_0x49e78d,_0x36f5cd){return _0x13f2(_0x49e78d- -0x225,_0x36f5cd);}return this[_0x4289be(-0x106,-0x17a)]['rpc'](_0x1d3ee2,_0x5c0541);}[_0x29adf0(-0x215,-0x19f)](_0x349eae){function _0x3df393(_0x171f49,_0x1037fd){return _0x13f2(_0x1037fd- -0x30b,_0x171f49);}return this['storage'][_0x3df393(-0x19e,-0x120)](_0x349eae);}[_0x29adf0(-0x1b4,-0x1d3)](_0x1264a4){function _0x59749b(_0x28281d,_0x54b8a0){return _0x13f2(_0x54b8a0-0x9c,_0x28281d);}return this['realtime'][_0x59749b(0x1fa,0x1ed)](_0x1264a4);}['invoke'](_0x5895ba,_0x1a876d){function _0x300063(_0x37f3ea,_0x2b47c8){return _0x13f2(_0x37f3ea- -0x240,_0x2b47c8);}return this[_0x300063(-0xbd,-0xeb)]['invoke'](_0x5895ba,_0x1a876d);}async['initializeCustomDatabase'](){function _0x2fac7a(_0x5e5fe7,_0x27483f){return _0x13f2(_0x5e5fe7-0xd0,_0x27483f);}if(this['options']?.[_0x2fac7a(0x1ef,0x24f)]?.['autoDetectCustomDatabase'])try{await this[_0x2fac7a(0x1ef,0x1fd)]['initialize']();}catch(_0x2f0e49){console['warn']('Failed to initialize custom database detection:',_0x2f0e49);}}async[_0x29adf0(-0x124,-0x153)](_0x32a91d){this['database']['setWorkspaceId'](_0x32a91d);function _0x36d974(_0x3fc1a2,_0x57b5d5){return _0x13f2(_0x57b5d5- -0xb4,_0x3fc1a2);}this[_0x36d974(0xca,0x136)]?.[_0x36d974(-0x3,0x6b)]?.['autoDetectCustomDatabase']&&await this[_0x36d974(0x58,0x6b)]['initialize']();}async['configureCustomDatabase'](_0x3c5abc){function _0x298a73(_0x25935d,_0x5bcf46){return _0x13f2(_0x5bcf46- -0x2c9,_0x25935d);}await this[_0x298a73(-0x21c,-0x1aa)][_0x298a73(-0xb5,-0x127)](_0x3c5abc);}[_0x29adf0(-0xe3,-0x15c)](){function _0x526266(_0xfa4c92,_0x572963){return _0x13f2(_0x572963-0x25b,_0xfa4c92);}return this[_0x526266(0x3ab,0x37a)][_0x526266(0x42c,0x423)]();}}function createClient(_0x22b1c9,_0x44f676,_0x5800f3){return new EBaaSClient(_0x22b1c9,_0x44f676,_0x5800f3);}function _0x5b68(){const _0x58bcaf=['l3n0B3jHz2uVDxnHz2u','DMfSDwu','rMfPBgvKihrVigXPC3qGzMLSzxm','y29UBMvJDgLUzW','DMvYAwz5','DgvZDenVBM5Ly3rPB24','zgv0zwn0zwrdB25MAwC','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','zw52','B25bDxrOu3rHDgvdAgfUz2u','C3rHDhvZ','Aw5Zzxj0','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','zNvUy3rPB25Z','y2XLyxjtzxnZAw9U','yNvJA2v0','sfruucbYzxf1zxn0igzHAwXLza','B3bLCMf0B3i','Bw92zq','BwfRzvjLzG','y3jLyxrLu2LNBMvKvxjS','l2f1DgGVDJeVC2LNBNvW','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','y29SDw1U','CNbJ','y29UDgvUDfr5Cgu','C2v0u2vZC2LVBKLUDgvYBMfS','D2vIC29JA2v0','B2zMC2v0','l21LDgfKyxrH','BgLTAxq','C2vSzwn0','Bgv2zwW','rMfPBgvKihrVihvWzgf0zsbIDwnRzxq','AgfZ','BgvUz3rO','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','y29UBMvJDgvK','zMLSDgvYCW','zw50CNLWB2LUDa','AgfUzgXLqxv0AevYCM9Y','yM9KEq','yMXVyG','z2v0sxrLBq','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','CMvTB3zL','oejQug9fsG','rgf0ywjHC2vdBgLLBNq','mtu4odeWnffVwMn4AG','AxndB25Uzwn0zwq','Ahr0CenSAwvUDa','B2zM','l2zPBgvZ','Dg9tDhjPBMC','C2vZC2LVBG','yMfZzvvsta','l3nPz24','DxnLCG','y29TBw9U','CMvZCg9UC2u','y2XLyxi','zgv0zwn0q3vZDg9Trgf0ywjHC2u','l2zPBgvZlW','CgvYAw9K','zwjHyxmUyxv0Ac5ZzxnZAw9U','zgvMyxvSDhm','p29WzxjHDgLVBJ1ZzwXLy3q','Dg9WAwm','nti3mZaYmhHlq3P6tq','zgf0yq','Dgv4Dc9WBgfPBG','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','y2fJAgvdB250CM9S','Aw5PDgLHBgL6zq','x3jLAM9PBG','mJuYtMDrELrh','l2f1DgGVDJeVCMvMCMvZAa','y3vYCMvUDfnJAgvTyq','y3jLzgvUDgLHBhm','AM9PBMLUzW','z2v0v29YA3nWywnLswq','CMvWBgfJzq','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','rNvUy3rPB25Zq2XPzw50','y2HHBM5LBhm','AgfUzgXLrxjYB3i','x3nLDfn0yxrL','mteWmtfnywzXzNG','C3rHDhvZvgv4Da','C2v0DxbjBNrLCMnLChrVCNm','zgf0yufYCMf5','C2v0v29YA3nWywnLswq','C29JA2v0','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','l3nKAY92ms8','zxzLBNq','ChjLC2vUy2u6','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','C2LNBK91Da','DxjS','zxHLy3v0zvf1zxj5','zxHLy3v0zq','zw1PDa','DgvZDen1C3rVBunVBM5Ly3rPB24','C2LNBLvW','BhrL','C3rHDgu','CxvLCNK','B3jKzxi','Cg9ZDgDYzxniB3n0','ChvZAa','zxjYB3i','DhjHy2S','l2f1DgGVDJeVDxnLCG','y2XPzw50','Bwv0Ag9K','B3b0Aw9UCW','zNjVBq','C2LNBKLU','C2v0DxbizwfYDgjLyxq','rMfPBgvKihrVigDLDcbIDwnRzxq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','shr0CenSAwvUDa','l2LUzM8','icHtDgf0Dxm6ia','C29YDej5','C3rVCMfNzq','y29Kzq','B25cCM9HzgnHC3q','AM9PBG','z2v0rMLSzuLUzM8','DxbKyxrL','zgvSzxrL','yNjVywrJyxn0','BgvHDMLUzW','qxv0AenSAwvUDa','Dw50CMfJAW','DhjHBNnMB3jT','BwvZC2fNzq','Dg9ku09o','ChjLzMvY','AgvHCNrIzwf0sw50zxj2ywW','zgLZy29UBMvJDa','ndK4mJeZoeDIy1vgvW','DxbKyxrLrw52','x3rYAwDNzxi','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','Dw5KzwzPBMvK','zxjYB3jLza','uhjLzMvY','rMfPBgvKihrVig1VDMuGzMLSzq','Dw5ZDwjZy3jPyMu','CMvXDwvZDa','y29WEq','C3nSrw5HyMXLza','CMvMCMvZAf90B2TLBG','zMLSzq','p29WzxjHDgLVBJ1PBNnLCNq','rujHyvndBgLLBNq','C3vIC2nYAxb0Aw9UCW','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','zgvSzxrLqNvJA2v0','zg93BMXVywq','CMvQzwn0','rMfPBgvKihrVignVChKGzMLSzq','nde3ufrlsxbW','Chv0','x2PVAw4','B25qB3n0z3jLC0nOyw5Nzxm','C2v0qxv0AfrVA2vU','C3rHy2S','u3rVCMfNzunSAwvUDa','y3vYCMvUDfnLC3nPB24','zgf0ywjHC2u','C3rYAw5NAwz5','igf0DgvTChrZoIa','qMvHCMvYia','z2v0uhvIBgLJvxjS','CMfUzg9T','z2XVyMfS','yNjVywrJyxn0oG','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','mZu3ngLfvKvtDa','Bwf0y2G','u1vcu0nssujfra','Cg9ZDgDYzxnqB3j0','DxnL','CgfYC2u','C29JA2v0lMLVlwnSAwvUDa','D29YA3nWywnLswq','CMvZzxrqyxnZD29Yza','C3bSAxq','ChjLC2vUy2u','Cg9ZDa','Dg9vChbLCKnHC2u','Aw1WB3j0twfW','C3vIC2nYAwjL','DgfIBgu','y2XVC2vK','zw50CMLLCW','yxv0Aa','z2v0vxnLCG','AgvHzgvYCW','CMvHBhrPBwu','z2v0u3rHDhvZ','y29UBMvJDgLVBLn0yxrL','C2nOzw1H','lMfZyW','BMfTzq','yxbPs2v5','D2fYBG','zMLSDgvY','q0HbtK5ftf9fuLjpuG','nJaWne9oDKXWAW','yNvJA2v0swq','B3bLCMf0Aw9U','ChjLzML4','C2LUz2XL','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','ms4WlJa','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','y2HHBM5LBa','l2zPBgvZl21VDMu','z2v0','y29UzMLN','CMvTB3zLqxv0AfrVA2vU','AM9PBMvK','zgLZy29UBMvJDgvK','AgfZq3vZDg9Trgf0ywjHC2u','nLD6C2rIza','l3n0B3jHz2uVyNvJA2v0CY8','y29UBMvJDf9LCNjVCG','l2z1BMn0Aw9UCY92ms8','ywnJzxnZx3rVA2vU','B25qCMvZzw5Jzq','yxnJzw5KAw5N','yxbWzw5K','CMfUz2u','y29UBMvJDa','y2fWDhvYzvn0ywnRvhjHy2u','AM9PBMvKt25Jzq','l3jWyY8','y3jLyxrLq2XPzw50','BgLRzq','C29JA2v0t3b0Aw9UCW','AwXPA2u','rMfPBgvKihrVigrVD25SB2fKigzPBgu','z2v0q29UBMvJDgLVBLn0yxrL','mtiXnJm0nJrhwxzhwvy','u3rVCMfNzuj1y2TLDa','CMvJB25Uzwn0qxr0zw1WDhm','C2v0u2vZC2LVBG','nJi5mgzSsxjeva','Cg9ZDgDYzxnFy2HHBMDLCZO','zM9YrwfJAa','Cgf0y2G','CMvTB3zLq3vZDg9Trgf0ywjHC2u'];_0x5b68=function(){return _0x58bcaf;};return _0x5b68();}const version=_0x29adf0(-0x15d,-0x1d5);exports[_0x29adf0(-0xe0,-0x126)]=AuthClient,exports['CustomDatabaseManager']=CustomDatabaseManager,exports[_0x29adf0(-0x17c,-0x17f)]=DatabaseClient,exports[_0x29adf0(-0x1cc,-0x214)]=EBaaSClient,exports['EBaaSError']=EBaaSError,exports[_0x29adf0(-0x108,-0x15b)]=FunctionsClient,exports[_0x29adf0(-0x1a4,-0x133)]=HttpClient,exports['QueryBuilder']=QueryBuilder,exports['RealtimeChannel']=RealtimeChannel,exports['RealtimeClient']=RealtimeClient,exports[_0x29adf0(-0x1ee,-0x1b7)]=StorageBucket,exports[_0x29adf0(-0x213,-0x207)]=StorageClient,exports[_0x29adf0(-0x14a,-0x1be)]=createClient,exports['version']=version;
|
|
1
|
+
'use strict';(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x2942c2(_0x3aeb63,_0x54a1f2){return _0xbff2(_0x3aeb63-0x121,_0x54a1f2);}while(!![]){try{const _0x3860ec=parseInt(_0x2942c2(0x2b7,0x2f9))/0x1+parseInt(_0x2942c2(0x252,0x263))/0x2+parseInt(_0x2942c2(0x2a8,0x2e7))/0x3*(parseInt(_0x2942c2(0x242,0x2bb))/0x4)+parseInt(_0x2942c2(0x2d3,0x2f8))/0x5+parseInt(_0x2942c2(0x28b,0x2ae))/0x6+parseInt(_0x2942c2(0x2d9,0x28c))/0x7+-parseInt(_0x2942c2(0x2a6,0x2db))/0x8;if(_0x3860ec===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x184e04){stringArray['push'](stringArray['shift']());}}}(_0x16f6,0xd0679));var axios=require(_0x37f67d(0x11c,0x181)),socket_ioClient=require(_0x37f67d(0x154,0x134)),EventEmitter=require('eventemitter3');class EBaaSError extends Error{constructor(_0x19c4c1,status=0x0,_0x12df5b){function _0x1444bb(_0x108753,_0x1dbc57){return _0xbff2(_0x108753-0x11,_0x1dbc57);}super(_0x19c4c1),this['name']='EBaaSError',this[_0x1444bb(0x175,0x131)]=status,this[_0x1444bb(0x13e,0x163)]=_0x12df5b,Error[_0x1444bb(0x150,0x1bd)]&&Error['captureStackTrace'](this,EBaaSError);}[_0x37f67d(0x1c4,0x1e3)](){function _0x44fa99(_0x2e6738,_0x1a5d6b){return _0xbff2(_0x2e6738-0x260,_0x1a5d6b);}return{'name':this['name'],'message':this[_0x44fa99(0x37f,0x327)],'status':this['status'],'details':this[_0x44fa99(0x38d,0x40b)],'stack':this[_0x44fa99(0x38f,0x3f7)]};}[_0x37f67d(0x1be,0x1f5)](){function _0x242e13(_0x43cede,_0x49fc82){return _0xbff2(_0x49fc82-0x353,_0x43cede);}return this[_0x242e13(0x443,0x45d)]+':\x20'+this['message']+_0x242e13(0x577,0x501)+this[_0x242e13(0x4ce,0x4b7)]+')';}}class HttpClient{constructor(config){function _0x2b416f(_0x54f3b4,_0x1b77aa){return _0xbff2(_0x1b77aa-0x122,_0x54f3b4);}this['baseURL']=config[_0x2b416f(0x192,0x20e)],this[_0x2b416f(0x1fa,0x217)]=config['apiKey'],this[_0x2b416f(0x277,0x297)]=axios[_0x2b416f(0x23c,0x2a6)]({'baseURL':this['baseURL'],'timeout':config[_0x2b416f(0x245,0x265)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this['setupInterceptors']();}[_0x37f67d(0x1ce,0x1e6)](){this[_0x175b26(0x414,0x3fd)]['interceptors'][_0x175b26(0x39c,0x38f)][_0x175b26(0x466,0x426)](config=>{return config;},_0x471e30=>{return Promise['reject'](new EBaaSError('Request\x20failed',0x0,_0x471e30));});function _0x175b26(_0x218a8d,_0x2446de){return _0xbff2(_0x2446de-0x288,_0x218a8d);}this['client']['interceptors'][_0x175b26(0x3a3,0x33a)][_0x175b26(0x444,0x426)](response=>{return response;},_0x12620c=>{function _0x982961(_0x525ce3,_0x5364b5){return _0xbff2(_0x5364b5-0x119,_0x525ce3);}const status=_0x12620c['response']?.[_0x982961(0x2fe,0x27d)]||0x0,_0x4a5990=_0x12620c[_0x982961(0x204,0x1cb)]?.[_0x982961(0x2d3,0x2c8)]?.[_0x982961(0x1f0,0x238)]||_0x12620c['message']||_0x982961(0x2be,0x293),_0x58731a=_0x12620c['response']?.[_0x982961(0x268,0x2c8)]||_0x12620c;return Promise[_0x982961(0x2f8,0x2a8)](new EBaaSError(_0x4a5990,status,_0x58731a));});}async[_0x37f67d(0x128,0x11a)](_0x30aec9,config){function _0xb99c11(_0x927e38,_0x598026){return _0xbff2(_0x598026- -0x1de,_0x927e38);}try{const response=await this['client']['get'](_0x30aec9,config);return{'data':response[_0xb99c11(-0x1b,-0x2f)],'status':response['status'],'statusText':response[_0xb99c11(-0x132,-0x12d)],'headers':response[_0xb99c11(-0x8e,-0x27)]};}catch(_0x45e219){throw this[_0xb99c11(-0x8f,-0xc6)](_0x45e219);}}async['post'](_0x2f4cbb,data,config){function _0x1d832a(_0x559f66,_0x4eadaf){return _0xbff2(_0x559f66- -0x267,_0x4eadaf);}try{const response=await this['client']['post'](_0x2f4cbb,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x1d832a(-0x1b6,-0x1a0)],'headers':response['headers']};}catch(_0x199dd7){throw this['handleError'](_0x199dd7);}}async['put'](_0x10f565,data,config){function _0x46732a(_0x1e3e80,_0x5455b3){return _0xbff2(_0x1e3e80-0x36d,_0x5455b3);}try{const response=await this[_0x46732a(0x4e2,0x4b3)]['put'](_0x10f565,data,config);return{'data':response[_0x46732a(0x51c,0x4e8)],'status':response['status'],'statusText':response[_0x46732a(0x41e,0x3ff)],'headers':response[_0x46732a(0x524,0x50a)]};}catch(_0x38aff5){throw this['handleError'](_0x38aff5);}}async[_0x37f67d(0x181,0x19c)](_0x1962c9,data,config){function _0x4640f4(_0x1e3ce5,_0xbba00d){return _0xbff2(_0x1e3ce5- -0x275,_0xbba00d);}try{const response=await this[_0x4640f4(-0x100,-0xa8)][_0x4640f4(-0x131,-0x158)](_0x1962c9,data,config);return{'data':response['data'],'status':response['status'],'statusText':response[_0x4640f4(-0x1c4,-0x159)],'headers':response[_0x4640f4(-0xbe,-0x53)]};}catch(_0x21f4a5){throw this[_0x4640f4(-0x15d,-0x1cd)](_0x21f4a5);}}async['delete'](_0x34ce64,config){function _0x37534d(_0x43249f,_0x51dd18){return _0xbff2(_0x43249f-0xfe,_0x51dd18);}try{const response=await this['client']['delete'](_0x34ce64,config);return{'data':response['data'],'status':response[_0x37534d(0x262,0x205)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x26b479){throw this['handleError'](_0x26b479);}}[_0x37f67d(0x1e1,0x1d6)](_0x108646){function _0x41e060(_0x32056c,_0x24d30f){return _0xbff2(_0x24d30f-0x1e9,_0x32056c);}this[_0x41e060(0x38f,0x35e)]['defaults']['headers'][_0x41e060(0x2d7,0x334)]['Authorization']='Bearer\x20'+_0x108646;}['removeAuthToken'](){delete this[_0x2b5141(-0xff,-0xef)]['defaults'][_0x2b5141(-0x58,-0xad)][_0x2b5141(-0x117,-0x119)]['Authorization'];function _0x2b5141(_0x4ddadd,_0x348925){return _0xbff2(_0x348925- -0x264,_0x4ddadd);}this['client']['defaults'][_0x2b5141(-0xfa,-0xad)]['common']['Authorization']=_0x2b5141(-0x1ad,-0x186)+this[_0x2b5141(-0x135,-0x16f)];}['handleError'](_0x258e12){function _0x248747(_0x377fff,_0x153f29){return _0xbff2(_0x153f29-0x296,_0x377fff);}if(_0x258e12 instanceof EBaaSError)return _0x258e12;return new EBaaSError(_0x258e12[_0x248747(0x366,0x3b5)]||'HTTP\x20request\x20failed',_0x258e12['status']||0x0,_0x258e12);}}class AuthClient{constructor(_0x994dab){this['currentSession']=null,this[_0x593ff9(-0x142,-0x128)]=_0x994dab;function _0x593ff9(_0x806c64,_0x4fba2e){return _0xbff2(_0x806c64- -0x251,_0x4fba2e);}this['loadSession']();}async['signUp'](data){function _0x401038(_0x43f52c,_0x4ccbef){return _0xbff2(_0x4ccbef-0x38c,_0x43f52c);}try{const response=await this[_0x401038(0x478,0x49b)]['post']('/auth/v1/signup',data);return response[_0x401038(0x4ca,0x53b)]['session']&&this[_0x401038(0x51b,0x4bf)](response[_0x401038(0x594,0x53b)]['session']),response['data'];}catch(_0x41efbc){throw this['handleAuthError'](_0x41efbc);}}async[_0x37f67d(0x1b4,0x1bb)](data){function _0x48af5a(_0x17b872,_0x577df6){return _0xbff2(_0x577df6- -0x2ae,_0x17b872);}try{const response=await this[_0x48af5a(-0x1bb,-0x19f)][_0x48af5a(-0x1d1,-0x1a3)]('/auth/v1/sdk/signin',data);return response[_0x48af5a(-0x88,-0xff)]['session']&&this['setSessionInternal'](response[_0x48af5a(-0x14f,-0xff)]['session']),response[_0x48af5a(-0xc3,-0xff)];}catch(_0x213658){throw this['handleAuthError'](_0x213658);}}async['signOut'](){function _0x11eed0(_0x299775,_0x4f2177){return _0xbff2(_0x299775- -0x176,_0x4f2177);}try{await this['httpClient'][_0x11eed0(-0x6b,-0xed)]('/auth/v1/signout'),this['clearSession']();}catch(_0x463da3){this[_0x11eed0(-0x5b,-0xdd)]();throw this[_0x11eed0(-0x56,-0xa6)](_0x463da3);}}async['getUser'](){function _0x55456c(_0x27bed7,_0xcbfd8){return _0xbff2(_0x27bed7- -0x30c,_0xcbfd8);}if(!this['currentSession']?.['access_token'])return null;try{const response=await this['httpClient']['get'](_0x55456c(-0x1a3,-0x170));return response['data'][_0x55456c(-0x166,-0x116)];}catch(_0x1a4733){if(_0x1a4733 instanceof EBaaSError&&_0x1a4733[_0x55456c(-0x1a8,-0x172)]===0x191)return this['clearSession'](),null;throw this[_0x55456c(-0x1ec,-0x20d)](_0x1a4733);}}async[_0x37f67d(0x1c9,0x17d)](){function _0x3f65b0(_0x168009,_0x5cf596){return _0xbff2(_0x168009- -0x20b,_0x5cf596);}if(!this[_0x3f65b0(-0x55,0x2b)]?.[_0x3f65b0(-0x10e,-0x134)])return null;try{const response=await this['httpClient']['post']('/auth/v1/refresh',{'refresh_token':this[_0x3f65b0(-0x55,-0x85)][_0x3f65b0(-0x10e,-0x115)]});if(response['data'][_0x3f65b0(-0x14d,-0x1a6)])return this[_0x3f65b0(-0xe3,-0xb8)](response[_0x3f65b0(-0x5c,-0x7d)]['session']),response[_0x3f65b0(-0x5c,-0x98)]['session'];return null;}catch(_0x402a9a){this[_0x3f65b0(-0xf0,-0x151)]();throw this[_0x3f65b0(-0xeb,-0xfe)](_0x402a9a);}}async[_0x37f67d(0x13e,0x183)](_0x2d8d04){function _0x46594d(_0x1a72f6,_0x316f87){return _0xbff2(_0x1a72f6-0x17e,_0x316f87);}try{await this['httpClient'][_0x46594d(0x289,0x20c)](_0x46594d(0x2a8,0x2bd),{'email':_0x2d8d04});}catch(_0x50b587){throw this[_0x46594d(0x29e,0x2ca)](_0x50b587);}}async['updateUser'](data){function _0x1ecd24(_0x437d75,_0x5956d5){return _0xbff2(_0x5956d5-0x1cd,_0x437d75);}try{const response=await this['httpClient']['put']('/auth/v1/user',data);return response['data'][_0x1ecd24(0x3a2,0x373)];}catch(_0x138a2b){throw this[_0x1ecd24(0x2dc,0x2ed)](_0x138a2b);}}[_0x37f67d(0x175,0x14a)](){function _0x49f014(_0x2acf4d,_0xa00c3c){return _0xbff2(_0x2acf4d- -0x45,_0xa00c3c);}return this[_0x49f014(0x171,0x181)];}['setSession'](_0x2bdb5f){function _0x2417fc(_0x375e0b,_0x10d56f){return _0xbff2(_0x10d56f- -0x30d,_0x375e0b);}this['currentSession']=_0x2bdb5f,this[_0x2417fc(-0x24c,-0x1fe)]['setAuthToken'](_0x2bdb5f[_0x2417fc(-0x116,-0x158)]),typeof localStorage!=='undefined'&&localStorage[_0x2417fc(-0x1ca,-0x16a)]('ebaas.auth.session',JSON[_0x2417fc(-0x1aa,-0x173)](_0x2bdb5f));}['onAuthStateChange'](_0x2d83e3){return()=>{};}['setSessionInternal'](_0x8e700b){this[_0x5c1aae(0x184,0x1aa)]=_0x8e700b;function _0x5c1aae(_0x4672b8,_0x31446c){return _0xbff2(_0x4672b8- -0x32,_0x31446c);}this['httpClient']['setAuthToken'](_0x8e700b['access_token']),typeof localStorage!==_0x5c1aae(0x134,0x1a6)&&localStorage[_0x5c1aae(0x171,0x119)](_0x5c1aae(0x92,0x9f),JSON[_0x5c1aae(0x168,0x1e3)](_0x8e700b));}['clearSession'](){this[_0x229dc3(0x442,0x48a)]=null;function _0x229dc3(_0x26816a,_0x46766c){return _0xbff2(_0x26816a-0x28c,_0x46766c);}this['httpClient'][_0x229dc3(0x3ec,0x413)](),typeof localStorage!=='undefined'&&localStorage['removeItem']('ebaas.auth.session');}['loadSession'](){function _0x274a1a(_0x39e71f,_0x1759c7){return _0xbff2(_0x1759c7- -0x308,_0x39e71f);}if(typeof localStorage!=='undefined'){const _0xe2d40d=localStorage[_0x274a1a(-0x281,-0x243)]('ebaas.auth.session');if(_0xe2d40d)try{const _0x4da7db=JSON[_0x274a1a(-0x1d8,-0x1f4)](_0xe2d40d);this['setSessionInternal'](_0x4da7db);}catch(_0x182be2){this['clearSession']();}}}[_0x37f67d(0x1cc,0x178)](_0x160803){if(_0x160803 instanceof EBaaSError)return _0x160803;function _0x59a8c8(_0x3efeb6,_0x324ccb){return _0xbff2(_0x3efeb6-0xd2,_0x324ccb);}return new EBaaSError(_0x160803['message']||'Authentication\x20failed',_0x160803[_0x59a8c8(0x236,0x1eb)]||0x0,_0x160803);}}class QueryBuilder{constructor(_0x6007ba,_0x82274e,_0x38c808,_0x3e2438){this['httpClient']=_0x6007ba,this['table']=_0x82274e,this['schema']=_0x38c808,this['workspaceId']=_0x3e2438,this['query']={'filters':[]};}['select'](_0x3668b4='*',_0x2682c4){function _0x4ac328(_0xa99dbd,_0x16a1e4){return _0xbff2(_0xa99dbd- -0x2f4,_0x16a1e4);}return this['query'][_0x4ac328(-0x1d6,-0x1d4)]=_0x3668b4,this;}['insert'](data,_0x294f1b){function _0x2c455b(_0x18372d,_0x36ac53){return _0xbff2(_0x36ac53-0x353,_0x18372d);}return this['executeQuery']('POST',_0x2c455b(0x500,0x4a9)+this[_0x2c455b(0x4e6,0x466)]+'?operation=insert',{'data':data,'options':_0x294f1b});}['update'](data,_0x47e097){function _0x3a5593(_0x6dd8be,_0x570bd2){return _0xbff2(_0x570bd2- -0x107,_0x6dd8be);}return this[_0x3a5593(0x32,0x66)]['updateData']=data,this['query'][_0x3a5593(-0x97,-0x13)]=_0x47e097,this;}[_0x37f67d(0xed,0x123)](data,_0x564c65){function _0x3415e8(_0x1dd87d,_0xf57730){return _0xbff2(_0xf57730- -0x25e,_0x1dd87d);}return this[_0x3415e8(-0xab,-0xff)]('POST',_0x3415e8(-0x140,-0x108)+this['table']+_0x3415e8(-0x16f,-0x1ab),{'data':data,'options':{..._0x564c65,'upsert':!![]}});}['delete'](_0x115aaf){this['query']['deleteOptions']=_0x115aaf,this[_0x3ed49b(0x4e3,0x494)]['isDelete']=!![];function _0x3ed49b(_0x38ffb5,_0x5e9d8f){return _0xbff2(_0x5e9d8f-0x327,_0x38ffb5);}return this;}['eq'](_0x29e007,_0x544c8f){function _0x244d93(_0x66dc42,_0x4cb01a){return _0xbff2(_0x66dc42-0x22,_0x4cb01a);}return this['query'][_0x244d93(0x19b,0x13d)]['push']({'column':_0x29e007,'operator':'eq','value':_0x544c8f}),this;}['neq'](_0x3aacd9,_0x2a31ff){function _0x3e56e0(_0x1ffbc0,_0xc3851e){return _0xbff2(_0x1ffbc0- -0x14,_0xc3851e);}return this['query'][_0x3e56e0(0x165,0x1bf)]['push']({'column':_0x3aacd9,'operator':'neq','value':_0x2a31ff}),this;}['gt'](_0x179322,_0x219182){function _0x42bd90(_0x54f573,_0x35259c){return _0xbff2(_0x54f573-0x3d3,_0x35259c);}return this[_0x42bd90(0x540,0x585)]['filters'][_0x42bd90(0x49d,0x43f)]({'column':_0x179322,'operator':'gt','value':_0x219182}),this;}['gte'](_0x5a34a4,_0x10c1d4){function _0x55b186(_0x57a33e,_0xfa6321){return _0xbff2(_0xfa6321- -0x16,_0x57a33e);}return this[_0x55b186(0x115,0x157)][_0x55b186(0x11b,0x163)][_0x55b186(0x56,0xb4)]({'column':_0x5a34a4,'operator':_0x55b186(0x191,0x18e),'value':_0x10c1d4}),this;}['lt'](_0x34c933,_0x189e3a){function _0x498693(_0x26163f,_0x3a0a6d){return _0xbff2(_0x3a0a6d- -0x283,_0x26163f);}return this[_0x498693(-0x169,-0x116)][_0x498693(-0x127,-0x10a)][_0x498693(-0x1fc,-0x1b9)]({'column':_0x34c933,'operator':'lt','value':_0x189e3a}),this;}['lte'](_0x4a4b03,_0x5dffc9){this[_0x7cfe14(-0x215,-0x1ce)]['filters'][_0x7cfe14(-0x2b8,-0x329)]({'column':_0x4a4b03,'operator':_0x7cfe14(-0x1d9,-0x1de),'value':_0x5dffc9});function _0x7cfe14(_0x51215c,_0x2991ef){return _0xbff2(_0x51215c- -0x382,_0x2991ef);}return this;}[_0x37f67d(0x1d9,0x209)](_0x41940c,_0x406689){this['query']['filters'][_0x8fe5f0(0x437,0x3e1)]({'column':_0x41940c,'operator':'like','value':_0x406689});function _0x8fe5f0(_0x3c7000,_0x424da6){return _0xbff2(_0x3c7000-0x36d,_0x424da6);}return this;}['ilike'](_0x5aa202,_0x553f16){this[_0x559fc2(0x2c1,0x26c)]['filters'][_0x559fc2(0x21e,0x1a1)]({'column':_0x5aa202,'operator':'ilike','value':_0x553f16});function _0x559fc2(_0x1c1495,_0x553b41){return _0xbff2(_0x1c1495-0x154,_0x553b41);}return this;}['is'](_0x1c25cb,_0xa44040){return this['query']['filters']['push']({'column':_0x1c25cb,'operator':'is','value':_0xa44040}),this;}['in'](_0x32f024,_0x226814){this['query']['filters'][_0x2affea(0x49,0x54)]({'column':_0x32f024,'operator':'in','value':_0x226814});function _0x2affea(_0x1ef18e,_0x21e516){return _0xbff2(_0x21e516- -0x76,_0x1ef18e);}return this;}['contains'](_0x4fdca9,_0x30ab50){function _0x70cc94(_0x3d387f,_0x528557){return _0xbff2(_0x528557-0x146,_0x3d387f);}return this[_0x70cc94(0x2c2,0x2b3)][_0x70cc94(0x2ef,0x2bf)][_0x70cc94(0x1cb,0x210)]({'column':_0x4fdca9,'operator':_0x70cc94(0x22c,0x209),'value':_0x30ab50}),this;}['match'](_0x41540b){function _0x46bdc0(_0x35e679,_0x56dfd1){return _0xbff2(_0x35e679- -0x211,_0x56dfd1);}return Object[_0x46bdc0(-0x8f,-0x93)](_0x41540b)['forEach'](([_0x277f61,_0x27d7e3])=>{this['eq'](_0x277f61,_0x27d7e3);}),this;}[_0x37f67d(0x226,0x1b1)](_0xb8126e,_0x34a8f4){!this[_0x1b33c0(0x282,0x295)]['order']&&(this['query'][_0x1b33c0(0x26e,0x2b8)]=[]);this[_0x1b33c0(0x282,0x1fe)][_0x1b33c0(0x26e,0x25f)]['push']({'column':_0xb8126e,'ascending':_0x34a8f4?.['ascending']!==![]});function _0x1b33c0(_0x537b3c,_0x3908e2){return _0xbff2(_0x537b3c-0x115,_0x3908e2);}return this;}['limit'](count){function _0x435164(_0x4aae59,_0x4484f8){return _0xbff2(_0x4484f8- -0x2c,_0x4aae59);}return this['query'][_0x435164(0x1a7,0x12c)]=count,this;}['range'](from,_0x33d191){this['query'][_0x4d06a1(0x306,0x321)]={'from':from,'to':_0x33d191};function _0x4d06a1(_0x3888e1,_0x4dd0f2){return _0xbff2(_0x4dd0f2-0x1a6,_0x3888e1);}return this;}async[_0x37f67d(0x12a,0x166)](){function _0x82a691(_0x218ba0,_0x234788){return _0xbff2(_0x218ba0- -0x1d6,_0x234788);}if(this[_0x82a691(-0x69,-0xd3)][_0x82a691(-0x71,-0x52)])return this['executeQuery']('PATCH','/sdk/v1/'+this['table'],{'data':this['query'][_0x82a691(-0x71,-0x17)],'options':this[_0x82a691(-0x69,-0x1e)]['updateOptions'],'filters':this[_0x82a691(-0x69,-0x4c)][_0x82a691(-0x5d,-0x51)]});else return this['query'][_0x82a691(-0xc6,-0x12a)]?this[_0x82a691(-0x77,-0x15)]('DELETE','/sdk/v1/'+this[_0x82a691(-0xc3,-0xe9)]+'?operation=delete',{'options':this[_0x82a691(-0x69,-0x53)][_0x82a691(-0x68,-0xf)],'filters':this[_0x82a691(-0x69,-0x7)]['filters']}):this[_0x82a691(-0x77,-0x59)]('GET','/sdk/v1/'+this[_0x82a691(-0xc3,-0x68)]+'?operation=select',{'select':this['query'][_0x82a691(-0xb8,-0x42)],'filters':this[_0x82a691(-0x69,-0x51)][_0x82a691(-0x5d,-0xd6)],'order':this['query']['order'],'limit':this['query'][_0x82a691(-0x7e,-0x21)],'range':this[_0x82a691(-0x69,-0x5)][_0x82a691(-0x5b,-0x54)]});}async[_0x37f67d(0x215,0x19f)](){this[_0x5b67cd(0x50c,0x517)](0x1);const result=await this['execute']();function _0x5b67cd(_0x36bd83,_0x3c57de){return _0xbff2(_0x36bd83-0x3b4,_0x3c57de);}return{'data':result['data']?.[0x0]||null,'error':result['error']};}async[_0x37f67d(0x1d8,0x1b7)](_0x547a94,_0x4a2040,_0x4cb809){function _0x1bda07(_0x390118,_0x2c8429){return _0xbff2(_0x390118-0x1c9,_0x2c8429);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x547a94==='GET'){const _0x25e9c4=_0x4a2040[_0x1bda07(0x2cf,0x296)]('?'),_0x17c7b4=_0x25e9c4[0x0],existingParams=new URLSearchParams(_0x25e9c4[0x1]||'');if(_0x4cb809[_0x1bda07(0x2e7,0x32c)])existingParams['append'](_0x1bda07(0x2e7,0x2ec),_0x4cb809['select']);_0x4cb809['filters']?.['length']&&_0x4cb809['filters']['forEach'](filter=>{function _0x227d25(_0x48e2fc,_0x552c1b){return _0xbff2(_0x48e2fc- -0x35e,_0x552c1b);}existingParams[_0x227d25(-0x27e,-0x210)](filter['column'],filter[_0x227d25(-0x1c9,-0x20e)]+'.'+filter[_0x227d25(-0x278,-0x232)]);});if(_0x4cb809['order']?.[_0x1bda07(0x300,0x347)]){const orderStr=_0x4cb809['order']['map'](_0x54a65a=>''+_0x54a65a['column']+(_0x54a65a[_0x1bda07(0x2b0,0x258)]?_0x1bda07(0x370,0x337):_0x1bda07(0x304,0x2ba)))[_0x1bda07(0x374,0x353)](',');existingParams['append'](_0x1bda07(0x322,0x2f5),orderStr);}if(_0x4cb809['limit'])existingParams[_0x1bda07(0x2a9,0x2c6)](_0x1bda07(0x321,0x2df),_0x4cb809[_0x1bda07(0x321,0x2b8)][_0x1bda07(0x366,0x35b)]());_0x4cb809['range']&&(existingParams['append'](_0x1bda07(0x325,0x2de),_0x4cb809[_0x1bda07(0x344,0x2db)][_0x1bda07(0x318,0x303)]['toString']()),existingParams[_0x1bda07(0x2a9,0x244)]('limit',(_0x4cb809[_0x1bda07(0x344,0x318)]['to']-_0x4cb809[_0x1bda07(0x344,0x358)]['from']+0x1)['toString']())),response=await this['httpClient'][_0x1bda07(0x28b,0x264)](_0x17c7b4+'?'+existingParams[_0x1bda07(0x366,0x3b0)](),{'headers':headers});}else{if(_0x547a94==='DELETE'){const _0x1d83c1=_0x4a2040[_0x1bda07(0x2cf,0x261)]('?'),_0x312209=_0x1d83c1[0x0],existingParams=new URLSearchParams(_0x1d83c1[0x1]||'');!existingParams[_0x1bda07(0x2ba,0x2fc)](_0x1bda07(0x341,0x357))&&existingParams[_0x1bda07(0x2a9,0x291)](_0x1bda07(0x341,0x349),_0x1bda07(0x33b,0x38e));_0x4cb809['filters']?.[_0x1bda07(0x300,0x309)]&&_0x4cb809['filters']['forEach'](filter=>{function _0x2e7a90(_0x44e8d3,_0x45c9b4){return _0xbff2(_0x44e8d3- -0x231,_0x45c9b4);}existingParams['append'](filter[_0x2e7a90(-0x16b,-0x15c)],filter[_0x2e7a90(-0x9c,-0x1c)]+'.'+filter['value']);});const deleteUrl=_0x312209+'?'+existingParams['toString']();console[_0x1bda07(0x326,0x389)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console['log']('\uD83D\uDD27 DELETE headers:',headers),console[_0x1bda07(0x326,0x36a)]('\uD83D\uDD27 DELETE filtros originais:',_0x4cb809[_0x1bda07(0x342,0x2da)]),response=await this['httpClient']['delete'](deleteUrl,{'headers':headers});}else{if(_0x547a94==='PATCH'){const _0x1be0a9=_0x4a2040['split']('?'),_0x18385e=_0x1be0a9[0x0],existingParams=new URLSearchParams(_0x1be0a9[0x1]||'');!existingParams[_0x1bda07(0x2ba,0x2fb)](_0x1bda07(0x341,0x3b4))&&existingParams[_0x1bda07(0x2a9,0x313)](_0x1bda07(0x341,0x2f9),_0x1bda07(0x2ef,0x35b));_0x4cb809[_0x1bda07(0x342,0x309)]?.[_0x1bda07(0x300,0x2df)]&&_0x4cb809['filters']['forEach'](filter=>{function _0xea7cb6(_0x37c4ea,_0xf802f2){return _0xbff2(_0x37c4ea-0x1c3,_0xf802f2);}existingParams[_0xea7cb6(0x2a3,0x321)](filter['column'],filter[_0xea7cb6(0x358,0x30b)]+'.'+filter[_0xea7cb6(0x2a9,0x2b1)]);});_0x4cb809[_0x1bda07(0x33d,0x384)]?.['prefer']&&(headers[_0x1bda07(0x303,0x30f)]=_0x4cb809[_0x1bda07(0x33d,0x318)][_0x1bda07(0x30e,0x2c0)]);const updateUrl=_0x18385e+'?'+existingParams['toString']();response=await this['httpClient'][_0x1bda07(0x30d,0x306)](updateUrl,_0x4cb809['data'],{'headers':headers});}else{let _0x319fd7=_0x4cb809['data'];!headers['Prefer']&&(headers['Prefer']=_0x1bda07(0x2e0,0x2d4)),_0x4cb809[_0x1bda07(0x33d,0x2c7)]?.[_0x1bda07(0x294,0x2c9)]&&(headers[_0x1bda07(0x303,0x31c)]='resolution=merge-duplicates,return=representation'),_0x4cb809[_0x1bda07(0x282,0x2f0)]&&(_0x319fd7=_0x4cb809['dataArray']),response=await this['httpClient']['post'](_0x4a2040,_0x319fd7,{'headers':headers});}}}return{'data':response[_0x1bda07(0x378,0x32c)],'error':null,'count':response['headers']?.['x-total-count']?parseInt(response['headers'][_0x1bda07(0x34c,0x2ec)]):undefined};}catch(_0x33fbc6){return{'data':null,'error':_0x33fbc6 instanceof EBaaSError?_0x33fbc6:new EBaaSError(_0x33fbc6 instanceof Error?_0x33fbc6[_0x1bda07(0x2e8,0x2df)]:'Database\x20operation\x20failed',0x0,_0x33fbc6)};}}}function _0xbff2(_0x2036f5,_0x11b70b){const _0x16f62a=_0x16f6();return _0xbff2=function(_0xbff264,_0x54ab35){_0xbff264=_0xbff264-0xb1;let _0x266e5f=_0x16f62a[_0xbff264];if(_0xbff2['AmnCVb']===undefined){var _0x25620a=function(_0x19c4c1){const _0x12df5b='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x471e30='',_0x12620c='';for(let _0x4a5990=0x0,_0x58731a,_0x30aec9,_0x45e219=0x0;_0x30aec9=_0x19c4c1['charAt'](_0x45e219++);~_0x30aec9&&(_0x58731a=_0x4a5990%0x4?_0x58731a*0x40+_0x30aec9:_0x30aec9,_0x4a5990++%0x4)?_0x471e30+=String['fromCharCode'](0xff&_0x58731a>>(-0x2*_0x4a5990&0x6)):0x0){_0x30aec9=_0x12df5b['indexOf'](_0x30aec9);}for(let _0x2f4cbb=0x0,_0x199dd7=_0x471e30['length'];_0x2f4cbb<_0x199dd7;_0x2f4cbb++){_0x12620c+='%'+('00'+_0x471e30['charCodeAt'](_0x2f4cbb)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x12620c);};_0xbff2['UdgHcl']=_0x25620a,_0x2036f5=arguments,_0xbff2['AmnCVb']=!![];}const _0x3d0f86=_0x16f62a[0x0],_0x40037f=_0xbff264+_0x3d0f86,_0x1da4cf=_0x2036f5[_0x40037f];return!_0x1da4cf?(_0x266e5f=_0xbff2['UdgHcl'](_0x266e5f),_0x2036f5[_0x40037f]=_0x266e5f):_0x266e5f=_0x1da4cf,_0x266e5f;},_0xbff2(_0x2036f5,_0x11b70b);}class CustomDatabaseManager{constructor(_0x1e1778,_0xa906cc){this[_0x4cdee1(0xc1,0x55)]=_0x1e1778;function _0x4cdee1(_0x30eaad,_0x27e59a){return _0xbff2(_0x27e59a- -0xba,_0x30eaad);}this['workspaceId']=_0xa906cc;}async[_0x37f67d(0x192,0x1aa)](){if(!this[_0x5bb717(0x391,0x39b)])return{'hasCustomDatabase':![]};function _0x5bb717(_0x24decc,_0x169e4e){return _0xbff2(_0x169e4e-0x2cc,_0x24decc);}try{const response=await this[_0x5bb717(0x38f,0x3db)][_0x5bb717(0x342,0x38e)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this[_0x5bb717(0x337,0x39b)]}});if(response[_0x5bb717(0x3ef,0x430)]===0xc8&&response['data']?.['config']){const config=response[_0x5bb717(0x409,0x47b)][_0x5bb717(0x4a8,0x454)],_0x1c99a4={'host':config['postgresHost'],'port':config[_0x5bb717(0x3d8,0x40d)],'database':config[_0x5bb717(0x42e,0x402)],'username':config[_0x5bb717(0x3fc,0x384)],'password':'','schema':config['postgresSchema'],'sslEnabled':config['sslEnabled']};return this[_0x5bb717(0x37f,0x3bc)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x1c99a4},this['detectedConfig'];}}catch(_0xf1ee55){if(_0xf1ee55?.[_0x5bb717(0x47e,0x430)]===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this[_0x5bb717(0x362,0x3bc)];console['warn']('Failed to detect custom database configuration:',_0xf1ee55);}return this[_0x5bb717(0x3c7,0x3bc)]={'hasCustomDatabase':![]},this['detectedConfig'];}async['testConnection'](_0x4d2233){function _0x22e869(_0x5595ee,_0x1830d3){return _0xbff2(_0x5595ee-0x39e,_0x1830d3);}try{const response=await this[_0x22e869(0x4ad,0x489)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x4d2233,{'headers':this[_0x22e869(0x46d,0x3ed)]?{'X-Workspace-ID':this[_0x22e869(0x46d,0x472)]}:{}});return response['data'];}catch(_0x5d37f9){return{'success':![],'message':_0x5d37f9?.[_0x22e869(0x4bd,0x522)]||_0x22e869(0x48c,0x440)};}}async['configureCustomDatabase'](_0x2e83d7){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');function _0x5b67b5(_0x4812ef,_0x43dcaa){return _0xbff2(_0x43dcaa- -0x2ac,_0x4812ef);}const response=await this['httpClient'][_0x5b67b5(-0x1a5,-0x1a1)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x2e83d7},{'headers':{'X-Workspace-ID':this['workspaceId']}}),config=response[_0x5b67b5(-0x167,-0xfd)][_0x5b67b5(-0xbe,-0x124)];return this[_0x5b67b5(-0x153,-0x1bc)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x2e83d7},config;}async['removeCustomDatabase'](){function _0x409daa(_0x3fc29d,_0x29be5d){return _0xbff2(_0x29be5d- -0x4e,_0x3fc29d);}if(!this['workspaceId'])throw new Error('Workspace ID is required to remove custom database');await this[_0x409daa(0x12e,0xc1)][_0x409daa(0xfb,0x124)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this['workspaceId']}}),this['detectedConfig']={'hasCustomDatabase':![]};}['getDetectedConfig'](){function _0x926e87(_0x396b7d,_0xd2040a){return _0xbff2(_0x396b7d- -0x93,_0xd2040a);}return this[_0x926e87(0x5d,0x48)];}['hasCustomDatabase'](){function _0x2d1ded(_0x23f448,_0x528186){return _0xbff2(_0x23f448- -0x1db,_0x528186);}return this[_0x2d1ded(-0xeb,-0x88)]?.['hasCustomDatabase']??![];}[_0x37f67d(0x208,0x1a4)](){function _0x425b34(_0x170488,_0x5aeae1){return _0xbff2(_0x5aeae1-0x6a,_0x170488);}return this[_0x425b34(0x186,0x15a)]?.[_0x425b34(0x10d,0x16e)];}['setWorkspaceId'](_0x23c4c0){this['workspaceId']=_0x23c4c0,this['detectedConfig']=undefined;}[_0x37f67d(0x155,0x195)](){return this['workspaceId'];}[_0x37f67d(0x150,0x133)](){function _0xa50ae0(_0x3f5a4b,_0x1d886f){return _0xbff2(_0x3f5a4b-0x1d0,_0x1d886f);}return{'workspaceId':this['workspaceId'],'hasConfig':this['hasCustomDatabase'](),'configDetails':this['detectedConfig']?.[_0xa50ae0(0x2d4,0x2c2)]?{'host':this[_0xa50ae0(0x2c0,0x2c4)]['credentials'][_0xa50ae0(0x2b3,0x279)],'port':this['detectedConfig']['credentials'][_0xa50ae0(0x2b2,0x2c8)],'database':this['detectedConfig']['credentials'][_0xa50ae0(0x2e1,0x341)],'schema':this['detectedConfig'][_0xa50ae0(0x2d4,0x290)][_0xa50ae0(0x2a1,0x26c)]||_0xa50ae0(0x347,0x2df),'sslEnabled':this['detectedConfig']['credentials']['sslEnabled']||![]}:undefined};}}class DatabaseClient{constructor(_0x37906e,_0x141e29){function _0x358096(_0x51bc07,_0x201c3b){return _0xbff2(_0x51bc07-0xaf,_0x201c3b);}this['httpClient']=_0x37906e,this[_0x358096(0x24f,0x254)]=new CustomDatabaseManager(_0x37906e,_0x141e29);}['from'](_0x11cf3){function _0x5c5fbe(_0xa469ee,_0x25e609){return _0xbff2(_0x25e609- -0x1c2,_0xa469ee);}return new QueryBuilder(this['httpClient'],_0x11cf3,this[_0x5c5fbe(-0xa3,-0x36)],this['customDatabaseManager'][_0x5c5fbe(-0x86,-0x85)]());}['rpc'](_0x1c7daa,_0x1ab0f8){function _0x1aa852(_0x4db565,_0x47e2b4){return _0xbff2(_0x47e2b4-0x2d4,_0x4db565);}return this['httpClient']['post'](_0x1aa852(0x3fc,0x390)+_0x1c7daa,_0x1ab0f8);}[_0x37f67d(0x14d,0x129)](_0xe3adfc){const _0x1026f0=new DatabaseClient(this['httpClient'],this['customDatabaseManager']['getWorkspaceId']());return _0x1026f0['currentSchema']=_0xe3adfc,_0x1026f0['customDatabaseManager']=this['customDatabaseManager'],_0x1026f0;}async['detectCustomDatabase'](){return this['customDatabaseManager']['detectCustomDatabase']();}async['testCustomConnection'](_0x44d84f){function _0x1e204d(_0x566173,_0x21b66e){return _0xbff2(_0x566173- -0x2bb,_0x21b66e);}return this['customDatabaseManager'][_0x1e204d(-0x111,-0xb2)](_0x44d84f);}async[_0x37f67d(0x1d8,0x205)](_0x2f61d1){function _0x1e3b4e(_0x225d24,_0x4ee9e3){return _0xbff2(_0x4ee9e3- -0x1aa,_0x225d24);}return this[_0x1e3b4e(-0x6a,-0xa)][_0x1e3b4e(-0x5,0x3)](_0x2f61d1);}async['removeCustomDatabase'](){function _0x4ff9b3(_0x1b1085,_0x94ac6b){return _0xbff2(_0x94ac6b- -0x325,_0x1b1085);}return this[_0x4ff9b3(-0x14d,-0x185)]['removeCustomDatabase']();}[_0x37f67d(0x23f,0x1c3)](){function _0x3b740d(_0x4acee1,_0x469212){return _0xbff2(_0x4acee1-0x23,_0x469212);}return this[_0x3b740d(0x1c3,0x1ad)]['hasCustomDatabase']();}[_0x37f67d(0x170,0x12a)](){function _0x7aef4c(_0x5da5dd,_0xbd1270){return _0xbff2(_0x5da5dd- -0x2e7,_0xbd1270);}return this[_0x7aef4c(-0x147,-0xc4)][_0x7aef4c(-0x20c,-0x1a4)]();}['setWorkspaceId'](_0x29ee12){this['customDatabaseManager']['setWorkspaceId'](_0x29ee12);}async[_0x37f67d(0x1f9,0x1f7)](){function _0x29a50e(_0xe146c8,_0x34d701){return _0xbff2(_0x34d701- -0xf2,_0xe146c8);}try{await this['customDatabaseManager'][_0x29a50e(-0x1a,0x60)]();}catch(_0x3d352b){console['warn']('Failed to initialize custom database detection:',_0x3d352b);}}}function _0x37f67d(_0x324dae,_0x243cf1){return _0xbff2(_0x243cf1-0x58,_0x324dae);}class StorageBucket{constructor(_0x14428f,bucketId){this[_0x560ae5(0x347,0x362)]=_0x14428f;function _0x560ae5(_0x3b4745,_0x40ef91){return _0xbff2(_0x40ef91-0x253,_0x3b4745);}this[_0x560ae5(0x45e,0x403)]=bucketId;}async['upload'](_0x8b4ca2,_0x52d4a8,_0x4e7661){function _0x4c52b6(_0x3a42a3,_0x2c3405){return _0xbff2(_0x2c3405- -0x259,_0x3a42a3);}try{const _0x364393=new FormData();if(_0x52d4a8 instanceof File)_0x364393['append'](_0x4c52b6(-0x1a9,-0x161),_0x52d4a8);else{if(_0x52d4a8 instanceof Blob)_0x364393[_0x4c52b6(-0x158,-0x179)](_0x4c52b6(-0x13e,-0x161),_0x52d4a8,_0x8b4ca2);else{if(_0x52d4a8 instanceof ArrayBuffer)_0x364393[_0x4c52b6(-0x149,-0x179)]('file',new Blob([_0x52d4a8]),_0x8b4ca2);else typeof _0x52d4a8===_0x4c52b6(-0x112,-0xbd)&&_0x364393[_0x4c52b6(-0x1dc,-0x179)]('file',new Blob([_0x52d4a8],{'type':_0x4c52b6(-0x1da,-0x19e)}),_0x8b4ca2);}}_0x364393['append']('path',_0x8b4ca2);_0x4e7661?.[_0x4c52b6(-0xe7,-0x160)]&&_0x364393['append']('cacheControl',_0x4e7661['cacheControl']);_0x4e7661?.['contentType']&&_0x364393[_0x4c52b6(-0x192,-0x179)](_0x4c52b6(-0xf1,-0xad),_0x4e7661['contentType']);_0x4e7661?.[_0x4c52b6(-0x1ed,-0x184)]&&_0x364393['append']('metadata',JSON['stringify'](_0x4e7661['metadata']));const _0x494891='/storage/buckets/'+this[_0x4c52b6(-0x43,-0xa9)]+'/files'+(_0x4e7661?.[_0x4c52b6(-0x124,-0x18e)]?'?upsert=true':''),response=await this['httpClient']['post'](_0x494891,_0x364393,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x4c52b6(-0x28,-0xaa)],'error':null};}catch(_0x3a98eb){return{'data':null,'error':_0x3a98eb instanceof EBaaSError?_0x3a98eb:new EBaaSError(_0x3a98eb instanceof Error?_0x3a98eb[_0x4c52b6(-0xe9,-0x13a)]:_0x4c52b6(-0x124,-0x117),0x0,_0x3a98eb)};}}async[_0x37f67d(0x19a,0x1d8)](_0x36d146,_0x41b3e5){function _0x3deb50(_0x1ce834,_0x57a1c1){return _0xbff2(_0x1ce834-0x3a1,_0x57a1c1);}try{const _0x48e258=new URLSearchParams();_0x41b3e5?.[_0x3deb50(0x4fb,0x4cb)]&&Object['entries'](_0x41b3e5[_0x3deb50(0x4fb,0x4ae)])[_0x3deb50(0x479,0x427)](([_0x3878fc,_0x1d7f9b])=>{_0x1d7f9b!==undefined&&_0x48e258['append'](_0x3878fc,String(_0x1d7f9b));});const _0x14ff41='/storage/buckets/'+this[_0x3deb50(0x551,0x574)]+_0x3deb50(0x53a,0x4cc)+_0x36d146+(_0x48e258['toString']()?'?'+_0x48e258[_0x3deb50(0x53e,0x584)]():''),response=await this[_0x3deb50(0x4b0,0x494)][_0x3deb50(0x463,0x44b)](_0x14ff41,{'responseType':_0x3deb50(0x4b6,0x493)});return{'data':response['data'],'error':null};}catch(_0x57e54f){return{'data':null,'error':_0x57e54f instanceof EBaaSError?_0x57e54f:new EBaaSError(_0x57e54f instanceof Error?_0x57e54f['message']:'Failed\x20to\x20download\x20file',0x0,_0x57e54f)};}}async[_0x37f67d(0x1cb,0x154)](_0x23e447,_0x4290f2){function _0x3a26e3(_0x583a3d,_0x3e40b2){return _0xbff2(_0x3e40b2- -0x1ff,_0x583a3d);}try{const _0x1aa995=new URLSearchParams();_0x23e447&&_0x1aa995[_0x3a26e3(-0x196,-0x11f)](_0x3a26e3(-0x153,-0xf3),_0x23e447);_0x4290f2?.[_0x3a26e3(-0x82,-0xa7)]&&_0x1aa995['append'](_0x3a26e3(-0x72,-0xa7),String(_0x4290f2[_0x3a26e3(-0x124,-0xa7)]));_0x4290f2?.['offset']&&_0x1aa995[_0x3a26e3(-0x140,-0x11f)]('offset',String(_0x4290f2['offset']));_0x4290f2?.['sortBy']&&_0x1aa995['append']('sortBy',JSON[_0x3a26e3(-0x87,-0x65)](_0x4290f2['sortBy']));_0x4290f2?.[_0x3a26e3(-0xed,-0xcf)]&&_0x1aa995['append'](_0x3a26e3(-0x148,-0xcf),_0x4290f2[_0x3a26e3(-0xf3,-0xcf)]);const _0x1f5383=_0x3a26e3(-0x1f,-0x97)+this['bucketId']+'/files'+(_0x1aa995['toString']()?'?'+_0x1aa995['toString']():''),response=await this['httpClient']['get'](_0x1f5383);return{'data':response['data'],'error':null};}catch(_0xcbb3b){return{'data':null,'error':_0xcbb3b instanceof EBaaSError?_0xcbb3b:new EBaaSError(_0xcbb3b instanceof Error?_0xcbb3b['message']:'Failed\x20to\x20list\x20files',0x0,_0xcbb3b)};}}async['remove'](_0x394d9f){function _0x44af4a(_0x540740,_0x20aa6d){return _0xbff2(_0x540740- -0x5e,_0x20aa6d);}try{const response=await this[_0x44af4a(0xb1,0xd5)]['delete']('/storage/buckets/'+this[_0x44af4a(0x152,0x1ae)]+_0x44af4a(0x112,0x10c),{'data':{'paths':_0x394d9f}});return{'data':response['data'],'error':null};}catch(_0x9a5fce){return{'data':null,'error':_0x9a5fce instanceof EBaaSError?_0x9a5fce:new EBaaSError(_0x9a5fce instanceof Error?_0x9a5fce[_0x44af4a(0xc1,0x9f)]:_0x44af4a(0x87,0x3c),0x0,_0x9a5fce)};}}async[_0x37f67d(0x195,0x139)](fromPath,_0xa809a9){function _0x44c3af(_0x3d424c,_0x19b513){return _0xbff2(_0x3d424c-0x13d,_0x19b513);}try{const response=await this[_0x44c3af(0x24c,0x293)]['post'](_0x44c3af(0x2a5,0x2e8)+this['bucketId']+_0x44c3af(0x2d0,0x258),{'sourceKey':fromPath,'destinationKey':_0xa809a9});return{'data':response['data'],'error':null};}catch(_0xc623fa){return{'data':null,'error':_0xc623fa instanceof EBaaSError?_0xc623fa:new EBaaSError(_0xc623fa instanceof Error?_0xc623fa['message']:'Failed\x20to\x20move\x20file',0x0,_0xc623fa)};}}async[_0x37f67d(0x221,0x1a6)](fromPath,_0x3d9086){function _0x40366c(_0x3cfcda,_0x44988a){return _0xbff2(_0x3cfcda- -0x2c1,_0x44988a);}try{const response=await this['httpClient'][_0x40366c(-0x1b6,-0x1ae)](_0x40366c(-0x159,-0x198)+this['bucketId']+_0x40366c(-0x181,-0x119),{'sourceKey':fromPath,'destinationKey':_0x3d9086});return{'data':response['data'],'error':null};}catch(_0x43b65b){return{'data':null,'error':_0x43b65b instanceof EBaaSError?_0x43b65b:new EBaaSError(_0x43b65b instanceof Error?_0x43b65b['message']:'Failed\x20to\x20copy\x20file',0x0,_0x43b65b)};}}async[_0x37f67d(0x109,0x15a)](_0x349218,_0x3a0e02,_0x48e58e){function _0x2eeebb(_0x446791,_0x3b2863){return _0xbff2(_0x446791- -0x11e,_0x3b2863);}try{const response=await this['httpClient']['post'](_0x2eeebb(0x4a,0xbe)+this[_0x2eeebb(0x92,0x10e)]+'/files/'+_0x349218+'/sign',{'expiresIn':_0x3a0e02,..._0x48e58e});return{'data':response[_0x2eeebb(0x91,0x1e)],'error':null};}catch(_0x2d3dca){return{'data':null,'error':_0x2d3dca instanceof EBaaSError?_0x2d3dca:new EBaaSError(_0x2d3dca instanceof Error?_0x2d3dca[_0x2eeebb(0x1,0x58)]:_0x2eeebb(-0x4a,-0x9e),0x0,_0x2d3dca)};}}[_0x37f67d(0x195,0x15b)](_0x3dc87c,_0x9dfd85){const _0x13400d=new URLSearchParams();_0x9dfd85?.['transform']&&Object[_0x5393b8(-0x1d6,-0x16d)](_0x9dfd85['transform'])[_0x5393b8(-0x280,-0x2e9)](([_0x2efaee,_0x2cc3d6])=>{_0x2cc3d6!==undefined&&_0x13400d['append'](_0x2efaee,String(_0x2cc3d6));});const _0x5b9475=this['httpClient'][_0x5393b8(-0x274,-0x2f0)]||'',_0x58b793=_0x5b9475+_0x5393b8(-0x1f0,-0x22a)+this['bucketId']+_0x5393b8(-0x1bf,-0x142)+_0x3dc87c+(_0x13400d[_0x5393b8(-0x1bb,-0x20a)]()?'?'+_0x13400d[_0x5393b8(-0x1bb,-0x1f8)]():'');function _0x5393b8(_0x14be89,_0x4ff34a){return _0xbff2(_0x14be89- -0x358,_0x4ff34a);}return{'data':{'publicUrl':_0x58b793}};}async['getFileInfo'](_0x5cc1a7){function _0x467ea2(_0x178b70,_0x24c356){return _0xbff2(_0x24c356-0xb7,_0x178b70);}try{const response=await this[_0x467ea2(0x243,0x1c6)]['get'](_0x467ea2(0x27f,0x21f)+this[_0x467ea2(0x2e0,0x267)]+_0x467ea2(0x223,0x250)+_0x5cc1a7+_0x467ea2(0x1bd,0x1da));return{'data':response['data'],'error':null};}catch(_0x6de241){return{'data':null,'error':_0x6de241 instanceof EBaaSError?_0x6de241:new EBaaSError(_0x6de241 instanceof Error?_0x6de241['message']:_0x467ea2(0x1c1,0x16d),0x0,_0x6de241)};}}async[_0x37f67d(0x9e,0x120)](_0xfcb446,metadata){function _0x10377a(_0x2475ef,_0x200084){return _0xbff2(_0x200084- -0x3ce,_0x2475ef);}try{const response=await this[_0x10377a(-0x25c,-0x2bf)][_0x10377a(-0x35e,-0x301)]('/storage/buckets/'+this['bucketId']+'/files/'+_0xfcb446+'/metadata',{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x406869){return{'data':null,'error':_0x406869 instanceof EBaaSError?_0x406869:new EBaaSError(_0x406869 instanceof Error?_0x406869[_0x10377a(-0x2b5,-0x2af)]:'Failed\x20to\x20update\x20file\x20metadata',0x0,_0x406869)};}}}class StorageClient{constructor(_0x1862a2){function _0x275859(_0x4ceb1a,_0x338202){return _0xbff2(_0x338202- -0x2c8,_0x4ceb1a);}this[_0x275859(-0x1fe,-0x1b9)]=_0x1862a2;}[_0x37f67d(0x1ce,0x1a7)](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async['createBucket'](_0x17df3c,_0x1b4b19){function _0x565828(_0x2001d7,_0x309daa){return _0xbff2(_0x309daa- -0x2b2,_0x2001d7);}try{const response=await this[_0x565828(-0x1c0,-0x1a3)]['post']('/storage/buckets',{'id':_0x17df3c,..._0x1b4b19});return{'data':response[_0x565828(-0x153,-0x103)],'error':null};}catch(_0x1ac125){return{'data':null,'error':_0x1ac125 instanceof EBaaSError?_0x1ac125:new EBaaSError(_0x1ac125 instanceof Error?_0x1ac125['message']:_0x565828(-0x23b,-0x1fe),0x0,_0x1ac125)};}}async[_0x37f67d(0x197,0x1a8)](_0x356371){function _0x2528b1(_0x29fc9a,_0x59fd35){return _0xbff2(_0x59fd35-0x33,_0x29fc9a);}try{const response=await this['httpClient']['get'](_0x2528b1(0x176,0x19b)+_0x356371);return{'data':response['data'],'error':null};}catch(_0x3990d9){return{'data':null,'error':_0x3990d9 instanceof EBaaSError?_0x3990d9:new EBaaSError(_0x3990d9 instanceof Error?_0x3990d9['message']:'Failed\x20to\x20get\x20bucket',0x0,_0x3990d9)};}}async[_0x37f67d(0x201,0x1a0)](){function _0x545330(_0x3ffbb2,_0x13071e){return _0xbff2(_0x13071e- -0xbd,_0x3ffbb2);}try{const response=await this['httpClient'][_0x545330(0x84,0x5)]('/storage/buckets');return{'data':response['data'],'error':null};}catch(_0x49bf35){return{'data':null,'error':_0x49bf35 instanceof EBaaSError?_0x49bf35:new EBaaSError(_0x49bf35 instanceof Error?_0x49bf35['message']:'Failed\x20to\x20list\x20buckets',0x0,_0x49bf35)};}}async[_0x37f67d(0x198,0x157)](_0xf85fb8,_0xb7aac5){function _0x1a3118(_0x31b711,_0x5a9834){return _0xbff2(_0x5a9834- -0x342,_0x31b711);}try{const response=await this['httpClient'][_0x1a3118(-0x22c,-0x275)]('/storage/buckets/'+_0xf85fb8,_0xb7aac5);return{'data':response[_0x1a3118(-0x164,-0x193)],'error':null};}catch(_0x521f1e){return{'data':null,'error':_0x521f1e instanceof EBaaSError?_0x521f1e:new EBaaSError(_0x521f1e instanceof Error?_0x521f1e['message']:'Failed\x20to\x20update\x20bucket',0x0,_0x521f1e)};}}async[_0x37f67d(0x168,0x1e8)](_0x51aada){function _0x176085(_0x5768cd,_0x48dc05){return _0xbff2(_0x5768cd-0x19b,_0x48dc05);}try{const response=await this[_0x176085(0x2aa,0x305)]['delete'](_0x176085(0x303,0x2c6)+_0x51aada);return{'data':response['data'],'error':null};}catch(_0x3b4b88){return{'data':null,'error':_0x3b4b88 instanceof EBaaSError?_0x3b4b88:new EBaaSError(_0x3b4b88 instanceof Error?_0x3b4b88[_0x176085(0x2ba,0x2c5)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x3b4b88)};}}async['getUsage'](){function _0xccd952(_0x53706c,_0x4b2dc5){return _0xbff2(_0x4b2dc5- -0x3d8,_0x53706c);}try{const response=await this['httpClient'][_0xccd952(-0x324,-0x316)]('/storage/usage');return{'data':response['data'],'error':null};}catch(_0x56c565){return{'data':null,'error':_0x56c565 instanceof EBaaSError?_0x56c565:new EBaaSError(_0x56c565 instanceof Error?_0x56c565['message']:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x56c565)};}}}class RealtimeChannel extends EventEmitter{constructor(_0x408f00,_0x38805f){super(),this[_0x33bfc3(0x227,0x1ca)]=![],this['state']=_0x33bfc3(0x1fb,0x202),this['subscriptions']=new Map();function _0x33bfc3(_0x2bf859,_0x1e0c7a){return _0xbff2(_0x2bf859-0x13e,_0x1e0c7a);}this[_0x33bfc3(0x22b,0x28e)]=_0x408f00,this['socket']=_0x38805f;}['subscribe'](_0x436003){!this[_0x38cbb0(-0x215,-0x1d4)]&&(this[_0x38cbb0(-0x215,-0x275)]=!![],this['_join']());_0x436003&&this['on'](_0x38cbb0(-0x19a,-0x122),_0x436003);function _0x38cbb0(_0x1d3400,_0x49fb9e){return _0xbff2(_0x1d3400- -0x2fe,_0x49fb9e);}return this;}['onPostgresChanges'](filter,_0x360a0d){const _0x2ec9fc=_0x5c7540(0x2c7,0x2bd)+JSON[_0x5c7540(0x332,0x31f)](filter);super['on'](_0x2ec9fc,_0x360a0d);function _0x5c7540(_0x37767e,_0x2270f9){return _0xbff2(_0x2270f9-0x185,_0x37767e);}const _0x131405={'unsubscribe':()=>{function _0x58550b(_0x41c015,_0x2912a1){return _0xbff2(_0x41c015- -0x1f0,_0x2912a1);}super['off'](_0x2ec9fc,_0x360a0d),this[_0x58550b(-0x99,-0xbc)][_0x58550b(-0x7e,-0xdb)](_0x2ec9fc);}};return this[_0x5c7540(0x2a9,0x2dc)][_0x5c7540(0x300,0x30e)](_0x2ec9fc,_0x131405),this[_0x5c7540(0x256,0x253)]?.['connected']&&this[_0x5c7540(0x2ed,0x2c3)]===_0x5c7540(0x2a9,0x25c)&&this[_0x5c7540(0x22f,0x253)][_0x5c7540(0x339,0x31c)](_0x5c7540(0x3a5,0x339),{'topic':this[_0x5c7540(0x1f7,0x272)],'filter':filter,'ref':this[_0x5c7540(0x306,0x297)]()}),_0x131405;}[_0x37f67d(0x190,0x1d5)](filter,_0x3a7380){const _0x371fe=_0x27ba8f(-0x40,0x35)+JSON[_0x27ba8f(0xae,0x9d)](filter);super['on'](_0x371fe,_0x3a7380);function _0x27ba8f(_0x45cc17,_0x2b45fa){return _0xbff2(_0x2b45fa- -0xfd,_0x45cc17);}const _0x26de17={'unsubscribe':()=>{super[_0x5430e0(0x2f0,0x289)](_0x371fe,_0x3a7380);function _0x5430e0(_0x547271,_0x47d1ca){return _0xbff2(_0x547271-0x1a3,_0x47d1ca);}this[_0x5430e0(0x2fa,0x2ba)][_0x5430e0(0x315,0x301)](_0x371fe);}};return this[_0x27ba8f(0x1c,0x5a)][_0x27ba8f(0x5e,0x8c)](_0x371fe,_0x26de17),_0x26de17;}[_0x37f67d(0x18a,0x1c4)](filter,_0x3d15cd){function _0x167587(_0x805c42,_0x3018ac){return _0xbff2(_0x3018ac-0x2cc,_0x805c42);}const _0x492139='presence:'+JSON[_0x167587(0x491,0x466)](filter);super['on'](_0x492139,_0x3d15cd);const _0x4b0440={'unsubscribe':()=>{function _0x4c07db(_0x5814c8,_0x2df561){return _0xbff2(_0x5814c8- -0x305,_0x2df561);}super['off'](_0x492139,_0x3d15cd),this[_0x4c07db(-0x1ae,-0x135)]['delete'](_0x492139);}};return this['subscriptions']['set'](_0x492139,_0x4b0440),_0x4b0440;}['send'](_0x3f1bdf){return new Promise(_0xad8a5b=>{function _0x4a634e(_0x124fc2,_0x486067){return _0xbff2(_0x124fc2- -0x224,_0x486067);}this[_0x4a634e(-0x156,-0x1be)]?.[_0x4a634e(-0x16d,-0x1a8)]&&this[_0x4a634e(-0xe6,-0x13f)]==='joined'?(this[_0x4a634e(-0x156,-0x168)][_0x4a634e(-0x8d,-0xac)]('broadcast',{'topic':this['topic'],'event':_0x3f1bdf[_0x4a634e(-0x164,-0x182)],'payload':_0x3f1bdf,'ref':this['makeRef']()}),_0xad8a5b('ok')):_0xad8a5b(_0x4a634e(-0x16a,-0xfc));});}[_0x37f67d(0xf2,0x174)](_0x47cf4d){return new Promise(_0x4391a0=>{function _0xcf8dfa(_0x4ca462,_0x4ebfc4){return _0xbff2(_0x4ebfc4-0x122,_0x4ca462);}this[_0xcf8dfa(0x212,0x1f0)]?.['connected']&&this['state']===_0xcf8dfa(0x24f,0x1f9)?(this[_0xcf8dfa(0x1aa,0x1f0)][_0xcf8dfa(0x2eb,0x2b9)]('presence',{'topic':this['topic'],'event':_0xcf8dfa(0x1dd,0x23e),'payload':_0x47cf4d,'ref':this[_0xcf8dfa(0x1cd,0x234)]()}),_0x4391a0('ok')):_0x4391a0('error');});}[_0x37f67d(0x1a7,0x1a1)](){return new Promise(_0x3f06b0=>{function _0x5d43ec(_0x1111c7,_0x2cfa07){return _0xbff2(_0x1111c7-0x19d,_0x2cfa07);}this[_0x5d43ec(0x26b,0x20f)]?.[_0x5d43ec(0x254,0x243)]&&this['state']==='joined'?(this['socket']['emit'](_0x5d43ec(0x29e,0x237),{'topic':this['topic'],'event':_0x5d43ec(0x2e6,0x2fb),'ref':this[_0x5d43ec(0x2af,0x2c8)]()}),_0x3f06b0('ok')):_0x3f06b0('error');});}['unsubscribe'](){return new Promise(_0x504161=>{this['state']=_0x22e0b3(-0x188,-0x124);function _0x22e0b3(_0xe551bf,_0x4501f0){return _0xbff2(_0x4501f0- -0x246,_0xe551bf);}this['subscriptions']['forEach'](_0x10377c=>{function _0x4ae425(_0x1d8dba,_0x3a66f3){return _0xbff2(_0x3a66f3-0x207,_0x1d8dba);}_0x10377c[_0x4ae425(0x2cf,0x343)]();}),this['subscriptions'][_0x22e0b3(-0x178,-0x10d)](),this['socket']?.['connected']&&this['socket']['emit']('leave',{'topic':this['topic'],'ref':this[_0x22e0b3(-0x1b7,-0x134)]()}),this['state']='closed',this[_0x22e0b3(-0x1c4,-0x173)](),_0x504161('ok');});}['_join'](){if(this[_0x1ddc75(-0x19f,-0x1b3)]==='leaving')return;this['state']=_0x1ddc75(-0x239,-0x1c5);function _0x1ddc75(_0x14cc9f,_0x32fe74){return _0xbff2(_0x32fe74- -0x2f1,_0x14cc9f);}this[_0x1ddc75(-0x1c7,-0x223)]?.['connected']&&(this[_0x1ddc75(-0x251,-0x223)]['emit'](_0x1ddc75(-0x172,-0x146),{'topic':this['topic'],'ref':this['makeRef']()}),setTimeout(()=>{function _0x6d344d(_0x25c4dd,_0x575353){return _0xbff2(_0x25c4dd-0x1d,_0x575353);}this[_0x6d344d(0x15b,0x1aa)]===_0x6d344d(0x149,0x16e)&&(this[_0x6d344d(0x15b,0x1a8)]=_0x6d344d(0xf4,0x16e),this['emit'](_0x6d344d(0x181,0x18a),_0x6d344d(0xde,0x141)));},0x64));}[_0x37f67d(0x195,0x1c9)](){function _0x112248(_0x2f1edd,_0xcfa662){return _0xbff2(_0x2f1edd-0x1c8,_0xcfa662);}this['joinedOnce']&&(this['_join'](),this['subscriptions'][_0x112248(0x2a0,0x277)]((_0x27eac9,_0x41a374)=>{function _0x5a73d1(_0x4e98c2,_0x42f88e){return _0xbff2(_0x42f88e- -0x2f6,_0x4e98c2);}if(_0x41a374['startsWith']('postgres_changes:')){const filter=JSON['parse'](_0x41a374['replace'](_0x5a73d1(-0x198,-0x1be),''));this['socket']?.['emit'](_0x5a73d1(-0xc5,-0x142),{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()});}}));}['_trigger'](_0x31e703,_0x5263e0){if(_0x31e703==='postgres_changes'){const _0x55cf0b='postgres_changes:'+JSON[_0x430856(-0x2a5,-0x226)](_0x5263e0['filter']||{});this[_0x430856(-0x1e6,-0x229)](_0x55cf0b,_0x5263e0);}else{if(_0x31e703==='broadcast'){const _0x2e41e2=_0x430856(-0x298,-0x28e)+JSON[_0x430856(-0x1fd,-0x226)]({'event':_0x5263e0['event']});this[_0x430856(-0x1fb,-0x229)](_0x2e41e2,_0x5263e0);}else{if(_0x31e703===_0x430856(-0x2cb,-0x2bf)){const _0x4b5f56=_0x430856(-0x2a7,-0x27a)+JSON[_0x430856(-0x218,-0x226)]({'event':_0x5263e0['event']});this[_0x430856(-0x200,-0x229)](_0x4b5f56,_0x5263e0);}}}function _0x430856(_0x4aa5a7,_0x49249b){return _0xbff2(_0x49249b- -0x3c0,_0x4aa5a7);}this[_0x430856(-0x202,-0x229)](_0x31e703,_0x5263e0);}[_0x37f67d(0x166,0x1ab)](_0xc40fbd){this[_0x5c37e7(0x416,0x446)]=_0xc40fbd;function _0x5c37e7(_0x20e5b7,_0x3c741a){return _0xbff2(_0x3c741a-0x308,_0x20e5b7);}let status;switch(_0xc40fbd){case'joined':status=_0x5c37e7(0x39b,0x3c9);break;case _0x5c37e7(0x410,0x459):status='CHANNEL_ERROR';break;case'closed':status=_0x5c37e7(0x3c2,0x3e1);break;default:return;}this[_0x5c37e7(0x4d5,0x49f)]('status',status);}[_0x37f67d(0xfd,0x16a)](){function _0x4c93a1(_0x205ca4,_0x4bc6d5){return _0xbff2(_0x205ca4- -0x2b,_0x4bc6d5);}return Math[_0x4c93a1(0xda,0x56)]()['toString'](0x24)['substring'](0x2,0xf);}['getState'](){function _0x3be264(_0xf437cf,_0x1b5c70){return _0xbff2(_0x1b5c70-0x187,_0xf437cf);}return this[_0x3be264(0x2c0,0x2c5)];}}class RealtimeClient{constructor(_0xdbdb63,_0x254ef9,_0x40f970={}){this[_0x420361(-0x1f,0x62)]=null,this['channels']=new Map(),this['connectionState']=_0x420361(0xae,0x83),this['reconnectAttempts']=0x0,this[_0x420361(0x13,-0x24)]=0x5,this[_0x420361(-0x1,0x65)]=_0xdbdb63;function _0x420361(_0x2343fe,_0x5daae2){return _0xbff2(_0x2343fe- -0xed,_0x5daae2);}this[_0x420361(0x8,-0x17)]=_0x254ef9,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x40f970};}['connect'](){return new Promise((_0x8fc71c,_0x293260)=>{if(this['socket']?.[_0x36c3d0(-0x15f,-0x1df)]){_0x8fc71c();return;}this['connectionState']=_0x36c3d0(-0x137,-0xfa),this['socket']=socket_ioClient['io'](this['url'],{'auth':{'apikey':this[_0x36c3d0(-0x121,-0xa0)]},'transports':[_0x36c3d0(-0xaf,-0xf8)],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this['options']['maxReconnectAttempts'],...this['options']['socketOptions']}),this['socket']['on']('connect',()=>{this[_0x7941d8(0x307,0x34d)]='connected',this[_0x7941d8(0x338,0x350)]=0x0;function _0x7941d8(_0x449b38,_0x837ba1){return _0xbff2(_0x837ba1-0x284,_0x449b38);}this[_0x7941d8(0x40d,0x38d)](),_0x8fc71c();}),this[_0x36c3d0(-0x148,-0x161)]['on'](_0x36c3d0(-0x12b,-0x164),_0x2415b1=>{this['connectionState']=_0x5463ef(0x48,-0x2b);function _0x5463ef(_0x105694,_0x297575){return _0xbff2(_0x297575- -0x1c6,_0x105694);}this['channels'][_0x5463ef(-0x84,-0xee)](channel=>{function _0x4cbb90(_0x70b677,_0x17e4d8){return _0xbff2(_0x17e4d8- -0x12f,_0x70b677);}channel['_setState'](_0x4cbb90(-0x65,-0x72));});});function _0x36c3d0(_0x593f28,_0x30968f){return _0xbff2(_0x593f28- -0x216,_0x30968f);}this[_0x36c3d0(-0x148,-0x171)]['on']('connect_error',_0x58c75a=>{this[_0x15077e(-0x34c,-0x2f5)]='error',this[_0x15077e(-0x34a,-0x2f2)]++;function _0x15077e(_0x262bcb,_0x299f33){return _0xbff2(_0x299f33- -0x3be,_0x262bcb);}this['reconnectAttempts']>=this['maxReconnectAttempts']&&_0x293260(new Error(_0x15077e(-0x2a5,-0x2c8)+this[_0x15077e(-0x247,-0x2be)]+'\x20attempts:\x20'+_0x58c75a['message']));}),this['socket']['on'](_0x36c3d0(-0xf9,-0xdc),()=>{function _0x160661(_0x45320a,_0x1ecba4){return _0xbff2(_0x1ecba4-0x331,_0x45320a);}this[_0x160661(0x45b,0x3fa)]=_0x160661(0x38a,0x3e8),this['reconnectAttempts']=0x0,this['channels']['forEach'](channel=>{channel['_rejoin']();});}),this['socket']['on']('postgres_changes',_0x4e8323=>{function _0x1a5a42(_0x662858,_0xf843c){return _0xbff2(_0x662858-0x247,_0xf843c);}const channel=this[_0x1a5a42(0x3c8,0x39e)][_0x1a5a42(0x309,0x37c)](_0x4e8323[_0x1a5a42(0x334,0x2ba)]);channel&&channel[_0x1a5a42(0x3d9,0x417)](_0x1a5a42(0x30e,0x2b8),_0x4e8323);}),this[_0x36c3d0(-0x148,-0x137)]['on'](_0x36c3d0(-0x118,-0xc8),_0x1e4666=>{const channel=this[_0x5cc8dc(0x525,0x4a2)]['get'](_0x1e4666['topic']);function _0x5cc8dc(_0x1427ed,_0x7d68d7){return _0xbff2(_0x7d68d7-0x321,_0x1427ed);}channel&&channel['_trigger'](_0x5cc8dc(0x46d,0x41f),_0x1e4666);}),this[_0x36c3d0(-0x148,-0xd0)]['on']('presence',_0x535de6=>{function _0x2ab016(_0x2dd7f6,_0x1c0f8e){return _0xbff2(_0x2dd7f6- -0x1db,_0x1c0f8e);}const channel=this[_0x2ab016(-0x5a,-0x4f)]['get'](_0x535de6['topic']);channel&&channel[_0x2ab016(-0x49,-0xaf)](_0x2ab016(-0xda,-0xcc),_0x535de6);});});}['disconnect'](){this['socket']&&(this['socket'][_0xb31d00(-0x178,-0x1eb)](),this[_0xb31d00(-0x195,-0x1ec)]=null);function _0xb31d00(_0x540c87,_0x1f1e60){return _0xbff2(_0x540c87- -0x263,_0x1f1e60);}this[_0xb31d00(-0x19a,-0x1d7)]=_0xb31d00(-0xc8,-0xfd),this[_0xb31d00(-0xe2,-0x12c)]['clear']();}[_0x37f67d(0x1d7,0x1d7)](_0x5e57e7){if(this[_0x164aef(0x3bf,0x43e)][_0x164aef(0x378,0x3ae)](_0x5e57e7))return this[_0x164aef(0x478,0x43e)]['get'](_0x5e57e7);function _0x164aef(_0x1789ed,_0x1c142c){return _0xbff2(_0x1c142c-0x2bd,_0x1789ed);}const channel=new RealtimeChannel(_0x5e57e7,this['socket']);return this['channels']['set'](_0x5e57e7,channel),this['connectionState']===_0x164aef(0x35e,0x374)&&channel[_0x164aef(0x46a,0x455)](),channel;}['removeChannel'](channel){function _0x49f18e(_0x36ae78,_0xa3531c){return _0xbff2(_0x36ae78- -0x44,_0xa3531c);}const _0x2a9741=channel['topic'];this[_0x49f18e(0x13d,0x14f)]['has'](_0x2a9741)&&(this[_0x49f18e(0x13d,0x1a3)][_0x49f18e(0x12e,0x195)](_0x2a9741),channel['unsubscribe']());}['removeAllChannels'](){function _0x1e6616(_0x424866,_0x2375a2){return _0xbff2(_0x424866- -0x337,_0x2375a2);}this['channels']['forEach'](channel=>{channel['unsubscribe']();}),this['channels'][_0x1e6616(-0x1fe,-0x1eb)]();}[_0x37f67d(0x200,0x186)](){function _0x22ab4c(_0x92af77,_0x4a1d88){return _0xbff2(_0x92af77- -0x367,_0x4a1d88);}return Array[_0x22ab4c(-0x218,-0x19a)](this[_0x22ab4c(-0x1e6,-0x17d)]['values']());}['isConnected'](){function _0xc34663(_0x43c66d,_0x3f1bb8){return _0xbff2(_0x3f1bb8-0x3ab,_0x43c66d);}return this['connectionState']===_0xc34663(0x4e6,0x462)&&!!this[_0xc34663(0x4d9,0x479)]?.[_0xc34663(0x3fb,0x462)];}['getConnectionState'](){return this['connectionState'];}['onConnectionStateChange'](_0x3a74c8){const _0x410d0a=()=>_0x3a74c8(this['connectionState']);function _0x2af2d6(_0x7090bd,_0x3f50f2){return _0xbff2(_0x7090bd-0x365,_0x3f50f2);}return this[_0x2af2d6(0x433,0x418)]&&(this[_0x2af2d6(0x433,0x43c)]['on']('connect',()=>{this['connectionState']='connected',_0x410d0a();}),this[_0x2af2d6(0x433,0x448)]['on'](_0x2af2d6(0x450,0x4c9),()=>{function _0xbd913(_0x32c490,_0x4e49c3){return _0xbff2(_0x32c490-0x334,_0x4e49c3);}this[_0xbd913(0x3fd,0x403)]=_0xbd913(0x4cf,0x4b2),_0x410d0a();}),this[_0x2af2d6(0x433,0x45d)]['on']('connect_error',()=>{function _0x6334d6(_0x26e476,_0x2528eb){return _0xbff2(_0x26e476-0x165,_0x2528eb);}this[_0x6334d6(0x22e,0x1d0)]='error',_0x410d0a();})),()=>{function _0x24395e(_0x1d40de,_0x274d78){return _0xbff2(_0x274d78-0x3b9,_0x1d40de);}this[_0x24395e(0x4ed,0x487)]&&(this[_0x24395e(0x442,0x487)]['off']('connect',_0x410d0a),this[_0x24395e(0x495,0x487)]['off'](_0x24395e(0x47d,0x4a4),_0x410d0a),this['socket'][_0x24395e(0x4a9,0x506)](_0x24395e(0x4f2,0x51a),_0x410d0a));};}['setupHeartbeat'](){if(!this['options']['heartbeatInterval']||!this[_0x58d59c(0x228,0x1a4)])return;function _0x58d59c(_0x5cc101,_0x11cde8){return _0xbff2(_0x5cc101-0x15a,_0x11cde8);}const interval=setInterval(()=>{function _0x4a24ee(_0x13effa,_0x7874a4){return _0xbff2(_0x7874a4-0x113,_0x13effa);}this['socket']?.['connected']?this['socket']['emit'](_0x4a24ee(0x1ff,0x1fb),{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x58d59c(0x2ce,0x273)][_0x58d59c(0x2ee,0x372)]);}[_0x37f67d(0x1f0,0x200)](){function _0x7ebf29(_0x5b37f3,_0x5d9fb2){return _0xbff2(_0x5d9fb2- -0xbb,_0x5b37f3);}return this[_0x7ebf29(0x57,0x13)];}}class FunctionsClient{constructor(_0x4ae942){this['httpClient']=_0x4ae942;}async['invoke'](_0x1b46f0,_0x30d4f3){function _0x6d4372(_0x153a49,_0x1d87bf){return _0xbff2(_0x153a49- -0x2aa,_0x1d87bf);}try{const _0x10a928=_0x30d4f3?.['method']||'POST',headers={'Content-Type':'application/json',..._0x30d4f3?.[_0x6d4372(-0xf3,-0x161)]};let response;const _0x5574fa='/functions/v1/'+_0x1b46f0;switch(_0x10a928['toUpperCase']()){case'GET':response=await this['httpClient'][_0x6d4372(-0x1e8,-0x1ec)](_0x5574fa,{'headers':headers,'params':_0x30d4f3?.['body']});break;case'POST':response=await this[_0x6d4372(-0x19b,-0x1ef)][_0x6d4372(-0x19f,-0x1db)](_0x5574fa,_0x30d4f3?.['body'],{'headers':headers});break;case'PUT':response=await this['httpClient'][_0x6d4372(-0x1dd,-0x1ed)](_0x5574fa,_0x30d4f3?.['body'],{'headers':headers});break;case'PATCH':response=await this[_0x6d4372(-0x19b,-0x186)]['patch'](_0x5574fa,_0x30d4f3?.[_0x6d4372(-0x119,-0xd4)],{'headers':headers});break;case'DELETE':response=await this[_0x6d4372(-0x19b,-0x1d2)]['delete'](_0x5574fa,{'headers':headers,'data':_0x30d4f3?.[_0x6d4372(-0x119,-0xda)]});break;default:throw new EBaaSError('Unsupported\x20HTTP\x20method:\x20'+_0x10a928,0x190);}return{'data':response[_0x6d4372(-0xfb,-0x130)],'error':null};}catch(_0x491275){return{'data':null,'error':_0x491275 instanceof EBaaSError?_0x491275:new EBaaSError(_0x491275 instanceof Error?_0x491275[_0x6d4372(-0x18b,-0x1b7)]:_0x6d4372(-0x12e,-0x136),0x0,_0x491275)};}}async[_0x37f67d(0x15b,0x154)](){function _0xc13b9b(_0x735441,_0x28293d){return _0xbff2(_0x735441-0x26e,_0x28293d);}try{const response=await this['httpClient']['get'](_0xc13b9b(0x35d,0x38c));return{'data':response['data'],'error':null};}catch(_0x4e39c0){return{'data':null,'error':_0x4e39c0 instanceof EBaaSError?_0x4e39c0:new EBaaSError(_0x4e39c0 instanceof Error?_0x4e39c0[_0xc13b9b(0x38d,0x392)]:_0xc13b9b(0x3d0,0x382),0x0,_0x4e39c0)};}}async['get'](_0xcfe3b4){function _0x1f23f9(_0x4ef88c,_0x3188d3){return _0xbff2(_0x3188d3- -0x2af,_0x4ef88c);}try{const response=await this[_0x1f23f9(-0x1d0,-0x1a0)][_0x1f23f9(-0x185,-0x1ed)]('/functions/v1/'+_0xcfe3b4+_0x1f23f9(-0x1c0,-0x18c));return{'data':response[_0x1f23f9(-0xea,-0x100)],'error':null};}catch(_0x1666c9){return{'data':null,'error':_0x1666c9 instanceof EBaaSError?_0x1666c9:new EBaaSError(_0x1666c9 instanceof Error?_0x1666c9[_0x1f23f9(-0x205,-0x190)]:_0x1f23f9(-0x146,-0x122),0x0,_0x1666c9)};}}async[_0x37f67d(0x1eb,0x20b)](_0x3cb300,_0x43992e){function _0x4ee45d(_0x34039b,_0x54627c){return _0xbff2(_0x54627c- -0x2c6,_0x34039b);}try{const _0x161bfa=new FormData();if(_0x43992e['code']instanceof File)_0x161bfa[_0x4ee45d(-0x1b0,-0x1e6)]('code',_0x43992e['code']);else typeof _0x43992e[_0x4ee45d(-0x17e,-0x153)]===_0x4ee45d(-0xe0,-0x12a)&&_0x161bfa[_0x4ee45d(-0x24c,-0x1e6)](_0x4ee45d(-0xd0,-0x153),new Blob([_0x43992e[_0x4ee45d(-0x1b3,-0x153)]],{'type':_0x4ee45d(-0x23c,-0x20b)}),_0x4ee45d(-0x140,-0x1b0));_0x43992e[_0x4ee45d(-0x132,-0x124)]&&_0x161bfa[_0x4ee45d(-0x238,-0x1e6)](_0x4ee45d(-0xf6,-0x124),_0x43992e[_0x4ee45d(-0xe8,-0x124)]);_0x43992e[_0x4ee45d(-0x16e,-0x1dc)]&&_0x161bfa['append'](_0x4ee45d(-0x1e4,-0x1dc),JSON[_0x4ee45d(-0x126,-0x12c)](_0x43992e['env']));_0x43992e[_0x4ee45d(-0x1a5,-0x1e9)]&&_0x161bfa[_0x4ee45d(-0x192,-0x1e6)](_0x4ee45d(-0x23c,-0x1e9),JSON[_0x4ee45d(-0x153,-0x12c)](_0x43992e[_0x4ee45d(-0x262,-0x1e9)]));_0x43992e[_0x4ee45d(-0x17f,-0x125)]!==undefined&&_0x161bfa[_0x4ee45d(-0x215,-0x1e6)](_0x4ee45d(-0xd8,-0x125),String(_0x43992e['verify']));const response=await this[_0x4ee45d(-0x212,-0x1b7)]['post']('/functions/v1/'+_0x3cb300+_0x4ee45d(-0x11d,-0x16b),_0x161bfa,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x4ee45d(-0x14d,-0x117)],'error':null};}catch(_0x36d92d){return{'data':null,'error':_0x36d92d instanceof EBaaSError?_0x36d92d:new EBaaSError(_0x36d92d instanceof Error?_0x36d92d[_0x4ee45d(-0x1c3,-0x1a7)]:_0x4ee45d(-0x1b2,-0x1f0),0x0,_0x36d92d)};}}async[_0x37f67d(0x174,0x1ca)](_0x1edea7){function _0x5ad226(_0x59d7a9,_0x5d2bc8){return _0xbff2(_0x5d2bc8- -0x390,_0x59d7a9);}try{const response=await this['httpClient'][_0x5ad226(-0x211,-0x21e)](_0x5ad226(-0x2b6,-0x232)+_0x1edea7);return{'data':response['data'],'error':null};}catch(_0x196f6b){return{'data':null,'error':_0x196f6b instanceof EBaaSError?_0x196f6b:new EBaaSError(_0x196f6b instanceof Error?_0x196f6b['message']:'Failed\x20to\x20delete\x20function',0x0,_0x196f6b)};}}async[_0x37f67d(0x118,0x10d)](_0x2c8e71,_0x145747){function _0x2106e1(_0x181aee,_0x53d568){return _0xbff2(_0x181aee-0x24a,_0x53d568);}try{const response=await this['httpClient']['put'](_0x2106e1(0x3a8,0x403)+_0x2c8e71+_0x2106e1(0x364,0x35a),{'env':_0x145747});return{'data':response['data'],'error':null};}catch(_0x2924fe){return{'data':null,'error':_0x2924fe instanceof EBaaSError?_0x2924fe:new EBaaSError(_0x2924fe instanceof Error?_0x2924fe[_0x2106e1(0x369,0x3c9)]:_0x2106e1(0x363,0x374),0x0,_0x2924fe)};}}async[_0x37f67d(0x129,0x165)](_0x44a904,_0x293f85){function _0x48d8a3(_0x36c08a,_0x32248b){return _0xbff2(_0x36c08a-0x320,_0x32248b);}try{const _0x4e7474=new URLSearchParams();_0x293f85?.[_0x48d8a3(0x478,0x45b)]&&_0x4e7474['append'](_0x48d8a3(0x478,0x445),String(_0x293f85[_0x48d8a3(0x478,0x49c)]));_0x293f85?.['offset']&&_0x4e7474['append']('offset',String(_0x293f85['offset']));_0x293f85?.['level']&&_0x4e7474[_0x48d8a3(0x400,0x37c)](_0x48d8a3(0x3fa,0x45d),_0x293f85['level']);const _0x4e1be5='/functions/v1/'+_0x44a904+'/logs'+(_0x4e7474[_0x48d8a3(0x4bd,0x4d6)]()?'?'+_0x4e7474['toString']():''),response=await this[_0x48d8a3(0x42f,0x451)][_0x48d8a3(0x3e2,0x3b5)](_0x4e1be5);return{'data':response[_0x48d8a3(0x4cf,0x4ec)],'error':null};}catch(_0x374811){return{'data':null,'error':_0x374811 instanceof EBaaSError?_0x374811:new EBaaSError(_0x374811 instanceof Error?_0x374811['message']:_0x48d8a3(0x447,0x4a9),0x0,_0x374811)};}}async[_0x37f67d(0x172,0x18c)](_0x25d268,_0x5e186a){function _0xdf17f4(_0x1e2f68,_0x59aacd){return _0xbff2(_0x59aacd-0x117,_0x1e2f68);}try{const _0x1a1e1f=new URLSearchParams();_0x5e186a?.['period']&&_0x1a1e1f['append']('period',_0x5e186a['period']);const _0x3bfbce='/functions/v1/'+_0x25d268+_0xdf17f4(0x223,0x29d)+(_0x1a1e1f['toString']()?'?'+_0x1a1e1f[_0xdf17f4(0x264,0x2b4)]():''),response=await this['httpClient']['get'](_0x3bfbce);return{'data':response['data'],'error':null};}catch(_0x2163f0){return{'data':null,'error':_0x2163f0 instanceof EBaaSError?_0x2163f0:new EBaaSError(_0x2163f0 instanceof Error?_0x2163f0[_0xdf17f4(0x1c9,0x236)]:_0xdf17f4(0x27e,0x212),0x0,_0x2163f0)};}}}function _0x16f6(){const _0x255bcf=['zxjYB3i','Dgv4Dc9WBgfPBG','l3jWyY8','y2XVC2vK','C2vZC2LVBG','CMvHBhrPBwu','zxzLBNq','u1vcu0nssujfra','z2v0','y29UDgfPBNm','zwjHyxmUyxv0Ac5ZzxnZAw9U','z2v0sxrLBq','y29SDw1U','Cg9ZDgDYzxnFy2HHBMDLCW','DxbKyxrLrMLSzu1LDgfKyxrH','y29UBMvJDgLVBLn0yxrL','ChvZAa','DxbZzxj0','CMvJB25Uzwn0qxr0zw1WDhm','Chv0','C29JA2v0','D29YA3nWywnLswq','yxv0Aa','C2nOzw1H','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','CMvTB3zLqwXStgLZDgvUzxjZ','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','Bwv0ywrHDge','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','AM9PBMvK','zM9YrwfJAa','q0Xpu0ve','Bgv2zwW','z2v0u3rHDhvZ','C29JA2v0lMLVlwnSAwvUDa','Aw1WB3j0twfW','qMvHCMvYia','y29UBMvJDgLUzW','yxbWzw5K','Bw92zq','Cg9YDa','Ag9ZDa','yMfZzvvsta','rMfPBgvKihrVihjLBw92zsbMAwXLCW','DMfSDwu','yxnJzw5KAw5N','AgvHCNrIzwf0','AM9PBMvKt25Jzq','zw52','zgLZy29UBMvJDa','DxjS','Dg9WAwm','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','l2z1BMn0Aw9UCY92mq','zgv0zwn0zwrdB25MAwC','AgfZ','z2v0u2vZC2LVBG','D2fYBG','DxbKyxrLt3b0Aw9UCW','yxbPs2v5','rMfPBgvKihrVignVBM5Ly3qGywz0zxiG','u3rVCMfNzuj1y2TLDa','zMLSzq','y2fJAgvdB250CM9S','qxv0AenSAwvUDa','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','BgLZDa','CMvMCMvZAf90B2TLBG','yNjVywrJyxn0','DxbKyxrLqNvJA2v0','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','ChjLC2vUy2u','y3jLyxrLu2LNBMvKvxjS','z2v0uhvIBgLJvxjS','y3jLzgvUDgLHBhm','CMfUzg9T','C3bSAxq','CMvXDwvZDa','C2v0v29YA3nWywnLswq','C2v0DxbizwfYDgjLyxq','BMfTzq','Cg9ZDa','ChjLzML4','z2v0tg9NCW','zxHLy3v0zq','Ahr0CenSAwvUDa','AxnezwXLDgu','zgf0ywjHC2u','BwfRzvjLzG','DgfIBgu','CgfYC2u','yMXVyG','Aw5KzxGUDhm','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','AgfUzgXLrxjYB3i','rMfPBgvKihrVihvWzgf0zsbMDw5JDgLVBIbLBNzPCM9UBwvUDa','l2vUDG','y2XLyxjtzxnZAw9U','DhjHy2S','CMvJB25Uzwn0','C2vSzwn0','BwvZC2fNzq','AgfUzgXLqxv0AevYCM9Y','mtzMqvbVwg4','BgvHDMLUzW','l2LUzM8','u3rVCMfNzunSAwvUDa','CMvMCMvZAfnLC3nPB24','DxbKyxrL','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbSB2DZ','C2v0u2vZC2LVBG','yxHPB3m','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','CMvZzxrqyxnZD29Yza','AM9PBMLUzW','zgv0ywLSCW','z2v0q2HHBM5LBhm','C3rHy2S','C2vHCMnO','ntKXmda2wu1dq1DY','yNjVywrJyxn0oG','C2v0u2vZC2LVBKLUDgvYBMfS','z2v0twv0CMLJCW','CNbJ','Cg9ZDgDYzxneyxrHyMfZzq','BgvUz3rO','Cg9ZDgDYzxnFy2HHBMDLCZO','y2XLyxi','uhjLzMvY','lMrLC2m','Dw5ZDwjZy3jPyMu','z2v0v29YA3nWywnLswq','C3rHDgu','y2fWDhvYzvn0ywnRvhjHy2u','l2zPBgvZl2nVChK','Cg9ZDgDYzxnqB3j0','rMfPBgvKihrVihvWBg9HzcbMAwXL','DgLTzw91Da','Cgf0y2G','ChjLzMvY','ChjLC2vUy2u6','C2LUz2XL','BgLZDej1y2TLDhm','Dw50CMfJAW','rNvUy3rPB25Zq2XPzw50','y29TBw9U','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','B2zM','y29WEq','zNjVBq','z2v0qNvJA2v0','zxjYB3jLza','zgv0zwn0q3vZDg9Trgf0ywjHC2u','x3nLDfn0yxrL','zNvUy3rPB25Z','rujHyvndBgLLBNq','l3nKAY92ms8','C3vIC2nYAxb0Aw9UCW','BgLTAxq','B3jKzxi','DhjHBNnMB3jT','l2rLCgXVEq','B2zMC2v0','Bg9N','l2z1BMn0Aw9UCY92ms8','zxHLy3v0zvf1zxj5','CMvTB3zLqxv0AfrVA2vU','y29UBMvJDf9LCNjVCG','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','C2LNBKLU','C3rHDhvZ','DxbKyxrLrgf0yq','Dw5KzwzPBMvK','D2vIC29JA2v0','l3n0B3jHz2uVyNvJA2v0CY8','l2f1DgGVDJeVDxnLCG','mtm5mZm2mMvHEwLLtW','AxnvC2LUz0n1C3rVBurHDgfIyxnL','B25qCMvZzw5Jzq','CxvLCNK','zgvSzxrLt3b0Aw9UCW','shr0CenSAwvUDa','l2zPBgvZ','x3jLAM9PBG','zgvSzxrL','y29Kzq','B3b0Aw9UCW','y2XPzw50','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','ChvIBgLJ','B3bLCMf0Aw9U','zMLSDgvYCW','vw5RBM93BIbLCNjVCG','CMfUz2u','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','B25cCM9HzgnHC3q','C2v0qxv0AfrVA2vU','y2HHBM5LBa','zg93BMXVywq','y2HHBM5LBhm','zw50CMLLCW','Ec10B3rHBc1JB3vUDa','y3jLyxrL','mtKYntmZntjxy0r3qwC','l21LDhjPy3m','mtGWug1gyvvp','y29UzMLN','C2v0','Aw52B2TL','Dg9ku09o','y3vYCMvUDfnJAgvTyq','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','C2v0DxbjBNrLCMnLChrVCNm','CMvQzwn0','zgvSzxrLqNvJA2v0','yM9KEq','x3rYAwDNzxi','l2zPBgvZl21VDMu','AgvHCNrIzwf0sw50zxj2ywW','B3bLCMf0B3i','nJG3mJy2B2T0r1Do','zw1PDa','x2PVAw4','l2zPBgvZlW','C3rYAw5NAwz5','zgLZy29UBMvJDgvK','C3rYAw5N','Dg9tDhjPBMC','DxnL','Aw5PDgLHBgL6zq','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','DMvYAwz5','zw50CNLWB2LUDa','C2v0sxrLBq','z3rL','rujHyvnfCNjVCG','DxnLCG','lMfZyW','x2DLDfnVy2TLDa','BhrL','DgvZDenVBM5Ly3rPB24','AM9PBG','y29UDgvUDfr5Cgu','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','icHtDgf0Dxm6ia','zgf0yq','yNvJA2v0swq','BgLRzq','mJe5ota0me1Lr2viqq','zgvWBg95','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','ywnJzxnZx3rVA2vU','y3vYCMvUDfnLC3nPB24','AgvHzgvYCW','mteYmZy3ntb3uvj3CLy','C3rHDhvZvgv4Da','CMvZCg9UC2u','p29WzxjHDgLVBJ11ChnLCNq','rMfPBgvKihrVignYzwf0zsbIDwnRzxq','DxbKyxrLrw52','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','y29UBMvJDgvK','Cg9ZDgDYzxnvC2vYBMfTzq','zgf0yufYCMf5'];_0x16f6=function(){return _0x255bcf;};return _0x16f6();}class EBaaSClient{constructor(_0x3748a9,_0xe1f4ba,_0x33b525){function _0x10081a(_0x2890f9,_0x4ec617){return _0xbff2(_0x2890f9- -0x26b,_0x4ec617);}this['options']=_0x33b525,this['httpClient']=new HttpClient({'url':_0x3748a9,'apiKey':_0xe1f4ba,'timeout':0x7530,'headers':_0x33b525?.['global']?.[_0x10081a(-0xb4,-0xc3)]}),this[_0x10081a(-0x19b,-0x11d)]=new AuthClient(this['httpClient']),this['database']=new DatabaseClient(this[_0x10081a(-0x15c,-0x111)],_0x33b525?.[_0x10081a(-0x15a,-0x125)]?.['workspaceId']),this['storage']=new StorageClient(this[_0x10081a(-0x15c,-0x1b4)]),this[_0x10081a(-0x1ac,-0x161)]=new RealtimeClient(_0x3748a9,_0xe1f4ba,_0x33b525?.['realtime']),this['functions']=new FunctionsClient(this['httpClient']),this['initializeCustomDatabase']();}[_0x37f67d(0x143,0x1a7)](_0x53fc56){return this['database']['from'](_0x53fc56);}['rpc'](_0x595144,_0x1fc2aa){function _0x5aa518(_0x31d63c,_0x77c019){return _0xbff2(_0x77c019- -0x26b,_0x31d63c);}return this[_0x5aa518(-0x121,-0x15a)][_0x5aa518(-0x17d,-0x136)](_0x595144,_0x1fc2aa);}['bucket'](_0xad140){return this['storage']['from'](_0xad140);}['channel'](_0x2fdc69){return this['realtime']['channel'](_0x2fdc69);}['invoke'](_0x5581a9,_0x1d4ff7){function _0xb4312c(_0xdbbe1c,_0x4c591b){return _0xbff2(_0xdbbe1c- -0x293,_0x4c591b);}return this[_0xb4312c(-0x13f,-0x1b1)][_0xb4312c(-0x109,-0x96)](_0x5581a9,_0x1d4ff7);}async[_0x37f67d(0x191,0x1ce)](){function _0x5dc8a7(_0x3a9798,_0x4ee669){return _0xbff2(_0x4ee669- -0x36e,_0x3a9798);}if(this['options']?.['database']?.['autoDetectCustomDatabase'])try{await this['database']['initialize']();}catch(_0x4e92e1){console[_0x5dc8a7(-0x2ba,-0x27b)]('Failed to initialize custom database detection:',_0x4e92e1);}}async[_0x37f67d(0x167,0x160)](_0x1e2c89){this['database']['setWorkspaceId'](_0x1e2c89);function _0x289cc0(_0x57561f,_0x471cc9){return _0xbff2(_0x57561f- -0x107,_0x471cc9);}this['options']?.[_0x289cc0(0xa,-0x31)]?.['autoDetectCustomDatabase']&&await this['database']['initialize']();}async['configureCustomDatabase'](_0x3fc495){function _0x51e9bf(_0x282b9f,_0xc99d00){return _0xbff2(_0x282b9f-0x2cc,_0xc99d00);}await this[_0x51e9bf(0x3dd,0x375)][_0x51e9bf(0x479,0x4be)](_0x3fc495);}['getCustomDatabaseStatus'](){return this['database']['getCustomDatabaseStatus']();}}function createClient(_0x1521b9,_0x1e5416,_0x2845b5){return new EBaaSClient(_0x1521b9,_0x1e5416,_0x2845b5);}const version='1.0.0';exports[_0x37f67d(0xd6,0x152)]=AuthClient,exports['CustomDatabaseManager']=CustomDatabaseManager,exports['DatabaseClient']=DatabaseClient,exports[_0x37f67d(0x198,0x1ad)]=EBaaSClient,exports[_0x37f67d(0x256,0x1fd)]=EBaaSError,exports[_0x37f67d(0x1e2,0x1a2)]=FunctionsClient,exports[_0x37f67d(0x23b,0x1c7)]=HttpClient,exports['QueryBuilder']=QueryBuilder,exports['RealtimeChannel']=RealtimeChannel,exports['RealtimeClient']=RealtimeClient,exports[_0x37f67d(0x19a,0x14f)]=StorageBucket,exports[_0x37f67d(0x10c,0x17c)]=StorageClient,exports['createClient']=createClient,exports['version']=version;
|