@e-techsolutions/e-baas-sdk 1.1.8 → 1.2.0
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 +7 -2
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(stringArrayFunction,comparisonValue){function _0x16218b(_0x45ba2f,_0x130808){return _0x1e97(_0x45ba2f-0x55,_0x130808);}const stringArray=stringArrayFunction();while(!![]){try{const _0x19ce91=-parseInt(_0x16218b(0x1d8,0x246))/0x1+-parseInt(_0x16218b(0x159,0x19a))/0x2+-parseInt(_0x16218b(0x20f,0x1e7))/0x3*(-parseInt(_0x16218b(0x148,0x10f))/0x4)+-parseInt(_0x16218b(0x143,0xfb))/0x5*(parseInt(_0x16218b(0x18b,0x19f))/0x6)+-parseInt(_0x16218b(0x152,0x1c5))/0x7*(parseInt(_0x16218b(0x1ec,0x21f))/0x8)+-parseInt(_0x16218b(0x1d4,0x1b2))/0x9*(parseInt(_0x16218b(0x22b,0x1fe))/0xa)+-parseInt(_0x16218b(0x1a3,0x1f8))/0xb*(-parseInt(_0x16218b(0x165,0x113))/0xc);if(_0x19ce91===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x3e0ab5){stringArray['push'](stringArray['shift']());}}}(_0x5df5,0xc901c));import axios from'axios';class EBaaSError extends Error{constructor(_0x10db32,status=0x0,_0x1fb62e){super(_0x10db32),this[_0x5c9a48(0x31c,0x2b7)]=_0x5c9a48(0x24c,0x2af),this['status']=status,this['details']=_0x1fb62e;function _0x5c9a48(_0x1889d9,_0x551a7b){return _0x1e97(_0x551a7b-0xce,_0x1889d9);}Error[_0x5c9a48(0x2fc,0x298)]&&Error[_0x5c9a48(0x22b,0x298)](this,EBaaSError);}[_0x4bcf27(-0x2c7,-0x303)](){function _0xf71b9b(_0x3adda8,_0x825c76){return _0x1e97(_0x825c76-0x315,_0x3adda8);}return{'name':this[_0xf71b9b(0x567,0x4fe)],'message':this['message'],'status':this['status'],'details':this[_0xf71b9b(0x49c,0x4d5)],'stack':this[_0xf71b9b(0x4ef,0x4ab)]};}['toString'](){function _0x212a39(_0x31adeb,_0x3144db){return _0x1e97(_0x3144db- -0x193,_0x31adeb);}return this['name']+':\x20'+this[_0x212a39(0xab,0x52)]+'\x20(Status:\x20'+this['status']+')';}}class HttpClient{constructor(config){this[_0x53c16a(0x18e,0x162)]=config[_0x53c16a(0x147,0xc6)];function _0x53c16a(_0x4f695c,_0x5bb283){return _0x1e97(_0x4f695c-0x3a,_0x5bb283);}this[_0x53c16a(0x156,0x14b)]=config['apiKey'],this[_0x53c16a(0x13c,0xd7)]=axios['create']({'baseURL':this[_0x53c16a(0x18e,0x183)],'timeout':config[_0x53c16a(0x20b,0x183)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this[_0x53c16a(0x156,0x159)],...config[_0x53c16a(0x217,0x1c9)]}}),this[_0x53c16a(0x166,0x12b)]();}[_0x4bcf27(-0x2b8,-0x270)](){this['client']['interceptors']['request'][_0x30a29f(-0x276,-0x205)](config=>{return config;},_0x481f57=>{return Promise['reject'](new EBaaSError('Request\x20failed',0x0,_0x481f57));});function _0x30a29f(_0x4c1fc6,_0x11eae8){return _0x1e97(_0x11eae8- -0x3dc,_0x4c1fc6);}this['client'][_0x30a29f(-0x299,-0x2c6)]['response'][_0x30a29f(-0x198,-0x205)](response=>{return response;},_0xe911a0=>{const status=_0xe911a0['response']?.['status']||0x0;function _0xd47aff(_0x4035c6,_0xe0ed56){return _0x1e97(_0x4035c6- -0x64,_0xe0ed56);}const _0x26cd03=_0xe911a0[_0xd47aff(0xc0,0xb9)]?.['data']?.['message']||_0xe911a0['message']||'Unknown\x20error',_0x12d93d=_0xe911a0[_0xd47aff(0xc0,0xe2)]?.[_0xd47aff(0x120,0xe7)]||_0xe911a0;return Promise[_0xd47aff(0xbc,0xbd)](new EBaaSError(_0x26cd03,status,_0x12d93d));});}async[_0x4bcf27(-0x204,-0x231)](_0x12c9e4,config){try{const response=await this['client']['get'](_0x12c9e4,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x52f10c){throw this['handleError'](_0x52f10c);}}async[_0x4bcf27(-0x2cc,-0x309)](_0x4655aa,data,config){function _0x950f45(_0x18aad5,_0x5da8c9){return _0x1e97(_0x18aad5- -0x394,_0x5da8c9);}try{const response=await this[_0x950f45(-0x292,-0x2c9)]['post'](_0x4655aa,data,config);return{'data':response[_0x950f45(-0x210,-0x292)],'status':response[_0x950f45(-0x1ce,-0x225)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x5c1c4e){throw this[_0x950f45(-0x1cc,-0x21c)](_0x5c1c4e);}}async['put'](_0x549dc2,data,config){function _0x1e1697(_0x358898,_0x29bd43){return _0x1e97(_0x358898- -0x2ec,_0x29bd43);}try{const response=await this[_0x1e1697(-0x1ea,-0x23f)]['put'](_0x549dc2,data,config);return{'data':response[_0x1e1697(-0x168,-0x1c3)],'status':response[_0x1e1697(-0x126,-0xb6)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x514775){throw this['handleError'](_0x514775);}}async['patch'](_0x59856b,data,config){function _0xdeb0da(_0x6f0673,_0x26419f){return _0x1e97(_0x26419f- -0x22,_0x6f0673);}try{const response=await this['client']['patch'](_0x59856b,data,config);return{'data':response[_0xdeb0da(0x1bf,0x162)],'status':response[_0xdeb0da(0x1e1,0x1a4)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x5a602e){throw this[_0xdeb0da(0x1c9,0x1a6)](_0x5a602e);}}async['delete'](_0x361c1a,config){function _0x309c24(_0x3db93b,_0x4dd548){return _0x1e97(_0x3db93b-0x38d,_0x4dd548);}try{const response=await this[_0x309c24(0x48f,0x446)][_0x309c24(0x475,0x471)](_0x361c1a,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x2731fc){throw this['handleError'](_0x2731fc);}}['setAuthToken'](_0x27ebe5){function _0x2d7cec(_0x4aeac0,_0x42fcc0){return _0x1e97(_0x4aeac0- -0xa5,_0x42fcc0);}this[_0x2d7cec(0x5d,-0x9)][_0x2d7cec(0x4c,0x3a)][_0x2d7cec(0x138,0x111)]['common']['Authorization']='Bearer\x20'+_0x27ebe5;}[_0x4bcf27(-0x2de,-0x331)](){function _0x4f15a8(_0x2874fe,_0x2135c0){return _0x1e97(_0x2135c0- -0x2b3,_0x2874fe);}delete this[_0x4f15a8(-0x1b9,-0x1b1)][_0x4f15a8(-0x142,-0x1c2)]['headers']['common']['Authorization'],this[_0x4f15a8(-0x234,-0x1b1)][_0x4f15a8(-0x1ff,-0x1c2)][_0x4f15a8(-0x108,-0xd6)][_0x4f15a8(-0x103,-0x124)]['Authorization']='Bearer\x20'+this[_0x4f15a8(-0x176,-0x197)];}[_0x4bcf27(-0x21c,-0x283)](_0xffe721){if(_0xffe721 instanceof EBaaSError)return _0xffe721;return new EBaaSError(_0xffe721['message']||'HTTP\x20request\x20failed',_0xffe721['status']||0x0,_0xffe721);}}class AuthClient{constructor(_0x2a936e,_0x5c1a17){this['currentSession']=null;function _0x168d17(_0x3ed356,_0x42d16f){return _0x1e97(_0x3ed356- -0x1df,_0x42d16f);}this['httpClient']=_0x2a936e,this[_0x168d17(-0xe8,-0x155)]=_0x5c1a17,this['loadSession']();}async['signUp'](data){function _0x3cd40e(_0x47c513,_0x575a1d){return _0x1e97(_0x47c513-0x2a9,_0x575a1d);}try{const response=await this[_0x3cd40e(0x443,0x404)][_0x3cd40e(0x3c1,0x3de)]('/auth/v1/signup',data);return response[_0x3cd40e(0x42d,0x3c2)]['session']&&this[_0x3cd40e(0x49b,0x4d5)](response['data']['session']),response[_0x3cd40e(0x42d,0x3ca)];}catch(_0x1c1009){throw this[_0x3cd40e(0x46d,0x400)](_0x1c1009);}}async['signIn'](data){function _0x253c16(_0x33384f,_0x11d0ef){return _0x1e97(_0x33384f-0xa5,_0x11d0ef);}try{const headers={};this[_0x253c16(0x19c,0x195)]&&(headers['X-Workspace-ID']=this['workspaceId']);const response=await this[_0x253c16(0x23f,0x233)][_0x253c16(0x1bd,0x1ba)](_0x253c16(0x232,0x1f7),data,{'headers':headers});return response[_0x253c16(0x229,0x1a2)]['session']&&this[_0x253c16(0x297,0x21d)](response['data'][_0x253c16(0x247,0x2c5)]),response[_0x253c16(0x229,0x27e)];}catch(_0x1ce18f){throw this['handleAuthError'](_0x1ce18f);}}async[_0x4bcf27(-0x216,-0x29b)](){function _0x5118f7(_0x464c54,_0x212176){return _0x1e97(_0x212176- -0x2be,_0x464c54);}try{await this[_0x5118f7(-0xee,-0x124)][_0x5118f7(-0x1c5,-0x1a6)](_0x5118f7(-0xb0,-0x129)),this[_0x5118f7(-0x140,-0x161)]();}catch(_0x5ea821){this[_0x5118f7(-0x1a8,-0x161)]();throw this['handleAuthError'](_0x5ea821);}}async[_0x4bcf27(-0x2a4,-0x296)](){if(!this[_0x4769ec(0x4df,0x479)]?.['access_token'])return null;function _0x4769ec(_0x478132,_0x8b2421){return _0x1e97(_0x478132-0x395,_0x8b2421);}try{const response=await this['httpClient'][_0x4769ec(0x575,0x5de)]('/auth/v1/user');return response[_0x4769ec(0x519,0x4fe)][_0x4769ec(0x551,0x5b4)];}catch(_0x3d88f0){if(_0x3d88f0 instanceof EBaaSError&&_0x3d88f0['status']===0x191)return this[_0x4769ec(0x4f2,0x528)](),null;throw this[_0x4769ec(0x559,0x59e)](_0x3d88f0);}}async['refreshSession'](){if(!this[_0x5a9271(0x1a4,0x192)]?.[_0x5a9271(0x16e,0x1eb)])return null;function _0x5a9271(_0x3bd48c,_0x268986){return _0x1e97(_0x268986-0x48,_0x3bd48c);}try{const response=await this['httpClient'][_0x5a9271(0x193,0x160)](_0x5a9271(0xec,0x170),{'refresh_token':this[_0x5a9271(0x16a,0x192)]['refresh_token']});if(response[_0x5a9271(0x242,0x1cc)]['session'])return this['setSession'](response['data']['session']),response[_0x5a9271(0x181,0x1cc)][_0x5a9271(0x193,0x1ea)];return null;}catch(_0x4eae95){this[_0x5a9271(0x127,0x1a5)]();throw this['handleAuthError'](_0x4eae95);}}async['resetPassword'](_0x44e0b3){function _0x34e16e(_0x249663,_0x11ddc1){return _0x1e97(_0x249663- -0x37,_0x11ddc1);}try{await this['httpClient'][_0x34e16e(0xe1,0x5c)](_0x34e16e(0x111,0xf9),{'email':_0x44e0b3});}catch(_0x436524){throw this['handleAuthError'](_0x436524);}}async[_0x4bcf27(-0x23c,-0x28b)](data){function _0x5dc104(_0x257b2d,_0x46202c){return _0x1e97(_0x257b2d-0x3d5,_0x46202c);}try{const response=await this[_0x5dc104(0x56f,0x58f)][_0x5dc104(0x571,0x56f)]('/auth/v1/user',data);return response[_0x5dc104(0x559,0x581)]['user'];}catch(_0x3f3574){throw this['handleAuthError'](_0x3f3574);}}[_0x4bcf27(-0x263,-0x287)](){return this['currentSession'];}[_0x4bcf27(-0x294,-0x283)](_0x2415a6){function _0xed3616(_0x50b75e,_0x3768fd){return _0x1e97(_0x3768fd- -0x3a1,_0x50b75e);}this[_0xed3616(-0x1cf,-0x257)]=_0x2415a6,this['httpClient'][_0xed3616(-0x197,-0x1f8)](_0x2415a6['access_token']),typeof localStorage!==_0xed3616(-0x22c,-0x280)&&localStorage['setItem']('ebaas.auth.session',JSON[_0xed3616(-0x2f8,-0x2a1)](_0x2415a6));}['onAuthStateChange'](_0x3a3fc0){return()=>{};}['setWorkspaceId'](_0x4fdbda){function _0x113caf(_0x2c97a7,_0x10af1f){return _0x1e97(_0x2c97a7- -0x130,_0x10af1f);}this[_0x113caf(-0x39,-0xa2)]=_0x4fdbda;}[_0x4bcf27(-0x1f2,-0x204)](_0x5282a8){this['currentSession']=_0x5282a8,this[_0x2fc37c(-0x232,-0x217)]['setAuthToken'](_0x5282a8['access_token']);function _0x2fc37c(_0x1d1dc5,_0x1bd58c){return _0x1e97(_0x1d1dc5- -0x3cc,_0x1bd58c);}typeof localStorage!=='undefined'&&localStorage[_0x2fc37c(-0x1dc,-0x1c9)]('ebaas.auth.session',JSON[_0x2fc37c(-0x2cc,-0x28c)](_0x5282a8));}['clearSession'](){this['currentSession']=null,this[_0x3f1c7c(0xa2,0xec)]['removeAuthToken']();function _0x3f1c7c(_0x300fbe,_0x12ac7a){return _0x1e97(_0x12ac7a- -0xae,_0x300fbe);}typeof localStorage!==_0x3f1c7c(0x7b,0x73)&&localStorage['removeItem'](_0x3f1c7c(0x108,0x13e));}[_0x4bcf27(-0x239,-0x262)](){function _0x3348c9(_0x2f5529,_0x1369a6){return _0x1e97(_0x1369a6-0x240,_0x2f5529);}if(typeof localStorage!==_0x3348c9(0x2f3,0x361)){const _0x21ba48=localStorage['getItem'](_0x3348c9(0x48a,0x42c));if(_0x21ba48)try{const _0x22d407=JSON[_0x3348c9(0x378,0x3de)](_0x21ba48);this[_0x3348c9(0x497,0x432)](_0x22d407);}catch(_0x401a89){this[_0x3348c9(0x3d5,0x39d)]();}}}[_0x4bcf27(-0x220,-0x1f1)](_0x5b9352){function _0x20ca90(_0x217f29,_0x3ae3fe){return _0x1e97(_0x3ae3fe-0x20c,_0x217f29);}if(_0x5b9352 instanceof EBaaSError)return _0x5b9352;return new EBaaSError(_0x5b9352[_0x20ca90(0x373,0x3f1)]||'Authentication\x20failed',_0x5b9352[_0x20ca90(0x443,0x3d2)]||0x0,_0x5b9352);}}class QueryBuilder{constructor(_0x8f7549,_0x3d2b86,_0x2133de,_0x4f5ba8){this['httpClient']=_0x8f7549,this[_0x2f86c2(-0xde,-0x126)]=_0x3d2b86;function _0x2f86c2(_0x219cfd,_0x20c296){return _0x1e97(_0x20c296- -0x268,_0x219cfd);}this[_0x2f86c2(-0x36,-0x82)]=_0x2133de,this[_0x2f86c2(-0x1b8,-0x171)]=_0x4f5ba8,this['query']={'filters':[]};}['select'](_0x11cf37='*',_0x271c09){return this['query']['select']=_0x11cf37,this;}['insert'](data,_0x589764){function _0x346e3c(_0x16ad0a,_0x1019d1){return _0x1e97(_0x16ad0a- -0x294,_0x1019d1);}return this[_0x346e3c(-0x12d,-0xc1)]('POST','/sdk/v1/'+this['table']+'?operation=insert',{'data':data,'options':_0x589764});}[_0x4bcf27(-0x249,-0x223)](data,_0x22ee6a){function _0x40b352(_0x5dde20,_0x5e9b62){return _0x1e97(_0x5dde20-0x34c,_0x5e9b62);}return this['query']['updateData']=data,this['query'][_0x40b352(0x4b2,0x44c)]=_0x22ee6a,this;}['upsert'](data,_0xa7cc36){function _0x50566(_0x550eb8,_0x3f1370){return _0x1e97(_0x3f1370-0x1c0,_0x550eb8);}return this[_0x50566(0x39e,0x327)]('POST','/sdk/v1/'+this['table']+_0x50566(0x336,0x36d),{'data':data,'options':{..._0xa7cc36,'upsert':!![]}});}['delete'](_0x3649e3){this[_0x5ef4da(-0x244,-0x2ad)]['deleteOptions']=_0x3649e3,this['query'][_0x5ef4da(-0x25f,-0x2a7)]=!![];function _0x5ef4da(_0x4845ec,_0x6b6d97){return _0x1e97(_0x4845ec- -0x3bf,_0x6b6d97);}return this;}['eq'](_0x27bd89,_0x57ae0e){function _0x15c234(_0x54e5d6,_0x558f10){return _0x1e97(_0x54e5d6- -0x172,_0x558f10);}return this[_0x15c234(0x9,-0x18)][_0x15c234(0x2e,-0x40)][_0x15c234(-0x7,-0x8c)]({'column':_0x27bd89,'operator':'eq','value':_0x57ae0e}),this;}[_0x4bcf27(-0x1f5,-0x23c)](_0x21574b,_0x5bb5b4){function _0xa6988e(_0x516056,_0x3f5cfe){return _0x1e97(_0x516056- -0xac,_0x3f5cfe);}return this[_0xa6988e(0xcf,0x9d)][_0xa6988e(0xf4,0xb9)][_0xa6988e(0xbf,0x121)]({'column':_0x21574b,'operator':_0xa6988e(0x143,0x16f),'value':_0x5bb5b4}),this;}['gt'](_0x28aa64,_0x1a9e25){function _0x1af12f(_0x29e10a,_0x36b417){return _0x1e97(_0x36b417- -0x2d1,_0x29e10a);}return this[_0x1af12f(-0x1ab,-0x156)]['filters'][_0x1af12f(-0x1c4,-0x166)]({'column':_0x28aa64,'operator':'gt','value':_0x1a9e25}),this;}['gte'](_0x28236b,_0x1eedc6){this['query'][_0x556326(0x38,0x25)][_0x556326(0x3,-0x56)]({'column':_0x28236b,'operator':_0x556326(0x24,0x3d),'value':_0x1eedc6});function _0x556326(_0x215545,_0x1e1823){return _0x1e97(_0x215545- -0x168,_0x1e1823);}return this;}['lt'](_0x15c51a,_0xdb3d71){this[_0x491a6c(-0x110,-0x14f)][_0x491a6c(-0xb1,-0x12a)][_0x491a6c(-0x13c,-0x15f)]({'column':_0x15c51a,'operator':'lt','value':_0xdb3d71});function _0x491a6c(_0x5a7d58,_0x4c8aaf){return _0x1e97(_0x4c8aaf- -0x2ca,_0x5a7d58);}return this;}['lte'](_0x12e586,_0x480c85){this[_0x3f733d(0x26f,0x1f6)][_0x3f733d(0x1f2,0x21b)][_0x3f733d(0x19d,0x1e6)]({'column':_0x12e586,'operator':'lte','value':_0x480c85});function _0x3f733d(_0x5c4c7a,_0x334096){return _0x1e97(_0x334096-0x7b,_0x5c4c7a);}return this;}['like'](_0x2e3238,_0x4e217a){this[_0x142000(0x13,0x42)]['filters']['push']({'column':_0x2e3238,'operator':_0x142000(-0x6f,-0x8a),'value':_0x4e217a});function _0x142000(_0x4f7186,_0x46c458){return _0x1e97(_0x4f7186- -0x168,_0x46c458);}return this;}['ilike'](_0x56abd1,_0xa85a7b){function _0x5995cd(_0x266346,_0x4d30e4){return _0x1e97(_0x4d30e4-0x1bb,_0x266346);}return this[_0x5995cd(0x376,0x336)][_0x5995cd(0x32e,0x35b)]['push']({'column':_0x56abd1,'operator':_0x5995cd(0x326,0x36c),'value':_0xa85a7b}),this;}['is'](_0x3b7594,_0x191bd8){function _0x125b24(_0x2b2db6,_0x2aeecb){return _0x1e97(_0x2aeecb- -0x257,_0x2b2db6);}return this['query'][_0x125b24(-0x3f,-0xb7)]['push']({'column':_0x3b7594,'operator':'is','value':_0x191bd8}),this;}['in'](_0x27992e,_0x19a6f2){function _0x11d7b8(_0x387d22,_0x794f27){return _0x1e97(_0x794f27- -0x1c8,_0x387d22);}return this[_0x11d7b8(-0xcc,-0x4d)][_0x11d7b8(0x2a,-0x28)]['push']({'column':_0x27992e,'operator':'in','value':_0x19a6f2}),this;}[_0x4bcf27(-0x1fc,-0x21b)](_0x22bc5d,_0x31640f){this['query'][_0x2b81c0(0x5b4,0x55b)][_0x2b81c0(0x538,0x526)]({'column':_0x22bc5d,'operator':_0x2b81c0(0x5ec,0x5a3),'value':_0x31640f});function _0x2b81c0(_0x46502b,_0x506819){return _0x1e97(_0x506819-0x3bb,_0x46502b);}return this;}['match'](_0x57d472){Object[_0x12e779(0x12,0x8f)](_0x57d472)[_0x12e779(0x1e,0x80)](([_0x3389c7,_0x10d68e])=>{this['eq'](_0x3389c7,_0x10d68e);});function _0x12e779(_0x5d3699,_0x49d787){return _0x1e97(_0x49d787- -0xb2,_0x5d3699);}return this;}['order'](_0x2b58f0,_0x4ad617){!this[_0x3d4019(0x1cf,0x153)]['order']&&(this[_0x3d4019(0x103,0x153)]['order']=[]);function _0x3d4019(_0x33b0be,_0x472706){return _0x1e97(_0x472706- -0x28,_0x33b0be);}return this[_0x3d4019(0x149,0x153)]['order']['push']({'column':_0x2b58f0,'ascending':_0x4ad617?.[_0x3d4019(0x187,0x15f)]!==![]}),this;}['limit'](count){return this['query']['limit']=count,this;}['range'](from,_0x42be16){function _0x4b9151(_0x39cce4,_0x5a1d75){return _0x1e97(_0x39cce4-0x212,_0x5a1d75);}return this[_0x4b9151(0x38d,0x3e8)]['range']={'from':from,'to':_0x42be16},this;}async[_0x4bcf27(-0x25c,-0x296)](){function _0x5b3280(_0xf0aab9,_0x1b2b73){return _0x1e97(_0x1b2b73-0x175,_0xf0aab9);}if(this[_0x5b3280(0x2e8,0x2f0)]['updateData'])return this['executeQuery']('PATCH','/sdk/v1/'+this[_0x5b3280(0x2a6,0x2b7)],{'data':this[_0x5b3280(0x28f,0x2f0)]['updateData'],'options':this['query']['updateOptions'],'filters':this[_0x5b3280(0x369,0x2f0)]['filters']});else return this['query'][_0x5b3280(0x33e,0x2d5)]?this['executeQuery']('DELETE',_0x5b3280(0x2ee,0x28f)+this[_0x5b3280(0x300,0x2b7)]+'?operation=delete',{'options':this[_0x5b3280(0x344,0x2f0)]['deleteOptions'],'filters':this['query'][_0x5b3280(0x29d,0x315)]}):this[_0x5b3280(0x361,0x2dc)]('GET','/sdk/v1/'+this['table']+_0x5b3280(0x290,0x2d1),{'select':this[_0x5b3280(0x2f8,0x2f0)][_0x5b3280(0x308,0x2b8)],'filters':this[_0x5b3280(0x34e,0x2f0)][_0x5b3280(0x2e4,0x315)],'order':this[_0x5b3280(0x343,0x2f0)][_0x5b3280(0x2b0,0x2a2)],'limit':this['query']['limit'],'range':this[_0x5b3280(0x304,0x2f0)]['range']});}async['single'](){this[_0x4dfae1(0x1f5,0x233)](0x1);function _0x4dfae1(_0x4d6fdb,_0x4a6a97){return _0x1e97(_0x4d6fdb-0x19,_0x4a6a97);}const result=await this['execute']();return{'data':result['data']?.[0x0]||null,'error':result[_0x4dfae1(0x17e,0x13f)]};}async['executeQuery'](_0x58c34e,_0x52f568,_0x10c3f8){function _0x2324c4(_0x2c36e4,_0x2afab2){return _0x1e97(_0x2afab2-0x9b,_0x2c36e4);}try{let response;const headers={};this[_0x2324c4(0x119,0x192)]&&(headers['x-workspace-id']=this['workspaceId']);if(_0x58c34e==='GET'){const _0xfc35e8=_0x52f568['split']('?'),_0x3dcd39=_0xfc35e8[0x0],existingParams=new URLSearchParams(_0xfc35e8[0x1]||'');if(_0x10c3f8[_0x2324c4(0x24a,0x1de)])existingParams['append']('select',_0x10c3f8['select']);_0x10c3f8['filters']?.['length']&&_0x10c3f8['filters']['forEach'](filter=>{function _0x2fda8f(_0x4e048d,_0x5469b1){return _0x1e97(_0x5469b1- -0x35c,_0x4e048d);}existingParams['append'](filter[_0x2fda8f(-0x1ba,-0x197)],filter['operator']+'.'+filter['value']);});if(_0x10c3f8[_0x2324c4(0x24f,0x1c8)]?.['length']){const orderStr=_0x10c3f8[_0x2324c4(0x21e,0x1c8)][_0x2324c4(0x142,0x18a)](_0x1dd550=>''+_0x1dd550['column']+(_0x1dd550[_0x2324c4(0x1c1,0x222)]?_0x2324c4(0x2e9,0x264):_0x2324c4(0x1b2,0x1f2)))['join'](',');existingParams['append']('order',orderStr);}if(_0x10c3f8['limit'])existingParams['append'](_0x2324c4(0x2a2,0x277),_0x10c3f8['limit']['toString']());_0x10c3f8['range']&&(existingParams['append']('offset',_0x10c3f8['range'][_0x2324c4(0x297,0x240)][_0x2324c4(0x210,0x1c4)]()),existingParams[_0x2324c4(0x307,0x286)]('limit',(_0x10c3f8[_0x2324c4(0x1a8,0x1e2)]['to']-_0x10c3f8['range'][_0x2324c4(0x246,0x240)]+0x1)[_0x2324c4(0x22c,0x1c4)]())),response=await this[_0x2324c4(0x2b8,0x235)]['get'](_0x3dcd39+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x58c34e==='DELETE'){const _0x1f4c0a=_0x52f568['split']('?'),_0xc11854=_0x1f4c0a[0x0],existingParams=new URLSearchParams(_0x1f4c0a[0x1]||'');!existingParams[_0x2324c4(0x185,0x187)](_0x2324c4(0x20d,0x275))&&existingParams['append']('operation',_0x2324c4(0x1dd,0x183));_0x10c3f8[_0x2324c4(0x26d,0x23b)]?.[_0x2324c4(0x1ed,0x1a4)]&&_0x10c3f8['filters']['forEach'](filter=>{function _0x225b01(_0x1b4f42,_0x50948d){return _0x1e97(_0x1b4f42-0xf9,_0x50948d);}existingParams[_0x225b01(0x2e4,0x2b1)](filter[_0x225b01(0x2be,0x268)],filter[_0x225b01(0x2ba,0x2ac)]+'.'+filter['value']);});const deleteUrl=_0xc11854+'?'+existingParams[_0x2324c4(0x218,0x1c4)]();console[_0x2324c4(0x27c,0x262)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x2324c4(0x214,0x262)]('\uD83D\uDD27 DELETE headers:',headers),console['log']('\uD83D\uDD27 DELETE filtros originais:',_0x10c3f8['filters']),response=await this['httpClient'][_0x2324c4(0x17d,0x183)](deleteUrl,{'headers':headers});}else{if(_0x58c34e==='PATCH'){const _0x209908=_0x52f568['split']('?'),_0x37c3ad=_0x209908[0x0],existingParams=new URLSearchParams(_0x209908[0x1]||'');!existingParams[_0x2324c4(0x174,0x187)]('operation')&&existingParams[_0x2324c4(0x2b4,0x286)]('operation',_0x2324c4(0x250,0x236));_0x10c3f8['filters']?.['length']&&_0x10c3f8['filters'][_0x2324c4(0x23f,0x1cd)](filter=>{function _0x146568(_0xe92ef4,_0x4e12ed){return _0x1e97(_0x4e12ed-0x2aa,_0xe92ef4);}existingParams[_0x146568(0x509,0x495)](filter['column'],filter[_0x146568(0x4ef,0x46b)]+'.'+filter['value']);});_0x10c3f8['options']?.['prefer']&&(headers['Prefer']=_0x10c3f8[_0x2324c4(0x2b2,0x24f)][_0x2324c4(0x1f7,0x203)]);const updateUrl=_0x37c3ad+'?'+existingParams['toString']();response=await this['httpClient'][_0x2324c4(0x1cb,0x1ed)](updateUrl,_0x10c3f8['data'],{'headers':headers});}else{let _0x53f510=_0x10c3f8['data'];!headers[_0x2324c4(0x225,0x1b0)]&&(headers['Prefer']='return=representation'),_0x10c3f8[_0x2324c4(0x288,0x24f)]?.['upsert']&&(headers[_0x2324c4(0x222,0x1b0)]=_0x2324c4(0x171,0x1e6)),_0x10c3f8['dataArray']&&(_0x53f510=_0x10c3f8[_0x2324c4(0x2c1,0x26f)]),response=await this[_0x2324c4(0x25b,0x235)]['post'](_0x52f568,_0x53f510,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response[_0x2324c4(0x2a8,0x278)]?.['x-total-count']?parseInt(response[_0x2324c4(0x24b,0x278)][_0x2324c4(0x208,0x221)]):undefined};}catch(_0x5c312c){return{'data':null,'error':_0x5c312c instanceof EBaaSError?_0x5c312c:new EBaaSError(_0x5c312c instanceof Error?_0x5c312c['message']:'Database\x20operation\x20failed',0x0,_0x5c312c)};}}}class CustomDatabaseManager{constructor(_0x2f32fd,_0x4cf8f0){this[_0x3f81c5(0x2d,0x96)]=_0x2f32fd;function _0x3f81c5(_0x30df03,_0x57d5c3){return _0x1e97(_0x57d5c3- -0x104,_0x30df03);}this[_0x3f81c5(-0x2e,-0xd)]=_0x4cf8f0;}async['detectCustomDatabase'](){if(!this[_0x13d976(-0x173,-0x131)])return{'hasCustomDatabase':![]};try{const response=await this['httpClient'][_0x13d976(-0x8a,-0x111)]('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this['workspaceId']}});if(response[_0x13d976(-0xa4,-0xf4)]===0xc8&&response[_0x13d976(-0xe6,-0x126)]?.[_0x13d976(-0x167,-0x1b1)]){const config=response[_0x13d976(-0xe6,-0xb7)]['config'],_0x3dcb2b={'host':config[_0x13d976(-0x157,-0x15e)],'port':config[_0x13d976(-0x124,-0x128)],'database':config[_0x13d976(-0xf7,-0x11f)],'username':config['postgresUsername'],'password':'','schema':config[_0x13d976(-0xb3,-0x43)],'sslEnabled':config[_0x13d976(-0x91,-0x96)]};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x3dcb2b},this['detectedConfig'];}}catch(_0x38820c){if(_0x38820c?.[_0x13d976(-0xa4,-0x7c)]===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this['detectedConfig'];console['warn']('Failed to detect custom database configuration:',_0x38820c);}this[_0x13d976(-0xb8,-0x13d)]={'hasCustomDatabase':![]};function _0x13d976(_0x1a635d,_0x21e183){return _0x1e97(_0x1a635d- -0x26a,_0x21e183);}return this['detectedConfig'];}async['testConnection'](_0x5afb99){function _0x56c45d(_0x2db072,_0xd25011){return _0x1e97(_0xd25011-0x3b9,_0x2db072);}try{const response=await this[_0x56c45d(0x5ad,0x553)]['post']('/admin/v1/workspace/custom-database/test-connection',_0x5afb99,{'headers':this['workspaceId']?{'X-Workspace-ID':this[_0x56c45d(0x449,0x4b0)]}:{}});return response[_0x56c45d(0x52d,0x53d)];}catch(_0xd4ad51){return{'success':![],'message':_0xd4ad51?.['message']||_0x56c45d(0x5d4,0x58b)};}}async['configureCustomDatabase'](_0x134a49){if(!this[_0x229870(0x389,0x338)])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient'][_0x229870(0x3aa,0x3ad)]('/admin/v1/workspace/custom-database',{'workspaceId':this['workspaceId'],..._0x134a49},{'headers':{'X-Workspace-ID':this[_0x229870(0x389,0x35f)]}}),config=response['data']['config'];function _0x229870(_0x157e37,_0x12a750){return _0x1e97(_0x157e37-0x292,_0x12a750);}return this[_0x229870(0x444,0x3f7)]={'hasCustomDatabase':!![],'config':config,'credentials':_0x134a49},config;}async[_0x4bcf27(-0x2e5,-0x2c5)](){function _0x4b1fc1(_0x190779,_0x536579){return _0x1e97(_0x190779-0x81,_0x536579);}if(!this[_0x4b1fc1(0x178,0x1a0)])throw new Error('Workspace ID is required to remove custom database');await this['httpClient']['delete']('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this[_0x4b1fc1(0x178,0x10c)]}}),this['detectedConfig']={'hasCustomDatabase':![]};}[_0x4bcf27(-0x2c2,-0x33e)](){return this['detectedConfig'];}[_0x4bcf27(-0x278,-0x203)](){function _0x51e11(_0x26be23,_0x941d61){return _0x1e97(_0x26be23- -0x190,_0x941d61);}return this[_0x51e11(0x22,-0x24)]?.['hasCustomDatabase']??![];}[_0x4bcf27(-0x22c,-0x1c1)](){function _0x44e15(_0x549620,_0x1a8c26){return _0x1e97(_0x549620- -0x37e,_0x1a8c26);}return this['detectedConfig']?.[_0x44e15(-0x1f4,-0x19e)];}[_0x4bcf27(-0x20c,-0x183)](_0xdef9b){this['workspaceId']=_0xdef9b;function _0xc06c89(_0x5f0a9e,_0x5c7573){return _0x1e97(_0x5c7573-0x8,_0x5f0a9e);}this[_0xc06c89(0x203,0x1ba)]=undefined;}[_0x4bcf27(-0x2ac,-0x25e)](){return this['workspaceId'];}[_0x4bcf27(-0x2fd,-0x2b3)](){function _0x115f63(_0x55beef,_0x47cd34){return _0x1e97(_0x47cd34- -0x35e,_0x55beef);}return{'workspaceId':this[_0x115f63(-0x2e1,-0x267)],'hasConfig':this['hasCustomDatabase'](),'configDetails':this[_0x115f63(-0x1de,-0x1ac)]?.['credentials']?{'host':this[_0x115f63(-0x181,-0x1ac)][_0x115f63(-0x243,-0x1d4)][_0x115f63(-0x1f5,-0x230)],'port':this['detectedConfig'][_0x115f63(-0x1f3,-0x1d4)][_0x115f63(-0x16f,-0x1e8)],'database':this['detectedConfig'][_0x115f63(-0x198,-0x1d4)][_0x115f63(-0x241,-0x224)],'schema':this[_0x115f63(-0x156,-0x1ac)][_0x115f63(-0x1fa,-0x1d4)]['schema']||_0x115f63(-0x18e,-0x1de),'sslEnabled':this['detectedConfig'][_0x115f63(-0x1a8,-0x1d4)][_0x115f63(-0x175,-0x185)]||![]}:undefined};}}class DatabaseClient{constructor(_0x17e20a,_0x25af0b){this['httpClient']=_0x17e20a,this['customDatabaseManager']=new CustomDatabaseManager(_0x17e20a,_0x25af0b);}['from'](_0x25b317){function _0x78ae68(_0x60069b,_0x3d1d82){return _0x1e97(_0x3d1d82- -0x1be,_0x60069b);}return new QueryBuilder(this['httpClient'],_0x25b317,this[_0x78ae68(-0x9c,-0x89)],this['customDatabaseManager'][_0x78ae68(-0x38,-0x86)]());}[_0x4bcf27(-0x277,-0x259)](_0x352a38,_0x114a7a){function _0x28cad8(_0x581532,_0x4dfb2a){return _0x1e97(_0x581532- -0x2a,_0x4dfb2a);}return this[_0x28cad8(0x170,0xf8)][_0x28cad8(0xee,0x16a)]('/rpc/'+_0x352a38,_0x114a7a);}['schema'](_0x544784){const _0x20d405=new DatabaseClient(this['httpClient'],this['customDatabaseManager']['getWorkspaceId']());_0x20d405[_0x406a6e(0x376,0x334)]=_0x544784;function _0x406a6e(_0x1e443c,_0x36bb69){return _0x1e97(_0x36bb69-0x1ff,_0x1e443c);}return _0x20d405['customDatabaseManager']=this[_0x406a6e(0x3e2,0x3f3)],_0x20d405;}async['detectCustomDatabase'](){return this['customDatabaseManager']['detectCustomDatabase']();}async['testCustomConnection'](_0x47e350){function _0x369a8b(_0x468f80,_0x1e7302){return _0x1e97(_0x468f80- -0x327,_0x1e7302);}return this[_0x369a8b(-0x133,-0xf6)][_0x369a8b(-0x1ec,-0x1d0)](_0x47e350);}async[_0x4bcf27(-0x252,-0x20e)](_0x29c3bb){function _0x736b39(_0xf304a6,_0x120497){return _0x1e97(_0x120497-0x288,_0xf304a6);}return this[_0x736b39(0x414,0x47c)][_0x736b39(0x39d,0x41a)](_0x29c3bb);}async['removeCustomDatabase'](){function _0x5dfafc(_0x4620b0,_0x370bde){return _0x1e97(_0x4620b0- -0x137,_0x370bde);}return this['customDatabaseManager'][_0x5dfafc(-0x38,-0xa6)]();}[_0x4bcf27(-0x2df,-0x30c)](){function _0x419227(_0x31379c,_0x6581eb){return _0x1e97(_0x6581eb-0xb3,_0x31379c);}return this[_0x419227(0x24b,0x2a7)][_0x419227(0x27c,0x21f)]();}['getCustomDatabaseStatus'](){function _0x353d72(_0x50c55a,_0x960305){return _0x1e97(_0x960305- -0x117,_0x50c55a);}return this[_0x353d72(0xb6,0xdd)]['getStatus']();}[_0x4bcf27(-0x20c,-0x18c)](_0x413635){function _0x52ade4(_0x3d363a,_0x1279d8){return _0x1e97(_0x3d363a-0x16e,_0x1279d8);}this[_0x52ade4(0x362,0x344)]['setWorkspaceId'](_0x413635);}async['initialize'](){function _0xfd5419(_0x1a3158,_0x5b5f99){return _0x1e97(_0x1a3158- -0x347,_0x5b5f99);}try{await this[_0xfd5419(-0x153,-0x16b)]['detectCustomDatabase']();}catch(_0x55cd05){console[_0xfd5419(-0x177,-0x15a)]('Failed to initialize custom database detection:',_0x55cd05);}}}class StorageBucket{constructor(_0x330dcf,bucketId){this[_0x22148a(-0xae,-0xc4)]=_0x330dcf;function _0x22148a(_0x53f90b,_0x5a38bb){return _0x1e97(_0x53f90b- -0x248,_0x5a38bb);}this['bucketId']=bucketId;}async[_0x4bcf27(-0x1f6,-0x248)](_0x523823,_0xd3d5d4,_0x1e4e0a){function _0x2e5353(_0x4516a5,_0x5d8009){return _0x1e97(_0x4516a5- -0x1e4,_0x5d8009);}try{const _0x342624=new FormData();if(_0xd3d5d4 instanceof File)_0x342624['append']('file',_0xd3d5d4);else{if(_0xd3d5d4 instanceof Blob)_0x342624[_0x2e5353(0x7,0x26)](_0x2e5353(-0xad,-0x4a),_0xd3d5d4,_0x523823);else{if(_0xd3d5d4 instanceof ArrayBuffer)_0x342624[_0x2e5353(0x7,0x1e)]('file',new Blob([_0xd3d5d4]),_0x523823);else typeof _0xd3d5d4==='string'&&_0x342624['append'](_0x2e5353(-0xad,-0x31),new Blob([_0xd3d5d4],{'type':'text/plain'}),_0x523823);}}_0x342624[_0x2e5353(0x7,0x4a)]('path',_0x523823);_0x1e4e0a?.['cacheControl']&&_0x342624[_0x2e5353(0x7,-0x3a)](_0x2e5353(-0xe6,-0x14a),_0x1e4e0a['cacheControl']);_0x1e4e0a?.[_0x2e5353(-0x9f,-0x112)]&&_0x342624[_0x2e5353(0x7,-0x70)](_0x2e5353(-0x9f,-0x8b),_0x1e4e0a[_0x2e5353(-0x9f,-0x1f)]);_0x1e4e0a?.['metadata']&&_0x342624['append']('metadata',JSON['stringify'](_0x1e4e0a[_0x2e5353(-0x40,-0x1)]));const _0x36820e='/storage/buckets/'+this[_0x2e5353(-0xc9,-0xc8)]+'/files'+(_0x1e4e0a?.[_0x2e5353(0x6,-0x3b)]?'?upsert=true':''),response=await this['httpClient'][_0x2e5353(-0xcc,-0x83)](_0x36820e,_0x342624,{'headers':{'Content-Type':'multipart/form-data'}});return{'data':response[_0x2e5353(-0x60,-0x6)],'error':null};}catch(_0x38ef23){return{'data':null,'error':_0x38ef23 instanceof EBaaSError?_0x38ef23:new EBaaSError(_0x38ef23 instanceof Error?_0x38ef23['message']:'Failed\x20to\x20upload\x20file',0x0,_0x38ef23)};}}async['download'](_0x33a4cd,_0x2fde01){function _0x2f4974(_0x5d3c6e,_0x2d77c4){return _0x1e97(_0x2d77c4- -0x1a6,_0x5d3c6e);}try{const _0xbc512d=new URLSearchParams();_0x2fde01?.['transform']&&Object['entries'](_0x2fde01[_0x2f4974(-0x9e,-0x34)])['forEach'](([_0x401660,_0x3ba7a8])=>{_0x3ba7a8!==undefined&&_0xbc512d['append'](_0x401660,String(_0x3ba7a8));});const _0xacf894='/storage/buckets/'+this[_0x2f4974(-0xb,-0x8b)]+'/files/'+_0x33a4cd+(_0xbc512d['toString']()?'?'+_0xbc512d['toString']():''),response=await this['httpClient']['get'](_0xacf894,{'responseType':'blob'});return{'data':response[_0x2f4974(0x1e,-0x22)],'error':null};}catch(_0x406b14){return{'data':null,'error':_0x406b14 instanceof EBaaSError?_0x406b14:new EBaaSError(_0x406b14 instanceof Error?_0x406b14[_0x2f4974(0x52,0x3f)]:'Failed\x20to\x20download\x20file',0x0,_0x406b14)};}}async[_0x4bcf27(-0x281,-0x2b2)](_0xb8e78a,_0x4d0e91){function _0x296c84(_0x477465,_0x323364){return _0x1e97(_0x477465- -0x35a,_0x323364);}try{const _0x437983=new URLSearchParams();_0xb8e78a&&_0x437983['append'](_0x296c84(-0x22a,-0x234),_0xb8e78a);_0x4d0e91?.['limit']&&_0x437983[_0x296c84(-0x16f,-0x176)](_0x296c84(-0x17e,-0x1d6),String(_0x4d0e91[_0x296c84(-0x17e,-0x1f5)]));_0x4d0e91?.['offset']&&_0x437983[_0x296c84(-0x16f,-0x174)](_0x296c84(-0x20b,-0x289),String(_0x4d0e91['offset']));_0x4d0e91?.[_0x296c84(-0x270,-0x256)]&&_0x437983['append']('sortBy',JSON[_0x296c84(-0x25a,-0x287)](_0x4d0e91['sortBy']));_0x4d0e91?.['search']&&_0x437983['append'](_0x296c84(-0x17f,-0x1d7),_0x4d0e91['search']);const _0x4a0a4f='/storage/buckets/'+this['bucketId']+'/files'+(_0x437983['toString']()?'?'+_0x437983['toString']():''),response=await this['httpClient']['get'](_0x4a0a4f);return{'data':response[_0x296c84(-0x1d6,-0x249)],'error':null};}catch(_0x464cb1){return{'data':null,'error':_0x464cb1 instanceof EBaaSError?_0x464cb1:new EBaaSError(_0x464cb1 instanceof Error?_0x464cb1['message']:_0x296c84(-0x1ea,-0x25a),0x0,_0x464cb1)};}}async['remove'](_0x354792){function _0x7cc89b(_0x52a249,_0xfccdde){return _0x1e97(_0x52a249- -0x30f,_0xfccdde);}try{const response=await this[_0x7cc89b(-0x175,-0xf6)]['delete']('/storage/buckets/'+this[_0x7cc89b(-0x1f4,-0x1e7)]+'/files',{'data':{'paths':_0x354792}});return{'data':response[_0x7cc89b(-0x18b,-0x125)],'error':null};}catch(_0x212b58){return{'data':null,'error':_0x212b58 instanceof EBaaSError?_0x212b58:new EBaaSError(_0x212b58 instanceof Error?_0x212b58[_0x7cc89b(-0x12a,-0x196)]:'Failed\x20to\x20remove\x20files',0x0,_0x212b58)};}}async[_0x4bcf27(-0x1fd,-0x278)](fromPath,_0x16f21d){function _0x1edd8d(_0x8a2b2c,_0x43557f){return _0x1e97(_0x43557f- -0x1b,_0x8a2b2c);}try{const response=await this['httpClient']['post']('/storage/buckets/'+this['bucketId']+_0x1edd8d(0x210,0x1a4),{'sourceKey':fromPath,'destinationKey':_0x16f21d});return{'data':response['data'],'error':null};}catch(_0x5e2101){return{'data':null,'error':_0x5e2101 instanceof EBaaSError?_0x5e2101:new EBaaSError(_0x5e2101 instanceof Error?_0x5e2101['message']:'Failed\x20to\x20move\x20file',0x0,_0x5e2101)};}}async[_0x4bcf27(-0x2a0,-0x261)](fromPath,_0x19c955){function _0x4dd2c6(_0x152434,_0x23afbb){return _0x1e97(_0x152434-0x318,_0x23afbb);}try{const response=await this['httpClient']['post'](_0x4dd2c6(0x48f,0x462)+this[_0x4dd2c6(0x433,0x47e)]+_0x4dd2c6(0x410,0x3ad),{'sourceKey':fromPath,'destinationKey':_0x19c955});return{'data':response[_0x4dd2c6(0x49c,0x500)],'error':null};}catch(_0x4f5bdb){return{'data':null,'error':_0x4f5bdb instanceof EBaaSError?_0x4f5bdb:new EBaaSError(_0x4f5bdb instanceof Error?_0x4f5bdb[_0x4dd2c6(0x4fd,0x504)]:'Failed\x20to\x20copy\x20file',0x0,_0x4f5bdb)};}}async['createSignedUrl'](_0x17dad9,_0xd25562,_0x1d440c){function _0x34c661(_0x5ab250,_0x20862e){return _0x1e97(_0x20862e- -0x3e4,_0x5ab250);}try{const response=await this['httpClient'][_0x34c661(-0x308,-0x2cc)]('/storage/buckets/'+this[_0x34c661(-0x27f,-0x2c9)]+'/files/'+_0x17dad9+'/sign',{'expiresIn':_0xd25562,..._0x1d440c});return{'data':response['data'],'error':null};}catch(_0x203cc3){return{'data':null,'error':_0x203cc3 instanceof EBaaSError?_0x203cc3:new EBaaSError(_0x203cc3 instanceof Error?_0x203cc3[_0x34c661(-0x1b2,-0x1ff)]:_0x34c661(-0x253,-0x28a),0x0,_0x203cc3)};}}[_0x4bcf27(-0x2d5,-0x293)](_0x28adb0,_0x3d696e){const _0x44d7d2=new URLSearchParams();function _0x1f7074(_0x32207e,_0x3417ea){return _0x1e97(_0x3417ea- -0x3de,_0x32207e);}_0x3d696e?.[_0x1f7074(-0x28c,-0x26c)]&&Object[_0x1f7074(-0x236,-0x29d)](_0x3d696e[_0x1f7074(-0x29c,-0x26c)])['forEach'](([_0x271e49,_0x9c9382])=>{function _0x33afe0(_0x16351a,_0x50dc98){return _0x1e97(_0x16351a- -0x309,_0x50dc98);}_0x9c9382!==undefined&&_0x44d7d2[_0x33afe0(-0x11e,-0xf1)](_0x271e49,String(_0x9c9382));});const _0x11218a=this[_0x1f7074(-0x216,-0x244)]['baseURL']||'',_0x5a66a6=_0x11218a+'/storage/buckets/'+this['bucketId']+'/files/'+_0x28adb0+(_0x44d7d2['toString']()?'?'+_0x44d7d2['toString']():'');return{'data':{'publicUrl':_0x5a66a6}};}async[_0x4bcf27(-0x2ab,-0x2a2)](_0x2bb478){function _0x21f384(_0x15e52f,_0x574386){return _0x1e97(_0x15e52f- -0x29b,_0x574386);}try{const response=await this[_0x21f384(-0x101,-0xce)]['get']('/storage/buckets/'+this['bucketId']+_0x21f384(-0x12d,-0xd6)+_0x2bb478+_0x21f384(-0x1ab,-0x123));return{'data':response['data'],'error':null};}catch(_0x4946aa){return{'data':null,'error':_0x4946aa instanceof EBaaSError?_0x4946aa:new EBaaSError(_0x4946aa instanceof Error?_0x4946aa['message']:_0x21f384(-0xf5,-0x17d),0x0,_0x4946aa)};}}async['updateFileMetadata'](_0x3a4540,metadata){function _0x469047(_0x2316c5,_0x369d1d){return _0x1e97(_0x369d1d- -0x3db,_0x2316c5);}try{const response=await this['httpClient']['put'](_0x469047(-0x25b,-0x264)+this['bucketId']+'/files/'+_0x3a4540+'/metadata',{'metadata':metadata});return{'data':response['data'],'error':null};}catch(_0x142d0f){return{'data':null,'error':_0x142d0f instanceof EBaaSError?_0x142d0f:new EBaaSError(_0x142d0f instanceof Error?_0x142d0f[_0x469047(-0x19b,-0x1f6)]:_0x469047(-0x2bc,-0x2c7),0x0,_0x142d0f)};}}}class StorageClient{constructor(_0x70bc8){function _0x34ecf5(_0x513893,_0x5813cb){return _0x1e97(_0x513893-0x3b4,_0x5813cb);}this[_0x34ecf5(0x54e,0x58a)]=_0x70bc8;}[_0x4bcf27(-0x23f,-0x284)](bucketId){function _0x444113(_0x797eef,_0x1c7e5e){return _0x1e97(_0x1c7e5e- -0x24f,_0x797eef);}return new StorageBucket(this[_0x444113(-0x123,-0xb5)],bucketId);}async['createBucket'](_0x1f7f90,_0xa57d4a){function _0x44d64a(_0x411cdc,_0x3f9b84){return _0x1e97(_0x3f9b84-0x3b5,_0x411cdc);}try{const response=await this[_0x44d64a(0x571,0x54f)][_0x44d64a(0x4ae,0x4cd)]('/storage/buckets',{'id':_0x1f7f90,..._0xa57d4a});return{'data':response['data'],'error':null};}catch(_0x41e3b7){return{'data':null,'error':_0x41e3b7 instanceof EBaaSError?_0x41e3b7:new EBaaSError(_0x41e3b7 instanceof Error?_0x41e3b7['message']:'Failed\x20to\x20create\x20bucket',0x0,_0x41e3b7)};}}async[_0x4bcf27(-0x22b,-0x24c)](_0x3e187b){function _0x3f1f5e(_0x4dd790,_0x5f5840){return _0x1e97(_0x5f5840-0x2f1,_0x4dd790);}try{const response=await this[_0x3f1f5e(0x480,0x48b)]['get'](_0x3f1f5e(0x46b,0x468)+_0x3e187b);return{'data':response[_0x3f1f5e(0x49a,0x475)],'error':null};}catch(_0x2652d4){return{'data':null,'error':_0x2652d4 instanceof EBaaSError?_0x2652d4:new EBaaSError(_0x2652d4 instanceof Error?_0x2652d4[_0x3f1f5e(0x508,0x4d6)]:_0x3f1f5e(0x3e5,0x3e7),0x0,_0x2652d4)};}}async['listBuckets'](){function _0x1f089e(_0x497e73,_0x378fbd){return _0x1e97(_0x497e73-0x33f,_0x378fbd);}try{const response=await this['httpClient'][_0x1f089e(0x51f,0x555)]('/storage/buckets');return{'data':response[_0x1f089e(0x4c3,0x512)],'error':null};}catch(_0x497f8c){return{'data':null,'error':_0x497f8c instanceof EBaaSError?_0x497f8c:new EBaaSError(_0x497f8c instanceof Error?_0x497f8c[_0x1f089e(0x524,0x4c8)]:_0x1f089e(0x530,0x56f),0x0,_0x497f8c)};}}async['updateBucket'](_0x4c2855,_0xa9d043){function _0xb2df81(_0x575e96,_0x21010a){return _0x1e97(_0x21010a-0x206,_0x575e96);}try{const response=await this['httpClient'][_0xb2df81(0x418,0x3a2)]('/storage/buckets/'+_0x4c2855,_0xa9d043);return{'data':response[_0xb2df81(0x3c2,0x38a)],'error':null};}catch(_0x7026c3){return{'data':null,'error':_0x7026c3 instanceof EBaaSError?_0x7026c3:new EBaaSError(_0x7026c3 instanceof Error?_0x7026c3[_0xb2df81(0x46a,0x3eb)]:'Failed\x20to\x20update\x20bucket',0x0,_0x7026c3)};}}async['deleteBucket'](_0x532e34){function _0xc55dae(_0x124c0b,_0x13be33){return _0x1e97(_0x124c0b-0x336,_0x13be33);}try{const response=await this[_0xc55dae(0x4d0,0x517)]['delete'](_0xc55dae(0x4ad,0x446)+_0x532e34);return{'data':response['data'],'error':null};}catch(_0x3deb7e){return{'data':null,'error':_0x3deb7e instanceof EBaaSError?_0x3deb7e:new EBaaSError(_0x3deb7e instanceof Error?_0x3deb7e[_0xc55dae(0x51b,0x4ee)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x3deb7e)};}}async['getUsage'](){function _0x5e5742(_0x3eeaf3,_0x1c9107){return _0x1e97(_0x3eeaf3-0x204,_0x1c9107);}try{const response=await this['httpClient']['get']('/storage/usage');return{'data':response[_0x5e5742(0x388,0x3ac)],'error':null};}catch(_0x1f2905){return{'data':null,'error':_0x1f2905 instanceof EBaaSError?_0x1f2905:new EBaaSError(_0x1f2905 instanceof Error?_0x1f2905[_0x5e5742(0x3e9,0x460)]:'Failed\x20to\x20get\x20storage\x20usage',0x0,_0x1f2905)};}}}function _0x5df5(){const _0x43cb85=['BM9Kzq','zxjYB3i','DxbKyxrLt3b0Aw9UCW','zxHLy3v0zvf1zxj5','ChjLzMvY','yM9KEq','AM9PBMvK','ChvZAa','AgfZq3vZDg9Trgf0ywjHC2u','CNbJ','l2zPBgvZlW','Bwf4uMvJB25Uzwn0qxr0zw1WDhm','rMfPBgvKihrVigXPC3qGzMLSzxm','C2vUza','DhjHBNnMB3jT','Cg9ZDgDYzxneyxrHyMfZzq','z2v0twv0CMLJCW','CMfUzg9T','Cg9YDa','l3n0B3jHz2uVyNvJA2v0CY8','Cg9ZDgDYzxnFy2HHBMDLCW','B25qB3n0z3jLC0nOyw5Nzxm','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','CxvLCNK','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','x3jLAM9PBG','CMvTB3zLq2HHBM5LBa','mZa0mta1nwfLDgTiCa','ChvIBgLJ','z2v0u2vZC2LVBG','zxjYB3jLza','ndu3mti1sM10wvjv','zgf0yq','C3vIC2nYAxb0Aw9UCW','Ec10B3rHBc1JB3vUDa','yxnJzw5KAw5N','zxHLy3v0zq','ms4XlJG','y3jLzgvUDgLHBhm','Dw5ZDwjZy3jPyMu','z3rL','l2f1DgGVDJeVC2rRl3nPz25PBG','C3rHDgu','y29TBw9U','y29UBMvJDgLUzW','Cg9ZDgDYzxnFy2HHBMDLCZO','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','CMvHBhrPBwu','y2HHBM5LBa','l2f1DgGVDJeVC2LNBM91Da','C3rHy2S','mta3mLPSA2LKvq','y29UBMvJDf9LCNjVCG','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','Ahr0CenSAwvUDa','DxbKyxrL','Chv0','CMvJB25Uzwn0','CgfYC2u','z2XVyMfS','zMLSDgvYCW','Bgv2zwW','C2vZC2LVBG','CMvMCMvZAf90B2TLBG','Bwv0ywrHDge','zNjVBq','rMfPBgvKihrVigDLDcbMAwXLigLUzM8','zxzLBNrZ','DxbKyxrLvxnLCG','C2v0qxv0AfrVA2vU','x2PVAw4','Bg9HzfnLC3nPB24','CgvYAw9K','p29WzxjHDgLVBJ11ChnLCNq','Aw1WB3j0twfW','AxndB25Uzwn0zwq','AM9PBG','AwXPA2u','zgv0zwn0zwrdB25MAwC','z2v0twf4tgLZDgvUzxjZ','B3b0Aw9UCW','y29Kzq','DMfSDwvZ','Cg9ZDgDYzxnty2HLBwe','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','z2v0qNvJA2v0','mtqWnZntzhHezvi','CMvHy3qTBMf0AxzL','DxnLCG','DMvYAwz5','Aw5PDgLHBgL6zq','l2zPBgvZl21VDMu','zgv0ywLSCW','B3bLCMf0B3i','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','zw1PDa','AgfUzgXLqxv0AevYCM9Y','y29SDw1U','C3rHDhvZ','Bg9N','AgfUzgXLrxjYB3i','lMfZyW','y2fWDhvYzvn0ywnRvhjHy2u','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','C2v0','igf0DgvTChrZoIa','C2LNBK91Da','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','D2fYBG','DgLTzw91Da','rMfPBgvKihrVihrLC3qGy29UBMvJDgLVBG','u29JA2v0lMLVlwnSAwvUDcbUW6nVigvZDmoHigrPC3bVBSoTDMvSlIbqyxjHifjLywn0ie5HDgL2zsWGAw5ZDgfSztOGBNbTigLUC3rHBgWGC29JA2v0lMLVlwnSAwvUDa','zgf0yufYCMf5','B2zM','mJbXsvD5wwm','DxnL','C2v0v29YA3nWywnLswq','C3nSrw5HyMXLza','B3bLCMf0Aw9U','C2vHCMnO','BgLTAxq','AgvHzgvYCW','l21LDhjPy3m','z2v0tg9NCW','z2v0','rujHyvnfCNjVCG','y2XVC2vK','CMvWBgfJzq','C2L6zq','BwvZC2fNzq','C2nOzw1H','Bw92zq','y29UDgfPBNm','BMfTzq','DxbZzxj0','yxbWzw5K','zwjHyxmUyxv0Ac5ZzxnZAw9U','BgvHDMLUzW','DxbSB2fK','BMvX','C2v0sxrLBq','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','C2v0u2vZC2LVBKLUDgvYBMfS','BgvHDMu','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','BgLZDgvUzxjZ','zgLZy29UBMvJDa','DhjHy2S','z2v0u3rHDhvZ','zgvSzxrL','BwfRzvjLzG','C29YDej5','AM9PBMvKt25Jzq','AgfZ','Dw50CMfJAW','mZK1otvVDe11y3O','BwfW','l2LUzM8','zgvMyxvSDhm','yNjVywrJyxn0','mte3mMfXsu5Tta','Aw5KzxGUDhm','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','rMfPBgvKihrVigDLDcbIDwnRzxq','D29YA3nWywnLswq','l2zPBgvZl2nVChK','BgLRzq','B25dB25Uzwn0Aw9Uu3rHDgvdAgfUz2u','yNvJA2v0','C3rYAw5N','ntyYoen5q1jAzW','y2fJAgvdB250CM9S','CMvTB3zLq3vZDg9Trgf0ywjHC2u','C3rYAw5NAwz5','C29JA2v0lMLVlwnSAwvUDcbUB3qGyxzHAwXHyMXL','y2XPzw50','y29UzMLN','mJaZnZm1mg5vD0HmDW','AxnvC2LUz0n1C3rVBurHDgfIyxnL','CMvTB3zLqxv0AfrVA2vU','zgvWBg95','AM9PBMLUzW','BgvUz3rO','y29UBMvJDa','u29JA2v0lMLVlwnSAwvUDcbUW6nVigvZDmoHigrPC3bVBSoTDMvSig5LC3rLigfTyMLLBNrLlIbqyxjHihvZyxiGzNvUy2LVBMfSAwrHzgvZigrLihjLywX0Aw1LlcbPBNn0ywXLoIbUCg0GAw5ZDgfSBcbZB2nRzxqUAw8Ty2XPzw50','CMvZB2X2zq','DxjS','Aw52B2TL','z2v0uhvIBgLJvxjS','mJrht3jzu2K','z2v0q2HHBM5LBhm','DMvYC2LVBNm','Cg9ZDgDYzxniB3n0','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','uhjLzMvY','Aw50zxjJzxb0B3jZ','Dgv4Dc9WBgfPBG','Cg9ZDa','BxvSDgLWyxj0l2zVCM0Tzgf0yq','l3nKAY92ms8','yNvJA2v0swq','yxbPs2v5','Dg9ku09o','y29UBMvJDgvK','AgvHCNrIzwf0sw50zxj2ywW','CMvQzwn0','Dw5KzwzPBMvK','z2v0rgv0zwn0zwrdB25MAwC','Dg9WAwm','CMvZCg9UC2u','zw50CNLWB2LUDa','zgLZy29UBMvJDgvK','DxbKyxrLrw52','l2f1DgGVDJeVCMvMCMvZAa','Dg9tDhjPBMC','Bwf4tgLZDgvUzxjZ','l2XVz3m','C2v0DxbjBNrLCMnLChrVCNm','B3jKzxi','Ag9ZDa','y2HHBM5LBhm','ChjLzML4','C3rHCNrZv2L0Aa','zM9YrwfJAa','B25Jzq','l2z1BMn0Aw9UCY92ms8','y3vYCMvUDfnJAgvTyq','mta4nNLfzwHuBW','zMLSzq','z2v0v29YA3nWywnLswq','z2v0rMLSzuLUzM8','zgf0ywjHC2u','DgvZDenVBM5Ly3rPB24','C29JA2v0lMLVlwnSAwvUDa','yNjVywrJyxn0oG','zw52','y2XLyxi','z2v0vxnLCG','zw50CMLLCW','DgfIBgu','C2vSzwn0','y29WEq','y29UDgvUDfr5Cgu','Cg9ZDgDYzxnqB3j0','CMfUz2u','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','y29UBMvJDgLVBLn0yxrL','y3vYCMvUDfnLC3nPB24','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','C29JA2v0qwrHChrLCG','mtCYnZGZotnlzNbQv3u','B2zMC2v0','C2v0u2vZC2LVBG','ChjLC2vUy2u6','Cgf0y2G','ChjLCgvUzeXPC3rLBMvY','yMfZzvvsta','CMf3tgLZDgvUzxjZ','C29JA2v0','lMrLC2m','x3nLDfn0yxrL','ChjLC2vUy2u','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','zxzLBNq','p29WzxjHDgLVBJ1ZzwXLy3q','y2XLyxjtzxnZAw9U','C29JA2v0t3b0Aw9UCW','ChjLCgvUze9Uy2vmAxn0zw5LCG','AxnezwXLDgu','x3rYAwDNzxi','u1vcu0nssujfra','BgLZDa'];_0x5df5=function(){return _0x43cb85;};return _0x5df5();}function _0x1e97(_0x1256b1,_0x3bacd6){const _0x5df500=_0x5df5();return _0x1e97=function(_0x1e9716,_0x4589a7){_0x1e9716=_0x1e9716-0xe5;let _0x177aed=_0x5df500[_0x1e9716];if(_0x1e97['JRHTFw']===undefined){var _0x693b3f=function(_0x10db32){const _0x1fb62e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x481f57='',_0xe911a0='';for(let _0x26cd03=0x0,_0x12d93d,_0x12c9e4,_0x52f10c=0x0;_0x12c9e4=_0x10db32['charAt'](_0x52f10c++);~_0x12c9e4&&(_0x12d93d=_0x26cd03%0x4?_0x12d93d*0x40+_0x12c9e4:_0x12c9e4,_0x26cd03++%0x4)?_0x481f57+=String['fromCharCode'](0xff&_0x12d93d>>(-0x2*_0x26cd03&0x6)):0x0){_0x12c9e4=_0x1fb62e['indexOf'](_0x12c9e4);}for(let _0x4655aa=0x0,_0x5c1c4e=_0x481f57['length'];_0x4655aa<_0x5c1c4e;_0x4655aa++){_0xe911a0+='%'+('00'+_0x481f57['charCodeAt'](_0x4655aa)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xe911a0);};_0x1e97['edwsyl']=_0x693b3f,_0x1256b1=arguments,_0x1e97['JRHTFw']=!![];}const _0x12bbe6=_0x5df500[0x0],_0x258443=_0x1e9716+_0x12bbe6,_0x507cff=_0x1256b1[_0x258443];return!_0x507cff?(_0x177aed=_0x1e97['edwsyl'](_0x177aed),_0x1256b1[_0x258443]=_0x177aed):_0x177aed=_0x507cff,_0x177aed;},_0x1e97(_0x1256b1,_0x3bacd6);}class EventManager{constructor(){function _0x27ba21(_0x21af30,_0x10b2a2){return _0x1e97(_0x10b2a2- -0x2a2,_0x21af30);}this['events']=new Map(),this[_0x27ba21(-0x1e0,-0x178)]=0xa;}['on'](_0x2614f8,_0x49f56f){!this[_0xe8db23(-0x87,-0xb3)][_0xe8db23(-0x10d,-0x16e)](_0x2614f8)&&this['events'][_0xe8db23(-0x110,-0x8e)](_0x2614f8,new Set());function _0xe8db23(_0x5478d6,_0x1a16db){return _0x1e97(_0x1a16db- -0x25a,_0x5478d6);}this[_0xe8db23(-0x48,-0xb3)][_0xe8db23(-0x60,-0x7a)](_0x2614f8)['add'](_0x49f56f);}[_0x4bcf27(-0x20f,-0x258)](_0x3302a0,_0x3fcdd9){if(!this[_0x641eba(0x2e6,0x28d)][_0x641eba(0x1d7,0x1d2)](_0x3302a0))return;function _0x641eba(_0xd142be,_0x546948){return _0x1e97(_0x546948-0xe6,_0xd142be);}const _0x79106f=this['events']['get'](_0x3302a0);_0x3fcdd9?_0x79106f[_0x641eba(0x181,0x1ce)](_0x3fcdd9):_0x79106f[_0x641eba(0x294,0x225)](),_0x79106f[_0x641eba(0x26a,0x2ca)]===0x0&&this[_0x641eba(0x252,0x28d)][_0x641eba(0x1ac,0x1ce)](_0x3302a0);}['emit'](_0x4c007c,..._0x5bc328){if(!this[_0x5c7383(0x23f,0x2c3)][_0x5c7383(0x18b,0x208)](_0x4c007c))return![];function _0x5c7383(_0x2c051a,_0x45ecd4){return _0x1e97(_0x45ecd4-0x11c,_0x2c051a);}const _0x22e2a8=this['events'][_0x5c7383(0x2d5,0x2fc)](_0x4c007c);for(const _0x533c1b of _0x22e2a8){try{_0x533c1b(..._0x5bc328);}catch(_0x2601c8){console[_0x5c7383(0x22c,0x281)]('Error\x20in\x20event\x20listener\x20for\x20\x22'+_0x4c007c+'\x22:',_0x2601c8);}}return _0x22e2a8['size']>0x0;}['removeAllListeners'](_0x8d5bb3){_0x8d5bb3?this['events']['delete'](_0x8d5bb3):this['events']['clear']();}['listenerCount'](_0x186569){function _0x489464(_0xe6de31,_0x1389b1){return _0x1e97(_0xe6de31- -0x393,_0x1389b1);}return this[_0x489464(-0x1ec,-0x164)]['get'](_0x186569)?.['size']??0x0;}['eventNames'](){function _0x4dfbdb(_0x252b29,_0x34a3cb){return _0x1e97(_0x252b29- -0x21,_0x34a3cb);}return Array['from'](this[_0x4dfbdb(0x186,0x1a6)]['keys']());}[_0x4bcf27(-0x1ef,-0x249)](_0x18f594){function _0x20060a(_0x55c6b8,_0x53d536){return _0x1e97(_0x53d536-0x2af,_0x55c6b8);}return Array['from'](this['events'][_0x20060a(0x406,0x48f)](_0x18f594)??[]);}['addListener'](_0xa10ef2,_0x173863){this['on'](_0xa10ef2,_0x173863);}['removeListener'](_0x59bd16,_0x4fddf8){function _0x1f7f72(_0x5ce929,_0x18ee55){return _0x1e97(_0x18ee55-0x124,_0x5ce929);}this[_0x1f7f72(0x296,0x2f9)](_0x59bd16,_0x4fddf8);}[_0x4bcf27(-0x2b1,-0x321)](_0x5ca79b,_0x10176d){const _0xb39156=(..._0x298c12)=>{this['off'](_0x5ca79b,_0xb39156),_0x10176d(..._0x298c12);};this['on'](_0x5ca79b,_0xb39156);}[_0x4bcf27(-0x291,-0x283)](_0x11344a,_0x2c68a0){this['on'](_0x11344a,_0x2c68a0);}[_0x4bcf27(-0x285,-0x291)](_0x18d7ac,_0x360d16){const _0x2fc9cd=(..._0xbe3615)=>{this[_0x56995f(-0x72,-0xb3)](_0x18d7ac,_0x2fc9cd);function _0x56995f(_0x598a6e,_0x4d4a94){return _0x1e97(_0x4d4a94- -0x288,_0x598a6e);}_0x360d16(..._0xbe3615);};this['on'](_0x18d7ac,_0x2fc9cd);}['setMaxListeners'](_0x4d87e0){return this['maxListeners']=_0x4d87e0,this;}[_0x4bcf27(-0x231,-0x285)](){return this['maxListeners'];}[_0x4bcf27(-0x28f,-0x305)](_0x43f66a){function _0x3799bc(_0x5d690e,_0x3e5e97){return _0x1e97(_0x5d690e-0x173,_0x3e5e97);}return this[_0x3799bc(0x368,0x348)](_0x43f66a);}}class RealtimeChannel extends EventManager{constructor(_0x7adbd2,_0x5b14c9){super(),this['joinedOnce']=![],this['state']=_0x35fc1f(-0xcc,-0xab),this[_0x35fc1f(-0x129,-0x113)]=new Map(),this[_0x35fc1f(-0x18b,-0x1e3)]=_0x7adbd2;function _0x35fc1f(_0x2f1049,_0x123a31){return _0x1e97(_0x2f1049- -0x2ae,_0x123a31);}this['socket']=_0x5b14c9;}['subscribe'](_0x2d1d78){!this[_0x8ed3b6(-0x231,-0x253)]&&(this[_0x8ed3b6(-0x231,-0x296)]=!![],this['_join']());_0x2d1d78&&this['on']('status',_0x2d1d78);function _0x8ed3b6(_0x8dbf7c,_0x5662cc){return _0x1e97(_0x8dbf7c- -0x31c,_0x5662cc);}return this;}[_0x4bcf27(-0x26b,-0x249)](filter,_0x2f09d0){const _0x40dd05=_0x155c6b(0x2e3,0x296)+JSON[_0x155c6b(0x252,0x1e7)](filter);this['on'](_0x40dd05,_0x2f09d0);const _0x553830={'unsubscribe':()=>{function _0x5a01cc(_0x1ffa14,_0x34d8de){return _0x1e97(_0x34d8de- -0x1b0,_0x1ffa14);}this[_0x5a01cc(0x9f,0x25)](_0x40dd05,_0x2f09d0),this[_0x5a01cc(0x26,-0x2b)]['delete'](_0x40dd05);}};function _0x155c6b(_0x27287b,_0xa57598){return _0x1e97(_0x27287b-0x152,_0xa57598);}return this[_0x155c6b(0x2d7,0x339)][_0x155c6b(0x31e,0x36c)](_0x40dd05,_0x553830),this[_0x155c6b(0x2a8,0x28b)]?.[_0x155c6b(0x270,0x2c5)]&&this['state']===_0x155c6b(0x2bc,0x317)&&this['socket'][_0x155c6b(0x315,0x330)]('subscribe_postgres_changes',{'topic':this[_0x155c6b(0x275,0x29b)],'filter':filter,'ref':this['makeRef']()}),_0x553830;}['onBroadcast'](filter,_0x44a58d){const _0x2e7e1a=_0x5b5215(-0x135,-0xcd)+JSON[_0x5b5215(-0x14b,-0x10a)](filter);function _0x5b5215(_0x1c1541,_0x50a384){return _0x1e97(_0x50a384- -0x20a,_0x1c1541);}this['on'](_0x2e7e1a,_0x44a58d);const _0x33b839={'unsubscribe':()=>{this['off'](_0x2e7e1a,_0x44a58d);function _0x3fcf54(_0x802571,_0x453896){return _0x1e97(_0x453896- -0x224,_0x802571);}this['subscriptions'][_0x3fcf54(-0x14d,-0x13c)](_0x2e7e1a);}};return this['subscriptions'][_0x5b5215(-0x5e,-0x3e)](_0x2e7e1a,_0x33b839),_0x33b839;}['onPresence'](filter,_0x100f51){const _0xa6fdf3=_0xf0ae25(0x239,0x24f)+JSON[_0xf0ae25(0x1b6,0x1fe)](filter);this['on'](_0xa6fdf3,_0x100f51);const _0x15c269={'unsubscribe':()=>{this[_0x49396d(0x28b,0x27d)](_0xa6fdf3,_0x100f51);function _0x49396d(_0x382524,_0x3432fb){return _0x1e97(_0x3432fb-0xa8,_0x382524);}this['subscriptions'][_0x49396d(0x1a4,0x190)](_0xa6fdf3);}};this['subscriptions']['set'](_0xa6fdf3,_0x15c269);function _0xf0ae25(_0x312be0,_0x48aeb5){return _0x1e97(_0x48aeb5-0xfe,_0x312be0);}return _0x15c269;}[_0x4bcf27(-0x273,-0x29a)](_0x4c37ba){return new Promise(_0x53992f=>{function _0x1de3e1(_0x19b39e,_0x41cadc){return _0x1e97(_0x41cadc-0x101,_0x19b39e);}this[_0x1de3e1(0x25f,0x257)]?.[_0x1de3e1(0x25b,0x21f)]&&this['state']==='joined'?(this[_0x1de3e1(0x2c4,0x257)][_0x1de3e1(0x336,0x2c4)]('broadcast',{'topic':this[_0x1de3e1(0x2a1,0x224)],'event':_0x4c37ba[_0x1de3e1(0x243,0x25c)],'payload':_0x4c37ba,'ref':this['makeRef']()}),_0x53992f('ok')):_0x53992f('error');});}[_0x4bcf27(-0x2fe,-0x284)](_0x5750d2){return new Promise(_0x3d4669=>{function _0x31f720(_0x1ab698,_0x310ac0){return _0x1e97(_0x310ac0- -0x2b4,_0x1ab698);}this[_0x31f720(-0x11f,-0x15e)]?.[_0x31f720(-0x198,-0x196)]&&this[_0x31f720(-0x18e,-0x126)]==='joined'?(this[_0x31f720(-0x1da,-0x15e)][_0x31f720(-0xb0,-0xf1)]('presence',{'topic':this['topic'],'event':'track','payload':_0x5750d2,'ref':this['makeRef']()}),_0x3d4669('ok')):_0x3d4669('error');});}[_0x4bcf27(-0x2f7,-0x334)](){return new Promise(_0x5a3f49=>{function _0x1fac05(_0x5b5958,_0x386849){return _0x1e97(_0x386849-0x139,_0x5b5958);}this[_0x1fac05(0x2b8,0x28f)]?.['connected']&&this['state']===_0x1fac05(0x311,0x2a3)?(this[_0x1fac05(0x2a9,0x28f)][_0x1fac05(0x2c4,0x2fc)](_0x1fac05(0x2ca,0x292),{'topic':this['topic'],'event':_0x1fac05(0x290,0x226),'ref':this[_0x1fac05(0x292,0x222)]()}),_0x5a3f49('ok')):_0x5a3f49('error');});}[_0x4bcf27(-0x259,-0x26e)](){return new Promise(_0x3f9676=>{this[_0x4bc7dd(-0x1ca,-0x19c)]='leaving',this['subscriptions']['forEach'](_0x12ee5c=>{function _0x345cf6(_0x2dcd2e,_0x171e9a){return _0x1e97(_0x171e9a- -0x234,_0x2dcd2e);}_0x12ee5c[_0x345cf6(-0xd7,-0xa9)]();}),this[_0x4bc7dd(-0x219,-0x1a5)]['clear']();this['socket']?.[_0x4bc7dd(-0x227,-0x20c)]&&this['socket'][_0x4bc7dd(-0x155,-0x167)](_0x4bc7dd(-0x1b1,-0x137),{'topic':this['topic'],'ref':this['makeRef']()});this[_0x4bc7dd(-0x1d6,-0x19c)]=_0x4bc7dd(-0x195,-0x148);function _0x4bc7dd(_0x30023f,_0x30f2b6){return _0x1e97(_0x30f2b6- -0x32a,_0x30023f);}this['removeAllListeners'](),_0x3f9676('ok');});}[_0x4bcf27(-0x23a,-0x2a9)](){function _0x28c461(_0xbd634f,_0x292e28){return _0x1e97(_0xbd634f-0x42,_0x292e28);}if(this['state']===_0x28c461(0x22f,0x200))return;this['state']='joining',this[_0x28c461(0x198,0x18f)]?.[_0x28c461(0x160,0x149)]&&(this['socket']['emit'](_0x28c461(0x1f2,0x1dd),{'topic':this['topic'],'ref':this['makeRef']()}),setTimeout(()=>{function _0x49332e(_0x5e8a2a,_0x55a25c){return _0x1e97(_0x5e8a2a-0x324,_0x55a25c);}this['state']===_0x49332e(0x42c,0x3e1)&&(this['state']='joined',this['emit'](_0x49332e(0x4ea,0x480),_0x49332e(0x486,0x45a)));},0x64));}[_0x4bcf27(-0x267,-0x2ca)](){function _0x55d38e(_0x282c6e,_0x508d9c){return _0x1e97(_0x508d9c- -0x1b9,_0x282c6e);}this['joinedOnce']&&(this[_0x55d38e(-0x47,-0xf)](),this['subscriptions']['forEach']((_0x3f93bf,_0x1a901e)=>{function _0x3252bf(_0x4b5e4b,_0x3b4069){return _0x1e97(_0x3b4069- -0x16f,_0x4b5e4b);}if(_0x1a901e[_0x3252bf(-0x85,-0x3e)]('postgres_changes:')){const filter=JSON[_0x3252bf(0xe,0x2f)](_0x1a901e[_0x3252bf(0x13,0x74)](_0x3252bf(-0x47,0x22),''));this[_0x3252bf(0x52,-0x19)]?.['emit'](_0x3252bf(-0x9,0x53),{'topic':this['topic'],'filter':filter,'ref':this[_0x3252bf(-0xd,-0x86)]()});}}));}['_trigger'](_0x31b1bd,_0x4f43ee){if(_0x31b1bd===_0x54f34c(-0x1e5,-0x26a)){const _0x3ccf5f=_0x54f34c(-0x1ed,-0x251)+JSON[_0x54f34c(-0x268,-0x2e2)](_0x4f43ee['filter']||{});this['emit'](_0x3ccf5f,_0x4f43ee);}else{if(_0x31b1bd==='broadcast'){const _0x25dd41='broadcast:'+JSON['stringify']({'event':_0x4f43ee[_0x54f34c(-0x264,-0x287)]});this[_0x54f34c(-0x1fc,-0x21f)](_0x25dd41,_0x4f43ee);}else{if(_0x31b1bd==='presence'){const _0xead4f3=_0x54f34c(-0x294,-0x291)+JSON[_0x54f34c(-0x342,-0x2e2)]({'event':_0x4f43ee['event']});this[_0x54f34c(-0x20f,-0x21f)](_0xead4f3,_0x4f43ee);}}}function _0x54f34c(_0x565d9d,_0x229b29){return _0x1e97(_0x229b29- -0x3e2,_0x565d9d);}this[_0x54f34c(-0x197,-0x21f)](_0x31b1bd,_0x4f43ee);}[_0x4bcf27(-0x28c,-0x312)](_0x196b5b){this['state']=_0x196b5b;let status;function _0x20c606(_0x56480d,_0x3b5c05){return _0x1e97(_0x56480d-0x332,_0x3b5c05);}switch(_0x196b5b){case _0x20c606(0x49c,0x420):status='SUBSCRIBED';break;case _0x20c606(0x4b4,0x4df):status='CHANNEL_ERROR';break;case _0x20c606(0x514,0x4a1):status='CLOSED';break;default:return;}this[_0x20c606(0x4f5,0x4e2)]('status',status);}[_0x4bcf27(-0x2fb,-0x298)](){function _0x1dd50c(_0x738616,_0x33c612){return _0x1e97(_0x33c612- -0xd2,_0x738616);}return Math[_0x1dd50c(0x2c,0xa3)]()['toString'](0x24)['substring'](0x2,0xf);}['getState'](){function _0x408744(_0x22c408,_0x3dde82){return _0x1e97(_0x3dde82-0x352,_0x22c408);}return this[_0x408744(0x45e,0x4e0)];}}function getEnvironment(){if(typeof navigator!==_0x251394(0x45f,0x4bf)&&navigator['product']==='ReactNative')return _0x251394(0x527,0x559);if(typeof window!=='undefined'&&typeof document!==_0x251394(0x48e,0x4bf))return'browser';function _0x251394(_0x353a1b,_0x44a729){return _0x1e97(_0x44a729-0x39e,_0x353a1b);}if(typeof global!==_0x251394(0x451,0x4bf)&&typeof process!==_0x251394(0x44c,0x4bf)&&process[_0x251394(0x49c,0x4b0)]?.[_0x251394(0x499,0x502)])return'node';return'browser';}function isSocketIOAvailable(){function _0x40aaeb(_0x16d91c,_0x1878ae){return _0x1e97(_0x1878ae-0x1c5,_0x16d91c);}try{const _0x9d98a2=getEnvironment();switch(_0x9d98a2){case _0x40aaeb(0x32b,0x329):return typeof require!=='undefined'&&require[_0x40aaeb(0x2ae,0x2d1)]&&!!require[_0x40aaeb(0x350,0x2d1)]('socket.io-client');case'browser':if(typeof globalThis!==_0x40aaeb(0x369,0x2e6)&&'io'in globalThis)return!![];return typeof require!=='undefined'&&require[_0x40aaeb(0x2c6,0x2d1)]&&!!require[_0x40aaeb(0x272,0x2d1)]('socket.io-client');case'react-native':try{return typeof require!==_0x40aaeb(0x29b,0x2e6)&&!!require('socket.io-client');}catch{return![];}default:return![];}}catch{return![];}}function getSocketIO(){function _0x11f852(_0x998979,_0x200792){return _0x1e97(_0x200792- -0xb9,_0x998979);}try{if(typeof require!==_0x11f852(0xc2,0x68))return require(_0x11f852(0x1c,0x83));if(typeof globalThis!==_0x11f852(0x62,0x68)&&'io'in globalThis)return{'io':globalThis['io']};throw new Error(_0x11f852(0x62,0x48));}catch(_0x3eaef7){throw new Error(_0x11f852(0xae,0x52));}}class WebSocketAdapter{constructor(){function _0x35a3a2(_0x5c1353,_0x2e45cf){return _0x1e97(_0x5c1353-0x21a,_0x2e45cf);}this[_0x35a3a2(0x370,0x3b9)]=null;}async['connect'](_0x453c16,_0x2da356){if(!isSocketIOAvailable())throw new Error('Socket.io-client não está disponível. Para usar funcionalidades de realtime, instale: npm install socket.io-client');const {io:_0x54dafb}=getSocketIO();return new Promise((_0x1b5cb3,_0x54002c)=>{function _0x3b8def(_0x46c47b,_0xa71522){return _0x1e97(_0xa71522-0x2b4,_0x46c47b);}this[_0x3b8def(0x402,0x40a)]=_0x54dafb(_0x453c16,_0x2da356),this[_0x3b8def(0x3a3,0x40a)]['on'](_0x3b8def(0x38a,0x3be),()=>_0x1b5cb3()),this['socket']['on']('connect_error',_0x36087a=>_0x54002c(_0x36087a));});}[_0x4bcf27(-0x2ff,-0x2d9)](){function _0x1c199e(_0x168844,_0x59db92){return _0x1e97(_0x59db92-0xdf,_0x168844);}this[_0x1c199e(0x20e,0x235)]&&(this['socket'][_0x1c199e(0x223,0x1c4)](),this[_0x1c199e(0x1c7,0x235)]=null);}['emit'](_0x50c5aa,data){function _0xfdea43(_0x286e8e,_0x318306){return _0x1e97(_0x318306-0x1dd,_0x286e8e);}this[_0xfdea43(0x304,0x333)]?.['emit'](_0x50c5aa,data);}['on'](_0x13c960,_0x162e78){function _0x40a67e(_0x297492,_0x5ad559){return _0x1e97(_0x5ad559-0x2c0,_0x297492);}this[_0x40a67e(0x450,0x416)]?.['on'](_0x13c960,_0x162e78);}['off'](_0x366110,_0x2d7800){_0x2d7800?this['socket']?.['off'](_0x366110,_0x2d7800):this['socket']?.['off'](_0x366110);}get['connected'](){function _0x3d0f2a(_0x2bdc92,_0x2e439a){return _0x1e97(_0x2bdc92- -0xe0,_0x2e439a);}return this['socket']?.[_0x3d0f2a(0x3e,-0x22)]??![];}}class ReactNativeSocketAdapter{constructor(){this['socket']=null;}async['connect'](_0x59b96a,_0x2d30b5){if(!isSocketIOAvailable())throw new Error(_0x5415c7(0x50f,0x4e2));const {io:_0x104237}=getSocketIO();function _0x5415c7(_0x3eea18,_0x573c79){return _0x1e97(_0x573c79-0x30f,_0x3eea18);}return new Promise((_0x2ed51e,_0x40d733)=>{function _0x8dc0d3(_0x5edc95,_0x71b1d9){return _0x1e97(_0x5edc95- -0x3a1,_0x71b1d9);}this['socket']=_0x104237(_0x59b96a,{..._0x2d30b5,'transports':['websocket'],'upgrade':![],'autoConnect':!![]}),this[_0x8dc0d3(-0x24b,-0x223)]['on']('connect',()=>_0x2ed51e()),this['socket']['on']('connect_error',_0x3ea8a2=>_0x40d733(_0x3ea8a2));});}[_0x4bcf27(-0x2ff,-0x28d)](){function _0x265004(_0xce23bf,_0x252a9c){return _0x1e97(_0x252a9c- -0x150,_0xce23bf);}this['socket']&&(this[_0x265004(-0x4e,0x6)][_0x265004(-0x43,-0x6b)](),this['socket']=null);}['emit'](_0x4dbc7e,data){this['socket']?.['emit'](_0x4dbc7e,data);}['on'](_0x48a0b7,_0x3fef56){function _0x45201c(_0x5c62fe,_0x5cee4f){return _0x1e97(_0x5c62fe- -0xaf,_0x5cee4f);}this[_0x45201c(0xa7,0xf1)]?.['on'](_0x48a0b7,_0x3fef56);}['off'](_0x2622df,_0x1af53f){function _0x37ffd9(_0x3f54b6,_0x131cd4){return _0x1e97(_0x3f54b6- -0x266,_0x131cd4);}_0x1af53f?this[_0x37ffd9(-0x110,-0xfa)]?.['off'](_0x2622df,_0x1af53f):this[_0x37ffd9(-0x110,-0x18a)]?.[_0x37ffd9(-0x91,-0x7a)](_0x2622df);}get['connected'](){return this['socket']?.['connected']??![];}}function createSocketAdapter(){const _0x320cf8=getEnvironment();function _0x5e107f(_0x5a6117,_0x11a6b2){return _0x1e97(_0x11a6b2-0x6c,_0x5a6117);}switch(_0x320cf8){case _0x5e107f(0x203,0x227):return new ReactNativeSocketAdapter();case'browser':case'node':default:return new WebSocketAdapter();}}function _0x4bcf27(_0x5e739a,_0x16ad07){return _0x1e97(_0x5e739a- -0x3e4,_0x16ad07);}class RealtimeClient{constructor(_0x1177ae,_0x505d3c,_0x23736b={}){function _0x50b847(_0x47d2d3,_0x3c29f1){return _0x1e97(_0x47d2d3- -0xc5,_0x3c29f1);}this['socket']=null,this['channels']=new Map(),this['connectionState']='disconnected',this['reconnectAttempts']=0x0,this[_0x50b847(0xaa,0xb2)]=0x5,this[_0x50b847(0x48,0xa8)]=_0x1177ae,this[_0x50b847(0x57,0x16)]=_0x505d3c,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x23736b},this['socketAdapter']=createSocketAdapter();}[_0x4bcf27(-0x2da,-0x2a6)](){return new Promise(async(_0x4dfe2e,_0xa056b4)=>{function _0x49688d(_0x5521cd,_0x4419f4){return _0x1e97(_0x4419f4- -0x239,_0x5521cd);}if(this[_0x49688d(-0xec,-0xec)]['connected']){_0x4dfe2e();return;}this['connectionState']=_0x49688d(-0x8e,-0xa9);try{await this[_0x49688d(-0x130,-0xec)][_0x49688d(-0x124,-0x12f)](this['url'],{'auth':{'apikey':this['apiKey']},'transports':['websocket'],'reconnection':!![],'reconnectionDelay':this['options']['reconnectInterval'],'reconnectionAttempts':this[_0x49688d(-0x3d,-0x85)][_0x49688d(-0xdf,-0xca)],...this[_0x49688d(-0x1d,-0x85)][_0x49688d(-0x8f,-0xdb)]}),this[_0x49688d(-0x11b,-0xe3)]=this['socketAdapter']['socket'],this['socketAdapter']['on'](_0x49688d(-0x11a,-0x12f),()=>{this[_0x10c92c(0x14d,0x1a7)]='connected';function _0x10c92c(_0x262b9a,_0x1ab548){return _0x1e97(_0x262b9a-0x4,_0x1ab548);}this['reconnectAttempts']=0x0,this['setupHeartbeat'](),_0x4dfe2e();}),this[_0x49688d(-0x165,-0xec)]['on']('disconnect',()=>{function _0x228f39(_0x29aa03,_0x208ef2){return _0x1e97(_0x208ef2- -0x2c9,_0x29aa03);}this[_0x228f39(-0x1ed,-0x180)]='disconnected',this['channels'][_0x228f39(-0x21e,-0x197)](channel=>{function _0x49cc59(_0x4f4be2,_0x1a6a2a){return _0x1e97(_0x1a6a2a- -0x2ac,_0x4f4be2);}channel[_0x49cc59(-0x125,-0x154)](_0x49cc59(-0x6d,-0xca));});}),this['socketAdapter']['on'](_0x49688d(-0x10d,-0xa1),_0x21bbe9=>{function _0x245b16(_0x3f78ef,_0x2c6d42){return _0x1e97(_0x2c6d42- -0xa2,_0x3f78ef);}this['connectionState']=_0x245b16(0xc1,0xc3),this['reconnectAttempts']++,this['reconnectAttempts']>=this[_0x245b16(0x96,0xcd)]&&_0xa056b4(new Error('Failed\x20to\x20connect\x20after\x20'+this[_0x245b16(0x73,0xcd)]+_0x245b16(0xfb,0x12b)+_0x21bbe9['message']));}),this[_0x49688d(-0x12a,-0xec)]['on'](_0x49688d(-0x68,-0x9c),()=>{function _0x76a6c6(_0x3bf758,_0x39e807){return _0x1e97(_0x39e807-0x253,_0x3bf758);}this[_0x76a6c6(0x326,0x39c)]=_0x76a6c6(0x31b,0x371),this['reconnectAttempts']=0x0,this[_0x76a6c6(0x33f,0x382)]['forEach'](channel=>{channel['_rejoin']();});}),this[_0x49688d(-0x11f,-0xec)]['on'](_0x49688d(-0x7f,-0xc1),_0x4556e4=>{function _0x2a10ff(_0x1bc25f,_0x2bea9a){return _0x1e97(_0x2bea9a-0x38a,_0x1bc25f);}const channel=this[_0x2a10ff(0x4fd,0x4b9)]['get'](_0x4556e4['topic']);channel&&channel[_0x2a10ff(0x532,0x4eb)]('postgres_changes',_0x4556e4);}),this['socketAdapter']['on'](_0x49688d(-0xe8,-0x147),_0x181d8e=>{const channel=this['channels'][_0x4390fc(-0x4f,-0x6)](_0x181d8e['topic']);function _0x4390fc(_0x5150d8,_0x1ec7ba){return _0x1e97(_0x1ec7ba- -0x1e6,_0x5150d8);}channel&&channel[_0x4390fc(-0x51,-0x85)](_0x4390fc(-0x128,-0xf4),_0x181d8e);}),this[_0x49688d(-0xfb,-0xec)]['on']('presence',_0x48b76f=>{const channel=this[_0xaea61f(0x34f,0x375)]['get'](_0x48b76f[_0xaea61f(0x332,0x369)]);function _0xaea61f(_0x3e1133,_0x5b7acd){return _0x1e97(_0x5b7acd-0x246,_0x3e1133);}channel&&channel[_0xaea61f(0x3ed,0x3a7)](_0xaea61f(0x390,0x39f),_0x48b76f);});}catch(_0x37f248){this[_0x49688d(-0xc8,-0xf0)]='error',_0xa056b4(_0x37f248);}});}[_0x4bcf27(-0x2ff,-0x320)](){this[_0x40bf7c(0x4fe,0x505)]&&(this[_0x40bf7c(0x4fe,0x4dd)][_0x40bf7c(0x496,0x4bf)](),this[_0x40bf7c(0x507,0x53d)]=null);this[_0x40bf7c(0x4fa,0x484)]=_0x40bf7c(0x4d7,0x513);function _0x40bf7c(_0x25d7b7,_0x489632){return _0x1e97(_0x25d7b7-0x3b1,_0x489632);}this[_0x40bf7c(0x4e0,0x52c)][_0x40bf7c(0x4f0,0x4f4)]();}['channel'](_0x46cf52){function _0x111c0b(_0x1acf63,_0x5120a0){return _0x1e97(_0x1acf63-0x22,_0x5120a0);}if(this['channels'][_0x111c0b(0x10e,0x153)](_0x46cf52))return this[_0x111c0b(0x151,0xd4)][_0x111c0b(0x202,0x218)](_0x46cf52);const channel=new RealtimeChannel(_0x46cf52,this[_0x111c0b(0x178,0x188)]);return this[_0x111c0b(0x151,0x131)][_0x111c0b(0x1ee,0x1fd)](_0x46cf52,channel),this[_0x111c0b(0x16b,0x169)]==='connected'&&channel['_join'](),channel;}[_0x4bcf27(-0x266,-0x2d4)](channel){const _0x32c2bd=channel[_0x1e379d(0x20d,0x1a5)];function _0x1e379d(_0xfc8e9c,_0x3f3ed4){return _0x1e97(_0xfc8e9c-0xea,_0x3f3ed4);}this['channels']['has'](_0x32c2bd)&&(this['channels'][_0x1e379d(0x1d2,0x1d6)](_0x32c2bd),channel['unsubscribe']());}['removeAllChannels'](){function _0x2b245c(_0x3c2706,_0xa47e9e){return _0x1e97(_0x3c2706-0x169,_0xa47e9e);}this[_0x2b245c(0x298,0x2d8)][_0x2b245c(0x29b,0x25f)](channel=>{channel['unsubscribe']();}),this[_0x2b245c(0x298,0x310)][_0x2b245c(0x2a8,0x26e)]();}[_0x4bcf27(-0x2d3,-0x2e1)](){function _0x46a4b4(_0x12c92f,_0x5d7293){return _0x1e97(_0x12c92f- -0x1d1,_0x5d7293);}return Array['from'](this['channels'][_0x46a4b4(-0x1b,0x24)]());}[_0x4bcf27(-0x235,-0x29b)](){function _0x50ff71(_0x57429a,_0x418d58){return _0x1e97(_0x57429a- -0x276,_0x418d58);}return this[_0x50ff71(-0x12d,-0x19d)]===_0x50ff71(-0x158,-0x15d)&&this['socketAdapter']['connected'];}['getConnectionState'](){return this['connectionState'];}[_0x4bcf27(-0x2ea,-0x2cc)](_0x500c0f){const _0x5754b6=()=>_0x500c0f(this[_0x4c2833(-0xb2,-0x91)]);this[_0x4c2833(-0xab,-0x8d)]&&(this['socketAdapter']['on'](_0x4c2833(-0x131,-0xd0),()=>{this['connectionState']='connected',_0x5754b6();}),this[_0x4c2833(-0x5b,-0x8d)]['on']('disconnect',()=>{function _0x439a99(_0x2f16a9,_0x2a9029){return _0x1e97(_0x2f16a9-0xfc,_0x2a9029);}this[_0x439a99(0x245,0x1f8)]=_0x439a99(0x222,0x231),_0x5754b6();}),this['socketAdapter']['on'](_0x4c2833(-0x76,-0x42),()=>{this['connectionState']='error',_0x5754b6();}));function _0x4c2833(_0x1e1aa3,_0x5ba13f){return _0x1e97(_0x5ba13f- -0x1da,_0x1e1aa3);}return()=>{function _0x4dc363(_0x413017,_0x265c64){return _0x1e97(_0x265c64-0x191,_0x413017);}this[_0x4dc363(0x271,0x2de)]&&(this['socketAdapter']['off']('connect',_0x5754b6),this['socketAdapter'][_0x4dc363(0x2f6,0x366)]('disconnect',_0x5754b6),this[_0x4dc363(0x2b0,0x2de)][_0x4dc363(0x2e0,0x366)](_0x4dc363(0x2b6,0x329),_0x5754b6));};}['setupHeartbeat'](){if(!this['options']['heartbeatInterval']||!this[_0x2f53f4(-0x1e1,-0x1e2)])return;function _0x2f53f4(_0x179aa9,_0x42e189){return _0x1e97(_0x179aa9- -0x32e,_0x42e189);}const interval=setInterval(()=>{function _0x3a2257(_0x3323a8,_0x3d7f6d){return _0x1e97(_0x3323a8- -0x34b,_0x3d7f6d);}this[_0x3a2257(-0x1fe,-0x223)]?.[_0x3a2257(-0x22d,-0x286)]?this[_0x3a2257(-0x1fe,-0x1ac)]['emit']('heartbeat',{'timestamp':Date['now']()}):clearInterval(interval);},this[_0x2f53f4(-0x17a,-0x196)][_0x2f53f4(-0x20f,-0x1c4)]);}['_getSocket'](){return this['socket'];}}class FunctionsClient{constructor(_0x1a3fe0){this['httpClient']=_0x1a3fe0;}async[_0x4bcf27(-0x2d6,-0x296)](_0x41d7ea,_0x3b7b41){function _0x260812(_0x3147c9,_0x4269f5){return _0x1e97(_0x4269f5- -0x34b,_0x3147c9);}try{const _0x1aa9b4=_0x3b7b41?.['method']||'POST',headers={'Content-Type':'application/json',..._0x3b7b41?.[_0x260812(-0x188,-0x16e)]};let response;const _0x3d025e=_0x260812(-0x1d1,-0x217)+_0x41d7ea;switch(_0x1aa9b4['toUpperCase']()){case'GET':response=await this['httpClient'][_0x260812(-0x1d7,-0x16b)](_0x3d025e,{'headers':headers,'params':_0x3b7b41?.[_0x260812(-0x1ba,-0x1e2)]});break;case'POST':response=await this['httpClient'][_0x260812(-0x2b7,-0x233)](_0x3d025e,_0x3b7b41?.['body'],{'headers':headers});break;case'PUT':response=await this[_0x260812(-0x236,-0x1b1)]['put'](_0x3d025e,_0x3b7b41?.[_0x260812(-0x1ee,-0x1e2)],{'headers':headers});break;case'PATCH':response=await this['httpClient']['patch'](_0x3d025e,_0x3b7b41?.[_0x260812(-0x1e1,-0x1e2)],{'headers':headers});break;case'DELETE':response=await this[_0x260812(-0x139,-0x1b1)]['delete'](_0x3d025e,{'headers':headers,'data':_0x3b7b41?.[_0x260812(-0x22b,-0x1e2)]});break;default:throw new EBaaSError(_0x260812(-0x22a,-0x256)+_0x1aa9b4,0x190);}return{'data':response['data'],'error':null};}catch(_0x38080e){return{'data':null,'error':_0x38080e instanceof EBaaSError?_0x38080e:new EBaaSError(_0x38080e instanceof Error?_0x38080e[_0x260812(-0x186,-0x166)]:_0x260812(-0x122,-0x17c),0x0,_0x38080e)};}}async[_0x4bcf27(-0x281,-0x2e0)](){function _0x19cdad(_0x50787d,_0x56deab){return _0x1e97(_0x50787d-0x1e6,_0x56deab);}try{const response=await this['httpClient'][_0x19cdad(0x3c6,0x418)]('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x4423d6){return{'data':null,'error':_0x4423d6 instanceof EBaaSError?_0x4423d6:new EBaaSError(_0x4423d6 instanceof Error?_0x4423d6['message']:'Failed\x20to\x20list\x20functions',0x0,_0x4423d6)};}}async[_0x4bcf27(-0x204,-0x1ba)](_0x29c1ca){function _0x3f3b2b(_0x13d185,_0x50d1b3){return _0x1e97(_0x50d1b3-0x32b,_0x13d185);}try{const response=await this['httpClient']['get'](_0x3f3b2b(0x461,0x45f)+_0x29c1ca+'/info');return{'data':response[_0x3f3b2b(0x499,0x4af)],'error':null};}catch(_0x1c0c2e){return{'data':null,'error':_0x1c0c2e instanceof EBaaSError?_0x1c0c2e:new EBaaSError(_0x1c0c2e instanceof Error?_0x1c0c2e[_0x3f3b2b(0x4bc,0x510)]:'Failed\x20to\x20get\x20function',0x0,_0x1c0c2e)};}}async[_0x4bcf27(-0x2dd,-0x2c7)](_0x3d0aa8,_0x55de8c){function _0x548966(_0x5e0e91,_0x263a71){return _0x1e97(_0x5e0e91- -0x1c7,_0x263a71);}try{const _0x3cc28b=new FormData();if(_0x55de8c[_0x548966(-0x12,0x1b)]instanceof File)_0x3cc28b[_0x548966(0x24,-0x58)]('code',_0x55de8c['code']);else typeof _0x55de8c['code']===_0x548966(-0xcb,-0x135)&&_0x3cc28b['append']('code',new Blob([_0x55de8c[_0x548966(-0x12,-0x76)]],{'type':_0x548966(-0xb0,-0x10f)}),_0x548966(-0xd3,-0x14a));_0x55de8c['entrypoint']&&_0x3cc28b['append']('entrypoint',_0x55de8c[_0x548966(-0xa2,-0x44)]);_0x55de8c[_0x548966(-0x89,-0xda)]&&_0x3cc28b[_0x548966(0x24,-0x10)](_0x548966(-0x89,-0x7a),JSON[_0x548966(-0xc7,-0x7f)](_0x55de8c[_0x548966(-0x89,-0xd2)]));_0x55de8c['importMap']&&_0x3cc28b[_0x548966(0x24,-0xe)](_0x548966(-0x19,-0x7),JSON['stringify'](_0x55de8c['importMap']));_0x55de8c['verify']!==undefined&&_0x3cc28b['append'](_0x548966(-0xa,-0x40),String(_0x55de8c[_0x548966(-0xa,-0x42)]));const response=await this[_0x548966(-0x2d,-0x2)][_0x548966(-0xaf,-0x41)](_0x548966(-0x93,-0x18)+_0x3d0aa8+'/deploy',_0x3cc28b,{'headers':{'Content-Type':_0x548966(-0xae,-0x112)}});return{'data':response['data'],'error':null};}catch(_0x4357c5){return{'data':null,'error':_0x4357c5 instanceof EBaaSError?_0x4357c5:new EBaaSError(_0x4357c5 instanceof Error?_0x4357c5[_0x548966(0x1e,0xc)]:_0x548966(-0x2e,-0x6d),0x0,_0x4357c5)};}}async['delete'](_0x59f17d){function _0x2666e8(_0x1615d4,_0x35a2c2){return _0x1e97(_0x1615d4- -0x375,_0x35a2c2);}try{const response=await this['httpClient']['delete'](_0x2666e8(-0x241,-0x1c3)+_0x59f17d);return{'data':response['data'],'error':null};}catch(_0x605054){return{'data':null,'error':_0x605054 instanceof EBaaSError?_0x605054:new EBaaSError(_0x605054 instanceof Error?_0x605054[_0x2666e8(-0x190,-0x179)]:'Failed\x20to\x20delete\x20function',0x0,_0x605054)};}}async[_0x4bcf27(-0x2bd,-0x305)](_0x4b2f68,_0x3603b2){function _0x515df8(_0x2ade83,_0x56f5ab){return _0x1e97(_0x2ade83-0x79,_0x56f5ab);}try{const response=await this['httpClient']['put']('/functions/v1/'+_0x4b2f68+'/env',{'env':_0x3603b2});return{'data':response['data'],'error':null};}catch(_0x37b46b){return{'data':null,'error':_0x37b46b instanceof EBaaSError?_0x37b46b:new EBaaSError(_0x37b46b instanceof Error?_0x37b46b[_0x515df8(0x25e,0x246)]:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x37b46b)};}}async[_0x4bcf27(-0x205,-0x1da)](_0x2f0062,_0x5b9887){function _0x53ca71(_0x5bf744,_0x2f9527){return _0x1e97(_0x2f9527-0x1e7,_0x5bf744);}try{const _0x41ad26=new URLSearchParams();_0x5b9887?.[_0x53ca71(0x3ff,0x3c3)]&&_0x41ad26[_0x53ca71(0x44d,0x3d2)](_0x53ca71(0x367,0x3c3),String(_0x5b9887['limit']));_0x5b9887?.['offset']&&_0x41ad26[_0x53ca71(0x43b,0x3d2)]('offset',String(_0x5b9887['offset']));_0x5b9887?.[_0x53ca71(0x336,0x388)]&&_0x41ad26[_0x53ca71(0x3a5,0x3d2)](_0x53ca71(0x311,0x388),_0x5b9887['level']);const _0x3be71e=_0x53ca71(0x33d,0x31b)+_0x2f0062+_0x53ca71(0x295,0x312)+(_0x41ad26[_0x53ca71(0x2ee,0x310)]()?'?'+_0x41ad26['toString']():''),response=await this['httpClient'][_0x53ca71(0x379,0x3c7)](_0x3be71e);return{'data':response[_0x53ca71(0x334,0x36b)],'error':null};}catch(_0x27ecbd){return{'data':null,'error':_0x27ecbd instanceof EBaaSError?_0x27ecbd:new EBaaSError(_0x27ecbd instanceof Error?_0x27ecbd[_0x53ca71(0x3cd,0x3cc)]:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x27ecbd)};}}async[_0x4bcf27(-0x270,-0x2f8)](_0x361a41,_0x1a98ed){function _0x6d862b(_0x32223f,_0x296724){return _0x1e97(_0x296724-0x257,_0x32223f);}try{const _0xab63c2=new URLSearchParams();_0x1a98ed?.[_0x6d862b(0x3bb,0x403)]&&_0xab63c2[_0x6d862b(0x4c6,0x442)](_0x6d862b(0x3af,0x403),_0x1a98ed['period']);const _0x5c1589='/functions/v1/'+_0x361a41+_0x6d862b(0x433,0x435)+(_0xab63c2['toString']()?'?'+_0xab63c2['toString']():''),response=await this[_0x6d862b(0x433,0x3f1)][_0x6d862b(0x464,0x437)](_0x5c1589);return{'data':response['data'],'error':null};}catch(_0xbe1c19){return{'data':null,'error':_0xbe1c19 instanceof EBaaSError?_0xbe1c19:new EBaaSError(_0xbe1c19 instanceof Error?_0xbe1c19[_0x6d862b(0x457,0x43c)]:_0x6d862b(0x3e8,0x422),0x0,_0xbe1c19)};}}}class EBaaSClient{constructor(_0x2c9d13,_0x1b728e,_0x5e4755){this['options']=_0x5e4755,this['httpClient']=new HttpClient({'url':_0x2c9d13,'apiKey':_0x1b728e,'timeout':0x7530,'headers':_0x5e4755?.[_0x41d58e(-0xa4,-0x101)]?.['headers']}),this['auth']=new AuthClient(this['httpClient'],_0x5e4755?.[_0x41d58e(-0x186,-0x166)]?.['workspaceId']),this[_0x41d58e(-0x18a,-0x166)]=new DatabaseClient(this['httpClient'],_0x5e4755?.[_0x41d58e(-0x14f,-0x166)]?.['workspaceId']),this['storage']=new StorageClient(this[_0x41d58e(-0xd8,-0x106)]),this[_0x41d58e(-0x194,-0x10d)]=new RealtimeClient(_0x2c9d13,_0x1b728e,_0x5e4755?.['realtime']);function _0x41d58e(_0x1dd942,_0x4efd82){return _0x1e97(_0x4efd82- -0x2a0,_0x1dd942);}this['functions']=new FunctionsClient(this['httpClient']),this['initializeCustomDatabase']();}['from'](_0x47fad3){function _0x203179(_0x3e0184,_0x6e4203){return _0x1e97(_0x3e0184- -0x3c8,_0x6e4203);}return this[_0x203179(-0x28e,-0x282)][_0x203179(-0x223,-0x253)](_0x47fad3);}['rpc'](_0x59f355,_0x427811){function _0x5e143a(_0x2857d4,_0x224037){return _0x1e97(_0x2857d4- -0xdd,_0x224037);}return this[_0x5e143a(0x5d,0x6b)]['rpc'](_0x59f355,_0x427811);}[_0x4bcf27(-0x2e9,-0x27d)](_0x40058b){return this['storage']['from'](_0x40058b);}[_0x4bcf27(-0x250,-0x288)](_0x1d732d){function _0x253b4c(_0x18a257,_0xb57052){return _0x1e97(_0x18a257- -0x283,_0xb57052);}return this[_0x253b4c(-0xf0,-0xc6)]['channel'](_0x1d732d);}[_0x4bcf27(-0x2d6,-0x2f0)](_0x30f53f,_0x1ff8b7){return this['functions']['invoke'](_0x30f53f,_0x1ff8b7);}async[_0x4bcf27(-0x268,-0x2cb)](){function _0x290446(_0x55bef4,_0x421602){return _0x1e97(_0x421602- -0x1ad,_0x55bef4);}if(this[_0x290446(-0x5f,0x7)]?.['database']?.['autoDetectCustomDatabase'])try{await this[_0x290446(-0xd0,-0x73)][_0x290446(-0x2e,0x11)]();}catch(_0x14ac16){console['warn']('Failed to initialize custom database detection:',_0x14ac16);}}async[_0x4bcf27(-0x20c,-0x1c0)](_0x31264e){this['auth'][_0x1e0cf7(0x301,0x331)](_0x31264e),this[_0x1e0cf7(0x292,0x293)][_0x1e0cf7(0x36c,0x331)](_0x31264e);function _0x1e0cf7(_0x285002,_0x10a9d9){return _0x1e97(_0x10a9d9-0x159,_0x285002);}this[_0x1e0cf7(0x303,0x30d)]?.[_0x1e0cf7(0x22c,0x293)]?.[_0x1e0cf7(0x30e,0x2d3)]&&await this[_0x1e0cf7(0x2cb,0x293)][_0x1e0cf7(0x2a5,0x317)]();}async['configureCustomDatabase'](_0x2ce36b){function _0x1b3575(_0x59cfcf,_0x2afe29){return _0x1e97(_0x2afe29- -0x157,_0x59cfcf);}await this['database'][_0x1b3575(0x2c,0x3b)](_0x2ce36b);}['getCustomDatabaseStatus'](){function _0x4c154a(_0x459e82,_0x166ea5){return _0x1e97(_0x459e82-0x12,_0x166ea5);}return this[_0x4c154a(0x14c,0x13f)][_0x4c154a(0x15e,0x1ad)]();}}function createClient(_0x1aa2a1,_0x124d77,_0x37c6af){return new EBaaSClient(_0x1aa2a1,_0x124d77,_0x37c6af);}const version=_0x4bcf27(-0x25b,-0x21d);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};
|
|
1
|
+
(function(stringArrayFunction,comparisonValue){const stringArray=stringArrayFunction();function _0x27fc1b(_0x13daec,_0x545080){return _0x46d3(_0x13daec-0x309,_0x545080);}while(!![]){try{const _0x7a8ed8=-parseInt(_0x27fc1b(0x482,0x446))/0x1+parseInt(_0x27fc1b(0x55d,0x5cf))/0x2*(-parseInt(_0x27fc1b(0x466,0x40c))/0x3)+-parseInt(_0x27fc1b(0x51c,0x589))/0x4+parseInt(_0x27fc1b(0x49e,0x50c))/0x5*(-parseInt(_0x27fc1b(0x4d7,0x507))/0x6)+-parseInt(_0x27fc1b(0x54a,0x54a))/0x7*(parseInt(_0x27fc1b(0x4b2,0x50a))/0x8)+parseInt(_0x27fc1b(0x4b1,0x4b7))/0x9+parseInt(_0x27fc1b(0x478,0x3f1))/0xa;if(_0x7a8ed8===comparisonValue)break;else stringArray['push'](stringArray['shift']());}catch(_0x498775){stringArray['push'](stringArray['shift']());}}}(_0x1ed3,0xb4896));import axios from'axios';function _0x46d3(_0x4b98e2,_0x4220ff){const _0x1ed34a=_0x1ed3();return _0x46d3=function(_0x46d366,_0x5a555f){_0x46d366=_0x46d366-0x14d;let _0x9f5936=_0x1ed34a[_0x46d366];if(_0x46d3['SWDoWb']===undefined){var _0x3a3327=function(_0x46e9df){const _0x2b9a15='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0xd92010='',_0x39eb4e='';for(let _0x13b141=0x0,_0x49db59,_0x423aab,_0x1427ae=0x0;_0x423aab=_0x46e9df['charAt'](_0x1427ae++);~_0x423aab&&(_0x49db59=_0x13b141%0x4?_0x49db59*0x40+_0x423aab:_0x423aab,_0x13b141++%0x4)?_0xd92010+=String['fromCharCode'](0xff&_0x49db59>>(-0x2*_0x13b141&0x6)):0x0){_0x423aab=_0x2b9a15['indexOf'](_0x423aab);}for(let _0x4942ab=0x0,_0x24a908=_0xd92010['length'];_0x4942ab<_0x24a908;_0x4942ab++){_0x39eb4e+='%'+('00'+_0xd92010['charCodeAt'](_0x4942ab)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x39eb4e);};_0x46d3['IfoNgL']=_0x3a3327,_0x4b98e2=arguments,_0x46d3['SWDoWb']=!![];}const _0x3320aa=_0x1ed34a[0x0],_0x52b71f=_0x46d366+_0x3320aa,_0x5cd24b=_0x4b98e2[_0x52b71f];return!_0x5cd24b?(_0x9f5936=_0x46d3['IfoNgL'](_0x9f5936),_0x4b98e2[_0x52b71f]=_0x9f5936):_0x9f5936=_0x5cd24b,_0x9f5936;},_0x46d3(_0x4b98e2,_0x4220ff);}class EBaaSError extends Error{constructor(_0x46e9df,status=0x0,_0x2b9a15){super(_0x46e9df),this['name']='EBaaSError';function _0x2c88e2(_0x3af8ab,_0x5a60a0){return _0x46d3(_0x5a60a0-0x1b1,_0x3af8ab);}this[_0x2c88e2(0x358,0x309)]=status,this[_0x2c88e2(0x437,0x408)]=_0x2b9a15,Error['captureStackTrace']&&Error['captureStackTrace'](this,EBaaSError);}['toJSON'](){function _0x413905(_0x111034,_0x168b04){return _0x46d3(_0x111034- -0x143,_0x168b04);}return{'name':this[_0x413905(0x1b,0x9d)],'message':this['message'],'status':this[_0x413905(0x15,0x6e)],'details':this[_0x413905(0x114,0x96)],'stack':this[_0x413905(0x120,0x132)]};}[_0x294921(-0xa,-0x21)](){function _0x18650d(_0xc0e78d,_0x41d469){return _0x46d3(_0xc0e78d- -0x2f9,_0x41d469);}return this['name']+':\x20'+this['message']+_0x18650d(-0x134,-0xc7)+this['status']+')';}}class HttpClient{constructor(config){this['baseURL']=config[_0x19c64a(0x28a,0x2a7)],this[_0x19c64a(0x38d,0x35e)]=config[_0x19c64a(0x37d,0x35e)];function _0x19c64a(_0x17e5d4,_0x3eaad4){return _0x46d3(_0x3eaad4-0x151,_0x17e5d4);}this['client']=axios[_0x19c64a(0x3b6,0x39a)]({'baseURL':this['baseURL'],'timeout':config[_0x19c64a(0x33c,0x32b)]||0x2710,'headers':{'Content-Type':'application/json','apikey':this['apiKey'],...config['headers']}}),this[_0x19c64a(0x315,0x321)]();}[_0x294921(-0x4d,0x22)](){this['client']['interceptors']['request']['use'](config=>{return config;},_0xd92010=>{function _0xa174ec(_0x49b344,_0x455f87){return _0x46d3(_0x455f87- -0x2a5,_0x49b344);}return Promise[_0xa174ec(-0xa4,-0xe9)](new EBaaSError('Request\x20failed',0x0,_0xd92010));});function _0x30e2e3(_0x5df2b2,_0xc56c7f){return _0x46d3(_0x5df2b2- -0x3a7,_0xc56c7f);}this[_0x30e2e3(-0x1d4,-0x19c)]['interceptors']['response'][_0x30e2e3(-0x1de,-0x221)](response=>{return response;},_0x39eb4e=>{const status=_0x39eb4e[_0x45db50(0x19a,0x1e8)]?.['status']||0x0,_0x13b141=_0x39eb4e['response']?.['data']?.['message']||_0x39eb4e[_0x45db50(0x286,0x258)]||'Unknown\x20error',_0x49db59=_0x39eb4e['response']?.[_0x45db50(0x17a,0x1bd)]||_0x39eb4e;function _0x45db50(_0xf60450,_0x182318){return _0x46d3(_0x182318- -0x4,_0xf60450);}return Promise['reject'](new EBaaSError(_0x13b141,status,_0x49db59));});}async['get'](_0x423aab,config){function _0xce36d1(_0x51cb18,_0x19e0a7){return _0x46d3(_0x51cb18- -0xe3,_0x19e0a7);}try{const response=await this['client'][_0xce36d1(0x14c,0x169)](_0x423aab,config);return{'data':response[_0xce36d1(0xde,0x140)],'status':response[_0xce36d1(0x75,0xfd)],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x1427ae){throw this['handleError'](_0x1427ae);}}async[_0x294921(-0x4f,-0x3d)](_0x4942ab,data,config){function _0x66bb5d(_0x10f6bf,_0x2edba4){return _0x46d3(_0x10f6bf- -0x229,_0x2edba4);}try{const response=await this[_0x66bb5d(-0x56,-0xba)]['post'](_0x4942ab,data,config);return{'data':response[_0x66bb5d(-0x68,-0x3e)],'status':response[_0x66bb5d(-0xd1,-0x14b)],'statusText':response[_0x66bb5d(-0x28,0xf)],'headers':response['headers']};}catch(_0x24a908){throw this[_0x66bb5d(-0x7a,-0x40)](_0x24a908);}}async[_0x294921(-0x33,-0x4e)](_0x5d9fc9,data,config){function _0x36b4eb(_0x39d0ec,_0x56bace){return _0x46d3(_0x56bace-0xaf,_0x39d0ec);}try{const response=await this[_0x36b4eb(0x27a,0x282)]['put'](_0x5d9fc9,data,config);return{'data':response[_0x36b4eb(0x287,0x270)],'status':response['status'],'statusText':response['statusText'],'headers':response['headers']};}catch(_0x51f9e5){throw this['handleError'](_0x51f9e5);}}async['patch'](_0x4b61cc,data,config){function _0x398b73(_0x5018d5,_0x8d6328){return _0x46d3(_0x5018d5- -0x301,_0x8d6328);}try{const response=await this['client']['patch'](_0x4b61cc,data,config);return{'data':response['data'],'status':response[_0x398b73(-0x1a9,-0x1e3)],'statusText':response[_0x398b73(-0x100,-0x8a)],'headers':response[_0x398b73(-0x1a7,-0x155)]};}catch(_0x6a438){throw this[_0x398b73(-0x152,-0x1c0)](_0x6a438);}}async[_0x294921(0x4b,-0x2a)](_0x24db05,config){function _0x1f0122(_0x54aa37,_0x2d3539){return _0x46d3(_0x2d3539- -0x37f,_0x54aa37);}try{const response=await this[_0x1f0122(-0x1a3,-0x1ac)][_0x1f0122(-0x179,-0x1fb)](_0x24db05,config);return{'data':response['data'],'status':response['status'],'statusText':response['statusText'],'headers':response[_0x1f0122(-0x279,-0x225)]};}catch(_0x55eace){throw this['handleError'](_0x55eace);}}[_0x294921(0x19,0x89)](_0x1fe112){function _0x888845(_0x4973db,_0x487777){return _0x46d3(_0x4973db-0x326,_0x487777);}this[_0x888845(0x4f9,0x48b)][_0x888845(0x56b,0x57a)][_0x888845(0x480,0x400)]['common']['Authorization']=_0x888845(0x4a9,0x502)+_0x1fe112;}[_0x294921(0x70,0x21)](){function _0x28d1c4(_0x221b8e,_0x2b9991){return _0x46d3(_0x2b9991- -0x13d,_0x221b8e);}delete this[_0x28d1c4(0x70,0x96)][_0x28d1c4(0xd9,0x108)]['headers'][_0x28d1c4(0x193,0x10b)]['Authorization'],this['client']['defaults'][_0x28d1c4(0x1f,0x1d)]['common']['Authorization']='Bearer\x20'+this[_0x28d1c4(0x12c,0xd0)];}['handleError'](_0x123f33){if(_0x123f33 instanceof EBaaSError)return _0x123f33;function _0x52f111(_0x15d296,_0x1f4e8e){return _0x46d3(_0x15d296-0x35c,_0x1f4e8e);}return new EBaaSError(_0x123f33[_0x52f111(0x5b8,0x52e)]||'HTTP\x20request\x20failed',_0x123f33[_0x52f111(0x4b4,0x464)]||0x0,_0x123f33);}}class AuthClient{constructor(_0x3454ed,_0x196b50){function _0x3795f6(_0x45ea0e,_0x377424){return _0x46d3(_0x377424-0x2b4,_0x45ea0e);}this['currentSession']=null,this[_0x3795f6(0x40e,0x467)]=_0x3454ed,this[_0x3795f6(0x44c,0x474)]=_0x196b50,this['loadSession']();}async['signUp'](data){function _0x507409(_0xcf53f4,_0xa77c86){return _0x46d3(_0xcf53f4-0x258,_0xa77c86);}try{const response=await this['httpClient'][_0x507409(0x3c9,0x455)]('/auth/v1/signup',data);return response[_0x507409(0x419,0x444)]['session']&&this['setSessionInternal'](response['data']['session']),response[_0x507409(0x419,0x4a3)];}catch(_0x51a8f7){throw this['handleAuthError'](_0x51a8f7);}}async[_0x294921(0x3a,0x55)](data){function _0x27137c(_0x583e22,_0x1e2cd1){return _0x46d3(_0x583e22- -0x313,_0x1e2cd1);}try{const headers={};this['workspaceId']&&(headers['X-Workspace-ID']=this['workspaceId']);const response=await this['httpClient']['post']('/auth/v1/sdk/signin',data,{'headers':headers});return response['data']['session']&&this[_0x27137c(-0x1b8,-0x133)](response['data']['session']),response[_0x27137c(-0x152,-0x174)];}catch(_0x45f9c3){throw this[_0x27137c(-0x10c,-0x13a)](_0x45f9c3);}}async['signOut'](){function _0x462eae(_0x258661,_0x1f2ad1){return _0x46d3(_0x1f2ad1-0x193,_0x258661);}try{await this['httpClient']['post']('/auth/v1/signout'),this[_0x462eae(0x3af,0x3d9)]();}catch(_0x2ca483){this[_0x462eae(0x36c,0x3d9)]();throw this['handleAuthError'](_0x2ca483);}}async[_0x294921(0x111,0xaa)](){if(!this[_0x43654b(0x352,0x34b)]?.['access_token'])return null;function _0x43654b(_0x1d5af1,_0x3d80cc){return _0x46d3(_0x3d80cc-0x1fc,_0x1d5af1);}try{const response=await this[_0x43654b(0x331,0x3af)]['get'](_0x43654b(0x426,0x39d));return response['data'][_0x43654b(0x42c,0x443)];}catch(_0x586832){if(_0x586832 instanceof EBaaSError&&_0x586832['status']===0x191)return this['clearSession'](),null;throw this[_0x43654b(0x41e,0x403)](_0x586832);}}async['refreshSession'](){function _0x39d02e(_0x53596,_0x58dc3d){return _0x46d3(_0x53596-0x2d4,_0x58dc3d);}if(!this['currentSession']?.[_0x39d02e(0x4ad,0x495)])return null;try{const response=await this['httpClient'][_0x39d02e(0x445,0x47b)]('/auth/v1/refresh',{'refresh_token':this[_0x39d02e(0x423,0x435)]['refresh_token']});if(response[_0x39d02e(0x495,0x49a)][_0x39d02e(0x4eb,0x4e2)])return this[_0x39d02e(0x4f7,0x580)](response[_0x39d02e(0x495,0x495)][_0x39d02e(0x4eb,0x517)]),response['data']['session'];return null;}catch(_0x5f1238){this[_0x39d02e(0x51a,0x592)]();throw this['handleAuthError'](_0x5f1238);}}async[_0x294921(0x23,0xaf)](_0x398042){function _0x546d19(_0x572d9e,_0x45d955){return _0x46d3(_0x572d9e- -0x365,_0x45d955);}try{await this['httpClient'][_0x546d19(-0x1f4,-0x1b0)](_0x546d19(-0x178,-0x140),{'email':_0x398042});}catch(_0x48860b){throw this['handleAuthError'](_0x48860b);}}async[_0x294921(0x18,0x50)](data){function _0x240698(_0x2c3616,_0x3bf6b1){return _0x46d3(_0x2c3616-0x1a0,_0x3bf6b1);}try{const response=await this['httpClient']['put']('/auth/v1/user',data);return response[_0x240698(0x361,0x3a2)]['user'];}catch(_0xfbdf38){throw this['handleAuthError'](_0xfbdf38);}}['getSession'](){function _0x316303(_0x5d6767,_0x26f4c7){return _0x46d3(_0x5d6767-0x2c,_0x26f4c7);}return this[_0x316303(0x17b,0x114)];}[_0x294921(0x68,0x75)](_0x58055b){this['currentSession']=_0x58055b,this['httpClient']['setAuthToken'](_0x58055b['access_token']);function _0x3f60e2(_0x127185,_0x399bcd){return _0x46d3(_0x127185-0x3b0,_0x399bcd);}typeof localStorage!==_0x3f60e2(0x582,0x5b6)&&localStorage[_0x3f60e2(0x572,0x54b)]('ebaas.auth.session',JSON['stringify'](_0x58055b));}[_0x294921(-0xa5,-0x2e)](_0x3aea47){return()=>{};}[_0x294921(0xa,-0x27)](_0x5c9cf5){function _0x3a2721(_0x2e8db3,_0x32c2a4){return _0x46d3(_0x32c2a4-0x213,_0x2e8db3);}this[_0x3a2721(0x399,0x3d3)]=_0x5c9cf5;}[_0x294921(-0x27,-0x53)](_0x11b980){function _0x396711(_0x360952,_0x4a2752){return _0x46d3(_0x4a2752- -0x384,_0x360952);}this[_0x396711(-0x1ab,-0x235)]=_0x11b980,this[_0x396711(-0x16a,-0x1d1)]['setAuthToken'](_0x11b980['access_token']),typeof localStorage!==_0x396711(-0x203,-0x1b2)&&localStorage['setItem'](_0x396711(-0x12f,-0x154),JSON[_0x396711(-0x262,-0x228)](_0x11b980));}[_0x294921(0x88,0x98)](){this[_0x1fd3bc(0xff,0xd6)]=null,this['httpClient'][_0x1fd3bc(0x1ac,0x156)]();function _0x1fd3bc(_0x3c81f8,_0x5cef3c){return _0x46d3(_0x5cef3c- -0x79,_0x3c81f8);}typeof localStorage!==_0x1fd3bc(0x18f,0x159)&&localStorage[_0x1fd3bc(0xaa,0x111)]('ebaas.auth.session');}['loadSession'](){function _0xd6881d(_0x91fdb2,_0x5ded93){return _0x46d3(_0x91fdb2- -0x121,_0x5ded93);}if(typeof localStorage!==_0xd6881d(0xb1,0x82)){const _0xf8e11f=localStorage['getItem']('ebaas.auth.session');if(_0xf8e11f)try{const _0x372407=JSON['parse'](_0xf8e11f);this[_0xd6881d(0x3a,0x7e)](_0x372407);}catch(_0x25b0b0){this[_0xd6881d(0x125,0xcc)]();}}}[_0x294921(0x6c,0x59)](_0x439fd6){if(_0x439fd6 instanceof EBaaSError)return _0x439fd6;return new EBaaSError(_0x439fd6['message']||'Authentication\x20failed',_0x439fd6['status']||0x0,_0x439fd6);}}class QueryBuilder{constructor(_0x4c616a,_0x2b18d3,_0x151c20,_0x461a59,_0x1e978c){this['httpClient']=_0x4c616a,this['table']=_0x2b18d3,this[_0x10f673(0x314,0x32e)]=_0x151c20,this['workspaceId']=_0x461a59;function _0x10f673(_0x36e538,_0x1b7206){return _0x46d3(_0x36e538-0xdc,_0x1b7206);}this[_0x10f673(0x24e,0x27d)]=_0x1e978c||'/sdk/v1',this[_0x10f673(0x2ed,0x2fc)]={'filters':[]};}[_0x294921(-0x44,-0x14)](_0x27c7d3='*',_0xa54851){function _0x537377(_0x54d9f9,_0x363a20){return _0x46d3(_0x363a20-0x6e,_0x54d9f9);}return this[_0x537377(0x2e5,0x27f)]['select']=_0x27c7d3,this;}[_0x294921(0x76,0x2)](data,_0x39fd46){function _0x4c376e(_0x30bfab,_0x14ee73){return _0x46d3(_0x30bfab-0x29c,_0x14ee73);}return this['executeQuery']('POST',this['restUrl']+'/'+this[_0x4c376e(0x498,0x461)]+_0x4c376e(0x453,0x429),{'data':data,'options':_0x39fd46});}[_0x294921(0x50,0x11)](data,_0x3e993c){this['query'][_0x30192b(-0x151,-0x196)]=data,this[_0x30192b(-0x18d,-0x1ec)]['updateOptions']=_0x3e993c;function _0x30192b(_0x107e1e,_0x6c451f){return _0x46d3(_0x107e1e- -0x39e,_0x6c451f);}return this;}['upsert'](data,_0x161097){function _0x4b0fe3(_0x14daeb,_0xbf18a5){return _0x46d3(_0xbf18a5-0x188,_0x14daeb);}return this[_0x4b0fe3(0x349,0x3c2)]('POST',this['restUrl']+'/'+this[_0x4b0fe3(0x3b0,0x384)]+_0x4b0fe3(0x355,0x38d),{'data':data,'options':{..._0x161097,'upsert':!![]}});}[_0x294921(0x38,-0x2a)](_0x245f16){function _0x2b9412(_0x2f7119,_0x3cee9a){return _0x46d3(_0x3cee9a- -0x21f,_0x2f7119);}return this[_0x2b9412(0x7e,-0xe)][_0x2b9412(-0x106,-0x87)]=_0x245f16,this['query'][_0x2b9412(-0x1a,-0x49)]=!![],this;}['eq'](_0x4024a0,_0x5422f5){this[_0x205e16(0x3c,-0x34)]['filters']['push']({'column':_0x4024a0,'operator':'eq','value':_0x5422f5});function _0x205e16(_0x56c20d,_0x182315){return _0x46d3(_0x56c20d- -0x1d5,_0x182315);}return this;}['neq'](_0x20b8e1,_0x4bb2bc){this[_0x4a8459(0x36c,0x383)][_0x4a8459(0x3d7,0x38b)][_0x4a8459(0x398,0x336)]({'column':_0x20b8e1,'operator':'neq','value':_0x4bb2bc});function _0x4a8459(_0x59d5d4,_0x4efd15){return _0x46d3(_0x4efd15-0x172,_0x59d5d4);}return this;}['gt'](_0x3c4032,_0x494e9f){this['query']['filters'][_0xbf7d3d(0x52d,0x58c)]({'column':_0x3c4032,'operator':'gt','value':_0x494e9f});function _0xbf7d3d(_0x4f7ad8,_0x14bdac){return _0x46d3(_0x14bdac-0x3c8,_0x4f7ad8);}return this;}[_0x294921(0xbf,0x7a)](_0x249400,_0x21a002){function _0x4dc382(_0x166111,_0x4af1fb){return _0x46d3(_0x166111- -0x1e5,_0x4af1fb);}return this[_0x4dc382(0x2c,0xa9)][_0x4dc382(0x34,0x58)]['push']({'column':_0x249400,'operator':_0x4dc382(0x43,-0x11),'value':_0x21a002}),this;}['lt'](_0x6d19c9,_0x7e86db){this[_0xff8829(0x235,0x2a6)]['filters'][_0xff8829(0x1e8,0x178)]({'column':_0x6d19c9,'operator':'lt','value':_0x7e86db});function _0xff8829(_0x168478,_0x25d628){return _0x46d3(_0x168478-0x24,_0x25d628);}return this;}['lte'](_0x1abe3f,_0x1eb1d4){function _0x935c19(_0x2fb795,_0x62ba07){return _0x46d3(_0x62ba07- -0x23a,_0x2fb795);}return this[_0x935c19(0x1f,-0x29)][_0x935c19(-0x16,-0x21)]['push']({'column':_0x1abe3f,'operator':_0x935c19(0x21,0x28),'value':_0x1eb1d4}),this;}['like'](_0x2112b7,_0x6ff611){function _0x1e72a4(_0x18257b,_0x34c9df){return _0x46d3(_0x34c9df-0xa4,_0x18257b);}return this['query']['filters'][_0x1e72a4(0x204,0x268)]({'column':_0x2112b7,'operator':_0x1e72a4(0x1ba,0x21c),'value':_0x6ff611}),this;}['ilike'](_0x5c8c35,_0x19b555){this[_0x526165(0x5e2,0x58c)]['filters']['push']({'column':_0x5c8c35,'operator':_0x526165(0x5b9,0x59d),'value':_0x19b555});function _0x526165(_0x28a756,_0x1fcc18){return _0x46d3(_0x28a756-0x3d1,_0x1fcc18);}return this;}['is'](_0x20b021,_0x5e78d5){this['query'][_0x44f8df(0x451,0x3f6)][_0x44f8df(0x3fc,0x410)]({'column':_0x20b021,'operator':'is','value':_0x5e78d5});function _0x44f8df(_0x276ffb,_0x369440){return _0x46d3(_0x276ffb-0x238,_0x369440);}return this;}['in'](_0x561173,_0x5b8d99){this[_0x183ce2(0xcf,0x129)][_0x183ce2(0x13b,0x131)]['push']({'column':_0x561173,'operator':'in','value':_0x5b8d99});function _0x183ce2(_0x2a8037,_0x4d7754){return _0x46d3(_0x4d7754- -0xe8,_0x2a8037);}return this;}[_0x294921(0x52,-0x2f)](_0x3af99b,_0xfdb906){this['query']['filters'][_0x41854f(0x5a1,0x600)]({'column':_0x3af99b,'operator':_0x41854f(0x55c,0x53f),'value':_0xfdb906});function _0x41854f(_0x15738a,_0x4a2974){return _0x46d3(_0x15738a-0x3dd,_0x4a2974);}return this;}[_0x294921(0x25,-0x61)](_0x9de57c){Object[_0x24ff13(0x388,0x34c)](_0x9de57c)['forEach'](([_0x1c03c0,_0x548139])=>{this['eq'](_0x1c03c0,_0x548139);});function _0x24ff13(_0x13984a,_0xce36e4){return _0x46d3(_0x13984a-0x18d,_0xce36e4);}return this;}[_0x294921(0xa3,0xa0)](_0x4f301d,_0x2f7ec4){!this['query'][_0x4b6114(-0x117,-0xc0)]&&(this['query']['order']=[]);this[_0x4b6114(-0x105,-0xfd)]['order']['push']({'column':_0x4f301d,'ascending':_0x2f7ec4?.['ascending']!==![]});function _0x4b6114(_0xf8871b,_0x2db352){return _0x46d3(_0x2db352- -0x30e,_0xf8871b);}return this;}[_0x294921(-0xcf,-0x5e)](count){return this['query']['limit']=count,this;}[_0x294921(0x29,-0x45)](from,_0x51c078){return this['query']['range']={'from':from,'to':_0x51c078},this;}async[_0x294921(0x7f,0x68)](){function _0x26f514(_0x243474,_0x766ee5){return _0x46d3(_0x766ee5-0x32b,_0x243474);}if(this[_0x26f514(0x5af,0x53c)]['updateData'])return this['executeQuery']('PATCH',this['restUrl']+'/'+this[_0x26f514(0x4f2,0x527)],{'data':this[_0x26f514(0x591,0x53c)]['updateData'],'options':this['query'][_0x26f514(0x582,0x53d)],'filters':this['query'][_0x26f514(0x516,0x544)]});else return this[_0x26f514(0x513,0x53c)][_0x26f514(0x4db,0x501)]?this['executeQuery']('DELETE',this[_0x26f514(0x41f,0x49d)]+'/'+this[_0x26f514(0x552,0x527)]+'?operation=delete',{'options':this['query'][_0x26f514(0x503,0x4c3)],'filters':this[_0x26f514(0x56c,0x53c)]['filters']}):this[_0x26f514(0x581,0x565)]('GET',this[_0x26f514(0x499,0x49d)]+'/'+this[_0x26f514(0x561,0x527)]+_0x26f514(0x57a,0x53f),{'select':this[_0x26f514(0x4fa,0x53c)][_0x26f514(0x4a5,0x4c5)],'filters':this['query'][_0x26f514(0x4fd,0x544)],'order':this['query']['order'],'limit':this['query']['limit'],'range':this[_0x26f514(0x504,0x53c)]['range']});}async[_0x294921(-0xad,-0x40)](){this['limit'](0x1);function _0x271d9c(_0x437dd9,_0x3fb1e8){return _0x46d3(_0x437dd9- -0x1e2,_0x3fb1e8);}const result=await this[_0x271d9c(0x34,0x26)]();return{'data':result['data']?.[0x0]||null,'error':result['error']};}async['executeQuery'](_0x3335f2,_0x16b908,_0x45771a){function _0x872c06(_0x493b71,_0x261836){return _0x46d3(_0x261836-0x264,_0x493b71);}try{let response;const headers={};this['workspaceId']&&(headers['x-workspace-id']=this['workspaceId']);if(_0x3335f2==='GET'){const _0x37681b=_0x16b908[_0x872c06(0x3d2,0x3e2)]('?'),_0x2187e7=_0x37681b[0x0],existingParams=new URLSearchParams(_0x37681b[0x1]||'');if(_0x45771a['select'])existingParams[_0x872c06(0x39d,0x416)](_0x872c06(0x3a5,0x3fe),_0x45771a[_0x872c06(0x375,0x3fe)]);_0x45771a[_0x872c06(0x4d8,0x47d)]?.['length']&&_0x45771a['filters']['forEach'](filter=>{function _0x56986f(_0x1102f5,_0x5d8117){return _0x46d3(_0x1102f5-0x368,_0x5d8117);}existingParams[_0x56986f(0x51a,0x4ae)](filter['column'],filter['operator']+'.'+filter[_0x56986f(0x532,0x4bf)]);});if(_0x45771a['order']?.[_0x872c06(0x3ef,0x403)]){const orderStr=_0x45771a[_0x872c06(0x4a4,0x4b2)][_0x872c06(0x40d,0x3c6)](_0x573b3d=>''+_0x573b3d['column']+(_0x573b3d['ascending']?_0x872c06(0x4ae,0x438):_0x872c06(0x484,0x402)))[_0x872c06(0x43e,0x45d)](',');existingParams[_0x872c06(0x433,0x416)](_0x872c06(0x475,0x4b2),orderStr);}if(_0x45771a['limit'])existingParams[_0x872c06(0x48b,0x416)](_0x872c06(0x421,0x3b4),_0x45771a['limit'][_0x872c06(0x393,0x3f1)]());_0x45771a['range']&&(existingParams[_0x872c06(0x459,0x416)]('offset',_0x45771a[_0x872c06(0x3d3,0x3cd)][_0x872c06(0x490,0x499)]['toString']()),existingParams[_0x872c06(0x43e,0x416)](_0x872c06(0x3b3,0x3b4),(_0x45771a[_0x872c06(0x44f,0x3cd)]['to']-_0x45771a['range']['from']+0x1)[_0x872c06(0x41b,0x3f1)]())),response=await this[_0x872c06(0x48b,0x417)]['get'](_0x2187e7+'?'+existingParams['toString'](),{'headers':headers});}else{if(_0x3335f2==='DELETE'){const _0x1710cb=_0x16b908['split']('?'),_0x5baa68=_0x1710cb[0x0],existingParams=new URLSearchParams(_0x1710cb[0x1]||'');!existingParams['has'](_0x872c06(0x41a,0x47c))&&existingParams['append']('operation','delete');_0x45771a['filters']?.[_0x872c06(0x37f,0x403)]&&_0x45771a['filters']['forEach'](filter=>{function _0x1c980e(_0x5e6e3a,_0x388b05){return _0x46d3(_0x388b05-0x1f2,_0x5e6e3a);}existingParams[_0x1c980e(0x341,0x3a4)](filter[_0x1c980e(0x3ae,0x383)],filter[_0x1c980e(0x3ab,0x3b5)]+'.'+filter[_0x1c980e(0x387,0x3bc)]);});const deleteUrl=_0x5baa68+'?'+existingParams['toString']();console[_0x872c06(0x460,0x46a)]('\uD83D\uDD27 DELETE URL construída:',deleteUrl),console[_0x872c06(0x4a5,0x46a)]('\uD83D\uDD27 DELETE headers:',headers),console['log']('\uD83D\uDD27 DELETE filtros originais:',_0x45771a['filters']),response=await this['httpClient'][_0x872c06(0x45e,0x3e8)](deleteUrl,{'headers':headers});}else{if(_0x3335f2==='PATCH'){const _0x5ef162=_0x16b908[_0x872c06(0x39b,0x3e2)]('?'),_0x5d4139=_0x5ef162[0x0],existingParams=new URLSearchParams(_0x5ef162[0x1]||'');!existingParams[_0x872c06(0x3b7,0x435)]('operation')&&existingParams[_0x872c06(0x3d1,0x416)]('operation',_0x872c06(0x3e2,0x423));_0x45771a['filters']?.['length']&&_0x45771a['filters'][_0x872c06(0x437,0x3c3)](filter=>{function _0x36aa56(_0x1826e2,_0x29797b){return _0x46d3(_0x29797b- -0x1df,_0x1826e2);}existingParams['append'](filter['column'],filter[_0x36aa56(0x62,-0x1c)]+'.'+filter[_0x36aa56(-0x34,-0x15)]);});_0x45771a['options']?.[_0x872c06(0x4f6,0x4c5)]&&(headers[_0x872c06(0x414,0x3e6)]=_0x45771a[_0x872c06(0x470,0x3f8)][_0x872c06(0x48e,0x4c5)]);const updateUrl=_0x5d4139+'?'+existingParams[_0x872c06(0x40a,0x3f1)]();response=await this['httpClient'][_0x872c06(0x40c,0x42a)](updateUrl,_0x45771a[_0x872c06(0x492,0x425)],{'headers':headers});}else{let _0x37b02b=_0x45771a[_0x872c06(0x436,0x425)];!headers['Prefer']&&(headers['Prefer']=_0x872c06(0x515,0x4b4)),_0x45771a['options']?.['upsert']&&(headers['Prefer']=_0x872c06(0x3a4,0x3e5)),_0x45771a[_0x872c06(0x3eb,0x3ef)]&&(_0x37b02b=_0x45771a[_0x872c06(0x3d0,0x3ef)]),response=await this[_0x872c06(0x3aa,0x417)][_0x872c06(0x34f,0x3d5)](_0x16b908,_0x37b02b,{'headers':headers});}}}return{'data':response['data'],'error':null,'count':response['headers']?.[_0x872c06(0x44b,0x3ff)]?parseInt(response[_0x872c06(0x347,0x3be)]['x-total-count']):undefined};}catch(_0x51de63){return{'data':null,'error':_0x51de63 instanceof EBaaSError?_0x51de63:new EBaaSError(_0x51de63 instanceof Error?_0x51de63[_0x872c06(0x526,0x4c0)]:_0x872c06(0x4c3,0x45c),0x0,_0x51de63)};}}}class CustomDatabaseManager{constructor(_0x1d3c77,_0x150e4c){this[_0x3a99df(0x149,0x1cd)]=_0x1d3c77;function _0x3a99df(_0x5872b1,_0xd61cb3){return _0x46d3(_0x5872b1- -0x6a,_0xd61cb3);}this['workspaceId']=_0x150e4c;}async[_0x294921(-0xc7,-0x46)](){function _0x4df875(_0x377714,_0x42a0c4){return _0x46d3(_0x377714-0x1e0,_0x42a0c4);}if(!this['workspaceId'])return{'hasCustomDatabase':![]};try{const response=await this['httpClient']['get']('/admin/v1/workspace/custom-database',{'headers':{'x-workspace-id':this[_0x4df875(0x3a0,0x360)]}});if(response['status']===0xc8&&response[_0x4df875(0x3a1,0x38a)]?.[_0x4df875(0x385,0x323)]){const config=response['data']['config'],_0x4f460f={'host':config[_0x4df875(0x35d,0x2f2)],'port':config[_0x4df875(0x40a,0x37f)],'database':config['postgresDatabase'],'username':config['postgresUsername'],'password':'','schema':config[_0x4df875(0x354,0x345)],'sslEnabled':config[_0x4df875(0x366,0x2f3)]};return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x4f460f},this['detectedConfig'];}}catch(_0x51e3cd){if(_0x51e3cd?.[_0x4df875(0x338,0x2b5)]===0x194)return this['detectedConfig']={'hasCustomDatabase':![]},this[_0x4df875(0x43e,0x404)];console[_0x4df875(0x3d0,0x3b0)]('Failed to detect custom database configuration:',_0x51e3cd);}return this[_0x4df875(0x43e,0x43a)]={'hasCustomDatabase':![]},this['detectedConfig'];}async['testConnection'](_0x2dd835){function _0x4fbb1f(_0x2b6bbf,_0x3a2f9b){return _0x46d3(_0x2b6bbf- -0x170,_0x3a2f9b);}try{const response=await this[_0x4fbb1f(0x43,0x25)][_0x4fbb1f(0x1,-0x6)]('/admin/v1/workspace/custom-database/test-connection',_0x2dd835,{'headers':this['workspaceId']?{'X-Workspace-ID':this['workspaceId']}:{}});return response['data'];}catch(_0x4d2495){return{'success':![],'message':_0x4d2495?.['message']||'Failed\x20to\x20test\x20connection'};}}async['configureCustomDatabase'](_0x25f721){if(!this['workspaceId'])throw new Error('Workspace ID is required to configure custom database');const response=await this['httpClient'][_0x76b320(0x66,-0x1e)]('/admin/v1/workspace/custom-database',{'workspaceId':this[_0x76b320(-0x33,0x31)],..._0x25f721},{'headers':{'X-Workspace-ID':this[_0x76b320(0x66,0x31)]}});function _0x76b320(_0x376ec8,_0x27a3a5){return _0x46d3(_0x27a3a5- -0x18f,_0x376ec8);}const config=response[_0x76b320(0x79,0x32)][_0x76b320(0x6c,0x16)];return this['detectedConfig']={'hasCustomDatabase':!![],'config':config,'credentials':_0x25f721},config;}async[_0x294921(0x1a,-0xa)](){if(!this[_0x13fd17(0x98,0xe2)])throw new Error('Workspace ID is required to remove custom database');await this['httpClient'][_0x13fd17(0xf0,0xa6)]('/admin/v1/workspace/custom-database',{'headers':{'X-Workspace-ID':this[_0x13fd17(0xe2,0xe2)]}});function _0x13fd17(_0x422494,_0x29d9b6){return _0x46d3(_0x29d9b6- -0xde,_0x422494);}this[_0x13fd17(0x1e2,0x180)]={'hasCustomDatabase':![]};}[_0x294921(-0xc6,-0x3e)](){function _0x578cd0(_0xe53021,_0x2a8109){return _0x46d3(_0xe53021- -0x30e,_0x2a8109);}return this[_0x578cd0(-0xb0,-0xa6)];}['hasCustomDatabase'](){function _0x324c2c(_0x355d0a,_0x28f2d3){return _0x46d3(_0x355d0a-0x173,_0x28f2d3);}return this[_0x324c2c(0x3d1,0x43d)]?.[_0x324c2c(0x36a,0x32f)]??![];}[_0x294921(0x3b,0x73)](){function _0x12a9a7(_0x38a129,_0x1f1c5e){return _0x46d3(_0x38a129-0x22b,_0x1f1c5e);}return this[_0x12a9a7(0x489,0x4bb)]?.['credentials'];}['setWorkspaceId'](_0xbb9bab){this['workspaceId']=_0xbb9bab;function _0x3c26c0(_0x17a2cb,_0x36119a){return _0x46d3(_0x36119a-0x3e1,_0x17a2cb);}this[_0x3c26c0(0x687,0x63f)]=undefined;}['getWorkspaceId'](){return this['workspaceId'];}[_0x294921(-0x15,-0x4a)](){function _0x144d1b(_0x512e72,_0x558aec){return _0x46d3(_0x512e72-0x3ab,_0x558aec);}return{'workspaceId':this['workspaceId'],'hasConfig':this['hasCustomDatabase'](),'configDetails':this['detectedConfig']?.['credentials']?{'host':this['detectedConfig'][_0x144d1b(0x5cb,0x60e)]['host'],'port':this[_0x144d1b(0x609,0x618)]['credentials']['port'],'database':this['detectedConfig'][_0x144d1b(0x5cb,0x56f)][_0x144d1b(0x59c,0x601)],'schema':this[_0x144d1b(0x609,0x5d0)]['credentials']['schema']||_0x144d1b(0x4f9,0x4a8),'sslEnabled':this['detectedConfig']['credentials'][_0x144d1b(0x531,0x597)]||![]}:undefined};}}class DatabaseClient{constructor(_0x4fd1e8,_0x98aff3,_0x17c0b9){this['httpClient']=_0x4fd1e8,this['customDatabaseManager']=new CustomDatabaseManager(_0x4fd1e8,_0x98aff3);function _0x23beb2(_0x30cd44,_0x60fd57){return _0x46d3(_0x60fd57-0x80,_0x30cd44);}this[_0x23beb2(0x1de,0x1f2)]=_0x17c0b9||'/sdk/v1';}[_0x294921(0x81,0x87)](_0x1d2846){function _0x155545(_0x2aee9b,_0xf3202){return _0x46d3(_0x2aee9b-0x361,_0xf3202);}return new QueryBuilder(this['httpClient'],_0x1d2846,this[_0x155545(0x55b,0x59b)],this['customDatabaseManager'][_0x155545(0x55e,0x5d4)](),this[_0x155545(0x4d3,0x475)]);}[_0x294921(-0x94,-0xb)](_0x4087e1,_0x59f4b5){return this['httpClient']['post']('/rpc/'+_0x4087e1,_0x59f4b5);}[_0x294921(0x53,0x8a)](_0x4b1fca){const _0x23b900=new DatabaseClient(this['httpClient'],this[_0x3f8beb(0x2d1,0x2e5)]['getWorkspaceId'](),this[_0x3f8beb(0x2a3,0x291)]);_0x23b900[_0x3f8beb(0x32b,0x325)]=_0x4b1fca;function _0x3f8beb(_0x32c5cc,_0x3d784a){return _0x46d3(_0x32c5cc-0x131,_0x3d784a);}return _0x23b900[_0x3f8beb(0x2d1,0x2fb)]=this['customDatabaseManager'],_0x23b900;}async[_0x294921(-0x85,-0x46)](){function _0x20c2fc(_0x55e833,_0x225978){return _0x46d3(_0x225978- -0xd2,_0x55e833);}return this[_0x20c2fc(0xee,0xce)]['detectCustomDatabase']();}async['testCustomConnection'](_0xb4cad9){function _0x166339(_0x4a68b8,_0x43fbe5){return _0x46d3(_0x4a68b8- -0x8a,_0x43fbe5);}return this[_0x166339(0x116,0x184)][_0x166339(0x15a,0x112)](_0xb4cad9);}async[_0x294921(0x27,0x48)](_0x46f577){function _0x56db48(_0x4fa32e,_0x4b6961){return _0x46d3(_0x4b6961-0x348,_0x4fa32e);}return this['customDatabaseManager'][_0x56db48(0x581,0x53e)](_0x46f577);}async['removeCustomDatabase'](){function _0x2f6e70(_0x11882a,_0x2fa683){return _0x46d3(_0x11882a-0x1e7,_0x2fa683);}return this[_0x2f6e70(0x387,0x33e)]['removeCustomDatabase']();}[_0x294921(0x7f,0x5c)](){return this['customDatabaseManager']['hasCustomDatabase']();}['getCustomDatabaseStatus'](){function _0x1df653(_0x1c4517,_0x221011){return _0x46d3(_0x221011- -0xa7,_0x1c4517);}return this[_0x1df653(0x70,0xf9)]['getStatus']();}['setWorkspaceId'](_0x55b584){function _0x5888dd(_0x1b34d1,_0x3bb5ac){return _0x46d3(_0x3bb5ac-0x56,_0x1b34d1);}this[_0x5888dd(0x275,0x1f6)]['setWorkspaceId'](_0x55b584);}async['initialize'](){function _0x14a01f(_0x29898e,_0x3eb13b){return _0x46d3(_0x29898e-0x229,_0x3eb13b);}try{await this[_0x14a01f(0x3c9,0x3af)]['detectCustomDatabase']();}catch(_0x517453){console[_0x14a01f(0x419,0x38d)]('Failed to initialize custom database detection:',_0x517453);}}}class StorageBucket{constructor(_0x5eb694,bucketId){function _0x403b77(_0x3003ba,_0x381e0e){return _0x46d3(_0x3003ba- -0x3c,_0x381e0e);}this[_0x403b77(0x177,0x15e)]=_0x5eb694,this[_0x403b77(0x18c,0x1cd)]=bucketId;}async['upload'](_0xfcb033,_0x12b0fa,_0x27e882){function _0x1d3a18(_0xdfd1d9,_0x2e399a){return _0x46d3(_0x2e399a- -0x312,_0xdfd1d9);}try{const _0x36f057=new FormData();if(_0x12b0fa instanceof File)_0x36f057['append']('file',_0x12b0fa);else{if(_0x12b0fa instanceof Blob)_0x36f057[_0x1d3a18(-0x14e,-0x160)](_0x1d3a18(-0xfa,-0x13d),_0x12b0fa,_0xfcb033);else{if(_0x12b0fa instanceof ArrayBuffer)_0x36f057[_0x1d3a18(-0x160,-0x160)]('file',new Blob([_0x12b0fa]),_0xfcb033);else typeof _0x12b0fa==='string'&&_0x36f057['append']('file',new Blob([_0x12b0fa],{'type':'text/plain'}),_0xfcb033);}}_0x36f057['append']('path',_0xfcb033);_0x27e882?.['cacheControl']&&_0x36f057['append'](_0x1d3a18(-0x146,-0x133),_0x27e882[_0x1d3a18(-0x1bf,-0x133)]);_0x27e882?.[_0x1d3a18(-0x71,-0xd2)]&&_0x36f057[_0x1d3a18(-0xd5,-0x160)]('contentType',_0x27e882['contentType']);_0x27e882?.[_0x1d3a18(-0xb3,-0xeb)]&&_0x36f057['append'](_0x1d3a18(-0x8c,-0xeb),JSON[_0x1d3a18(-0x173,-0x1b6)](_0x27e882[_0x1d3a18(-0x13b,-0xeb)]));const _0x53d828='/storage/buckets/'+this[_0x1d3a18(-0xc3,-0x14a)]+'/files'+(_0x27e882?.['upsert']?_0x1d3a18(-0x124,-0xd5):''),response=await this[_0x1d3a18(-0x15b,-0x15f)][_0x1d3a18(-0x1cc,-0x1a1)](_0x53d828,_0x36f057,{'headers':{'Content-Type':_0x1d3a18(-0x1f8,-0x17c)}});return{'data':response[_0x1d3a18(-0x114,-0x151)],'error':null};}catch(_0x1e1e66){return{'data':null,'error':_0x1e1e66 instanceof EBaaSError?_0x1e1e66:new EBaaSError(_0x1e1e66 instanceof Error?_0x1e1e66['message']:_0x1d3a18(-0x11d,-0x102),0x0,_0x1e1e66)};}}async[_0x294921(0xb7,0x45)](_0x2abe66,_0x225a79){function _0x1d7f87(_0x539e06,_0x2f15d8){return _0x46d3(_0x2f15d8-0xe,_0x539e06);}try{const _0x1b1f85=new URLSearchParams();_0x225a79?.['transform']&&Object[_0x1d7f87(0x1a0,0x209)](_0x225a79[_0x1d7f87(0x21b,0x23a)])['forEach'](([_0x3d13fc,_0x6c562b])=>{_0x6c562b!==undefined&&_0x1b1f85['append'](_0x3d13fc,String(_0x6c562b));});const _0x168a63='/storage/buckets/'+this['bucketId']+_0x1d7f87(0x1da,0x263)+_0x2abe66+(_0x1b1f85[_0x1d7f87(0x1a8,0x19b)]()?'?'+_0x1b1f85['toString']():''),response=await this[_0x1d7f87(0x237,0x1c1)][_0x1d7f87(0x1dc,0x23d)](_0x168a63,{'responseType':'blob'});return{'data':response['data'],'error':null};}catch(_0x24bf86){return{'data':null,'error':_0x24bf86 instanceof EBaaSError?_0x24bf86:new EBaaSError(_0x24bf86 instanceof Error?_0x24bf86[_0x1d7f87(0x272,0x26a)]:_0x1d7f87(0x22d,0x1d5),0x0,_0x24bf86)};}}async[_0x294921(-0x6c,0x8)](_0x2d802a,_0x3111ad){function _0x54ff48(_0x1a4c9d,_0x32dc2c){return _0x46d3(_0x1a4c9d- -0x63,_0x32dc2c);}try{const _0x4b1a60=new URLSearchParams();_0x2d802a&&_0x4b1a60['append']('prefix',_0x2d802a);_0x3111ad?.['limit']&&_0x4b1a60[_0x54ff48(0x14f,0xfc)](_0x54ff48(0xed,0x113),String(_0x3111ad['limit']));_0x3111ad?.['offset']&&_0x4b1a60['append'](_0x54ff48(0x104,0x88),String(_0x3111ad[_0x54ff48(0x104,0x146)]));_0x3111ad?.[_0x54ff48(0x184,0x1f7)]&&_0x4b1a60[_0x54ff48(0x14f,0x1c4)]('sortBy',JSON['stringify'](_0x3111ad['sortBy']));_0x3111ad?.['search']&&_0x4b1a60[_0x54ff48(0x14f,0x167)]('search',_0x3111ad['search']);const _0x3b8cf8='/storage/buckets/'+this['bucketId']+'/files'+(_0x4b1a60['toString']()?'?'+_0x4b1a60['toString']():''),response=await this[_0x54ff48(0x150,0x103)]['get'](_0x3b8cf8);return{'data':response['data'],'error':null};}catch(_0x2fbe07){return{'data':null,'error':_0x2fbe07 instanceof EBaaSError?_0x2fbe07:new EBaaSError(_0x2fbe07 instanceof Error?_0x2fbe07['message']:'Failed\x20to\x20list\x20files',0x0,_0x2fbe07)};}}async[_0x294921(0xa,0x88)](_0x103f3a){function _0x22c37b(_0x28d780,_0x1eb27a){return _0x46d3(_0x1eb27a-0x4c,_0x28d780);}try{const response=await this['httpClient']['delete'](_0x22c37b(0x185,0x1dc)+this['bucketId']+_0x22c37b(0x282,0x27d),{'data':{'paths':_0x103f3a}});return{'data':response['data'],'error':null};}catch(_0x2dc9ff){return{'data':null,'error':_0x2dc9ff instanceof EBaaSError?_0x2dc9ff:new EBaaSError(_0x2dc9ff instanceof Error?_0x2dc9ff[_0x22c37b(0x325,0x2a8)]:_0x22c37b(0x226,0x1d8),0x0,_0x2dc9ff)};}}async[_0x294921(0x5b,0x7)](fromPath,_0x351076){function _0x2a5ab0(_0x479594,_0x530879){return _0x46d3(_0x530879-0x398,_0x479594);}try{const response=await this[_0x2a5ab0(0x5ae,0x54b)]['post']('/storage/buckets/'+this[_0x2a5ab0(0x5d5,0x560)]+_0x2a5ab0(0x5ca,0x5eb),{'sourceKey':fromPath,'destinationKey':_0x351076});return{'data':response[_0x2a5ab0(0x5c9,0x559)],'error':null};}catch(_0x441e42){return{'data':null,'error':_0x441e42 instanceof EBaaSError?_0x441e42:new EBaaSError(_0x441e42 instanceof Error?_0x441e42[_0x2a5ab0(0x62a,0x5f4)]:'Failed\x20to\x20move\x20file',0x0,_0x441e42)};}}async[_0x294921(-0x55,0x1e)](fromPath,_0x292289){function _0xab4545(_0xae8b6f,_0x1f6da0){return _0x46d3(_0x1f6da0-0x19e,_0xae8b6f);}try{const response=await this['httpClient'][_0xab4545(0x306,0x30f)](_0xab4545(0x380,0x32e)+this['bucketId']+'/files/copy',{'sourceKey':fromPath,'destinationKey':_0x292289});return{'data':response['data'],'error':null};}catch(_0x5372b3){return{'data':null,'error':_0x5372b3 instanceof EBaaSError?_0x5372b3:new EBaaSError(_0x5372b3 instanceof Error?_0x5372b3['message']:_0xab4545(0x328,0x2f1),0x0,_0x5372b3)};}}async['createSignedUrl'](_0x121faa,_0x270372,_0x233a24){function _0x5c3bc3(_0x2c4c6e,_0x4e5f17){return _0x46d3(_0x4e5f17- -0xf8,_0x2c4c6e);}try{const response=await this[_0x5c3bc3(0x37,0xbb)]['post']('/storage/buckets/'+this[_0x5c3bc3(0x122,0xd0)]+_0x5c3bc3(0x1cb,0x15d)+_0x121faa+_0x5c3bc3(0x128,0xa1),{'expiresIn':_0x270372,..._0x233a24});return{'data':response['data'],'error':null};}catch(_0x2aa398){return{'data':null,'error':_0x2aa398 instanceof EBaaSError?_0x2aa398:new EBaaSError(_0x2aa398 instanceof Error?_0x2aa398['message']:_0x5c3bc3(0x51,0x9f),0x0,_0x2aa398)};}}['getPublicUrl'](_0x1b3615,_0xf71ed5){const _0x521b9f=new URLSearchParams();function _0x358fbe(_0x519f9f,_0x2d273a){return _0x46d3(_0x519f9f- -0x267,_0x2d273a);}_0xf71ed5?.['transform']&&Object['entries'](_0xf71ed5[_0x358fbe(-0x3b,0x2)])[_0x358fbe(-0x108,-0x12e)](([_0x4111eb,_0x1deec9])=>{_0x1deec9!==undefined&&_0x521b9f['append'](_0x4111eb,String(_0x1deec9));});const _0x377305=this['httpClient'][_0x358fbe(-0x2c,-0x6e)]||'',_0x6bb8fe=_0x377305+_0x358fbe(-0xd7,-0x13a)+this['bucketId']+_0x358fbe(-0x12,0x20)+_0x1b3615+(_0x521b9f['toString']()?'?'+_0x521b9f[_0x358fbe(-0xda,-0xe5)]():'');return{'data':{'publicUrl':_0x6bb8fe}};}async[_0x294921(0xe5,0x85)](_0x184d7a){function _0x3a3791(_0xbc1b95,_0x578ac3){return _0x46d3(_0x578ac3- -0x1a6,_0xbc1b95);}try{const response=await this[_0x3a3791(0x16,0xd)][_0x3a3791(0x31,0x89)](_0x3a3791(0x49,-0x16)+this['bucketId']+'/files/'+_0x184d7a+'/info');return{'data':response[_0x3a3791(0x3d,0x1b)],'error':null};}catch(_0x24df5f){return{'data':null,'error':_0x24df5f instanceof EBaaSError?_0x24df5f:new EBaaSError(_0x24df5f instanceof Error?_0x24df5f['message']:'Failed\x20to\x20get\x20file\x20info',0x0,_0x24df5f)};}}async['updateFileMetadata'](_0x3aa78b,metadata){function _0x33d6f6(_0x5f1208,_0x1057f6){return _0x46d3(_0x1057f6- -0x287,_0x5f1208);}try{const response=await this[_0x33d6f6(-0x7f,-0xd4)]['put'](_0x33d6f6(-0xf7,-0xf7)+this['bucketId']+_0x33d6f6(0x2f,-0x32)+_0x3aa78b+'/metadata',{'metadata':metadata});return{'data':response[_0x33d6f6(-0x12e,-0xc6)],'error':null};}catch(_0x44192c){return{'data':null,'error':_0x44192c instanceof EBaaSError?_0x44192c:new EBaaSError(_0x44192c instanceof Error?_0x44192c['message']:_0x33d6f6(-0xb8,-0xbc),0x0,_0x44192c)};}}}class StorageClient{constructor(_0x3348d3){this['httpClient']=_0x3348d3;}[_0x294921(0xd1,0x87)](bucketId){return new StorageBucket(this['httpClient'],bucketId);}async[_0x294921(-0xce,-0x48)](_0x3d6209,_0x406b4b){function _0x1594b6(_0x25a4bc,_0x12e362){return _0x46d3(_0x25a4bc-0x2ab,_0x12e362);}try{const response=await this['httpClient']['post']('/storage/buckets',{'id':_0x3d6209,..._0x406b4b});return{'data':response['data'],'error':null};}catch(_0x20dc7d){return{'data':null,'error':_0x20dc7d instanceof EBaaSError?_0x20dc7d:new EBaaSError(_0x20dc7d instanceof Error?_0x20dc7d[_0x1594b6(0x507,0x4de)]:'Failed\x20to\x20create\x20bucket',0x0,_0x20dc7d)};}}async['getBucket'](_0x58f659){function _0x1fe553(_0x4eaf2c,_0x5ca4df){return _0x46d3(_0x4eaf2c-0xd5,_0x5ca4df);}try{const response=await this[_0x1fe553(0x288,0x293)]['get'](_0x1fe553(0x265,0x232)+_0x58f659);return{'data':response['data'],'error':null};}catch(_0xd6e9bb){return{'data':null,'error':_0xd6e9bb instanceof EBaaSError?_0xd6e9bb:new EBaaSError(_0xd6e9bb instanceof Error?_0xd6e9bb['message']:_0x1fe553(0x2b2,0x25b),0x0,_0xd6e9bb)};}}async[_0x294921(-0xa4,-0x44)](){function _0x13979d(_0x34cc56,_0x5072b1){return _0x46d3(_0x34cc56- -0x203,_0x5072b1);}try{const response=await this[_0x13979d(-0x50,0x20)][_0x13979d(0x2c,0xaa)]('/storage/buckets');return{'data':response['data'],'error':null};}catch(_0x5aa400){return{'data':null,'error':_0x5aa400 instanceof EBaaSError?_0x5aa400:new EBaaSError(_0x5aa400 instanceof Error?_0x5aa400['message']:_0x13979d(-0xa0,-0x113),0x0,_0x5aa400)};}}async['updateBucket'](_0x39c42a,_0x480b9e){function _0x4cc340(_0x1fc3e4,_0x55a2d2){return _0x46d3(_0x1fc3e4- -0x341,_0x55a2d2);}try{const response=await this[_0x4cc340(-0x18e,-0x138)][_0x4cc340(-0x1e1,-0x1f3)](_0x4cc340(-0x1b1,-0x195)+_0x39c42a,_0x480b9e);return{'data':response[_0x4cc340(-0x180,-0x170)],'error':null};}catch(_0x34f550){return{'data':null,'error':_0x34f550 instanceof EBaaSError?_0x34f550:new EBaaSError(_0x34f550 instanceof Error?_0x34f550['message']:_0x4cc340(-0x19b,-0x185),0x0,_0x34f550)};}}async['deleteBucket'](_0x2980d2){function _0x150d64(_0x55243b,_0x1e49fa){return _0x46d3(_0x55243b-0x68,_0x1e49fa);}try{const response=await this['httpClient']['delete'](_0x150d64(0x1f8,0x1f4)+_0x2980d2);return{'data':response['data'],'error':null};}catch(_0x2bce25){return{'data':null,'error':_0x2bce25 instanceof EBaaSError?_0x2bce25:new EBaaSError(_0x2bce25 instanceof Error?_0x2bce25[_0x150d64(0x2c4,0x2ca)]:'Failed\x20to\x20delete\x20bucket',0x0,_0x2bce25)};}}async['getUsage'](){function _0x44d3b4(_0x2e8d1e,_0x152b56){return _0x46d3(_0x2e8d1e-0xcf,_0x152b56);}try{const response=await this[_0x44d3b4(0x282,0x2df)]['get'](_0x44d3b4(0x2d7,0x30d));return{'data':response['data'],'error':null};}catch(_0x47d104){return{'data':null,'error':_0x47d104 instanceof EBaaSError?_0x47d104:new EBaaSError(_0x47d104 instanceof Error?_0x47d104['message']:_0x44d3b4(0x224,0x1ae),0x0,_0x47d104)};}}}class EventManager{constructor(){function _0x13c229(_0x81c0a8,_0x265b52){return _0x46d3(_0x81c0a8- -0x332,_0x265b52);}this['events']=new Map(),this[_0x13c229(-0x1cd,-0x15f)]=0xa;}['on'](_0x961cd2,_0x315750){function _0x16956e(_0x104046,_0x34d592){return _0x46d3(_0x104046- -0x9b,_0x34d592);}!this[_0x16956e(0x1bf,0x137)][_0x16956e(0x136,0x155)](_0x961cd2)&&this['events']['set'](_0x961cd2,new Set()),this[_0x16956e(0x1bf,0x1ed)]['get'](_0x961cd2)[_0x16956e(0x173,0x169)](_0x315750);}[_0x294921(0xb4,0x2e)](_0x31e2c2,_0x66f0c0){function _0xf81f7f(_0x473ff8,_0x2bcf42){return _0x46d3(_0x473ff8- -0x71,_0x2bcf42);}if(!this['events']['has'](_0x31e2c2))return;const _0xe04138=this[_0xf81f7f(0x1e9,0x256)][_0xf81f7f(0x1be,0x1ba)](_0x31e2c2);_0x66f0c0?_0xe04138[_0xf81f7f(0x113,0x103)](_0x66f0c0):_0xe04138['clear'](),_0xe04138[_0xf81f7f(0x1cd,0x238)]===0x0&&this[_0xf81f7f(0x1e9,0x216)][_0xf81f7f(0x113,0x136)](_0x31e2c2);}['emit'](_0x1459c5,..._0x32483e){if(!this[_0x2d89ff(0x5be,0x541)]['has'](_0x1459c5))return![];const _0x58ebb4=this[_0x2d89ff(0x5be,0x5df)][_0x2d89ff(0x593,0x510)](_0x1459c5);function _0x2d89ff(_0x29f04f,_0x219d19){return _0x46d3(_0x29f04f-0x364,_0x219d19);}for(const _0xf74873 of _0x58ebb4){try{_0xf74873(..._0x32483e);}catch(_0x5431b5){console['error']('Error\x20in\x20event\x20listener\x20for\x20\x22'+_0x1459c5+'\x22:',_0x5431b5);}}return _0x58ebb4[_0x2d89ff(0x5a2,0x5f7)]>0x0;}['removeAllListeners'](_0x32bded){function _0x5e0fc3(_0x5e34c0,_0xd8eb19){return _0x46d3(_0x5e34c0- -0x308,_0xd8eb19);}_0x32bded?this[_0x5e0fc3(-0xae,-0x97)]['delete'](_0x32bded):this['events']['clear']();}['listenerCount'](_0x260b12){function _0x8121ec(_0x537a69,_0x4d4b36){return _0x46d3(_0x537a69-0x3b3,_0x4d4b36);}return this['events'][_0x8121ec(0x5e2,0x5ff)](_0x260b12)?.['size']??0x0;}['eventNames'](){function _0x2695c3(_0x276d07,_0x4bd95b){return _0x46d3(_0x276d07-0x1a1,_0x4bd95b);}return Array['from'](this['events'][_0x2695c3(0x326,0x3a4)]());}['listeners'](_0x780f1c){function _0x55c835(_0x563d3e,_0x48c971){return _0x46d3(_0x48c971- -0xf,_0x563d3e);}return Array[_0x55c835(0x2a8,0x226)](this[_0x55c835(0x22f,0x24b)][_0x55c835(0x24e,0x220)](_0x780f1c)??[]);}[_0x294921(0x46,0x6e)](_0x31eccf,_0x50ec08){this['on'](_0x31eccf,_0x50ec08);}['removeListener'](_0x3701e3,_0x32b89f){this['off'](_0x3701e3,_0x32b89f);}['once'](_0x4b9d4f,_0x233769){const _0x126db7=(..._0x473e96)=>{this['off'](_0x4b9d4f,_0x126db7),_0x233769(..._0x473e96);};this['on'](_0x4b9d4f,_0x126db7);}['prependListener'](_0x5ab693,_0x4de130){this['on'](_0x5ab693,_0x4de130);}[_0x294921(0x7b,0x33)](_0x4e75a8,_0x4139c6){const _0x3f9cb6=(..._0x4e63cd)=>{this['off'](_0x4e75a8,_0x3f9cb6),_0x4139c6(..._0x4e63cd);};this['on'](_0x4e75a8,_0x3f9cb6);}[_0x294921(0x58,-0xc)](_0x382185){this[_0x3319f4(0x23c,0x28f)]=_0x382185;function _0x3319f4(_0x373cca,_0x4ee421){return _0x46d3(_0x4ee421-0x12a,_0x373cca);}return this;}[_0x294921(-0x6e,-0x1b)](){function _0xd7a4e2(_0x46903e,_0x10b347){return _0x46d3(_0x46903e-0xe5,_0x10b347);}return this[_0xd7a4e2(0x24a,0x2ac)];}['rawListeners'](_0x452110){return this['listeners'](_0x452110);}}function _0x294921(_0x1e8750,_0x5d58be){return _0x46d3(_0x5d58be- -0x1ae,_0x1e8750);}class RealtimeChannel extends EventManager{constructor(_0x13cb2f,_0x3034d0){super(),this[_0x4d77d0(0x3b1,0x343)]=![],this[_0x4d77d0(0x3b5,0x36b)]=_0x4d77d0(0x349,0x327);function _0x4d77d0(_0x1fce69,_0x530a01){return _0x46d3(_0x1fce69-0x1cf,_0x530a01);}this['subscriptions']=new Map(),this['topic']=_0x13cb2f,this[_0x4d77d0(0x328,0x2de)]=_0x3034d0;}['subscribe'](_0x3b65f9){!this[_0x18472d(-0xda,-0xcb)]&&(this['joinedOnce']=!![],this['_join']());_0x3b65f9&&this['on'](_0x18472d(-0x17f,-0x155),_0x3b65f9);function _0x18472d(_0x15d3e8,_0x233e15){return _0x46d3(_0x233e15- -0x2ad,_0x15d3e8);}return this;}['onPostgresChanges'](filter,_0xf4243b){const _0x138da1='postgres_changes:'+JSON['stringify'](filter);this['on'](_0x138da1,_0xf4243b);function _0x2f1936(_0x1e3638,_0x288791){return _0x46d3(_0x288791-0x124,_0x1e3638);}const _0x11ef56={'unsubscribe':()=>{function _0x2736d7(_0x44a4a8,_0x15fc7f){return _0x46d3(_0x15fc7f- -0x35c,_0x44a4a8);}this['off'](_0x138da1,_0xf4243b),this[_0x2736d7(-0x156,-0x168)]['delete'](_0x138da1);}};return this[_0x2f1936(0x335,0x318)]['set'](_0x138da1,_0x11ef56),this['socket']?.[_0x2f1936(0x2f5,0x33f)]&&this['state']==='joined'&&this['socket']['emit']('subscribe_postgres_changes',{'topic':this[_0x2f1936(0x2f3,0x342)],'filter':filter,'ref':this['makeRef']()}),_0x11ef56;}[_0x294921(0x7d,0x35)](filter,_0x5f17bf){const _0x47bf8b='broadcast:'+JSON['stringify'](filter);this['on'](_0x47bf8b,_0x5f17bf);const _0x3734b9={'unsubscribe':()=>{this[_0x42bd34(0x42a,0x467)](_0x47bf8b,_0x5f17bf);function _0x42bd34(_0x51ea37,_0x25644d){return _0x46d3(_0x51ea37-0x24e,_0x25644d);}this['subscriptions']['delete'](_0x47bf8b);}};this['subscriptions'][_0x146f85(-0x274,-0x1ed)](_0x47bf8b,_0x3734b9);function _0x146f85(_0x2ac0fa,_0x35725a){return _0x46d3(_0x35725a- -0x360,_0x2ac0fa);}return _0x3734b9;}[_0x294921(-0x7e,-0x20)](filter,_0x1682ac){const _0x4e3ec9=_0x528273(-0x1c8,-0x1f8)+JSON['stringify'](filter);this['on'](_0x4e3ec9,_0x1682ac);function _0x528273(_0x30bdde,_0x3ab3ce){return _0x46d3(_0x3ab3ce- -0x3a2,_0x30bdde);}const _0x1275f2={'unsubscribe':()=>{this['off'](_0x4e3ec9,_0x1682ac);function _0x5df842(_0xc9cd97,_0x5b7dc1){return _0x46d3(_0xc9cd97- -0x28a,_0x5b7dc1);}this['subscriptions'][_0x5df842(-0x106,-0x176)](_0x4e3ec9);}};return this[_0x528273(-0x225,-0x1ae)][_0x528273(-0x24c,-0x22f)](_0x4e3ec9,_0x1275f2),_0x1275f2;}[_0x294921(0x2e,0x7b)](_0x5a4ba2){return new Promise(_0x179ca5=>{function _0x2714ab(_0x581ce4,_0x35df6b){return _0x46d3(_0x581ce4-0x163,_0x35df6b);}this['socket']?.[_0x2714ab(0x37e,0x305)]&&this[_0x2714ab(0x349,0x30c)]==='joined'?(this[_0x2714ab(0x2bc,0x2b8)]['emit'](_0x2714ab(0x34d,0x364),{'topic':this[_0x2714ab(0x381,0x353)],'event':_0x5a4ba2['event'],'payload':_0x5a4ba2,'ref':this[_0x2714ab(0x33e,0x38d)]()}),_0x179ca5('ok')):_0x179ca5(_0x2714ab(0x2d8,0x35f));});}['track'](_0x75e26d){return new Promise(_0x14353b=>{function _0x433747(_0x2527a1,_0x184cdd){return _0x46d3(_0x2527a1-0xbc,_0x184cdd);}this['socket']?.['connected']&&this[_0x433747(0x2a2,0x2ef)]===_0x433747(0x263,0x233)?(this['socket']['emit'](_0x433747(0x213,0x254),{'topic':this[_0x433747(0x2da,0x30c)],'event':'track','payload':_0x75e26d,'ref':this[_0x433747(0x297,0x265)]()}),_0x14353b('ok')):_0x14353b('error');});}['untrack'](){return new Promise(_0x16f6ee=>{function _0x2226f6(_0x164dc0,_0x1f739b){return _0x46d3(_0x164dc0- -0x395,_0x1f739b);}this['socket']?.[_0x2226f6(-0x17a,-0xf9)]&&this['state']===_0x2226f6(-0x1ee,-0x271)?(this['socket'][_0x2226f6(-0x15c,-0x122)](_0x2226f6(-0x23e,-0x2c6),{'topic':this['topic'],'event':'untrack','ref':this['makeRef']()}),_0x16f6ee('ok')):_0x16f6ee(_0x2226f6(-0x220,-0x21d));});}[_0x294921(0x7c,0xa3)](){return new Promise(_0x1a6bd4=>{function _0x195c7c(_0x1ec16b,_0x327db0){return _0x46d3(_0x327db0-0xe2,_0x1ec16b);}this['state']=_0x195c7c(0x2ee,0x2cb),this['subscriptions'][_0x195c7c(0x261,0x241)](_0x4ce858=>{function _0x10ea1c(_0xaafdf4,_0x195b57){return _0x46d3(_0xaafdf4- -0x196,_0x195b57);}_0x4ce858[_0x10ea1c(0xbb,0xb3)]();}),this['subscriptions'][_0x195c7c(0x2c0,0x2d1)](),this['socket']?.[_0x195c7c(0x32e,0x2fd)]&&this['socket']['emit'](_0x195c7c(0x354,0x32e),{'topic':this[_0x195c7c(0x284,0x300)],'ref':this[_0x195c7c(0x2de,0x2bd)]()}),this[_0x195c7c(0x31b,0x2c8)]='closed',this[_0x195c7c(0x2f2,0x2ee)](),_0x1a6bd4('ok');});}[_0x294921(0xa6,0x9c)](){function _0xe8a895(_0x5ccea9,_0xb96e3b){return _0x46d3(_0xb96e3b- -0x17d,_0x5ccea9);}if(this[_0xe8a895(0x35,0x69)]==='leaving')return;this['state']=_0xe8a895(0x73,0xce),this[_0xe8a895(-0x50,-0x24)]?.['connected']&&(this['socket']['emit']('join',{'topic':this['topic'],'ref':this['makeRef']()}),setTimeout(()=>{function _0x437638(_0x498426,_0x429068){return _0x46d3(_0x429068- -0x2e7,_0x498426);}this[_0x437638(-0x181,-0x101)]==='joining'&&(this[_0x437638(-0x186,-0x101)]=_0x437638(-0x13b,-0x140),this[_0x437638(-0x40,-0xae)]('status',_0x437638(-0xdc,-0xde)));},0x64));}['_rejoin'](){function _0x41875c(_0x37a692,_0x2bc96d){return _0x46d3(_0x37a692-0x220,_0x2bc96d);}this[_0x41875c(0x402,0x38c)]&&(this['_join'](),this[_0x41875c(0x414,0x3f8)]['forEach']((_0x2fa2b8,_0x45c10a)=>{function _0x1d9a00(_0x412894,_0x448faf){return _0x46d3(_0x412894- -0x34a,_0x448faf);}if(_0x45c10a['startsWith'](_0x1d9a00(-0x1de,-0x1a6))){const filter=JSON['parse'](_0x45c10a['replace']('postgres_changes:',''));this['socket']?.[_0x1d9a00(-0x111,-0x8c)](_0x1d9a00(-0x148,-0xf6),{'topic':this['topic'],'filter':filter,'ref':this['makeRef']()});}}));}['_trigger'](_0x2760fc,_0x4de603){if(_0x2760fc==='postgres_changes'){const _0x1b9144=_0x139743(0x4b8,0x52a)+JSON['stringify'](_0x4de603[_0x139743(0x590,0x616)]||{});this[_0x139743(0x585,0x5e3)](_0x1b9144,_0x4de603);}else{if(_0x2760fc===_0x139743(0x536,0x552)){const _0x58681c='broadcast:'+JSON[_0x139743(0x4a8,0x458)]({'event':_0x4de603[_0x139743(0x4db,0x482)]});this['emit'](_0x58681c,_0x4de603);}else{if(_0x2760fc===_0x139743(0x4a3,0x461)){const _0x406293='presence:'+JSON['stringify']({'event':_0x4de603['event']});this['emit'](_0x406293,_0x4de603);}}}function _0x139743(_0x20b8cd,_0x2be4bb){return _0x46d3(_0x20b8cd-0x34c,_0x2be4bb);}this['emit'](_0x2760fc,_0x4de603);}[_0x294921(0x10,0x56)](_0x105763){function _0x2b6e32(_0x4b4001,_0x5a6a99){return _0x46d3(_0x5a6a99- -0x3aa,_0x4b4001);}this[_0x2b6e32(-0x149,-0x1c4)]=_0x105763;let status;switch(_0x105763){case'joined':status='SUBSCRIBED';break;case'errored':status='CHANNEL_ERROR';break;case'closed':status='CLOSED';break;default:return;}this[_0x2b6e32(-0x13d,-0x171)]('status',status);}[_0x294921(0x8,0x2d)](){function _0x4a67f0(_0x1b4a18,_0x38e669){return _0x46d3(_0x1b4a18-0x297,_0x38e669);}return Math[_0x4a67f0(0x4f6,0x582)]()['toString'](0x24)['substring'](0x2,0xf);}[_0x294921(0x27,0x80)](){return this['state'];}}function getEnvironment(){function _0x20683f(_0x3986e9,_0x3a81cd){return _0x46d3(_0x3986e9- -0xcd,_0x3a81cd);}if(typeof navigator!==_0x20683f(0x105,0x122)&&navigator['product']==='ReactNative')return _0x20683f(0xa0,0x7e);if(typeof window!==_0x20683f(0x105,0x102)&&typeof document!==_0x20683f(0x105,0x190))return _0x20683f(0x14d,0xc8);if(typeof global!==_0x20683f(0x105,0x12b)&&typeof process!==_0x20683f(0x105,0xc7)&&process[_0x20683f(0xde,0x114)]?.[_0x20683f(0x189,0x181)])return _0x20683f(0x189,0x1eb);return _0x20683f(0x14d,0x12c);}function _0x1ed3(){const _0x297fbe=['C29JA2v0qwrHChrLCG','z2v0twf4tgLZDgvUzxjZ','B3b0Aw9UCW','nuL4tgv6Bq','BxvSDgLWyxj0l2zVCM0Tzgf0yq','rMfPBgvKihrVignYzwf0zsbZAwDUzwqGvvjm','zgvSzxrLt3b0Aw9UCW','l3nPz24','C2vSzwn0','Ec10B3rHBc1JB3vUDa','Aw52B2TL','DMfSDwvZ','lMrLC2m','BgvUz3rO','y3vZDg9Trgf0ywjHC2vnyw5Hz2vY','l2f1DgGVDJeVDxnLCG','C2v0twf4tgLZDgvUzxjZ','CNbJ','CMvTB3zLq3vZDg9Trgf0ywjHC2u','y29UzMLN','rMfPBgvKihrVihvWzgf0zsbIDwnRzxq','AM9PBMvK','ota5mtG2m2TyrKz3za','mta0DfPZwvn0','ChjLC2vUy2u6','DMvYC2LVBNm','CMvHBhrPBwu','y29UBMvJDf9LCNjVCG','D2vIC29JA2v0','AgfUzgXLrxjYB3i','Aw5Zzxj0','C3rVCMfNzq','yxbWzw5K','Ahr0CenSAwvUDa','zgvWBg95','Bw92zq','BgLZDa','p29WzxjHDgLVBJ1PBNnLCNq','z2v0q29UBMvJDgLVBLn0yxrL','Cg9ZDgDYzxnFy2HHBMDLCW','zgLZy29UBMvJDgvK','z2XVyMfS','CMvQzwn0','yM9KEq','DxbKyxrLrw52','DxbKyxrL','D29YA3nWywnLswq','zgf0yq','C2v0sxrLBq','B3bLCMf0B3i','ChvZAa','icHtDgf0Dxm6ia','Cgf0y2G','rMfPBgvKihrVigrVD25SB2fKigzPBgu','yNvJA2v0swq','DxnL','DMfSDwu','rMfPBgvKihrVihvWzgf0zsbMAwXLig1LDgfKyxrH','y29WEq','Aw5KzxGUDhm','nJy3nZm0D3z2DhPq','CMvTB3zLqxv0AfrVA2vU','C2v0DxbjBNrLCMnLChrVCNm','AgfZ','Dw5KzwzPBMvK','y2XPzw50','lMfZyW','zMLSzq','AxnezwXLDgu','y29UBMvJDgLUzW','C29JA2v0t3b0Aw9UCW','CMvMCMvZAf90B2TLBG','DgLTzw91Da','BwfRzvjLzG','B2zM','rMfPBgvKihrVigDLDcbIDwnRzxq','zw50CNLWB2LUDa','y2fJAgvdB250CM9S','rMfPBgvKihrVigrLCgXVEsbMDw5JDgLVBG','ChjLCgvUze9Uy2vmAxn0zw5LCG','AM9PBMvKt25Jzq','B25cCM9HzgnHC3q','DgvZDenVBM5Ly3rPB24','rMfPBgvKihrVigDLDcbMDw5JDgLVBIbTzxrYAwnZ','C3rHDgu','C29YDej5','AwXPA2u','BgvHDMLUzW','yNjVywrJyxn0','rNvUy3rPB24GAw52B2nHDgLVBIbMywLSzwq','CMvZCg9UC2u','l2f1DgGVDJeVCMvZzxqTCgfZC3DVCMq','Aw5PDgLHBgL6zq','y2XLyxi','D2fYBG','zgf0ywjHC2u','z2v0tg9NCW','zg93BMXVywq','C3vIC2nYAxb0Aw9UCW','u29JA2v0lMLVlwnSAwvUDcbUW6nVigvZDmoHigrPC3bVBSoTDMvSlIbqyxjHifjLywn0ie5HDgL2zsWGAw5ZDgfSztOGBNbTigLUC3rHBgWGC29JA2v0lMLVlwnSAwvUDa','y29UzMLNDxjLq3vZDg9Trgf0ywjHC2u','AgfZq3vZDg9Trgf0ywjHC2u','rgf0ywjHC2uGB3bLCMf0Aw9UigzHAwXLza','AM9PBG','y3vYCMvUDfnJAgvTyq','zw50CMLLCW','DgfIBgu','z2v0v29YA3nWywnLswq','DxbKyxrLvxnLCG','rMfPBgvKihrVigXPC3qGzNvUy3rPB25Z','zgLZy29UBMvJDa','C3rHDhvZvgv4Da','C3vIC2nYAwjLx3bVC3rNCMvZx2nOyw5Nzxm','C2LNBKLU','x3nLDfn0yxrL','p29WzxjHDgLVBJ11ChnLCNq','Bg9N','AgfUzgXLqxv0AevYCM9Y','l3n0B3jHz2uVDxnHz2u','u1vcu0nssujfra','AxnvC2LUz0n1C3rVBurHDgfIyxnL','x3rYAwDNzxi','CMvTB3zLqwXStgLZDgvUzxjZ','yxbPs2v5','ywrK','CMvTB3zLq2HHBM5LBa','rMfPBgvKihrVihvWBg9HzcbMAwXL','CxvLCNK','DxbKyxrLt3b0Aw9UCW','ntG0odu0nhr1Eej4DW','p29WzxjHDgLVBJ1ZzwXLy3q','z2v0twv0CMLJCW','zxHLy3v0zq','C2vZC2LVBG','B3bLCMf0Aw9U','zMLSDgvYCW','yNjVD3nLCG','y29UBMvJDgvK','ywrKtgLZDgvUzxi','l2z1BMn0Aw9UCY92ms8','Dg9WAwm','y29UBMvJDa','y3jLzgvUDgLHBhm','z2v0q3vZDg9Tq3jLzgvUDgLHBhm','Aw5PDgLHBgL6zun1C3rVBurHDgfIyxnL','C2v0u2vZC2LVBG','CMvTB3zLqwXSq2HHBM5LBhm','l2XVz3m','CgvYAw9K','Bwv0ywrHDge','z3rL','C2vUza','Cg9ZDgDYzxnqB3j0','ms4XlJG','DhjHBNnMB3jT','C29JA2v0lMLVlwnSAwvUDcbUB3qGyxzHAwXHyMXL','z2v0u3rHDgu','z2v0','zwjHyxmUyxv0Ac5ZzxnZAw9U','l2zPBgvZ','x2DLDfnVy2TLDa','z2v0rMLSzuLUzM8','DMvYAwz5','zNjVBq','CMvTB3zL','C2v0qxv0AfrVA2vU','C2nOzw1H','zw1PDa','zxHLy3v0zvf1zxj5','yMfZzvvsta','rMfPBgvKihrVigrLBgv0zsbMDw5JDgLVBG','p3vWC2vYDd10CNvL','C2L6zq','CMvJB25Uzwn0qxr0zw1WDhm','y29UDgvUDfr5Cgu','mZq3mJe0z3HRCg1e','y2HHBM5LBa','yxv0Aa','zMLSDgvY','zgvMyxvSDhm','y2XLyxjtzxnZAw9U','DxnLCG','y29TBw9U','y3jLyxrL','x2PVAw4','AM9PBMLUzW','BgvHDMu','DxbKyxrLrgf0yq','B3jKzxi','Dgv4Dc9WBgfPBG','CMv0DxjUpxjLChjLC2vUDgf0Aw9U','Dw5ZDwjZy3jPyMu','BM93','l2zPBgvZl21VDMu','mtbOs0HWvuK','l2zPBgvZlW','BM9Kzq','zgv0ywLSCW','z2v0vxnLCG','y2HHBM5LBhm','zxzLBNrZ','Aw1WB3j0twfW','BwvZC2fNzq','CMvZzxrqyxnZD29Yza','zgv0zwn0zwrdB25MAwC','CMfUzg9T','zw52','ChjLzMvY','BhrL','C3rHy2S','Bwf0y2G','ChvIBgLJ','y3vYCMvUDfnLC3nPB24','BgLTAxq','rMfPBgvKihrVigDLDcbMDw5JDgLVBG','Bgv2zwW','rMfPBgvKihrVignVChKGzMLSzq','AgvHCNrIzwf0sw50zxj2ywW','rMfPBgvKihrVigDLDcbZDg9YywDLihvZywDL','DxjS','ChjLC2vUy2u','C3rHDhvZ','C29JA2v0','AgvHzgvYCW','C2v0u2vZC2LVBKLUDgvYBMfS','C3rYAw5NAwz5','ndi1mZfcvNflqxq','BMfTzq','zM9YrwfJAa','Chv0','yxv0B0rLDgvJDen1C3rVBurHDgfIyxnL','BwfW','rMfPBgvKihrVigXPC3qGyNvJA2v0CW','z2v0u3rHDhvZ','Bwf4tgLZDgvUzxjZ','y3jLyxrLqNvJA2v0','B2zMC2v0','zgv0zwn0q3vZDg9Trgf0ywjHC2u','CMfUz2u','BgLZDej1y2TLDhm','vw5ZDxbWB3j0zwqGsfruucbTzxrOB2q6ia','Cg9ZDgDYzxnFy2HHBMDLCZO','CMvHy3qTBMf0AxzL','C2LUz2XL','mZaWmda2mdbLB3jLAfC','z2v0rgv0zwn0zwrdB25MAwC','Cg9ZDa','CMvZDfvYBa','C2v0','Cg9ZDgDYzxnty2HLBwe','zxjYB3i','y29Kzq','x3jLAM9PBG','BgLRzq','otGXnJuZBfHpEKX1','y2XVC2vK','C29JA2v0lMLVlwnSAwvUDa','CMvZB2X2zq','Cg9ZDgDYzxniB3n0','C3bSAxq','y29UDgfPBNm','B25bDxrOu3rHDgvdAgfUz2u','CMvZB2X1DgLVBJ1TzxjNzs1KDxbSAwnHDgvZlhjLDhvYBJ1YzxbYzxnLBNrHDgLVBG','uhjLzMvY','qMvHCMvYia','zgvSzxrL','A2v5CW','C3nSrw5HyMXLza','C2v0v29YA3nWywnLswq','y29UBMvJDgLVBLn0yxrL','z2v0q3vZDg9Trgf0ywjHC2vtDgf0Dxm','CMvTB3zLsxrLBq','zgf0yufYCMf5','rMfPBgvKihrVihjLBw92zsbMAwXLCW','Dg9tDhjPBMC','B25qCMvZzw5Jzq','zxzLBNq','l3n0B3jHz2uVyNvJA2v0CY8','y29SDw1U'];_0x1ed3=function(){return _0x297fbe;};return _0x1ed3();}function isSocketIOAvailable(){function _0xb8216(_0x3ec052,_0x247668){return _0x46d3(_0x3ec052- -0x390,_0x247668);}try{const _0x1be534=getEnvironment();switch(_0x1be534){case'node':return typeof require!=='undefined'&&require[_0xb8216(-0x214,-0x26e)]&&!!require['resolve'](_0xb8216(-0x215,-0x18b));case'browser':if(typeof globalThis!==_0xb8216(-0x1be,-0x1e3)&&'io'in globalThis)return!![];return typeof require!==_0xb8216(-0x1be,-0x1f9)&&require['resolve']&&!!require['resolve']('socket.io-client');case'react-native':try{return typeof require!==_0xb8216(-0x1be,-0x1de)&&!!require(_0xb8216(-0x215,-0x1a4));}catch{return![];}default:return![];}}catch{return![];}}function getSocketIO(){function _0x59fed0(_0x15c0da,_0x269a52){return _0x46d3(_0x269a52- -0x203,_0x15c0da);}try{if(typeof require!=='undefined')return require(_0x59fed0(-0x99,-0x88));if(typeof globalThis!=='undefined'&&'io'in globalThis)return{'io':globalThis['io']};throw new Error(_0x59fed0(0x1e,0x2a));}catch(_0x369ce2){throw new Error('Socket.io-client\x20não\x20está\x20disponível\x20neste\x20ambiente.\x20Para\x20usar\x20funcionalidades\x20de\x20realtime,\x20instale:\x20npm\x20install\x20socket.io-client');}}class WebSocketAdapter{constructor(){function _0x57cbec(_0x52c14f,_0x14ef29){return _0x46d3(_0x14ef29- -0x4a,_0x52c14f);}this[_0x57cbec(0x15b,0x10f)]=null;}async[_0x294921(0xd1,0x71)](_0x52695f,_0x23ca10){if(!isSocketIOAvailable())throw new Error('Socket.io-client não está disponível. Para usar funcionalidades de realtime, instale: npm install socket.io-client');const {io:_0x624c6b}=getSocketIO();return new Promise((_0x361b3f,_0x547b12)=>{function _0x581aec(_0x18fad5,_0x1983c3){return _0x46d3(_0x1983c3-0x36d,_0x18fad5);}this[_0x581aec(0x4f1,0x4c6)]=_0x624c6b(_0x52695f,_0x23ca10),this[_0x581aec(0x47d,0x4c6)]['on']('connect',()=>_0x361b3f()),this['socket']['on'](_0x581aec(0x4a1,0x51a),_0xbbd33d=>_0x547b12(_0xbbd33d));});}['disconnect'](){function _0x31b20c(_0x5b75a0,_0x1c061f){return _0x46d3(_0x1c061f-0x23b,_0x5b75a0);}this[_0x31b20c(0x40e,0x394)]&&(this[_0x31b20c(0x384,0x394)][_0x31b20c(0x4a7,0x43b)](),this['socket']=null);}[_0x294921(0x56,0x8b)](_0x4cd7fb,data){function _0x104e5c(_0x3f699d,_0x30a739){return _0x46d3(_0x3f699d- -0x31d,_0x30a739);}this[_0x104e5c(-0x1c4,-0x186)]?.[_0x104e5c(-0xe4,-0xb1)](_0x4cd7fb,data);}['on'](_0x13e26b,_0x1eaf32){function _0x45520d(_0x26ba07,_0x15a03d){return _0x46d3(_0x15a03d- -0xc,_0x26ba07);}this[_0x45520d(0x17e,0x14d)]?.['on'](_0x13e26b,_0x1eaf32);}[_0x294921(-0x5b,0x2e)](_0x159da3,_0x5e66b2){function _0x4c5cba(_0x24ff0e,_0x314e85){return _0x46d3(_0x24ff0e-0x23f,_0x314e85);}_0x5e66b2?this[_0x4c5cba(0x398,0x311)]?.[_0x4c5cba(0x41b,0x3ae)](_0x159da3,_0x5e66b2):this[_0x4c5cba(0x398,0x409)]?.['off'](_0x159da3);}get['connected'](){return this['socket']?.['connected']??![];}}class ReactNativeSocketAdapter{constructor(){this['socket']=null;}async['connect'](_0x4e7316,_0x2c64a6){function _0x1fa6e2(_0x115434,_0x4614f8){return _0x46d3(_0x4614f8-0xce,_0x115434);}if(!isSocketIOAvailable())throw new Error(_0x1fa6e2(0x293,0x2c3));const {io:_0x9aebf7}=getSocketIO();return new Promise((_0x215ec1,_0x10b4f9)=>{this[_0x27a83a(0x47c,0x478)]=_0x9aebf7(_0x4e7316,{..._0x2c64a6,'transports':['websocket'],'upgrade':![],'autoConnect':!![]});function _0x27a83a(_0x2b8e85,_0x25d461){return _0x46d3(_0x2b8e85-0x323,_0x25d461);}this[_0x27a83a(0x47c,0x418)]['on']('connect',()=>_0x215ec1()),this['socket']['on'](_0x27a83a(0x4d0,0x500),_0x497fb9=>_0x10b4f9(_0x497fb9));});}['disconnect'](){function _0x284ac6(_0x1a4433,_0x5a008a){return _0x46d3(_0x1a4433- -0x280,_0x5a008a);}this['socket']&&(this['socket'][_0x284ac6(-0x80,-0x93)](),this['socket']=null);}['emit'](_0x182934,data){function _0x119f23(_0x530f0a,_0x2d1942){return _0x46d3(_0x530f0a- -0x1c0,_0x2d1942);}this[_0x119f23(-0x67,-0xe7)]?.['emit'](_0x182934,data);}['on'](_0x4439bb,_0x583b26){this['socket']?.['on'](_0x4439bb,_0x583b26);}[_0x294921(0x1a,0x2e)](_0x483985,_0x319422){function _0x5390a5(_0x261e1d,_0x28ccdb){return _0x46d3(_0x28ccdb- -0x20,_0x261e1d);}_0x319422?this['socket']?.['off'](_0x483985,_0x319422):this[_0x5390a5(0xf6,0x139)]?.['off'](_0x483985);}get[_0x294921(0xe6,0x6d)](){function _0x1ff5ab(_0x44e9c8,_0x45a6db){return _0x46d3(_0x44e9c8-0x122,_0x45a6db);}return this[_0x1ff5ab(0x27b,0x223)]?.['connected']??![];}}function createSocketAdapter(){const _0x484206=getEnvironment();switch(_0x484206){case'react-native':return new ReactNativeSocketAdapter();case'browser':case'node':default:return new WebSocketAdapter();}}class RealtimeClient{constructor(_0x489ace,_0x46a5ab,_0x381b38={}){this[_0x56d7bd(0x141,0x169)]=null,this[_0x56d7bd(0x241,0x1dc)]=new Map(),this[_0x56d7bd(0x170,0x15c)]='disconnected',this[_0x56d7bd(0x227,0x23c)]=0x0,this['maxReconnectAttempts']=0x5,this[_0x56d7bd(0x13e,0x110)]=_0x489ace;function _0x56d7bd(_0x98d8e3,_0x34e347){return _0x46d3(_0x98d8e3- -0x18,_0x34e347);}this['apiKey']=_0x46a5ab,this['options']={'heartbeatInterval':0x7530,'reconnectInterval':0x1388,'maxReconnectAttempts':0x5,..._0x381b38},this['socketAdapter']=createSocketAdapter();}['connect'](){return new Promise(async(_0x14b604,_0x5b7014)=>{if(this['socketAdapter'][_0x498830(0x5e0,0x639)]){_0x14b604();return;}this[_0x498830(0x54d,0x545)]=_0x498830(0x59c,0x52f);function _0x498830(_0x3ebb3c,_0x3b6ec0){return _0x46d3(_0x3ebb3c-0x3c5,_0x3b6ec0);}try{await this[_0x498830(0x557,0x5a9)][_0x498830(0x5e4,0x5dc)](this['url'],{'auth':{'apikey':this[_0x498830(0x5d2,0x64e)]},'transports':[_0x498830(0x573,0x593)],'reconnection':!![],'reconnectionDelay':this[_0x498830(0x559,0x501)]['reconnectInterval'],'reconnectionAttempts':this[_0x498830(0x559,0x51d)]['maxReconnectAttempts'],...this['options'][_0x498830(0x59d,0x577)]}),this[_0x498830(0x51e,0x58b)]=this[_0x498830(0x557,0x4cf)]['socket'],this['socketAdapter']['on'](_0x498830(0x5e4,0x65d),()=>{this['connectionState']=_0x1def2a(0x3d1,0x357),this['reconnectAttempts']=0x0;function _0x1def2a(_0xf75bce,_0x2118d3){return _0x46d3(_0x2118d3-0x13c,_0xf75bce);}this['setupHeartbeat'](),_0x14b604();}),this[_0x498830(0x557,0x592)]['on'](_0x498830(0x5c5,0x5de),()=>{function _0x276738(_0x1a8c40,_0x1aef93){return _0x46d3(_0x1aef93- -0x3cd,_0x1a8c40);}this[_0x276738(-0x21c,-0x245)]='disconnected',this['channels'][_0x276738(-0x1ef,-0x26e)](channel=>{channel['_setState']('closed');});}),this[_0x498830(0x557,0x4ec)]['on'](_0x498830(0x572,0x5b4),_0x313c19=>{this['connectionState']='error',this[_0x1be2dd(0x44a,0x46a)]++;function _0x1be2dd(_0x1603dd,_0x2b781a){return _0x46d3(_0x2b781a-0x22b,_0x1603dd);}this[_0x1be2dd(0x470,0x46a)]>=this['maxReconnectAttempts']&&_0x5b7014(new Error('Failed\x20to\x20connect\x20after\x20'+this['maxReconnectAttempts']+'\x20attempts:\x20'+_0x313c19['message']));}),this['socketAdapter']['on']('reconnect',()=>{function _0x364fcf(_0x3ab677,_0x4eb0fc){return _0x46d3(_0x4eb0fc- -0x2f8,_0x3ab677);}this['connectionState']=_0x364fcf(-0xe6,-0xdd),this['reconnectAttempts']=0x0,this['channels']['forEach'](channel=>{function _0x894248(_0x4e7040,_0xf4d9d9){return _0x46d3(_0x4e7040-0xef,_0xf4d9d9);}channel[_0x894248(0x266,0x218)]();});}),this['socketAdapter']['on']('postgres_changes',_0x25751f=>{const channel=this[_0x4a3deb(0x401,0x47f)]['get'](_0x25751f['topic']);function _0x4a3deb(_0x3bef47,_0x54eea1){return _0x46d3(_0x54eea1-0x226,_0x3bef47);}channel&&channel['_trigger'](_0x4a3deb(0x3b7,0x3df),_0x25751f);}),this['socketAdapter']['on'](_0x498830(0x5af,0x5c8),_0x36f63f=>{function _0xa42cd7(_0x4025f7,_0x144da8){return _0x46d3(_0x4025f7-0xb0,_0x144da8);}const channel=this['channels']['get'](_0x36f63f[_0xa42cd7(0x2ce,0x268)]);channel&&channel[_0xa42cd7(0x2bb,0x2a2)](_0xa42cd7(0x29a,0x261),_0x36f63f);}),this[_0x498830(0x557,0x511)]['on']('presence',_0x4edb06=>{function _0x190301(_0x21727d,_0x4498e7){return _0x46d3(_0x4498e7-0x2f6,_0x21727d);}const channel=this[_0x190301(0x562,0x54f)][_0x190301(0x585,0x525)](_0x4edb06['topic']);channel&&channel[_0x190301(0x4c7,0x501)]('presence',_0x4edb06);});}catch(_0x4949a9){this['connectionState']='error',_0x5b7014(_0x4949a9);}});}[_0x294921(0x4c,0x52)](){this['socketAdapter']&&(this['socketAdapter']['disconnect'](),this['socket']=null);function _0x41c845(_0x115318,_0x3b80d2){return _0x46d3(_0x3b80d2-0x101,_0x115318);}this['connectionState']='disconnected',this['channels'][_0x41c845(0x2ec,0x2f0)]();}[_0x294921(0x10d,0x94)](_0x5e8092){if(this['channels']['has'](_0x5e8092))return this[_0x133a79(0x2e,-0x1d)][_0x133a79(0x4,0x7b)](_0x5e8092);const channel=new RealtimeChannel(_0x5e8092,this['socket']);function _0x133a79(_0x143f60,_0x54ca7b){return _0x46d3(_0x143f60- -0x22b,_0x54ca7b);}return this['channels'][_0x133a79(-0xb8,-0xfd)](_0x5e8092,channel),this[_0x133a79(-0xa3,-0xac)]==='connected'&&channel[_0x133a79(0x1f,0x9b)](),channel;}[_0x294921(0x8a,0x61)](channel){function _0xe21546(_0x4ca9fa,_0x1176cb){return _0x46d3(_0x1176cb-0x189,_0x4ca9fa);}const _0x7c8fb4=channel[_0xe21546(0x41d,0x3a7)];this[_0xe21546(0x3b5,0x3e2)]['has'](_0x7c8fb4)&&(this['channels']['delete'](_0x7c8fb4),channel[_0xe21546(0x43d,0x3da)]());}[_0x294921(0xe3,0x76)](){this['channels'][_0x19dbdd(-0x10e,-0x14f)](channel=>{function _0x47c8b5(_0x343841,_0xfed7d9){return _0x46d3(_0x343841- -0x2d9,_0xfed7d9);}channel[_0x47c8b5(-0x88,-0x73)]();});function _0x19dbdd(_0x5ac880,_0x49ee3f){return _0x46d3(_0x49ee3f- -0x2ae,_0x5ac880);}this['channels']['clear']();}['getChannels'](){function _0x2d7a47(_0x17e078,_0x133eee){return _0x46d3(_0x17e078-0x14,_0x133eee);}return Array['from'](this['channels'][_0x2d7a47(0x1b1,0x179)]());}['isConnected'](){function _0x3728ee(_0x12d254,_0x5cc987){return _0x46d3(_0x5cc987-0x37d,_0x12d254);}return this[_0x3728ee(0x543,0x505)]==='connected'&&this[_0x3728ee(0x4cc,0x50f)][_0x3728ee(0x59b,0x598)];}[_0x294921(0x37,0xa)](){return this['connectionState'];}['onConnectionStateChange'](_0x2ebda7){const _0x2c6761=()=>_0x2ebda7(this['connectionState']);this[_0x4546d1(0x14a,0x10d)]&&(this[_0x4546d1(0x103,0x10d)]['on'](_0x4546d1(0x1d1,0x19a),()=>{this[_0x4d1104(0x547,0x5cf)]=_0x4d1104(0x5da,0x552);function _0x4d1104(_0x3c073b,_0xc92bd2){return _0x46d3(_0x3c073b-0x3bf,_0xc92bd2);}_0x2c6761();}),this[_0x4546d1(0xa9,0x10d)]['on'](_0x4546d1(0x114,0x17b),()=>{function _0xfd843a(_0x12757d,_0x2605bb){return _0x46d3(_0x12757d- -0x3ac,_0x2605bb);}this[_0xfd843a(-0x224,-0x1e6)]=_0xfd843a(-0x1f2,-0x186),_0x2c6761();}),this['socketAdapter']['on'](_0x4546d1(0x164,0x128),()=>{function _0x56b12a(_0x1fa703,_0x33f44e){return _0x46d3(_0x33f44e- -0x1d7,_0x1fa703);}this[_0x56b12a(-0xbf,-0x4f)]=_0x56b12a(-0x1e,-0x62),_0x2c6761();}));function _0x4546d1(_0x57dc30,_0x497bae){return _0x46d3(_0x497bae- -0x85,_0x57dc30);}return()=>{function _0x4e6a6d(_0x595aeb,_0x385e74){return _0x46d3(_0x385e74- -0x37f,_0x595aeb);}this[_0x4e6a6d(-0x1b7,-0x1ed)]&&(this[_0x4e6a6d(-0x171,-0x1ed)][_0x4e6a6d(-0x156,-0x1a3)](_0x4e6a6d(-0x101,-0x160),_0x2c6761),this[_0x4e6a6d(-0x165,-0x1ed)][_0x4e6a6d(-0x1d0,-0x1a3)]('disconnect',_0x2c6761),this['socketAdapter'][_0x4e6a6d(-0x204,-0x1a3)]('connect_error',_0x2c6761));};}['setupHeartbeat'](){if(!this[_0x21bbaf(0x498,0x4e9)][_0x21bbaf(0x534,0x4a9)]||!this[_0x21bbaf(0x53e,0x4e7)])return;function _0x21bbaf(_0x3bbc59,_0x53c663){return _0x46d3(_0x53c663-0x355,_0x3bbc59);}const interval=setInterval(()=>{function _0x122900(_0xacfb5a,_0x5c5ad0){return _0x46d3(_0xacfb5a- -0x20,_0x5c5ad0);}this[_0x122900(0x172,0x16b)]?.[_0x122900(0x1fb,0x20b)]?this[_0x122900(0x172,0x138)][_0x122900(0x219,0x26f)]('heartbeat',{'timestamp':Date[_0x122900(0x232,0x1f0)]()}):clearInterval(interval);},this['options'][_0x21bbaf(0x4e0,0x4a9)]);}[_0x294921(0x28,0x84)](){function _0xa5e03b(_0x5d9589,_0x1aa6a5){return _0x46d3(_0x1aa6a5-0x372,_0x5d9589);}return this[_0xa5e03b(0x4b1,0x4cb)];}}class FunctionsClient{constructor(_0x423a59){this['httpClient']=_0x423a59;}async[_0x294921(-0x77,-0x12)](_0x4bed82,_0x5674fe){function _0x305526(_0x11016d,_0x4998c7){return _0x46d3(_0x4998c7- -0x386,_0x11016d);}try{const _0x423b59=_0x5674fe?.['method']||'POST',headers={'Content-Type':'application/json',..._0x5674fe?.['headers']};let response;const _0x4e155d='/functions/v1/'+_0x4bed82;switch(_0x423b59['toUpperCase']()){case'GET':response=await this['httpClient'][_0x305526(-0xdd,-0x157)](_0x4e155d,{'headers':headers,'params':_0x5674fe?.['body']});break;case'POST':response=await this[_0x305526(-0x22e,-0x1d3)]['post'](_0x4e155d,_0x5674fe?.[_0x305526(-0x17e,-0x1c9)],{'headers':headers});break;case'PUT':response=await this[_0x305526(-0x24e,-0x1d3)]['put'](_0x4e155d,_0x5674fe?.['body'],{'headers':headers});break;case'PATCH':response=await this['httpClient'][_0x305526(-0x16e,-0x1c0)](_0x4e155d,_0x5674fe?.[_0x305526(-0x18b,-0x1c9)],{'headers':headers});break;case'DELETE':response=await this['httpClient'][_0x305526(-0x1f7,-0x202)](_0x4e155d,{'headers':headers,'data':_0x5674fe?.['body']});break;default:throw new EBaaSError(_0x305526(-0x19d,-0x21b)+_0x423b59,0x190);}return{'data':response[_0x305526(-0x1cd,-0x1c5)],'error':null};}catch(_0x207d90){return{'data':null,'error':_0x207d90 instanceof EBaaSError?_0x207d90:new EBaaSError(_0x207d90 instanceof Error?_0x207d90['message']:_0x305526(-0x201,-0x19b),0x0,_0x207d90)};}}async[_0x294921(-0x83,0x8)](){function _0x22dde7(_0x4aa28d,_0x3329e7){return _0x46d3(_0x4aa28d-0x1ed,_0x3329e7);}try{const response=await this[_0x22dde7(0x3a0,0x41e)]['get']('/functions/v1');return{'data':response['data'],'error':null};}catch(_0x1a1f7f){return{'data':null,'error':_0x1a1f7f instanceof EBaaSError?_0x1a1f7f:new EBaaSError(_0x1a1f7f instanceof Error?_0x1a1f7f['message']:_0x22dde7(0x3ec,0x3ab),0x0,_0x1a1f7f)};}}async[_0x294921(-0xa,0x81)](_0x57146d){function _0x359150(_0x47df13,_0x1f678a){return _0x46d3(_0x47df13-0x323,_0x1f678a);}try{const response=await this['httpClient']['get'](_0x359150(0x540,0x511)+_0x57146d+'/info');return{'data':response[_0x359150(0x4e4,0x4a5)],'error':null};}catch(_0x41fd6e){return{'data':null,'error':_0x41fd6e instanceof EBaaSError?_0x41fd6e:new EBaaSError(_0x41fd6e instanceof Error?_0x41fd6e[_0x359150(0x57f,0x5e2)]:_0x359150(0x474,0x43e),0x0,_0x41fd6e)};}}async[_0x294921(-0x33,0x6)](_0x51de24,_0x566572){function _0x110dc3(_0x241df4,_0x4ad443){return _0x46d3(_0x241df4- -0x16b,_0x4ad443);}try{const _0x37051c=new FormData();if(_0x566572['code']instanceof File)_0x37051c[_0x110dc3(0x47,0x13)]('code',_0x566572['code']);else typeof _0x566572['code']==='string'&&_0x37051c['append']('code',new Blob([_0x566572[_0x110dc3(0xb,0x8f)]],{'type':_0x110dc3(0xe4,0x10f)}),_0x110dc3(0x62,0x44));_0x566572['entrypoint']&&_0x37051c[_0x110dc3(0x47,0xcf)]('entrypoint',_0x566572[_0x110dc3(0x73,0xfc)]);_0x566572['env']&&_0x37051c[_0x110dc3(0x47,0x71)](_0x110dc3(0xf5,0x17c),JSON['stringify'](_0x566572[_0x110dc3(0xf5,0x136)]));_0x566572['importMap']&&_0x37051c[_0x110dc3(0x47,0x5a)](_0x110dc3(0xf0,0x138),JSON['stringify'](_0x566572['importMap']));_0x566572['verify']!==undefined&&_0x37051c['append']('verify',String(_0x566572[_0x110dc3(0xc9,0xb4)]));const response=await this[_0x110dc3(0x48,0x96)]['post'](_0x110dc3(0xb2,0x56)+_0x51de24+'/deploy',_0x37051c,{'headers':{'Content-Type':_0x110dc3(0x2b,0x57)}});return{'data':response['data'],'error':null};}catch(_0x3d1f8f){return{'data':null,'error':_0x3d1f8f instanceof EBaaSError?_0x3d1f8f:new EBaaSError(_0x3d1f8f instanceof Error?_0x3d1f8f[_0x110dc3(0xf1,0x10b)]:_0x110dc3(0x75,0x64),0x0,_0x3d1f8f)};}}async[_0x294921(-0x74,-0x2a)](_0x2a49a8){function _0x5c8838(_0x22b811,_0x18014d){return _0x46d3(_0x18014d- -0x18a,_0x22b811);}try{const response=await this['httpClient'][_0x5c8838(-0x81,-0x6)]('/functions/v1/'+_0x2a49a8);return{'data':response['data'],'error':null};}catch(_0x4babc4){return{'data':null,'error':_0x4babc4 instanceof EBaaSError?_0x4babc4:new EBaaSError(_0x4babc4 instanceof Error?_0x4babc4['message']:_0x5c8838(0x31,0xb2),0x0,_0x4babc4)};}}async[_0x294921(0x11,0x10)](_0xca8a7a,_0x57875a){function _0x3addc9(_0x1e8309,_0x7ca6de){return _0x46d3(_0x7ca6de-0x224,_0x1e8309);}try{const response=await this[_0x3addc9(0x423,0x3d7)]['put']('/functions/v1/'+_0xca8a7a+'/env',{'env':_0x57875a});return{'data':response['data'],'error':null};}catch(_0x23d20b){return{'data':null,'error':_0x23d20b instanceof EBaaSError?_0x23d20b:new EBaaSError(_0x23d20b instanceof Error?_0x23d20b[_0x3addc9(0x450,0x480)]:'Failed\x20to\x20update\x20function\x20environment',0x0,_0x23d20b)};}}async[_0x294921(-0x28,0x44)](_0x4f1b58,_0x1e2154){function _0xe5fa59(_0x4a45ec,_0x4c2f2e){return _0x46d3(_0x4a45ec- -0x19e,_0x4c2f2e);}try{const _0x3684eb=new URLSearchParams();_0x1e2154?.[_0xe5fa59(-0x4e,0x1e)]&&_0x3684eb['append'](_0xe5fa59(-0x4e,-0xc),String(_0x1e2154[_0xe5fa59(-0x4e,-0x9b)]));_0x1e2154?.['offset']&&_0x3684eb[_0xe5fa59(0x14,-0x3f)]('offset',String(_0x1e2154[_0xe5fa59(-0x37,0x1f)]));_0x1e2154?.[_0xe5fa59(-0x4c,-0xc0)]&&_0x3684eb['append'](_0xe5fa59(-0x4c,-0x1d),_0x1e2154['level']);const _0x17e229=_0xe5fa59(0x7f,0xab)+_0x4f1b58+_0xe5fa59(0x87,0xb6)+(_0x3684eb[_0xe5fa59(-0x11,-0x9a)]()?'?'+_0x3684eb[_0xe5fa59(-0x11,-0x59)]():''),response=await this[_0xe5fa59(0x15,0x5)]['get'](_0x17e229);return{'data':response['data'],'error':null};}catch(_0x4a0413){return{'data':null,'error':_0x4a0413 instanceof EBaaSError?_0x4a0413:new EBaaSError(_0x4a0413 instanceof Error?_0x4a0413[_0xe5fa59(0xbe,0x133)]:'Failed\x20to\x20get\x20function\x20logs',0x0,_0x4a0413)};}}async[_0x294921(0x87,0x67)](_0x12ff7e,_0x3e2836){function _0x338da5(_0xa9b286,_0x48741c){return _0x46d3(_0xa9b286-0x28b,_0x48741c);}try{const _0x3e4497=new URLSearchParams();_0x3e2836?.[_0x338da5(0x4b1,0x4e2)]&&_0x3e4497['append'](_0x338da5(0x4b1,0x43c),_0x3e2836['period']);const _0x5e7f86='/functions/v1/'+_0x12ff7e+'/metrics'+(_0x3e4497['toString']()?'?'+_0x3e4497['toString']():''),response=await this['httpClient'][_0x338da5(0x4ba,0x46e)](_0x5e7f86);return{'data':response[_0x338da5(0x44c,0x47f)],'error':null};}catch(_0x1fe20e){return{'data':null,'error':_0x1fe20e instanceof EBaaSError?_0x1fe20e:new EBaaSError(_0x1fe20e instanceof Error?_0x1fe20e['message']:_0x338da5(0x470,0x450),0x0,_0x1fe20e)};}}}class EBaaSClient{constructor(_0x359039,_0x4379b9,_0x5ef557){this['options']=_0x5ef557,this[_0x21d965(-0x107,-0x188)]=new HttpClient({'url':_0x359039,'apiKey':_0x4379b9,'timeout':0x7530,'headers':_0x5ef557?.[_0x21d965(-0x18f,-0x180)]?.[_0x21d965(-0x161,-0x1e1)]});function _0x21d965(_0x54bc02,_0x20ed7e){return _0x46d3(_0x20ed7e- -0x33b,_0x54bc02);}this['auth']=new AuthClient(this[_0x21d965(-0xfe,-0x188)],_0x5ef557?.[_0x21d965(-0xf4,-0x14a)]?.['workspaceId']),this['database']=new DatabaseClient(this[_0x21d965(-0x15c,-0x188)],_0x5ef557?.['database']?.[_0x21d965(-0x116,-0x17b)],_0x5ef557?.['rest']?.[_0x21d965(-0x245,-0x1e5)]),this[_0x21d965(-0x1b5,-0x18a)]=new StorageClient(this['httpClient']),this['realtime']=new RealtimeClient(_0x359039,_0x4379b9,_0x5ef557?.['realtime']),this['functions']=new FunctionsClient(this[_0x21d965(-0x116,-0x188)]),this[_0x21d965(-0x9b,-0x119)]();}[_0x294921(0x112,0x87)](_0x235c61){return this['database']['from'](_0x235c61);}[_0x294921(-0x12,-0xb)](_0x255405,_0x5a752c){function _0x30df0a(_0x5b81c3,_0x49a558){return _0x46d3(_0x49a558-0x3b3,_0x5b81c3);}return this[_0x30df0a(0x58d,0x5a4)][_0x30df0a(0x5d1,0x556)](_0x255405,_0x5a752c);}['bucket'](_0x380c28){function _0x5c0d54(_0x55fa4f,_0x333451){return _0x46d3(_0x55fa4f-0x24f,_0x333451);}return this[_0x5c0d54(0x400,0x3de)]['from'](_0x380c28);}[_0x294921(0x66,0x94)](_0x1c5a03){function _0x28122c(_0x12e69d,_0x3395c4){return _0x46d3(_0x12e69d-0x2f5,_0x3395c4);}return this[_0x28122c(0x4a1,0x4ea)][_0x28122c(0x537,0x528)](_0x1c5a03);}[_0x294921(-0x23,-0x12)](_0xbd6f4e,_0x1d3f74){function _0x444f3c(_0x33c233,_0x1ff99a){return _0x46d3(_0x33c233- -0x3b5,_0x1ff99a);}return this['functions'][_0x444f3c(-0x219,-0x1ef)](_0xbd6f4e,_0x1d3f74);}async[_0x294921(0x4d,0x74)](){function _0x346898(_0xdaf922,_0x302491){return _0x46d3(_0x302491- -0x109,_0xdaf922);}if(this['options']?.[_0x346898(0xde,0xe8)]?.[_0x346898(0xc0,0x58)])try{await this['database'][_0x346898(0xf5,0xe5)]();}catch(_0x18e8d1){console['warn']('Failed to initialize custom database detection:',_0x18e8d1);}}async['setWorkspaceId'](_0x220d07){this[_0x18ec09(0x248,0x1f5)][_0x18ec09(0x113,0x139)](_0x220d07);function _0x18ec09(_0x205218,_0x2dc748){return _0x46d3(_0x2dc748- -0x4e,_0x205218);}this[_0x18ec09(0x1f9,0x1a3)]['setWorkspaceId'](_0x220d07),this['options']?.['database']?.[_0x18ec09(0x157,0x113)]&&await this[_0x18ec09(0x191,0x1a3)][_0x18ec09(0x11e,0x1a0)]();}async[_0x294921(0x72,0x48)](_0x229d99){function _0x4d6253(_0x3fb4e9,_0x21b4ec){return _0x46d3(_0x3fb4e9-0x6c,_0x21b4ec);}await this[_0x4d6253(0x25d,0x278)]['configureCustomDatabase'](_0x229d99);}[_0x294921(-0x93,-0x25)](){function _0x248f3e(_0x5dcb7c,_0x397b9a){return _0x46d3(_0x5dcb7c-0x4a,_0x397b9a);}return this[_0x248f3e(0x23b,0x28a)]['getCustomDatabaseStatus']();}}function createClient(_0x493407,_0x2fca66,_0x371adf){return new EBaaSClient(_0x493407,_0x2fca66,_0x371adf);}const version=_0x294921(0xa0,0x7d);export{AuthClient,CustomDatabaseManager,DatabaseClient,EBaaSClient,EBaaSError,FunctionsClient,HttpClient,QueryBuilder,RealtimeChannel,RealtimeClient,StorageBucket,StorageClient,createClient,version};
|