scimgateway 4.5.8 → 4.5.10

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/README.md CHANGED
@@ -65,7 +65,7 @@ Can be used to chain several gateways
65
65
 
66
66
  * **Soap** (SOAP Webservice)
67
67
  Demonstrates user provisioning towards SOAP-Based endpoint
68
- Excample WSDLs are included
68
+ Example WSDLs are included
69
69
  Using endpoint "Forwardinc" as an example (comes with Symantec/Broadcom/CA IM SDK - SDKWS)
70
70
  Shows how to implement a highly configurable multi tenant or multi endpoint solution through `baseEntity` in URL
71
71
 
@@ -84,7 +84,7 @@ Includes Symantec/Broadcom/CA ConnectorXpress metafile for creating provisioning
84
84
  * **LDAP** (Directory)
85
85
  Fully functional LDAP plugin
86
86
  Pre-configured for Microsoft Active Directory
87
- Using endpointMapper (like plugin-entra-id) for attribute flexibility
87
+ Using endpointMapper (like plugin-entra-id) for attribute mapping flexibility
88
88
 
89
89
  * **API** (REST Webservices)
90
90
  Demonstrates API Gateway/plugin functionality using post/put/patch/get/delete
@@ -1163,6 +1163,18 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
1163
1163
 
1164
1164
  ## Change log
1165
1165
 
1166
+ ### v4.5.10
1167
+
1168
+ [Fixed]
1169
+
1170
+ - PUT changes introduced in v4.5.7 had incorrect check of configuration groupMemberOfUser (default not set)
1171
+
1172
+ ### v4.5.9
1173
+
1174
+ [Improved]
1175
+
1176
+ - Dependencies bump
1177
+
1166
1178
  ### v4.5.8
1167
1179
 
1168
1180
  [Fixed]
package/lib/plugin-api.js CHANGED
@@ -283,8 +283,8 @@ const getAccessToken = async (baseEntity, ctx) => {
283
283
  lock.release()
284
284
  throw (err)
285
285
  }
286
- if (config.entity[baseEntity].tokenAuth) { // in case response using token instead of access_token
287
- if (jbody.token) jbody.access_token = jbody.token
286
+ if (config.entity[baseEntity].tokenAuth) { // custom access_token
287
+ if (jbody.accessToken) jbody.access_token = jbody.accessToken
288
288
  }
289
289
  if (!jbody.access_token) {
290
290
  const err = new Error(`[${action}] Error message: Retrieved invalid token response`)
@@ -209,8 +209,6 @@ scimgateway.getUsers = async (baseEntity, getObj, attributes, ctx) => {
209
209
  const users = await doRequest(baseEntity, method, base, ldapOptions, ctx) // ignoring SCIM paging startIndex/count - get all
210
210
  result.totalResults = users.length
211
211
  result.Resources = await Promise.all(users.map(async (user) => { // Promise.all because of async map
212
- if (user.name) delete user.name // because mapper converts to SCIM name.xxx
213
-
214
212
  // endpoint spesific attribute handling
215
213
  // "active" must be handled separate
216
214
  if (user.userAccountControl !== undefined) { // SCIM "active" - Active Directory
@@ -1221,8 +1219,6 @@ const getNamingAttribute = (baseEntity, type) => {
1221
1219
  throw new Error(`getNamingAttribute error: invalid type ${type}`)
1222
1220
  }
1223
1221
  if (!Array.isArray(arr) || arr.length !== 1) throw new Error(`configuration missing namingAttribute definition for ${type}`)
1224
- const [endpointAttr] = scimgateway.endpointMapper('outbound', arr[0].mapTo, config.map[type])
1225
- if (!endpointAttr) throw new Error(`namingAttribute mapTo:${arr[0].mapTo} cannot be found in the map ${type} configuration`)
1226
1222
  return [arr[0].attribute, arr[0].mapTo]
1227
1223
  }
1228
1224
 
@@ -1533,6 +1529,12 @@ for (const key in config.entity) {
1533
1529
  scimgateway.logger.error(`configuration missing attribute/mapTo: endpoint.entity.${key}.ldap.namingAttribute.user`)
1534
1530
  throw new Error(`using exception to exit ${pluginName}, please ignore message...`)
1535
1531
  }
1532
+ const [endpointAttr] = scimgateway.endpointMapper('outbound', usrArr[0].mapTo, config.map.user)
1533
+ if (!endpointAttr) {
1534
+ scimgateway.logger.error(`configuration namingAttribute mapTo:${usrArr[0].mapTo} cannot be found in the map user configuration`)
1535
+ throw new Error(`using exception to exit ${pluginName}, please ignore message...`)
1536
+ }
1537
+
1536
1538
  let grpArr = config.entity[key]?.ldap?.namingAttribute?.group
1537
1539
  if (config?.map?.group && Object.keys(config.map.group).length > 0) {
1538
1540
  if (!grpArr || !Array.isArray(grpArr)) { // check for legacy
@@ -1551,6 +1553,11 @@ for (const key in config.entity) {
1551
1553
  scimgateway.logger.error(`configuration missing attribute/mapTo: endpoint.entity.${key}.ldap.namingAttribute.group`)
1552
1554
  throw new Error(`using exception to exit ${pluginName}, please ignore message...`)
1553
1555
  }
1556
+ const [endpointAttr] = scimgateway.endpointMapper('outbound', grpArr[0].mapTo, config.map.group)
1557
+ if (!endpointAttr) {
1558
+ scimgateway.logger.error(`configuration namingAttribute mapTo:${grpArr[0].mapTo} cannot be found in the map group configuration`)
1559
+ throw new Error(`using exception to exit ${pluginName}, please ignore message...`)
1560
+ }
1554
1561
  }
1555
1562
  }
1556
1563
 
@@ -10,4 +10,4 @@
10
10
  // Note: scim-stream.js is part of the licensed SCIM Stream which is a prerequisite for message Pub/Sub
11
11
  // for details see: https://elshaug.xyz/docs/scim-stream
12
12
  //
13
- 'use strict';const a0_0xf49a16=a0_0x5a7e;(function(_0x5e39d1,_0x5650e3){const _0x4d67be=a0_0x5a7e,_0x4e0af8=_0x5e39d1();while(!![]){try{const _0x9ce7a=parseInt(_0x4d67be(0x198))/0x1+parseInt(_0x4d67be(0x130))/0x2*(parseInt(_0x4d67be(0x161))/0x3)+-parseInt(_0x4d67be(0x10a))/0x4*(parseInt(_0x4d67be(0x192))/0x5)+parseInt(_0x4d67be(0x17a))/0x6*(-parseInt(_0x4d67be(0x146))/0x7)+parseInt(_0x4d67be(0x11c))/0x8*(parseInt(_0x4d67be(0x13a))/0x9)+parseInt(_0x4d67be(0x15b))/0xa+-parseInt(_0x4d67be(0x19a))/0xb;if(_0x9ce7a===_0x5650e3)break;else _0x4e0af8['push'](_0x4e0af8['shift']());}catch(_0x25023b){_0x4e0af8['push'](_0x4e0af8['shift']());}}}(a0_0xfc06,0xa972d));function a0_0xfc06(){const _0x44faf6=['baseUrls',']\x20error:\x20','split','obj','toLowerCase','encode',']\x20initialization\x20error:\x20missing\x20configuration\x20stream.baseUrls','\x20(count=','name','jwtAuthenticator','configDir','publisher[','join',']\x20initialization\x20error:\x20missing\x20configuration\x20nats','\x20Delete\x20User\x20id=','detail',']\x20initialization\x20error:\x20missing\x20certificate\x20configuration','\x20message:\x20user\x20does\x20not\x20exist','passThrough','##doIncrement','data','replaceDomains','tenant','\x20group\x20removal\x20error:\x20',']\x20subscriber[','_info','getUsers()\x20getObj=','40jjFKDj','createGroup','internal\x20stream\x20policy\x20have\x20been\x20changed\x20-\x20central\x20SCIM\x20Stream\x20must\x20be\x20stopped\x20and\x20corresponding\x20./jetstream\x20folder\x20deleted\x20before\x20startup\x20allowing\x20new\x20policy','\x20-\x20will\x20do\x20auto\x20reconnect\x20when\x20connection\x20becomes\x20available','elementnumber','filter_subject','config',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.tenant','userName','servers','getAppRoles','password','set','displayName','gwName','query','Reconnecting','SCIM\x20Stream\x20-\x20Autogenerated','7064ggRruQ','deleteGroup','publisher\x20response\x20error:\x20','patchApi','\x20message:\x20user\x20not\x20created\x20because\x20of\x20active=false',']\x20approle\x20uuid\x20file\x20created:\x20',']\x20client\x20is\x20attempting\x20to\x20reconnect\x20','copyObj','firstn','headers','\x20result=','connect',']\x20client\x20error\x20','subscriber\x20message\x20error:\x20handle\x20\x27','deleteApi','GW.','pingInterval','value','forEach','toString','16AyyVwI','postApi','push','SIGINT','\x20done','lowercase','originalUrl',']\x20connect\x20error:\x20','StaleConnection','usePutSoftSync','12906twQKsu',']\x20initialization\x20error:\x20nats.subject\x20root\x20topic\x20must\x20be\x20\x27GW\x27,\x20nats.subject\x20example:\x20GW.APP1','StringCodec','fsExistsSync','subscribe',']\x20publisher[','certificate','503','write','path','_autogenerated.cfg','handle','28HkuMHe','/Users/','server_name','getApi','ack','\x20message\x20handled:\x20','\x20processing\x20incoming\x20message','User','deleteUserOnLastGroupRoleRemoval','call','operation','authenticator',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.subject','nats','normalize','SCIM\x20Stream','\x27\x20not\x20supported','\x20error:\x20','stringify','\x20getUserId()\x20error:\x20','maxReconnectAttempts','2159090SRcrqo','\x20error:\x20missing\x20result',']\x20initialization\x20error:\x20configuration\x20scim.usePutSoftSync\x20must\x20be\x20set\x20to\x20true\x20when\x20subscribing\x20to\x20ENTRA\x20or\x20HR\x20topics','attributes','replaceUsrGrp','ENTRA.','401613vkrZkJ','substring','description',',\x20obj=','subscriber\x20message\x20error:\x20message\x20not\x20JSON\x20formatted','durable_','Reconnect','/approles','uppercase','error','params',']\x20connected\x20','getGroups','then','roles','UnableConnectingService','deleteUser','Msg-Id','\x20role\x20removal\x20error:\x20','createUser','\x22,\x22errName\x22:\x22','prototype','\x20message:\x20user\x20not\x20created\x20because\x20of\x20configuration\x20modifyOnly=true',']\x20client\x20reconnected\x20','Events','799356WNVvZZ','maxPingOut','publish','replaceAll','string',']\x20client\x20consumer\x20reinitiated\x20because\x20of\x20','timeout','HR.','\x20-\x20','waitOnFirstConnect',',\x20id=','publisher\x20not\x20initialized/connected','modifyOnly','subscriber\x20message\x20error:\x20message\x20baseEntity=','undefined','remove','typeId','baseEntity','\x20handling\x20message:\x20','request','transports','isArray','Errors',']\x20handling\x20\x22','512065vVnHcU','/certs/','AckPolicy','subscriber\x20message\x20error:\x20message\x20missing\x20handle',']\x20client\x20has\x20a\x20stale\x20connection\x20','\x20Create\x20userName=','1011830lRGCPT','activityOperation','14452174RPqIAp','\x20message:\x20','modifyUser','createRandomPassword','jetstreamManager','logger','ETIMEDOUT','\x20message\x20error\x20response:\x20',']\x20error:\x20no\x20subscribers/responders\x20to\x20subject\x20','trim','length','Resources','getProcessed','toUpperCase','{\x22error\x22:\x22','file-not-configured',',true','close','jwt','\x20roles\x20converted\x20to\x20groups:\x20','groups','display','drain',']\x20error:\x20missing\x20entity\x20configuration\x20for\x20baseEntity=',']\x20error:\x20message\x20must\x20be\x20JSON\x20formatted','\x20Create\x20User\x20userName=','Disconnect','rejectUnauthorized','exports','add','status','\x20missing\x20mandatory\x20user.userName\x20in\x20message:\x20','putApi','UnableConnectingHost','closed','get','\x20Replace\x20User\x20id=','foldReplacing','Publisher','\x20error:\x20missing\x20id}','\x20createUser()\x20obj=','SIGTERM','startsWith',']\x20error:\x20client\x20have\x20not\x20been\x20initialized','hasOwnProperty','\x20subscriber\x20error:\x20scimgateway\x20endpoint\x20connect\x20problem\x20-\x20will\x20do\x20auto\x20retry\x20until\x20connected','getuniquevalue','delete','consumers','ENOTFOUND','Operations','\x20=>\x20subscriber\x20not\x20activated','modifyGroup','Explicit',']\x20client\x20disconnected\x20','includes',']\x20closed\x20with\x20error:\x20','generateUserPassword','decode','tls','reconnectTimeWait','isClosed','utf-8','type','existsSync','from','publisher\x20error:\x20none\x20JSON\x20formatted\x20response:\x20','../lib/utils','parse','increment','message','getUsers','onCreate','crypto','readFileSync','subject','replace','DebugEvents','level','secret','ctxPassThrough','\x20convertedScim20\x20error:\x20','body','DeliverPolicy','info','approles_','debug','pluginName','schemas','active','respond',']\x20initialization\x20certificate\x20error:\x20','utf8'];a0_0xfc06=function(){return _0x44faf6;};return a0_0xfc06();}function a0_0x5a7e(_0x223546,_0x1200fe){const _0xfc0625=a0_0xfc06();return a0_0x5a7e=function(_0x5a7efa,_0x30129c){_0x5a7efa=_0x5a7efa-0xcc;let _0x4ae288=_0xfc0625[_0x5a7efa];return _0x4ae288;},a0_0x5a7e(_0x223546,_0x1200fe);}const nats=require(a0_0xf49a16(0x153)),ascii127=require('fold-to-ascii'),fs=require('fs'),utils=require(a0_0xf49a16(0xd5)),path=require(a0_0xf49a16(0x143)),crypto=require(a0_0xf49a16(0xdb));module[a0_0xf49a16(0x1b6)]['Subscriber']=function(_0x9d91cd){const _0x3db26f=a0_0xf49a16,_0x5b85c5=_0x9d91cd,_0x376b9f={};let _0x474f5e='';for(let _0x4b1bc5=0x0;_0x4b1bc5<_0x5b85c5['logger'][_0x3db26f(0x18e)][_0x3db26f(0x1a4)];_0x4b1bc5++){if(_0x5b85c5[_0x3db26f(0x19f)][_0x3db26f(0x18e)][_0x4b1bc5][_0x3db26f(0xf7)]==='file'){_0x474f5e=_0x5b85c5[_0x3db26f(0x19f)][_0x3db26f(0x18e)][_0x4b1bc5][_0x3db26f(0xe0)];break;}}const _0x5270e2=''+(_0x474f5e===_0x3db26f(0xe8)?'\x0a':''),_0x1d509a=async(_0x4b0b79,_0x3c220b)=>{const _0x15052c=_0x3db26f,_0xf2a527=_0x376b9f[_0x4b0b79][_0x15052c(0x110)]?.['nats']?.[_0x15052c(0xdd)];let _0x47ce31;try{_0x47ce31=await nats[_0x15052c(0x127)](_0x3c220b);if(_0x47ce31[_0x15052c(0xe6)]['server_name']!==_0x15052c(0x155)){_0x47ce31[_0x15052c(0x1ab)]();return;}_0x376b9f[_0x4b0b79]['nc']=_0x47ce31,_0x705127(_0x4b0b79,_0x47ce31),_0x521add(_0x4b0b79,_0x47ce31);}catch(_0x57045e){_0x5b85c5[_0x15052c(0x19f)][_0x15052c(0x16a)](_0x5b85c5['gwName']+'['+_0x5b85c5[_0x15052c(0xe9)]+']\x20subscriber['+_0x4b0b79+']['+_0xf2a527+']\x20connect\x20error:\x20'+_0x57045e[_0x15052c(0xd8)]+'\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration'),_0x3c220b[_0x15052c(0x183)]=!![];try{_0x47ce31=await nats[_0x15052c(0x127)](_0x3c220b);if(_0x47ce31['info'][_0x15052c(0x148)]!==_0x15052c(0x155)){_0x47ce31[_0x15052c(0x1ab)]();return;}_0x376b9f[_0x4b0b79]['nc']=_0x47ce31,_0x705127(_0x4b0b79,_0x47ce31),_0x521add(_0x4b0b79,_0x47ce31);}catch(_0x3a0e28){_0x5b85c5['logger'][_0x15052c(0x16a)](_0x5b85c5[_0x15052c(0x118)]+'['+_0x5b85c5[_0x15052c(0xe9)]+_0x15052c(0x107)+_0x4b0b79+']['+_0xf2a527+_0x15052c(0x137)+_0x3a0e28[_0x15052c(0xd8)]);return;}}_0x5b85c5[_0x15052c(0x19f)]['debug'](_0x5b85c5[_0x15052c(0x118)]+'['+_0x5b85c5[_0x15052c(0xe9)]+_0x15052c(0x107)+_0x4b0b79+']['+_0xf2a527+_0x15052c(0x16c)+(_0x3c220b[_0x15052c(0xcd)]['ca']?_0x15052c(0xcd):'')+'\x20'+_0x47ce31['getServer']()),_0x47ce31[_0x15052c(0x1bc)]()['then'](_0x1dd804=>{const _0x5e7151=_0x15052c;_0x1dd804&&_0x5b85c5[_0x5e7151(0x19f)]['error'](_0x5b85c5[_0x5e7151(0x118)]+'['+_0x5b85c5['pluginName']+_0x5e7151(0x107)+_0x4b0b79+']['+_0xf2a527+_0x5e7151(0x1d2)+_0x1dd804['message']);});};this['add']=async(_0xdf7874,_0x53c0b4)=>{const _0x51e08a=_0x3db26f;if(!_0x53c0b4?.['nats']){_0x5b85c5[_0x51e08a(0x19f)][_0x51e08a(0x16a)](_0x5b85c5[_0x51e08a(0x118)]+'['+_0x5b85c5[_0x51e08a(0xe9)]+_0x51e08a(0x107)+_0xdf7874+_0x51e08a(0xfc));return;}if(!_0x53c0b4?.[_0x51e08a(0x153)]?.[_0x51e08a(0x105)]){_0x5b85c5[_0x51e08a(0x19f)][_0x51e08a(0x16a)](_0x5b85c5[_0x51e08a(0x118)]+'['+_0x5b85c5[_0x51e08a(0xe9)]+_0x51e08a(0x107)+_0xdf7874+']\x20initialization\x20error:\x20missing\x20configuration\x20nats.tenant');return;}if(!_0x53c0b4?.[_0x51e08a(0x153)]?.[_0x51e08a(0xdd)]){_0x5b85c5['logger']['error'](_0x5b85c5[_0x51e08a(0x118)]+'['+_0x5b85c5['pluginName']+']\x20subscriber['+_0xdf7874+_0x51e08a(0x152));return;}if(!_0x53c0b4?.['certificate']?.['ca']){_0x5b85c5[_0x51e08a(0x19f)][_0x51e08a(0x16a)](_0x5b85c5[_0x51e08a(0x118)]+'['+_0x5b85c5[_0x51e08a(0xe9)]+_0x51e08a(0x107)+_0xdf7874+_0x51e08a(0xff));return;}if(!_0x53c0b4['baseUrls']||!Array[_0x51e08a(0x18f)](_0x53c0b4[_0x51e08a(0xef)])||_0x53c0b4['baseUrls'][_0x51e08a(0x1a4)]<0x1){_0x5b85c5[_0x51e08a(0x19f)][_0x51e08a(0x16a)](_0x5b85c5[_0x51e08a(0x118)]+'['+_0x5b85c5[_0x51e08a(0xe9)]+_0x51e08a(0x107)+_0xdf7874+_0x51e08a(0xf5));return;}if(!_0x53c0b4[_0x51e08a(0x139)]){const _0x235ad8=_0x53c0b4?.[_0x51e08a(0x153)]?.[_0x51e08a(0xdd)]['toUpperCase']();if(_0x235ad8[_0x51e08a(0x1c4)](_0x51e08a(0x160))||_0x235ad8[_0x51e08a(0x1c4)](_0x51e08a(0x181))){_0x5b85c5[_0x51e08a(0x19f)][_0x51e08a(0x16a)](_0x5b85c5[_0x51e08a(0x118)]+'['+_0x5b85c5['pluginName']+_0x51e08a(0x107)+_0xdf7874+_0x51e08a(0x15d));return;}}const _0x1e49f6={};try{let _0x12d19c=path[_0x51e08a(0xfb)](_0x5b85c5[_0x51e08a(0xf9)],_0x51e08a(0x193),_0x53c0b4?.['certificate']?.['ca']||_0x51e08a(0x1a9));(_0x53c0b4?.[_0x51e08a(0x140)]?.['ca']?.[_0x51e08a(0x1c4)]('/')||_0x53c0b4?.[_0x51e08a(0x140)]?.['ca']?.[_0x51e08a(0x1d1)]('\x5c'))&&(_0x12d19c=_0x53c0b4[_0x51e08a(0x140)]['ca']),_0x1e49f6['ca']=[fs[_0x51e08a(0xdc)](_0x12d19c)],_0x1e49f6[_0x51e08a(0x1b5)]=!![];}catch(_0x4529ac){_0x5b85c5['logger']['error'](_0x5b85c5[_0x51e08a(0x118)]+'['+_0x5b85c5[_0x51e08a(0xe9)]+']\x20subscriber['+_0xdf7874+_0x51e08a(0xed)+_0x4529ac[_0x51e08a(0xd8)]);return;}const _0x15f3a8={},_0x531986=new TextEncoder()[_0x51e08a(0xf4)](_0x53c0b4?.[_0x51e08a(0x153)]?.['secret']),_0x3f0833=_0x53c0b4?.[_0x51e08a(0x153)]?.[_0x51e08a(0x1ac)];_0x15f3a8[_0x51e08a(0x151)]=nats[_0x51e08a(0xf8)](_0x3f0833,_0x531986),_0x15f3a8[_0x51e08a(0x113)]=_0x53c0b4[_0x51e08a(0xef)],_0x15f3a8[_0x51e08a(0xcd)]=_0x1e49f6,_0x15f3a8[_0x51e08a(0x183)]=![],_0x15f3a8['reconnect']=!![],_0x15f3a8['reconnectTimeWait']=0x3e8*0xa,_0x15f3a8[_0x51e08a(0x15a)]=-0x1,_0x15f3a8[_0x51e08a(0x12c)]=0x2*0x3c*0x3e8,_0x15f3a8[_0x51e08a(0x17b)]=0x5,_0x15f3a8['debug']=![],_0x376b9f[_0xdf7874]={},_0x376b9f[_0xdf7874]['config']=_0x53c0b4,_0x376b9f[_0xdf7874]['nc']=undefined,_0x376b9f[_0xdf7874]['sub']=undefined,_0x1d509a(_0xdf7874,_0x15f3a8);};const _0x521add=async(_0x2a77f1,_0x4a36dd)=>{const _0x2c4d46=_0x3db26f,_0x1cd796=_0x376b9f[_0x2a77f1][_0x2c4d46(0x110)],_0x2ab88f=_0x1cd796?.[_0x2c4d46(0x153)]?.[_0x2c4d46(0xdd)];if(!_0x4a36dd){_0x5b85c5[_0x2c4d46(0x19f)][_0x2c4d46(0x16a)](_0x5b85c5[_0x2c4d46(0x118)]+'['+_0x5b85c5['pluginName']+']\x20subscriber['+_0x2a77f1+']['+_0x2ab88f+_0x2c4d46(0x1c5));return;}const _0x36d936=async(_0x3cbf23,_0xb61071)=>{const _0x553f2c=_0x2c4d46;try{_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe6)](_0x3cbf23+_0x553f2c(0x18c)+_0xb61071);let _0x72a681;try{if(_0x1cd796[_0x553f2c(0x104)]&&Array[_0x553f2c(0x18f)](_0x1cd796['replaceDomains']))for(let _0x198023=0x0;_0x198023<_0x1cd796[_0x553f2c(0x104)][_0x553f2c(0x1a4)];_0x198023++){const _0x4edd65=_0x1cd796[_0x553f2c(0x104)][_0x198023];if(!_0x4edd65[_0x553f2c(0xd3)]||!_0x4edd65['from'][_0x553f2c(0x1d1)]('.')||!_0x4edd65['to']||!_0x4edd65['to'][_0x553f2c(0x1d1)]('.'))continue;const _0x22c701=new RegExp('@'+_0x4edd65[_0x553f2c(0xd3)]+'\x22','gi');_0xb61071=_0xb61071['replace'](_0x22c701,'@'+_0x4edd65['to']+'\x22');}_0x72a681=JSON[_0x553f2c(0xd6)](_0xb61071);}catch(_0x22d621){_0x5b85c5['logger'][_0x553f2c(0x16a)](_0x3cbf23+'\x20message\x20json\x20parsing\x20error:\x20'+_0x22d621['message']+_0x553f2c(0x19b)+_0xb61071),_0x5b85c5[_0x553f2c(0x19f)]['debug'](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);return;}const _0x536239=_0x72a681['user'];if(!_0x536239){_0x5b85c5['logger']['error'](_0x3cbf23+'\x20missing\x20user\x20object\x20in\x20message:\x20'+JSON[_0x553f2c(0x158)](_0x72a681)),_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);return;}if(!_0x536239[_0x553f2c(0x112)]){_0x5b85c5[_0x553f2c(0x19f)]['error'](_0x3cbf23+_0x553f2c(0x1b9)+JSON[_0x553f2c(0x158)](_0x72a681)),_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+'\x20done'+_0x5270e2);return;}delete _0x536239[_0x553f2c(0xea)];let _0x20884a;_0x536239['id']&&(_0x20884a=_0x536239['id'],delete _0x536239['id']);let _0x310112;_0x536239[_0x553f2c(0xda)]&&(_0x310112=utils[_0x553f2c(0x123)](_0x536239[_0x553f2c(0xda)]),delete _0x536239[_0x553f2c(0xda)]);await _0x38befb(_0x2a77f1,_0x536239);const _0x280b1a=_0x536239[_0x553f2c(0x112)];let _0xf12229,_0x142dbc;try{_0xf12229=await _0x2c9991(_0x2a77f1,_0x553f2c(0x112),_0x280b1a);}catch(_0x16a13e){_0x5b85c5[_0x553f2c(0x19f)]['error'](_0x3cbf23+_0x553f2c(0x159)+_0x16a13e[_0x553f2c(0xd8)]),_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);const _0x4996b8=[_0x553f2c(0x1bb),_0x553f2c(0x170),'ECONNREFUSED',_0x553f2c(0x1cb),_0x553f2c(0x1a0),_0x553f2c(0x180)];for(const _0x209b8a in _0x4996b8){if(_0x16a13e['message'][_0x553f2c(0x1d1)](_0x209b8a))return!![];}return;}if(!_0x1cd796['skipConvertRolesToGroups']){let _0x582e2a=![];if(_0x72a681['Operations']&&Array[_0x553f2c(0x18f)](_0x72a681[_0x553f2c(0x1cc)]))for(let _0x5a204a=0x0;_0x5a204a<_0x72a681['Operations'][_0x553f2c(0x1a4)];_0x5a204a++){const _0x210ec4=_0x72a681[_0x553f2c(0x1cc)][_0x5a204a];_0x210ec4[_0x553f2c(0x143)][_0x553f2c(0x1c4)]('roles')&&(_0x210ec4[_0x553f2c(0x143)]=_0x553f2c(0x1ae),Array[_0x553f2c(0x18f)](_0x210ec4[_0x553f2c(0x12d)])?(_0x210ec4[_0x553f2c(0x12d)][0x0]['id']=_0x210ec4['value'][0x0][_0x553f2c(0x12d)],_0x210ec4['value'][0x0][_0x553f2c(0x1af)]=_0x210ec4[_0x553f2c(0x12d)][0x0][_0x553f2c(0xd1)]+'\x20-\x20'+_0x210ec4[_0x553f2c(0x12d)][0x0][_0x553f2c(0x12d)],delete _0x210ec4['value'][0x0]['value'],delete _0x210ec4[_0x553f2c(0x12d)][0x0]['type']):_0x210ec4[_0x553f2c(0x12d)]=[{'id':_0x210ec4[_0x553f2c(0x12d)],'display':_0x210ec4[_0x553f2c(0x12d)]}],delete _0x210ec4[_0x553f2c(0x18a)],_0x582e2a=!![]);}if(_0x536239[_0x553f2c(0x16f)]&&Array['isArray'](_0x536239[_0x553f2c(0x16f)])&&_0x536239['roles'][_0x553f2c(0x1a4)]>0x0){if(!_0x536239[_0x553f2c(0x1ae)])_0x536239[_0x553f2c(0x1ae)]=[];if(!Array[_0x553f2c(0x18f)](_0x536239[_0x553f2c(0x1ae)]))_0x536239[_0x553f2c(0x1ae)]=[];for(let _0x57a7df=0x0;_0x57a7df<_0x536239[_0x553f2c(0x16f)][_0x553f2c(0x1a4)];_0x57a7df++){const _0x25c5a4={},_0x2be95f=_0x536239['roles'][_0x57a7df];_0x25c5a4[_0x553f2c(0x12d)]=_0x2be95f[_0x553f2c(0x12d)],_0x25c5a4[_0x553f2c(0x1af)]=_0x2be95f[_0x553f2c(0xd1)]+_0x553f2c(0x182)+_0x2be95f[_0x553f2c(0x1af)],_0x536239[_0x553f2c(0x1ae)][_0x553f2c(0x132)](_0x25c5a4);}delete _0x536239[_0x553f2c(0x16f)],_0x582e2a=!![];}if(_0x582e2a)_0x5b85c5[_0x553f2c(0x19f)]['debug'](_0x3cbf23+_0x553f2c(0x1ad)+JSON['stringify'](_0x72a681));}if(!_0xf12229){if(_0x72a681[_0x553f2c(0x199)]===_0x553f2c(0x171)){_0x5b85c5['logger'][_0x553f2c(0xe8)](_0x3cbf23+'\x20Delete\x20User\x20userName='+_0x280b1a+_0x553f2c(0x100)),_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+'\x20done'+_0x5270e2);return;}if(_0x1cd796[_0x553f2c(0x186)]&&_0x1cd796[_0x553f2c(0x186)]===!![]){_0x5b85c5['logger'][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0x197)+_0x280b1a+_0x553f2c(0x177)),_0x5b85c5[_0x553f2c(0x19f)]['debug'](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);return;}if(Object[_0x553f2c(0x176)][_0x553f2c(0x1c6)][_0x553f2c(0x14f)](_0x536239,_0x553f2c(0xeb))){if(typeof _0x536239[_0x553f2c(0xeb)]==='string'){const _0x5e9bad=_0x536239['active'][_0x553f2c(0xf3)]();if(_0x5e9bad==='true')_0x536239[_0x553f2c(0xeb)]=!![];else{if(_0x5e9bad==='false')_0x536239[_0x553f2c(0xeb)]=![];}}if(_0x536239[_0x553f2c(0xeb)]===![]){_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+'\x20Create\x20userName='+_0x280b1a+_0x553f2c(0x120)),_0x5b85c5[_0x553f2c(0x19f)]['debug'](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);return;}}_0x5b85c5['logger'][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0x1b3)+_0x280b1a);const _0x10d736=utils[_0x553f2c(0x123)](_0x536239);try{delete _0x10d736[_0x553f2c(0x1ae)];!_0x10d736[_0x553f2c(0x115)]&&_0x1cd796[_0x553f2c(0x1d3)]&&_0x1cd796[_0x553f2c(0x1d3)]===!![]&&(_0x10d736[_0x553f2c(0x115)]=utils[_0x553f2c(0x19d)](0xf));if(_0x310112||_0x20884a){if(_0x310112)for(const _0x2a0edb in _0x310112){_0x10d736[_0x2a0edb]=_0x310112[_0x2a0edb];}if(_0x20884a)_0x10d736['id']=_0x20884a;await _0x38befb(_0x2a77f1,_0x10d736);}await _0x5b85c5[_0x553f2c(0x174)](_0x2a77f1,_0x10d736),_0x536239['groups']&&Array[_0x553f2c(0x18f)](_0x536239[_0x553f2c(0x1ae)])&&_0x536239[_0x553f2c(0x1ae)][_0x553f2c(0x1a4)]>0x0&&(_0x142dbc=await _0x2c9991(_0x2a77f1,_0x553f2c(0x112),_0x280b1a));}catch(_0x416202){_0x5b85c5['logger'][_0x553f2c(0x16a)](_0x3cbf23+_0x553f2c(0x1c2)+JSON[_0x553f2c(0x158)](_0x10d736)+_0x553f2c(0x157)+_0x416202[_0x553f2c(0xd8)]+'}'),_0x5b85c5[_0x553f2c(0x19f)]['debug'](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);return;}}if(_0xf12229||_0x142dbc){if(_0x72a681[_0x553f2c(0x199)]===_0x553f2c(0x171)){if(_0x1cd796['modifyOnly']&&_0x1cd796[_0x553f2c(0x186)]===!![]){_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0xfd)+_0xf12229+'\x20message:\x20user\x20not\x20deleted\x20because\x20of\x20configuration\x20modifyOnly=true'),_0x5b85c5['logger'][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);return;}_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0xfd)+_0xf12229);try{await _0x5b85c5[_0x553f2c(0x171)](_0x2a77f1,_0xf12229);}catch(_0x1c1f36){_0x5b85c5[_0x553f2c(0x19f)]['error'](_0x3cbf23+_0x553f2c(0xfd)+_0xf12229+_0x553f2c(0x157)+_0x1c1f36[_0x553f2c(0xd8)]+'}'),_0x5b85c5[_0x553f2c(0x19f)]['debug'](_0x3cbf23+'\x20done'+_0x5270e2);return;}}else{if(_0x142dbc)_0xf12229=_0x142dbc;_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0x1be)+_0xf12229);const _0x12668b={};_0x12668b['set']=()=>{},_0x12668b[_0x553f2c(0x16b)]={},_0x12668b[_0x553f2c(0x16b)][_0x553f2c(0x18b)]=_0x2a77f1,_0x12668b[_0x553f2c(0x16b)]['id']=_0xf12229,_0x12668b[_0x553f2c(0x18d)]={},_0x12668b['request'][_0x553f2c(0x136)]=_0x2a77f1?'/'+_0x2a77f1+_0x553f2c(0x147)+_0xf12229:'/Users/'+_0xf12229,_0x12668b[_0x553f2c(0x18d)][_0x553f2c(0xe4)]=_0x536239;try{await _0x5b85c5[_0x553f2c(0x15f)](_0x12668b);}catch(_0x1d443b){_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0x16a)](_0x3cbf23+_0x553f2c(0x1be)+_0xf12229+_0x553f2c(0x157)+_0x1d443b[_0x553f2c(0xd8)]),_0x5b85c5[_0x553f2c(0x19f)]['debug'](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);return;}if(_0x12668b['status']&&(_0x12668b[_0x553f2c(0x1b8)]<0xc8||_0x12668b[_0x553f2c(0x1b8)]>0x12b)){if(_0x12668b[_0x553f2c(0xe4)]){if(_0x12668b[_0x553f2c(0xe4)]['detail']){let _0x40074c=_0x12668b['body'][_0x553f2c(0xfe)];_0x40074c=_0x40074c[_0x553f2c(0xde)](_0x5b85c5['gwName']+'['+_0x5b85c5[_0x553f2c(0xe9)]+']',''+_0x3cbf23),_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0x16a)](''+_0x40074c);}else{if(_0x12668b[_0x553f2c(0xe4)][_0x553f2c(0x190)]&&Array[_0x553f2c(0x18f)](_0x12668b['body'][_0x553f2c(0x190)])&&_0x12668b[_0x553f2c(0xe4)][_0x553f2c(0x190)][_0x553f2c(0x1a4)]>0x0){let _0x4af99a=_0x12668b[_0x553f2c(0xe4)][_0x553f2c(0x190)][0x0][_0x553f2c(0x163)];_0x4af99a=_0x4af99a[_0x553f2c(0xde)](_0x5b85c5[_0x553f2c(0x118)]+'['+_0x5b85c5[_0x553f2c(0xe9)]+']',''+_0x3cbf23),_0x5b85c5['logger'][_0x553f2c(0x16a)](''+_0x4af99a);}}}}if(_0x1cd796[_0x553f2c(0x139)]){const [_0x1f3645,_0x4eca0b]=_0x5b85c5['convertedScim20']({'Operations':_0x72a681['Operations']});if(_0x4eca0b){_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0x16a)](_0x3cbf23+_0x553f2c(0x1be)+_0xf12229+_0x553f2c(0xe3)+_0x4eca0b[_0x553f2c(0xd8)]),_0x5b85c5[_0x553f2c(0x19f)]['debug'](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);return;}const _0x400648=[];if(_0x1f3645[_0x553f2c(0x16f)]&&Array[_0x553f2c(0x18f)](_0x1f3645[_0x553f2c(0x16f)]))for(let _0x3c2129=0x0;_0x3c2129<_0x1f3645['roles'][_0x553f2c(0x1a4)];_0x3c2129++){_0x1f3645['roles'][_0x3c2129][_0x553f2c(0x150)]&&_0x1f3645['roles'][_0x3c2129][_0x553f2c(0x150)]===_0x553f2c(0x1c9)&&_0x400648['push'](_0x1f3645[_0x553f2c(0x16f)][_0x3c2129]);}if(_0x400648[_0x553f2c(0x1a4)]>0x0)try{await _0x5b85c5['modifyUser'](_0x2a77f1,_0xf12229,{'roles':_0x400648});}catch(_0x4090e2){_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0x16a)](_0x3cbf23+'\x20Replace\x20User\x20id='+_0xf12229+_0x553f2c(0x173)+_0x4090e2[_0x553f2c(0xd8)]);}const _0x5c88c7=[];if(_0x1f3645['groups']&&Array['isArray'](_0x1f3645[_0x553f2c(0x1ae)]))for(let _0x3c4e9c=0x0;_0x3c4e9c<_0x1f3645['groups'][_0x553f2c(0x1a4)];_0x3c4e9c++){_0x1f3645[_0x553f2c(0x1ae)][_0x3c4e9c][_0x553f2c(0x150)]&&_0x1f3645['groups'][_0x3c4e9c][_0x553f2c(0x150)]===_0x553f2c(0x1c9)&&_0x5c88c7[_0x553f2c(0x132)](_0x1f3645[_0x553f2c(0x1ae)][_0x3c4e9c]);}if(_0x5c88c7[_0x553f2c(0x1a4)]>0x0)for(let _0x58489b=0x0;_0x58489b<_0x5c88c7['length'];_0x58489b++){try{await _0x5b85c5[_0x553f2c(0x1ce)](_0x2a77f1,_0x5c88c7[_0x58489b]['id'],{'members':[{'operation':_0x553f2c(0x1c9),'value':_0xf12229}]});}catch(_0x51d576){_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0x16a)](_0x3cbf23+'\x20Replace\x20User\x20id='+_0xf12229+_0x553f2c(0x106)+_0x51d576[_0x553f2c(0xd8)]);}}}if(_0x1cd796[_0x553f2c(0x14e)]&&_0x72a681[_0x553f2c(0x199)]===_0x553f2c(0x19c)){if(_0x536239[_0x553f2c(0x1ae)]&&Array['isArray'](_0x536239[_0x553f2c(0x1ae)])&&_0x536239[_0x553f2c(0x1ae)][_0x553f2c(0x1a4)]===0x0){if(_0x536239['roles']&&Array[_0x553f2c(0x18f)](_0x536239[_0x553f2c(0x16f)])&&_0x536239[_0x553f2c(0x16f)][_0x553f2c(0x1a4)]===0x0){if(_0x72a681[_0x553f2c(0x1cc)]&&Array['isArray'](_0x72a681['Operations'])&&_0x72a681[_0x553f2c(0x1cc)][_0x553f2c(0x1a4)]>0x0){let _0x356a57=![];for(let _0xf110f4=0x0;_0xf110f4<_0x72a681['Operations'][_0x553f2c(0x1a4)];_0xf110f4++){const _0x61397e=_0x72a681[_0x553f2c(0x1cc)][_0xf110f4];if(_0x61397e['op']===_0x553f2c(0x189)){if(_0x61397e[_0x553f2c(0x143)]){if(_0x61397e[_0x553f2c(0x143)][_0x553f2c(0x1c4)](_0x553f2c(0x16f))&&_0x61397e[_0x553f2c(0x18a)]){_0x356a57=!![];break;}else{if(_0x61397e[_0x553f2c(0x143)]==='groups'){_0x356a57=!![];break;}}}}}if(_0x356a57){_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0xfd)+_0xf12229);try{await _0x5b85c5[_0x553f2c(0x171)](_0x2a77f1,_0xf12229);}catch(_0x2a122f){_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0x16a)](_0x3cbf23+_0x553f2c(0xfd)+_0xf12229+_0x553f2c(0x157)+_0x2a122f[_0x553f2c(0xd8)]+'}'),_0x5b85c5['logger'][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);return;}}}}}}}}_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0xe8)](_0x3cbf23+_0x553f2c(0x134)+_0x5270e2);}catch(_0x3d5f06){_0x5b85c5[_0x553f2c(0x19f)][_0x553f2c(0x16a)](_0x5b85c5[_0x553f2c(0x118)]+'['+_0x5b85c5['pluginName']+']\x20subscriber['+_0x2a77f1+']['+_0x2ab88f+']\x20error:\x20'+_0x3d5f06[_0x553f2c(0xd8)]+_0x553f2c(0x1cd)+_0x5270e2);}},_0x2ca014=nats[_0x2c4d46(0x13c)](),_0x3a8a87=_0x4a36dd['jetstream'](),_0x4a48e9=(_0x2c4d46(0x166)+_0x5b85c5[_0x2c4d46(0xe9)]+'_'+_0x2a77f1)['replaceAll']('*','#')[_0x2c4d46(0x17d)]('>','##')[_0x2c4d46(0x17d)]('.','_'),_0x103154=_0x2ab88f[_0x2c4d46(0xf1)]('.')[0x0][_0x2c4d46(0x1a7)]()==='GW',_0xcf4135=async()=>{const _0x3f3df0=_0x2c4d46;try{let _0x541313;const _0x269c05=''+_0x1cd796?.[_0x3f3df0(0x153)]?.[_0x3f3df0(0x105)],_0x4e28a1=await _0x4a36dd[_0x3f3df0(0x19e)](),_0xa994e7=async()=>{const _0x192d3a=_0x3f3df0;let _0x9c3ff2;try{_0x9c3ff2=await _0x3a8a87[_0x192d3a(0x1ca)]['get'](_0x269c05,_0x4a48e9);}catch(_0x20c97c){const _0x334452={'durable_name':_0x4a48e9,'deliver_policy':nats[_0x192d3a(0xe5)]['All'],'ack_policy':nats[_0x192d3a(0x194)][_0x192d3a(0x1cf)],'filter_subject':_0x2ab88f};await _0x4e28a1['consumers'][_0x192d3a(0x1b7)](_0x269c05,_0x334452),_0x9c3ff2=await _0x3a8a87[_0x192d3a(0x1ca)][_0x192d3a(0x1bd)](_0x269c05,_0x4a48e9);}if(_0x9c3ff2?.[_0x192d3a(0x108)]?.[_0x192d3a(0x110)]?.['deliver_policy']!=='all')throw new Error(_0x192d3a(0x10c));_0x9c3ff2?.[_0x192d3a(0x108)]?.['config']?.[_0x192d3a(0x10f)]!==_0x2ab88f&&(await _0x4e28a1[_0x192d3a(0x1ca)]['update'](_0x269c05,_0x4a48e9,{'filter_subject':_0x2ab88f}),_0x9c3ff2=await _0x3a8a87[_0x192d3a(0x1ca)][_0x192d3a(0x1bd)](_0x269c05,_0x4a48e9)),_0x541313=await _0x9c3ff2['consume']({'max_messages':0x64}),_0x1e4622(_0x541313);},_0x1e4622=async _0x4964da=>{const _0x1f1886=_0x3f3df0;for await(const _0x4a36ac of await _0x4964da[_0x1f1886(0x1b8)]()){switch(_0x4a36ac['type']){case nats['ConsumerEvents']['ConsumerNotFound']:_0x5b85c5['logger'][_0x1f1886(0xe6)](_0x5b85c5[_0x1f1886(0x118)]+'['+_0x5b85c5[_0x1f1886(0xe9)]+']\x20subscriber['+_0x2a77f1+']['+_0x2ab88f+_0x1f1886(0x17f)+_0x4a36ac[_0x1f1886(0xd1)]),_0xa994e7();return;}}};await _0xa994e7();let _0x4e54a2=-0x1;do{for await(const _0x458606 of _0x541313){if(!_0x458606[_0x3f3df0(0x125)]||!_0x458606[_0x3f3df0(0x125)]['get'](_0x3f3df0(0x172))){_0x458606['ack']();continue;}_0x4e54a2=_0x541313[_0x3f3df0(0x1a6)]();const _0x1b4090=_0x5b85c5[_0x3f3df0(0x118)]+'['+_0x5b85c5[_0x3f3df0(0xe9)]+_0x3f3df0(0x107)+_0x2a77f1+']['+_0x458606[_0x3f3df0(0xdd)]+']['+_0x4e54a2+']['+(_0x458606[_0x3f3df0(0x125)]?_0x458606['headers'][_0x3f3df0(0x1bd)](_0x3f3df0(0x172)):'')+']',_0x44925a=_0x2ca014[_0x3f3df0(0xcc)](_0x458606[_0x3f3df0(0x103)]),_0x334efc=await _0x36d936(_0x1b4090,_0x44925a);if(!_0x334efc||_0x334efc!==!![])_0x458606[_0x3f3df0(0x14a)]();else _0x5b85c5['logger'][_0x3f3df0(0x16a)](_0x1b4090+_0x3f3df0(0x1c7));if(_0x4e54a2<0x1)break;}}while(_0x4e54a2===0x0);}catch(_0xf708ce){_0x5b85c5[_0x3f3df0(0x19f)][_0x3f3df0(0x16a)](_0x5b85c5[_0x3f3df0(0x118)]+'['+_0x5b85c5[_0x3f3df0(0xe9)]+_0x3f3df0(0x107)+_0x2a77f1+']['+_0x2ab88f+']\x20subscriber\x20stopped\x20error:\x20'+_0xf708ce['message']);}},_0x2217c2=async()=>{const _0x1a4208=_0x2c4d46,_0x47c291=_0x4a36dd[_0x1a4208(0x13e)](_0x2ab88f,{'max':0x64});for await(const _0x589cd6 of _0x47c291){if(!_0x589cd6[_0x1a4208(0x125)]||!_0x589cd6[_0x1a4208(0x125)][_0x1a4208(0x1bd)](_0x1a4208(0x172)))continue;let _0x26a652,_0x31a02c;try{try{_0x26a652=JSON['parse'](_0x589cd6['string']());}catch(_0x50e88c){const _0x4fd1c2=_0x1a4208(0x165);_0x5b85c5[_0x1a4208(0x19f)][_0x1a4208(0x16a)](_0x5b85c5[_0x1a4208(0x118)]+'['+_0x5b85c5[_0x1a4208(0xe9)]+_0x1a4208(0x107)+_0x2a77f1+']['+_0x2ab88f+']\x20'+_0x4fd1c2+':\x20'+_0x589cd6['string']());throw new Error(_0x4fd1c2);}if(!_0x26a652||!_0x26a652['handle']){const _0x1c90bc=_0x1a4208(0x195);_0x5b85c5[_0x1a4208(0x19f)][_0x1a4208(0x16a)](_0x5b85c5[_0x1a4208(0x118)]+'['+_0x5b85c5['pluginName']+_0x1a4208(0x107)+_0x2a77f1+']['+_0x2ab88f+']\x20'+_0x1c90bc+':\x20'+_0x26a652);throw new Error(_0x1c90bc);}!Object[_0x1a4208(0x176)]['hasOwnProperty'][_0x1a4208(0x14f)](_0x26a652,'baseEntity')&&(_0x26a652[_0x1a4208(0x18b)]=_0x1a4208(0x188));if(_0x26a652[_0x1a4208(0x18b)]!==_0x2a77f1){const _0x4dfb8e=_0x1a4208(0x187)+_0x26a652[_0x1a4208(0x18b)]+'\x20not\x20equal\x20subscriber\x20configured\x20baseEntity='+_0x2a77f1;_0x5b85c5[_0x1a4208(0x19f)][_0x1a4208(0x16a)](_0x5b85c5[_0x1a4208(0x118)]+'['+_0x5b85c5[_0x1a4208(0xe9)]+_0x1a4208(0x107)+_0x2a77f1+']['+_0x2ab88f+']\x20'+_0x4dfb8e);throw new Error(_0x4dfb8e);}_0x31a02c=_0x5b85c5[_0x1a4208(0x118)]+'['+_0x5b85c5[_0x1a4208(0xe9)]+_0x1a4208(0x107)+_0x2a77f1+']['+_0x589cd6['subject']+']['+(_0x589cd6[_0x1a4208(0x125)]?_0x589cd6['headers']['get'](_0x1a4208(0x172)):'')+']',_0x5b85c5[_0x1a4208(0x19f)][_0x1a4208(0xe8)](_0x31a02c+_0x1a4208(0x14c));let _0x28c8ca,_0x2c2c31;switch(_0x26a652['handle']){case'getUsers':_0x28c8ca=await _0x5b85c5[_0x26a652['handle']](_0x2a77f1,_0x26a652[_0x1a4208(0xf2)],_0x26a652[_0x1a4208(0x15e)],_0x26a652[_0x1a4208(0xe2)]);break;case _0x1a4208(0x16d):_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x2a77f1,_0x26a652[_0x1a4208(0xf2)],_0x26a652[_0x1a4208(0x15e)],_0x26a652['ctxPassThrough']);break;case'createUser':_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x2a77f1,_0x26a652[_0x1a4208(0xf2)],_0x26a652['ctxPassThrough']);break;case _0x1a4208(0x10b):_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x2a77f1,_0x26a652[_0x1a4208(0xf2)],_0x26a652['ctxPassThrough']);break;case _0x1a4208(0x171):_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x2a77f1,_0x26a652['id'],_0x26a652[_0x1a4208(0xe2)]);break;case _0x1a4208(0x11d):_0x28c8ca=await _0x5b85c5[_0x26a652['handle']](_0x2a77f1,_0x26a652['id'],_0x26a652['ctxPassThrough']);break;case _0x1a4208(0x19c):_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x2a77f1,_0x26a652['id'],_0x26a652[_0x1a4208(0xf2)],_0x26a652['ctxPassThrough']);break;case _0x1a4208(0x1ce):_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x2a77f1,_0x26a652['id'],_0x26a652[_0x1a4208(0xf2)],_0x26a652[_0x1a4208(0xe2)]);break;case _0x1a4208(0x15f):const _0x19a9e8={};_0x19a9e8[_0x1a4208(0x116)]=()=>{},_0x19a9e8[_0x1a4208(0x16b)]={},_0x19a9e8[_0x1a4208(0x16b)][_0x1a4208(0x18b)]=_0x2a77f1,_0x19a9e8[_0x1a4208(0x16b)]['id']=_0x26a652['id'],_0x19a9e8[_0x1a4208(0x18d)]={},_0x19a9e8['request'][_0x1a4208(0x136)]=_0x26a652['originalUrl'],_0x19a9e8['request'][_0x1a4208(0xe4)]=_0x26a652['obj'],_0x19a9e8[_0x1a4208(0x101)]=_0x26a652['ctxPassThrough'],_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x19a9e8);break;case _0x1a4208(0x131):_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x2a77f1,_0x26a652[_0x1a4208(0xf2)],_0x26a652[_0x1a4208(0xe2)]);break;case _0x1a4208(0x1ba):_0x28c8ca=await _0x5b85c5[_0x26a652['handle']](_0x2a77f1,_0x26a652['id'],_0x26a652[_0x1a4208(0xf2)],_0x26a652['ctxPassThrough']);break;case _0x1a4208(0x11f):_0x28c8ca=await _0x5b85c5[_0x26a652['handle']](_0x2a77f1,_0x26a652['id'],_0x26a652[_0x1a4208(0xf2)],_0x26a652[_0x1a4208(0xe2)]);break;case _0x1a4208(0x149):_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x2a77f1,_0x26a652['id'],_0x26a652[_0x1a4208(0x119)],_0x26a652[_0x1a4208(0xf2)],_0x26a652[_0x1a4208(0xe2)]);break;case _0x1a4208(0x12a):_0x28c8ca=await _0x5b85c5[_0x26a652[_0x1a4208(0x145)]](_0x2a77f1,_0x26a652['id'],_0x26a652[_0x1a4208(0xe2)]);break;default:_0x2c2c31=_0x1a4208(0x129)+_0x26a652[_0x1a4208(0x145)]+_0x1a4208(0x156),_0x5b85c5['logger'][_0x1a4208(0x16a)](_0x5b85c5[_0x1a4208(0x118)]+'['+_0x5b85c5[_0x1a4208(0xe9)]+_0x1a4208(0x107)+_0x2a77f1+']['+_0x2ab88f+']\x20'+_0x2c2c31);throw new Error(_0x2c2c31);}if(!_0x28c8ca)_0x28c8ca=null;const _0x30cdc9=JSON['stringify'](_0x28c8ca);_0x589cd6[_0x1a4208(0xec)](_0x30cdc9),_0x5b85c5[_0x1a4208(0x19f)][_0x1a4208(0xe6)](_0x31a02c+_0x1a4208(0x14b)+_0x26a652['handle']+_0x1a4208(0x164)+(_0x26a652[_0x1a4208(0xf2)]?JSON[_0x1a4208(0x158)](_0x26a652[_0x1a4208(0xf2)]):'')+_0x1a4208(0x184)+(_0x26a652['id']?_0x26a652['id']:'')+',\x20attributes='+(_0x26a652[_0x1a4208(0x15e)]?_0x26a652[_0x1a4208(0x15e)]:'')+'\x20message\x20response:\x20'+_0x30cdc9+_0x5270e2);}catch(_0x285fff){const _0x41ed35=_0x1a4208(0x1a8)+_0x285fff['message']+_0x1a4208(0x175)+_0x285fff[_0x1a4208(0xf7)]+'\x22}';_0x589cd6['respond'](_0x41ed35),_0x5b85c5['logger'][_0x1a4208(0xe6)]((_0x31a02c||'')+_0x1a4208(0x14b)+_0x26a652[_0x1a4208(0x145)]+',\x20obj='+(_0x26a652[_0x1a4208(0xf2)]?JSON[_0x1a4208(0x158)](_0x26a652[_0x1a4208(0xf2)]):'')+_0x1a4208(0x184)+(_0x26a652['id']?_0x26a652['id']:'')+',\x20attributes='+(_0x26a652['attributes']?_0x26a652[_0x1a4208(0x15e)]:'')+_0x1a4208(0x1a1)+_0x41ed35+_0x5270e2);}}};if(_0x103154)_0x2217c2();else _0xcf4135();},_0x705127=async(_0x3cfac7,_0x152a4d)=>{const _0x454677=_0x3db26f,_0x2fbf10=_0x376b9f[_0x3cfac7][_0x454677(0x110)]?.['nats']?.[_0x454677(0xdd)];let _0x3bfb0d=0x0;for await(const _0x48b079 of _0x152a4d['status']()){switch(_0x48b079[_0x454677(0xd1)]){case nats['Events'][_0x454677(0x1b4)]:_0x5b85c5['logger'][_0x454677(0x16a)](_0x5b85c5[_0x454677(0x118)]+'['+_0x5b85c5[_0x454677(0xe9)]+_0x454677(0x107)+_0x3cfac7+']['+_0x2fbf10+_0x454677(0x1d0)+_0x48b079['data']+_0x454677(0x10d)),_0x3bfb0d=0x0;break;case nats[_0x454677(0x179)][_0x454677(0x167)]:_0x5b85c5[_0x454677(0x19f)][_0x454677(0xe6)](_0x5b85c5['gwName']+'['+_0x5b85c5[_0x454677(0xe9)]+_0x454677(0x107)+_0x3cfac7+']['+_0x2fbf10+_0x454677(0x178)+_0x48b079['data']);break;case nats[_0x454677(0x179)]['Error']:_0x5b85c5['logger'][_0x454677(0x16a)](_0x5b85c5['gwName']+'['+_0x5b85c5['pluginName']+_0x454677(0x107)+_0x3cfac7+']['+_0x2fbf10+_0x454677(0x128)+_0x48b079[_0x454677(0x103)]);break;case nats['DebugEvents'][_0x454677(0x11a)]:_0x3bfb0d+=0x1;_0x3bfb0d%0x1e===0x0&&_0x5b85c5['logger'][_0x454677(0xe8)](_0x5b85c5['gwName']+'['+_0x5b85c5['pluginName']+']\x20subscriber['+_0x3cfac7+']['+_0x2fbf10+_0x454677(0x122)+_0x48b079[_0x454677(0x103)]+_0x454677(0xf6)+_0x3bfb0d+')');break;case nats['DebugEvents'][_0x454677(0x138)]:_0x5b85c5[_0x454677(0x19f)][_0x454677(0xe8)](_0x5b85c5['gwName']+'['+_0x5b85c5[_0x454677(0xe9)]+_0x454677(0x107)+_0x3cfac7+']['+_0x2fbf10+_0x454677(0x196)+_0x48b079[_0x454677(0x103)]);break;}}};process['on'](_0x3db26f(0x1c3),async()=>{const _0xd75158=_0x3db26f;for(const _0x233d23 in _0x376b9f){_0x376b9f[_0x233d23]['nc']&&!_0x376b9f[_0x233d23]['nc'][_0xd75158(0xcf)]()&&await _0x376b9f[_0x233d23]['nc'][_0xd75158(0x1b0)]();}}),process['on'](_0x3db26f(0x133),async()=>{const _0xe8d76c=_0x3db26f;for(const _0x2faad1 in _0x376b9f){_0x376b9f[_0x2faad1]['nc']&&!_0x376b9f[_0x2faad1]['nc'][_0xe8d76c(0xcf)]()&&await _0x376b9f[_0x2faad1]['nc']['drain']();}});const _0x2c9991=async(_0x50a019,_0x288db8,_0x3ea9fe)=>{const _0x2fb830=_0x3db26f,_0x52a9d6={'attribute':_0x288db8,'operator':'eq','value':_0x3ea9fe,'rawFilter':undefined,'startIndex':undefined,'count':undefined},_0x3d80e7=[_0x288db8];if(_0x288db8!=='id')_0x3d80e7['push']('id');try{const _0x16edee=await _0x5b85c5[_0x2fb830(0xd9)](_0x50a019,_0x52a9d6,_0x3d80e7);if(!_0x16edee||!_0x16edee['Resources']||!Array['isArray'](_0x16edee[_0x2fb830(0x1a5)]))throw new Error(_0x2fb830(0x109)+JSON['stringify'](_0x52a9d6)+_0x2fb830(0x15c));if(_0x16edee[_0x2fb830(0x1a5)]['length']===0x0)return null;else{if(_0x16edee['Resources'][_0x2fb830(0x1a4)]>0x2)throw new Error('getUsers()\x20getObj='+JSON[_0x2fb830(0x158)](_0x52a9d6)+'\x20error:\x20more\x20than\x20one\x20user\x20were\x20found}');else{const _0x56a9fe=_0x16edee[_0x2fb830(0x1a5)][0x0];if(!_0x56a9fe['id'])throw new Error(_0x2fb830(0x109)+JSON[_0x2fb830(0x158)](_0x52a9d6)+_0x2fb830(0x126)+JSON[_0x2fb830(0x158)](_0x56a9fe)+_0x2fb830(0x1c1));return decodeURIComponent(_0x56a9fe['id']);}}}catch(_0x530f9a){throw new Error(_0x2fb830(0x109)+JSON[_0x2fb830(0x158)](_0x52a9d6)+_0x2fb830(0x157)+_0x530f9a[_0x2fb830(0xd8)]+'}');}},_0xa13361=_0x1a0753=>{const _0x3210b5=_0x3db26f;if(!_0x1a0753||typeof _0x1a0753!==_0x3210b5(0x17e))return[null,null];_0x1a0753=_0x1a0753[_0x3210b5(0x1a3)]();const _0x567c72=_0x1a0753['indexOf']('(');if(_0x567c72<0x1)return[null,null];if(_0x1a0753[_0x3210b5(0x162)](_0x1a0753['length']-0x1)!==')')return[null,null];if(_0x832160(_0x1a0753,'(')!==_0x832160(_0x1a0753,')'))return[null,null];const _0x4bc13a=_0x1a0753[_0x3210b5(0x162)](0x0,_0x567c72),_0x583bc0=_0x1a0753[_0x3210b5(0x162)](_0x567c72+0x1,_0x1a0753['length']-0x1);let _0xc5a7a3=[];const _0x75d599=_0x583bc0[_0x3210b5(0xf1)](',');let _0x45c6b2='';for(let _0x38d2fd=0x0;_0x38d2fd<_0x75d599['length'];_0x38d2fd++){const _0x912608=_0x45c6b2?_0x45c6b2+','+_0x75d599[_0x38d2fd]:_0x75d599[_0x38d2fd],_0x2195e7=_0x832160(_0x912608,'('),_0x2f0d27=_0x832160(_0x912608,')');if(_0x2195e7===_0x2f0d27)_0xc5a7a3[_0x3210b5(0x132)](_0x51ad44(_0x912608,'\x22')),_0x45c6b2='';else{if(_0x45c6b2)_0x45c6b2+=','+_0x75d599[_0x38d2fd];else _0x45c6b2+=_0x75d599[_0x38d2fd];}}if(_0xc5a7a3[_0x3210b5(0x1a4)]===0x0)_0xc5a7a3=null;return[_0x4bc13a,_0xc5a7a3];};function _0x832160(_0xee7d67,_0x22063e){let _0xa2b70e=0x0;for(let _0x5daece=0x0;_0x5daece<_0xee7d67['length'];_0x5daece++){_0xee7d67['charAt'](_0x5daece)===_0x22063e&&(_0xa2b70e+=0x1);}return _0xa2b70e;}const _0x51ad44=(_0x14af62,_0x336308)=>{const _0x117172=_0x3db26f;if(typeof _0x14af62!==_0x117172(0x17e)||typeof _0x336308!==_0x117172(0x17e))return _0x14af62;if(_0x14af62[_0x117172(0x1a4)]===0x1)return _0x14af62;if(_0x336308[_0x117172(0x1a4)]!==0x1)return _0x14af62;return _0x14af62=_0x14af62['trim'](),_0x14af62[_0x117172(0x162)](0x0,0x1)===_0x336308&&(_0x14af62=_0x14af62['substring'](0x1)),_0x14af62[_0x117172(0x162)](_0x14af62['length']-0x1)===_0x336308&&(_0x14af62=_0x14af62[_0x117172(0x162)](0x0,_0x14af62[_0x117172(0x1a4)]-0x1)),_0x14af62;},_0x576317=async(_0x53b326,_0x2c78b5,_0x4c6278,_0x25a35e)=>{const _0x3b97e1=_0x3db26f;if(!_0x2c78b5||!_0x4c6278||!_0x25a35e)return null;const [_0x4e5eaf,_0x5b2fb9]=_0xa13361(_0x25a35e);if(!_0x4e5eaf||!_0x5b2fb9){const _0x2d73d6=_0x25a35e[_0x3b97e1(0xf1)]('(');if(_0x2d73d6[_0x3b97e1(0x1a4)]>0x1){const _0x34e9b7=[_0x3b97e1(0x135),_0x3b97e1(0x169),_0x3b97e1(0x124),_0x3b97e1(0x10e),'join',_0x3b97e1(0xde),_0x3b97e1(0x154),_0x3b97e1(0xd7),_0x3b97e1(0x1c8)],_0x90e03c=_0x2d73d6[0x0]['toLowerCase']();if(_0x34e9b7['includes'](_0x90e03c))return null;}return _0x25a35e;}for(let _0x166e90=0x0;_0x166e90<_0x5b2fb9[_0x3b97e1(0x1a4)];_0x166e90++){if(_0x5b2fb9[_0x166e90][_0x3b97e1(0x162)](0x0,0x1)==='['){const _0xebfade=_0x5b2fb9[_0x166e90]['indexOf'](']');if(_0xebfade<0x0)return null;const _0x27b333=_0x5b2fb9[_0x166e90][_0x3b97e1(0x162)](0x1,_0xebfade),_0x344a1c=_0x27b333['split']('.');let _0xff8622;for(let _0x200da8=0x0;_0x200da8<_0x344a1c['length'];_0x200da8++){if(_0x200da8===0x0)_0xff8622=_0x2c78b5[_0x344a1c[_0x200da8]];else{if(!_0xff8622)return null;_0xff8622=_0xff8622[_0x344a1c[_0x200da8]];}}if(!_0xff8622)return null;_0x5b2fb9[_0x166e90]=_0xff8622;}}for(let _0x39dd21=0x0;_0x39dd21<_0x5b2fb9['length'];_0x39dd21++){const [_0xb77a69]=_0xa13361(_0x5b2fb9[_0x39dd21]);_0xb77a69&&(_0x5b2fb9[_0x39dd21]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x5b2fb9[_0x39dd21]));}if(_0x5b2fb9[0x0]===null)return null;switch(_0x4e5eaf[_0x3b97e1(0xf3)]()){case _0x3b97e1(0x135):{if(_0x5b2fb9[_0x3b97e1(0x1a4)]!==0x1)return null;const [_0x555c3b]=_0xa13361(_0x5b2fb9[0x0]);if(_0x555c3b)_0x5b2fb9[0x0]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x555c3b);if(_0x5b2fb9[0x0]===null)return null;return _0x5b2fb9[0x0][_0x3b97e1(0xf3)]();}case _0x3b97e1(0x169):{if(_0x5b2fb9[_0x3b97e1(0x1a4)]!==0x1)return null;const [_0x13ebbd]=_0xa13361(_0x5b2fb9[0x0]);if(_0x13ebbd)_0x5b2fb9[0x0]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x13ebbd);if(_0x5b2fb9[0x0]===null)return null;return _0x5b2fb9[0x0][_0x3b97e1(0x1a7)]();}case _0x3b97e1(0x124):{if(_0x5b2fb9[_0x3b97e1(0x1a4)]!==0x2)return null;const [_0x5a73f2]=_0xa13361(_0x5b2fb9[0x0]);if(_0x5a73f2)_0x5b2fb9[0x0]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x5a73f2);if(_0x5b2fb9[0x0]===null)return null;if(isNaN(_0x5b2fb9[0x1]))return null;return _0x5b2fb9[0x0]['substring'](0x0,_0x5b2fb9[0x1]);}case _0x3b97e1(0x10e):{const [_0x2f6dab]=_0xa13361(_0x5b2fb9[0x0]);if(_0x5b2fb9[_0x3b97e1(0x1a4)]<0x2)return null;if(_0x2f6dab)_0x5b2fb9[0x0]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x2f6dab);if(_0x5b2fb9[0x0]===null)return null;const _0x57ed34=_0x5b2fb9[0x1];if(isNaN(_0x57ed34))return null;let _0x4b4324;if(_0x5b2fb9['length']===0x3)_0x4b4324=_0x5b2fb9[0x0][_0x3b97e1(0xf1)](_0x5b2fb9[0x2]);else _0x4b4324=_0x4b4324=_0x5b2fb9[0x0][_0x3b97e1(0xf1)]('\x20');if(_0x57ed34<=_0x4b4324['length'])return _0x4b4324[_0x57ed34-0x1];else return'';}case _0x3b97e1(0xde):{const [_0x348c28]=_0xa13361(_0x5b2fb9[0x0]);if(_0x348c28)_0x5b2fb9[0x0]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x348c28);if(_0x5b2fb9[0x0]===null)return null;if(_0x5b2fb9['length']!==0x3)return null;return _0x5b2fb9[0x0][_0x3b97e1(0x17d)](_0x5b2fb9[0x1],_0x5b2fb9[0x2]);}case _0x3b97e1(0x154):{if(_0x5b2fb9[_0x3b97e1(0x1a4)]!==0x1)return null;const [_0x4f9cb3]=_0xa13361(_0x5b2fb9[0x0]);if(_0x4f9cb3)_0x5b2fb9[0x0]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x4f9cb3);if(_0x5b2fb9[0x0]===null)return null;return ascii127[_0x3b97e1(0x1bf)](_0x5b2fb9[0x0]);}case _0x3b97e1(0xfb):{let _0x176f28='';for(let _0xdb049e=0x0;_0xdb049e<_0x5b2fb9[_0x3b97e1(0x1a4)];_0xdb049e++){const [_0x5b9d73]=_0xa13361(_0x5b2fb9[_0xdb049e]);if(_0x5b9d73)_0x5b2fb9[_0xdb049e]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x5b9d73);if(_0x5b2fb9[_0xdb049e]===null)return null;_0x176f28+=_0x5b2fb9[_0xdb049e];}return _0x176f28;}case _0x3b97e1(0xd7):{if(_0x5b2fb9['length']>0x2)return null;const [_0x490afc]=_0xa13361(_0x5b2fb9[0x0]);if(_0x490afc)_0x5b2fb9[0x0]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x490afc);if(_0x5b2fb9[0x0]===null)return null;const _0xee743d=parseInt(_0x5b2fb9[0x0]);if(isNaN(_0xee743d))return null;let _0x54730a=_0x3b97e1(0x102);_0x54730a+=','+_0x5b2fb9[0x0];if(_0x5b2fb9[_0x3b97e1(0x1a4)]===0x2&&_0x5b2fb9[0x1]['toLowerCase']()==='true')_0x54730a+=_0x3b97e1(0x1aa);else _0x54730a+=',false';return _0x54730a+='##',_0x54730a;}case _0x3b97e1(0x1c8):{if(_0x5b2fb9[_0x3b97e1(0x1a4)]!==0x1)return null;const [_0x485c88]=_0xa13361(_0x5b2fb9[0x0]);if(_0x485c88)_0x5b2fb9[0x0]=await _0x576317(_0x53b326,_0x2c78b5,_0x4c6278,_0x485c88);if(_0x5b2fb9[0x0]===null)return null;let _0x3b2ebc,_0x50f4ed=![],_0x5df141='';const _0x632737=_0x5b2fb9[0x0]['split']('##');if(_0x632737['length']>0x2)for(let _0x522f51=0x0;_0x522f51<_0x632737[_0x3b97e1(0x1a4)];_0x522f51++){if(_0x632737[_0x522f51]['startsWith']('doIncrement')){const _0x39bc85=_0x632737[_0x522f51][_0x3b97e1(0xf1)](',');if(_0x39bc85[_0x3b97e1(0x1a4)]<0x2)return null;const _0x27d6b2=parseInt(_0x39bc85[0x1]);if(isNaN(_0x27d6b2))return null;_0x5df141='##'+_0x632737[_0x522f51]+'##',_0x3b2ebc=_0x39bc85[0x1],_0x39bc85[_0x3b97e1(0x1a4)]>0x2&&(_0x50f4ed=_0x39bc85[0x2][_0x3b97e1(0xf3)]()==='true');}}let _0x3cd424,_0x44768d=0x0,_0x2712f9=0x0;if(_0x3b2ebc){_0x2712f9=_0x3b2ebc['length'],_0x44768d=0xa;for(let _0x118642=0x1;_0x118642<_0x2712f9;_0x118642++){_0x44768d*=0xa;}_0x44768d-=0x1,_0x3cd424=parseInt(_0x3b2ebc);if(isNaN(_0x3cd424))return null;_0x3cd424-=0x1;}else _0x3cd424=0x0;do{_0x3cd424+=0x1;let _0x173299=_0x5b2fb9[0x0];if(_0x3b2ebc!==undefined&&_0x5df141){let _0x4a0601=_0x3cd424[_0x3b97e1(0x12f)]();while(_0x4a0601['length']<_0x2712f9){_0x4a0601='0'+_0x4a0601;}_0x50f4ed?_0x173299=_0x173299[_0x3b97e1(0xde)](_0x5df141,_0x4a0601):(_0x173299=_0x173299['replace'](_0x5df141,''),_0x50f4ed=!![],_0x3cd424-=0x1);}try{const _0x308c56=await _0x2c9991(_0x53b326,_0x4c6278,_0x173299);if(!_0x308c56)return _0x173299;}catch(_0x2df5d4){return _0x5b85c5[_0x3b97e1(0x19f)][_0x3b97e1(0x16a)](_0x5b85c5['gwName']+'['+_0x5b85c5[_0x3b97e1(0xe9)]+']\x20'+_0x4e5eaf+'\x20getUserId()\x20error:\x20'+_0x2df5d4[_0x3b97e1(0xd8)]),null;}}while(_0x3cd424<_0x44768d);return null;}default:}return null;},_0x38befb=async(_0x448519,_0x2bb3a9)=>{const _0x262772=_0x3db26f;for(const _0x7156f3 in _0x2bb3a9){const _0x3ceb57=_0x2bb3a9[_0x7156f3],[_0x18e4f9,_0x527a11]=_0xa13361(_0x3ceb57);if(_0x18e4f9){const _0x28c4fd=''+_0x7156f3,_0xbdc027=_0x18e4f9+'('+_0x527a11[_0x262772(0xfb)](',')+')',_0x52f745=await _0x576317(_0x448519,_0x2bb3a9,_0x28c4fd,_0xbdc027);if(_0x52f745===null)delete _0x2bb3a9[_0x7156f3];else _0x2bb3a9[_0x7156f3]=_0x52f745;}for(const _0x428dac in _0x3ceb57){const _0x2173e8=_0x3ceb57[_0x428dac],[_0xb34633,_0x558bd8]=_0xa13361(_0x2173e8);if(_0xb34633){const _0x428d0c=_0x7156f3+'.'+_0x428dac,_0x3cfa59=_0xb34633+'('+_0x558bd8[_0x262772(0xfb)](',')+')',_0x116e90=await _0x576317(_0x448519,_0x2bb3a9,_0x428d0c,_0x3cfa59);if(_0x116e90===null)delete _0x3ceb57[_0x428dac];else _0x3ceb57[_0x428dac]=_0x116e90;}}}return _0x2bb3a9;};},module[a0_0xf49a16(0x1b6)][a0_0xf49a16(0x1c0)]=function(_0x999858){const _0x4f23e9=a0_0xf49a16,_0x59fa9b=_0x999858,_0x1252bc={},_0x147c9a=async(_0x5bc41c,_0x1866b8)=>{const _0x31e25d=a0_0x5a7e,_0x108e70=_0x1252bc[_0x5bc41c][_0x31e25d(0x110)]?.[_0x31e25d(0x153)]?.['subject'];let _0x410bb3=0x0;for await(const _0x506814 of _0x1866b8['status']()){switch(_0x506814[_0x31e25d(0xd1)]){case nats[_0x31e25d(0x179)][_0x31e25d(0x1b4)]:_0x59fa9b['logger'][_0x31e25d(0x16a)](_0x59fa9b['gwName']+'['+_0x59fa9b['pluginName']+_0x31e25d(0x13f)+_0x5bc41c+']['+_0x108e70+']\x20client\x20disconnected\x20'+_0x506814[_0x31e25d(0x103)]+_0x31e25d(0x10d)),_0x410bb3=0x0;break;case nats[_0x31e25d(0x179)][_0x31e25d(0x167)]:_0x59fa9b[_0x31e25d(0x19f)][_0x31e25d(0xe6)](_0x59fa9b[_0x31e25d(0x118)]+'['+_0x59fa9b[_0x31e25d(0xe9)]+_0x31e25d(0x13f)+_0x5bc41c+']['+_0x108e70+_0x31e25d(0x178)+_0x506814['data']);break;case nats[_0x31e25d(0x179)]['Error']:_0x59fa9b[_0x31e25d(0x19f)][_0x31e25d(0x16a)](_0x59fa9b['gwName']+'['+_0x59fa9b[_0x31e25d(0xe9)]+_0x31e25d(0x13f)+_0x5bc41c+']['+_0x108e70+_0x31e25d(0x128)+_0x506814[_0x31e25d(0x103)]);break;case nats[_0x31e25d(0xdf)][_0x31e25d(0x11a)]:_0x410bb3+=0x1;_0x410bb3%0x1e===0x0&&_0x59fa9b[_0x31e25d(0x19f)][_0x31e25d(0xe8)](_0x59fa9b[_0x31e25d(0x118)]+'['+_0x59fa9b['pluginName']+_0x31e25d(0x13f)+_0x5bc41c+']['+_0x108e70+_0x31e25d(0x122)+_0x506814['data']+_0x31e25d(0xf6)+_0x410bb3+')');break;case nats[_0x31e25d(0xdf)][_0x31e25d(0x138)]:_0x59fa9b[_0x31e25d(0x19f)][_0x31e25d(0xe8)](_0x59fa9b[_0x31e25d(0x118)]+'['+_0x59fa9b['pluginName']+']\x20publisher['+_0x5bc41c+']['+_0x108e70+_0x31e25d(0x196)+_0x506814[_0x31e25d(0x103)]);break;}}},_0x5abc6f=async(_0x5f1b0f,_0x303fa1)=>{const _0x5582f8=a0_0x5a7e,_0x73ab95=_0x1252bc[_0x5f1b0f][_0x5582f8(0x110)]?.[_0x5582f8(0x153)]?.[_0x5582f8(0xdd)];let _0x36fe97;try{_0x36fe97=await nats[_0x5582f8(0x127)](_0x303fa1);if(_0x36fe97[_0x5582f8(0xe6)][_0x5582f8(0x148)]!==_0x5582f8(0x155)){_0x36fe97['close']();return;}_0x1252bc[_0x5f1b0f]['nc']=_0x36fe97,_0x147c9a(_0x5f1b0f,_0x36fe97);}catch(_0xf8608e){_0x59fa9b[_0x5582f8(0x19f)][_0x5582f8(0x16a)](_0x59fa9b[_0x5582f8(0x118)]+'['+_0x59fa9b['pluginName']+_0x5582f8(0x13f)+_0x5f1b0f+']['+_0x73ab95+']\x20connect\x20error:\x20'+_0xf8608e[_0x5582f8(0xd8)]+'\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration'),_0x303fa1[_0x5582f8(0x183)]=!![];try{_0x36fe97=await nats[_0x5582f8(0x127)](_0x303fa1);if(_0x36fe97[_0x5582f8(0xe6)][_0x5582f8(0x148)]!==_0x5582f8(0x155)){_0x36fe97[_0x5582f8(0x1ab)]();return;}_0x1252bc[_0x5f1b0f]['nc']=_0x36fe97,_0x147c9a(_0x5f1b0f,_0x36fe97);}catch(_0x33d063){_0x59fa9b[_0x5582f8(0x19f)][_0x5582f8(0x16a)](_0x59fa9b[_0x5582f8(0x118)]+'['+_0x59fa9b[_0x5582f8(0xe9)]+_0x5582f8(0x13f)+_0x5f1b0f+']['+_0x73ab95+']\x20connect\x20error:\x20'+_0x33d063[_0x5582f8(0xd8)]);return;}}_0x59fa9b[_0x5582f8(0x19f)][_0x5582f8(0xe8)](_0x59fa9b[_0x5582f8(0x118)]+'['+_0x59fa9b[_0x5582f8(0xe9)]+_0x5582f8(0x13f)+_0x5f1b0f+']['+_0x73ab95+']\x20connected\x20'+(_0x303fa1[_0x5582f8(0xcd)]['ca']?_0x5582f8(0xcd):'')+'\x20'+_0x36fe97['getServer']()),_0x36fe97[_0x5582f8(0x1bc)]()[_0x5582f8(0x16e)](_0x35c80c=>{const _0x289769=_0x5582f8;_0x35c80c&&_0x59fa9b[_0x289769(0x19f)]['error'](_0x59fa9b['gwName']+'['+_0x59fa9b[_0x289769(0xe9)]+_0x289769(0x13f)+_0x5f1b0f+']['+_0x73ab95+']\x20closed\x20with\x20error:\x20'+_0x35c80c[_0x289769(0xd8)]);});};this[_0x4f23e9(0x1b7)]=async(_0x203d4b,_0x14310a)=>{const _0x36c9b5=_0x4f23e9;if(!_0x14310a?.[_0x36c9b5(0x153)]){_0x59fa9b['logger'][_0x36c9b5(0x16a)](_0x59fa9b['gwName']+'['+_0x59fa9b[_0x36c9b5(0xe9)]+_0x36c9b5(0x13f)+_0x203d4b+_0x36c9b5(0xfc));return;}if(!_0x14310a?.[_0x36c9b5(0x153)]?.['tenant']){_0x59fa9b['logger']['error'](_0x59fa9b[_0x36c9b5(0x118)]+'['+_0x59fa9b[_0x36c9b5(0xe9)]+_0x36c9b5(0x13f)+_0x203d4b+_0x36c9b5(0x111));return;}if(!_0x14310a?.['nats']?.[_0x36c9b5(0xdd)]){_0x59fa9b[_0x36c9b5(0x19f)]['error'](_0x59fa9b[_0x36c9b5(0x118)]+'['+_0x59fa9b['pluginName']+_0x36c9b5(0x13f)+_0x203d4b+_0x36c9b5(0x152));return;}if(!_0x14310a?.['nats']?.[_0x36c9b5(0xdd)][_0x36c9b5(0x1c4)](_0x36c9b5(0x12b))){_0x59fa9b[_0x36c9b5(0x19f)]['error'](_0x59fa9b[_0x36c9b5(0x118)]+'['+_0x59fa9b[_0x36c9b5(0xe9)]+']\x20publisher['+_0x203d4b+_0x36c9b5(0x13b));return;}if(!_0x14310a[_0x36c9b5(0xef)]||!Array[_0x36c9b5(0x18f)](_0x14310a[_0x36c9b5(0xef)])||_0x14310a[_0x36c9b5(0xef)][_0x36c9b5(0x1a4)]<0x1){_0x59fa9b['logger'][_0x36c9b5(0x16a)](_0x59fa9b['gwName']+'['+_0x59fa9b[_0x36c9b5(0xe9)]+_0x36c9b5(0x13f)+_0x203d4b+']\x20initialization\x20error:\x20missing\x20configuration\x20stream.baseUrls');return;}if(!_0x14310a?.[_0x36c9b5(0x140)]?.['ca']){_0x59fa9b[_0x36c9b5(0x19f)][_0x36c9b5(0x16a)](_0x59fa9b[_0x36c9b5(0x118)]+'['+_0x59fa9b[_0x36c9b5(0xe9)]+_0x36c9b5(0x13f)+_0x203d4b+_0x36c9b5(0xff));return;}const _0x48b193={};try{let _0x424989=path[_0x36c9b5(0xfb)](_0x59fa9b[_0x36c9b5(0xf9)],_0x36c9b5(0x193),_0x14310a?.[_0x36c9b5(0x140)]?.['ca']||_0x36c9b5(0x1a9));(_0x14310a?.[_0x36c9b5(0x140)]?.['ca']?.['startsWith']('/')||_0x14310a?.['certificate']?.['ca']?.[_0x36c9b5(0x1d1)]('\x5c'))&&(_0x424989=_0x14310a[_0x36c9b5(0x140)]['ca']),_0x48b193['ca']=[fs[_0x36c9b5(0xdc)](_0x424989)],_0x48b193[_0x36c9b5(0x1b5)]=!![];}catch(_0x395586){_0x59fa9b[_0x36c9b5(0x19f)][_0x36c9b5(0x16a)](_0x59fa9b[_0x36c9b5(0x118)]+'['+_0x59fa9b[_0x36c9b5(0xe9)]+_0x36c9b5(0x13f)+_0x203d4b+_0x36c9b5(0xed)+_0x395586['message']);return;}const _0x31215f={},_0x36d251=new TextEncoder()[_0x36c9b5(0xf4)](_0x14310a?.[_0x36c9b5(0x153)]?.[_0x36c9b5(0xe1)]),_0x3e3597=_0x14310a?.['nats']?.[_0x36c9b5(0x1ac)];_0x31215f[_0x36c9b5(0x151)]=nats['jwtAuthenticator'](_0x3e3597,_0x36d251),_0x31215f[_0x36c9b5(0x113)]=_0x14310a['baseUrls'],_0x31215f[_0x36c9b5(0xcd)]=_0x48b193,_0x31215f[_0x36c9b5(0x183)]=![],_0x31215f['reconnect']=!![],_0x31215f[_0x36c9b5(0xce)]=0x3e8*0xa,_0x31215f[_0x36c9b5(0x15a)]=-0x1,_0x31215f['pingInterval']=0x2*0x3c*0x3e8,_0x31215f[_0x36c9b5(0x17b)]=0x5,_0x31215f['debug']=![],_0x1252bc[_0x203d4b]={},_0x1252bc[_0x203d4b][_0x36c9b5(0x110)]=_0x14310a,_0x1252bc[_0x203d4b]['nc']=undefined,_0x5abc6f(_0x203d4b,_0x31215f);};const _0x4572d8=nats[_0x4f23e9(0x13c)]();this[_0x4f23e9(0x17c)]=async _0x25b5a8=>{const _0x450e28=_0x4f23e9;let _0x2dbd4d;try{if(_0x25b5a8['constructor']===Object){_0x2dbd4d=_0x25b5a8[_0x450e28(0x18b)];if(!_0x2dbd4d)_0x25b5a8[_0x450e28(0x18b)]=_0x450e28(0x188);_0x25b5a8=JSON[_0x450e28(0x158)](_0x25b5a8);}else{const _0xb1ea8d=JSON[_0x450e28(0xd6)](_0x25b5a8);_0x2dbd4d=_0xb1ea8d[_0x450e28(0x18b)];}}catch(_0x5d9e83){throw new Error(_0x450e28(0xfa)+_0x2dbd4d+_0x450e28(0x1b2));}if(!_0x1252bc[_0x2dbd4d])throw new Error(_0x450e28(0xfa)+_0x2dbd4d+_0x450e28(0x1b1)+_0x2dbd4d);const _0x1fc317=nats[_0x450e28(0x125)]();_0x1fc317['append']('Msg-Id',crypto['randomUUID']());let _0x3dce0d;try{if(!_0x1252bc[_0x2dbd4d]['nc'])throw new Error(_0x450e28(0x185));_0x3dce0d=await _0x1252bc[_0x2dbd4d]['nc']['request'](_0x1252bc[_0x2dbd4d][_0x450e28(0x110)]?.[_0x450e28(0x153)]?.['subject'],_0x4572d8[_0x450e28(0xf4)](_0x25b5a8),{'headers':_0x1fc317});}catch(_0x497a3d){if(_0x497a3d['message']===_0x450e28(0x141))throw new Error(_0x450e28(0xfa)+_0x2dbd4d+_0x450e28(0x1a2)+_0x1252bc[_0x2dbd4d][_0x450e28(0x110)]?.[_0x450e28(0x153)]?.[_0x450e28(0xdd)]);else throw new Error(_0x450e28(0xfa)+_0x2dbd4d+_0x450e28(0xf0)+_0x497a3d[_0x450e28(0xd8)]);}let _0xa78444;try{_0xa78444=JSON[_0x450e28(0xd6)](_0x3dce0d[_0x450e28(0x17e)]());}catch(_0x1fa3a9){throw new Error(_0x450e28(0xd4)+_0x3dce0d[_0x450e28(0x17e)]());}if(_0xa78444?.[_0x450e28(0x16a)]){const _0x4823d0=new Error(_0x450e28(0x11e)+_0xa78444[_0x450e28(0x16a)]);_0x4823d0[_0x450e28(0xf7)]=_0xa78444['errName'];throw _0x4823d0;}return _0xa78444;},process['on'](_0x4f23e9(0x1c3),async()=>{const _0x171a99=_0x4f23e9;for(const _0xbd72dc in _0x1252bc){_0x1252bc[_0xbd72dc]['nc']&&!_0x1252bc[_0xbd72dc]['nc'][_0x171a99(0xcf)]()&&await _0x1252bc[_0xbd72dc]['nc'][_0x171a99(0x1b0)]();}}),process['on']('SIGINT',async()=>{const _0x31a248=_0x4f23e9;for(const _0x85903b in _0x1252bc){_0x1252bc[_0x85903b]['nc']&&!_0x1252bc[_0x85903b]['nc'][_0x31a248(0xcf)]()&&await _0x1252bc[_0x85903b]['nc'][_0x31a248(0x1b0)]();}});},module[a0_0xf49a16(0x1b6)][a0_0xf49a16(0x114)]=async(_0x185721,_0x2f2697,_0x4d95a4,_0x24a125)=>{const _0x58811e=a0_0xf49a16,_0x4e20ae=_0x58811e(0x114),_0x4844fc=_0x185721;_0x4844fc[_0x58811e(0x19f)]['debug'](_0x4844fc['gwName']+'['+_0x4844fc[_0x58811e(0xe9)]+_0x58811e(0x191)+_0x4e20ae+'\x22');try{if(!fs[_0x58811e(0xd2)](_0x4844fc['configDir']+_0x58811e(0x168)))fs['mkdirSync'](_0x4844fc['configDir']+_0x58811e(0x168));}catch(_0x294eca){}const _0x4ba2a1=path['join'](''+_0x4844fc[_0x58811e(0xf9)],'approles',_0x58811e(0xe7)+_0x4844fc['pluginName']+_0x58811e(0x144)),_0x13b902={};utils[_0x58811e(0x13d)](_0x4ba2a1)&&fs['readFileSync'](_0x4ba2a1,_0x58811e(0xd0))[_0x58811e(0xf1)](/\r?\n/)['forEach'](_0x5f9303=>{const _0x44493e=_0x58811e,_0x3b2e4f=_0x5f9303[_0x44493e(0xf1)]('\x20');_0x3b2e4f[_0x44493e(0x1a4)]===0x2&&(_0x13b902[_0x3b2e4f[0x0]]=_0x3b2e4f[0x1]);});const _0x4055bc=fs['createWriteStream'](_0x4ba2a1,{'flags':'w','encoding':_0x58811e(0xee),'mode':0x1b6,'autoClose':!![]}),_0x1b5414=[],_0x43b49f=await _0x4844fc[_0x58811e(0x16d)](_0x2f2697,{'attribute':undefined,'operator':undefined,'value':undefined},['id','displayName']);return _0x43b49f[_0x58811e(0x1a5)][_0x58811e(0x12e)](_0x841066=>{const _0x423bb7=_0x58811e;if(_0x841066['id']){let _0x4d0156=crypto['randomUUID']();if(_0x13b902[_0x841066['id']])_0x4d0156=_0x13b902[_0x841066['id']];const _0x113945={'allowedMemberTypes':[_0x423bb7(0x14d)],'description':_0x423bb7(0x11b),'displayName':_0x841066[_0x423bb7(0x117)]||_0x841066['id'],'id':_0x4d0156,'isEnabled':!![],'lang':null,'origin':'Application','value':decodeURIComponent(_0x841066['id'])};_0x1b5414[_0x423bb7(0x132)](_0x113945),_0x4055bc[_0x423bb7(0x142)](_0x841066['id']+'\x20'+_0x4d0156+'\x0a');}}),_0x4055bc['close'](),_0x4844fc['logger'][_0x58811e(0xe8)](_0x4844fc[_0x58811e(0x118)]+'['+_0x4844fc[_0x58811e(0xe9)]+_0x58811e(0x121)+_0x4ba2a1),{'Resources':[{'appRoles':_0x1b5414}]};};
13
+ 'use strict';const a0_0x2ad4e4=a0_0x7bcd;(function(_0x2159da,_0x1cd6cf){const _0x364e9f=a0_0x7bcd,_0xc901f9=_0x2159da();while(!![]){try{const _0x54c0b3=-parseInt(_0x364e9f(0x13a))/0x1*(-parseInt(_0x364e9f(0x138))/0x2)+parseInt(_0x364e9f(0x16a))/0x3*(parseInt(_0x364e9f(0xf9))/0x4)+-parseInt(_0x364e9f(0x1b5))/0x5+-parseInt(_0x364e9f(0x1a8))/0x6+parseInt(_0x364e9f(0x188))/0x7+parseInt(_0x364e9f(0x19e))/0x8+-parseInt(_0x364e9f(0x147))/0x9;if(_0x54c0b3===_0x1cd6cf)break;else _0xc901f9['push'](_0xc901f9['shift']());}catch(_0x4f48c0){_0xc901f9['push'](_0xc901f9['shift']());}}}(a0_0x1c1a,0x86d37));function a0_0x1c1a(){const _0x3d9ff8=['##doIncrement','includes','\x20-\x20will\x20do\x20auto\x20reconnect\x20when\x20connection\x20becomes\x20available','request','modifyOnly','putApi','\x20error:\x20missing\x20id}','approles_','Disconnect','rejectUnauthorized','false','remove','replaceUsrGrp','getServer','crypto','2zOShak','respond','1103814rpgQCV','indexOf',']\x20subscriber\x20stopped\x20error:\x20','\x20message:\x20user\x20does\x20not\x20exist','handle','obj','parse','originalUrl','\x20message\x20handled:\x20','utf8','timeout','baseUrls','\x22,\x22errName\x22:\x22','12227634dUNtkU','delete','detail','value',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.subject','lowercase','DeliverPolicy','toUpperCase','getAppRoles','\x20Delete\x20User\x20userName=','publisher[','replace','update','decode',']\x20initialization\x20error:\x20missing\x20configuration\x20stream.baseUrls','normalize','debug','SCIM\x20Stream','\x20=>\x20subscriber\x20not\x20activated','\x20convertedScim20\x20error:\x20','patchApi',',\x20attributes=',']\x20subscriber[','secret','increment','split',']\x20initialization\x20error:\x20nats.subject\x20root\x20topic\x20must\x20be\x20\x27GW\x27,\x20nats.subject\x20example:\x20GW.APP1','subscriber\x20message\x20error:\x20handle\x20\x27','\x20Replace\x20User\x20id=','jwtAuthenticator','servers','SIGTERM','configDir','\x20createUser()\x20obj=','level','2652009gLvXYX','subject','ack','reconnectTimeWait','Resources','tls','baseEntity','\x20message:\x20user\x20not\x20created\x20because\x20of\x20configuration\x20modifyOnly=true','randomUUID','\x20-\x20','push','connect','prototype',']\x20closed\x20with\x20error:\x20','write','name',']\x20connected\x20','description','info','ENOTFOUND',']\x20initialization\x20error:\x20missing\x20certificate\x20configuration','headers',']\x20client\x20has\x20a\x20stale\x20connection\x20','string','passThrough','activityOperation','\x20missing\x20user\x20object\x20in\x20message:\x20','jetstreamManager','file-not-configured','jwt','1519280bhcmzC','ETIMEDOUT','set','Error','\x20message\x20json\x20parsing\x20error:\x20','body','Reconnect','attributes','pingInterval','substring',']\x20client\x20disconnected\x20',']\x20error:\x20message\x20must\x20be\x20JSON\x20formatted','SCIM\x20Stream\x20-\x20Autogenerated','encode','trim','Explicit',']\x20initialization\x20error:\x20missing\x20configuration\x20nats.tenant','data','\x20message\x20error\x20response:\x20','config','elementnumber','DebugEvents','7027344WsagdU','exports','uppercase','\x20result=','ctxPassThrough','toString','onCreate','charAt','503','replaceAll','4404270dtpFmn','publisher\x20error:\x20none\x20JSON\x20formatted\x20response:\x20','query','\x20Delete\x20User\x20id=','\x20done','../lib/utils','path','\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration','StaleConnection','length','add',']\x20publisher[','\x20Create\x20User\x20userName=','2191785VBvtbd','displayName',']\x20initialization\x20error:\x20missing\x20configuration\x20nats','{\x22error\x22:\x22','internal\x20stream\x20policy\x20have\x20been\x20changed\x20-\x20central\x20SCIM\x20Stream\x20must\x20be\x20stopped\x20and\x20corresponding\x20./jetstream\x20folder\x20deleted\x20before\x20startup\x20allowing\x20new\x20policy','GW.','subscriber\x20message\x20error:\x20message\x20baseEntity=','close','_info','user','roles','getUsers()\x20getObj=','Msg-Id','\x20processing\x20incoming\x20message','\x20getUserId()\x20error:\x20',',true','nats','Events','type','deleteGroup','logger',']\x20connect\x20error:\x20','display','readFileSync','drain','All',']\x20client\x20is\x20attempting\x20to\x20reconnect\x20','/certs/','Operations','waitOnFirstConnect',']\x20client\x20reconnected\x20','getGroups','deleteUserOnLastGroupRoleRemoval','existsSync','params','deleteApi','operation','from','file','Reconnecting','\x20roles\x20converted\x20to\x20groups:\x20','consumers','stringify','gwName','getUsers','groups','schemas','deleteUser','durable_','authenticator','maxPingOut','SIGINT','subscriber\x20message\x20error:\x20message\x20missing\x20handle','server_name','approles','copyObj','\x20message:\x20','modifyGroup','\x20error:\x20','Subscriber','UnableConnectingService',']\x20error:\x20','error','true','password','userName','\x20Create\x20userName=','call','undefined','closed','typeId','4kXCVvp','createWriteStream','\x20(count=','\x20message:\x20user\x20not\x20deleted\x20because\x20of\x20configuration\x20modifyOnly=true','getuniquevalue','toLowerCase','replaceDomains','forEach','reconnect','join','certificate','startsWith','constructor',']\x20client\x20error\x20','ECONNREFUSED','jetstream','firstn','then','\x20error:\x20missing\x20result','HR.','subscriber\x20message\x20error:\x20message\x20not\x20JSON\x20formatted','transports','\x20message:\x20user\x20not\x20created\x20because\x20of\x20active=false','status','StringCodec','modifyUser','skipConvertRolesToGroups','message','foldReplacing','utf-8',']\x20initialization\x20certificate\x20error:\x20','Publisher','pluginName',',false','User','createRandomPassword','Errors','isArray','\x20handling\x20message:\x20','all',',\x20obj=','/Users/','sub','get','usePutSoftSync','doIncrement','isClosed','active'];a0_0x1c1a=function(){return _0x3d9ff8;};return a0_0x1c1a();}function a0_0x7bcd(_0x245a4b,_0x55c34b){const _0x1c1a27=a0_0x1c1a();return a0_0x7bcd=function(_0x7bcd61,_0x54c915){_0x7bcd61=_0x7bcd61-0xf0;let _0x198ea0=_0x1c1a27[_0x7bcd61];return _0x198ea0;},a0_0x7bcd(_0x245a4b,_0x55c34b);}const nats=require(a0_0x2ad4e4(0x1c5)),ascii127=require('fold-to-ascii'),fs=require('fs'),utils=require(a0_0x2ad4e4(0x1ad)),path=require(a0_0x2ad4e4(0x1ae)),crypto=require(a0_0x2ad4e4(0x137));module[a0_0x2ad4e4(0x19f)][a0_0x2ad4e4(0x1f0)]=function(_0xc533ab){const _0x375032=a0_0x2ad4e4,_0x2a0389=_0xc533ab,_0x2f6dd3={};let _0x5eec2c='';for(let _0x288c56=0x0;_0x288c56<_0x2a0389[_0x375032(0x1c9)][_0x375032(0x10e)][_0x375032(0x1b1)];_0x288c56++){if(_0x2a0389['logger']['transports'][_0x288c56][_0x375032(0x179)]===_0x375032(0x1db)){_0x5eec2c=_0x2a0389[_0x375032(0x1c9)][_0x375032(0x10e)][_0x288c56][_0x375032(0x169)];break;}}const _0x77a231=''+(_0x5eec2c==='debug'?'\x0a':''),_0x298c5b=async(_0x5171a7,_0x26c189)=>{const _0x495dd1=_0x375032,_0x1833cc=_0x2f6dd3[_0x5171a7][_0x495dd1(0x19b)]?.['nats']?.[_0x495dd1(0x16b)];let _0xd54145;try{_0xd54145=await nats[_0x495dd1(0x175)](_0x26c189);if(_0xd54145['info'][_0x495dd1(0x1ea)]!=='SCIM\x20Stream'){_0xd54145[_0x495dd1(0x1bc)]();return;}_0x2f6dd3[_0x5171a7]['nc']=_0xd54145,_0x3b536e(_0x5171a7,_0xd54145),_0x549abb(_0x5171a7,_0xd54145);}catch(_0xdb95b9){_0x2a0389[_0x495dd1(0x1c9)][_0x495dd1(0xf0)](_0x2a0389[_0x495dd1(0x1e0)]+'['+_0x2a0389[_0x495dd1(0x119)]+']\x20subscriber['+_0x5171a7+']['+_0x1833cc+_0x495dd1(0x1ca)+_0xdb95b9[_0x495dd1(0x114)]+_0x495dd1(0x1af)),_0x26c189['waitOnFirstConnect']=!![];try{_0xd54145=await nats['connect'](_0x26c189);if(_0xd54145['info'][_0x495dd1(0x1ea)]!==_0x495dd1(0x158)){_0xd54145[_0x495dd1(0x1bc)]();return;}_0x2f6dd3[_0x5171a7]['nc']=_0xd54145,_0x3b536e(_0x5171a7,_0xd54145),_0x549abb(_0x5171a7,_0xd54145);}catch(_0x23f8a3){_0x2a0389[_0x495dd1(0x1c9)][_0x495dd1(0xf0)](_0x2a0389[_0x495dd1(0x1e0)]+'['+_0x2a0389[_0x495dd1(0x119)]+_0x495dd1(0x15d)+_0x5171a7+']['+_0x1833cc+_0x495dd1(0x1ca)+_0x23f8a3['message']);return;}}_0x2a0389[_0x495dd1(0x1c9)][_0x495dd1(0x157)](_0x2a0389[_0x495dd1(0x1e0)]+'['+_0x2a0389['pluginName']+']\x20subscriber['+_0x5171a7+']['+_0x1833cc+']\x20connected\x20'+(_0x26c189[_0x495dd1(0x16f)]['ca']?_0x495dd1(0x16f):'')+'\x20'+_0xd54145['getServer']()),_0xd54145[_0x495dd1(0xf7)]()[_0x495dd1(0x10a)](_0x57a741=>{const _0x570bec=_0x495dd1;_0x57a741&&_0x2a0389[_0x570bec(0x1c9)][_0x570bec(0xf0)](_0x2a0389['gwName']+'['+_0x2a0389[_0x570bec(0x119)]+']\x20subscriber['+_0x5171a7+']['+_0x1833cc+_0x570bec(0x177)+_0x57a741[_0x570bec(0x114)]);});};this['add']=async(_0x5b86f0,_0x23ceeb)=>{const _0x264667=_0x375032;if(!_0x23ceeb?.['nats']){_0x2a0389[_0x264667(0x1c9)][_0x264667(0xf0)](_0x2a0389['gwName']+'['+_0x2a0389['pluginName']+_0x264667(0x15d)+_0x5b86f0+']\x20initialization\x20error:\x20missing\x20configuration\x20nats');return;}if(!_0x23ceeb?.[_0x264667(0x1c5)]?.['tenant']){_0x2a0389[_0x264667(0x1c9)][_0x264667(0xf0)](_0x2a0389[_0x264667(0x1e0)]+'['+_0x2a0389[_0x264667(0x119)]+_0x264667(0x15d)+_0x5b86f0+']\x20initialization\x20error:\x20missing\x20configuration\x20nats.tenant');return;}if(!_0x23ceeb?.[_0x264667(0x1c5)]?.[_0x264667(0x16b)]){_0x2a0389[_0x264667(0x1c9)][_0x264667(0xf0)](_0x2a0389['gwName']+'['+_0x2a0389['pluginName']+_0x264667(0x15d)+_0x5b86f0+_0x264667(0x14b));return;}if(!_0x23ceeb?.['certificate']?.['ca']){_0x2a0389[_0x264667(0x1c9)][_0x264667(0xf0)](_0x2a0389['gwName']+'['+_0x2a0389[_0x264667(0x119)]+_0x264667(0x15d)+_0x5b86f0+_0x264667(0x17e));return;}if(!_0x23ceeb[_0x264667(0x145)]||!Array[_0x264667(0x11e)](_0x23ceeb[_0x264667(0x145)])||_0x23ceeb['baseUrls'][_0x264667(0x1b1)]<0x1){_0x2a0389['logger'][_0x264667(0xf0)](_0x2a0389[_0x264667(0x1e0)]+'['+_0x2a0389['pluginName']+_0x264667(0x15d)+_0x5b86f0+_0x264667(0x155));return;}if(!_0x23ceeb[_0x264667(0x125)]){const _0x522033=_0x23ceeb?.[_0x264667(0x1c5)]?.[_0x264667(0x16b)][_0x264667(0x14e)]();if(_0x522033[_0x264667(0x104)](_0x264667(0x10c)))_0x23ceeb[_0x264667(0x125)]=!![];}const _0x24d2c6={};try{let _0x50be22=path[_0x264667(0x102)](_0x2a0389[_0x264667(0x167)],_0x264667(0x1d0),_0x23ceeb?.['certificate']?.['ca']||_0x264667(0x186));(_0x23ceeb?.[_0x264667(0x103)]?.['ca']?.[_0x264667(0x104)]('/')||_0x23ceeb?.[_0x264667(0x103)]?.['ca']?.[_0x264667(0x12a)]('\x5c'))&&(_0x50be22=_0x23ceeb[_0x264667(0x103)]['ca']),_0x24d2c6['ca']=[fs[_0x264667(0x1cc)](_0x50be22)],_0x24d2c6[_0x264667(0x132)]=!![];}catch(_0x2b0d41){_0x2a0389[_0x264667(0x1c9)]['error'](_0x2a0389[_0x264667(0x1e0)]+'['+_0x2a0389[_0x264667(0x119)]+_0x264667(0x15d)+_0x5b86f0+_0x264667(0x117)+_0x2b0d41[_0x264667(0x114)]);return;}const _0x2ae1b6={},_0x152eba=new TextEncoder()[_0x264667(0x195)](_0x23ceeb?.[_0x264667(0x1c5)]?.[_0x264667(0x15e)]),_0x5da4e4=_0x23ceeb?.[_0x264667(0x1c5)]?.['jwt'];_0x2ae1b6[_0x264667(0x1e6)]=nats[_0x264667(0x164)](_0x5da4e4,_0x152eba),_0x2ae1b6[_0x264667(0x165)]=_0x23ceeb[_0x264667(0x145)],_0x2ae1b6['tls']=_0x24d2c6,_0x2ae1b6['waitOnFirstConnect']=![],_0x2ae1b6['reconnect']=!![],_0x2ae1b6['reconnectTimeWait']=0x3e8*0xa,_0x2ae1b6['maxReconnectAttempts']=-0x1,_0x2ae1b6['pingInterval']=0x2*0x3c*0x3e8,_0x2ae1b6['maxPingOut']=0x5,_0x2ae1b6[_0x264667(0x157)]=![],_0x2f6dd3[_0x5b86f0]={},_0x2f6dd3[_0x5b86f0][_0x264667(0x19b)]=_0x23ceeb,_0x2f6dd3[_0x5b86f0]['nc']=undefined,_0x2f6dd3[_0x5b86f0][_0x264667(0x123)]=undefined,_0x298c5b(_0x5b86f0,_0x2ae1b6);};const _0x549abb=async(_0x11a74c,_0x117e8a)=>{const _0x27c58=_0x375032,_0x4a3c1c=_0x2f6dd3[_0x11a74c]['config'],_0x1be0d9=_0x4a3c1c?.[_0x27c58(0x1c5)]?.[_0x27c58(0x16b)];if(!_0x117e8a){_0x2a0389[_0x27c58(0x1c9)][_0x27c58(0xf0)](_0x2a0389[_0x27c58(0x1e0)]+'['+_0x2a0389['pluginName']+_0x27c58(0x15d)+_0x11a74c+']['+_0x1be0d9+']\x20error:\x20client\x20have\x20not\x20been\x20initialized');return;}const _0x1dc621=async(_0xdff44d,_0x32458c)=>{const _0x917b52=_0x27c58;try{_0x2a0389[_0x917b52(0x1c9)]['info'](_0xdff44d+_0x917b52(0x11f)+_0x32458c);let _0x197126;try{if(_0x4a3c1c[_0x917b52(0xff)]&&Array['isArray'](_0x4a3c1c[_0x917b52(0xff)]))for(let _0x58c7c6=0x0;_0x58c7c6<_0x4a3c1c['replaceDomains'][_0x917b52(0x1b1)];_0x58c7c6++){const _0x4acba6=_0x4a3c1c[_0x917b52(0xff)][_0x58c7c6];if(!_0x4acba6[_0x917b52(0x1da)]||!_0x4acba6[_0x917b52(0x1da)][_0x917b52(0x12a)]('.')||!_0x4acba6['to']||!_0x4acba6['to']['includes']('.'))continue;const _0x4bbdfb=new RegExp('@'+_0x4acba6['from']+'\x22','gi');_0x32458c=_0x32458c['replace'](_0x4bbdfb,'@'+_0x4acba6['to']+'\x22');}_0x197126=JSON[_0x917b52(0x140)](_0x32458c);}catch(_0x376cea){_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0xf0)](_0xdff44d+_0x917b52(0x18c)+_0x376cea[_0x917b52(0x114)]+_0x917b52(0x1ed)+_0x32458c),_0x2a0389['logger'][_0x917b52(0x157)](_0xdff44d+'\x20done'+_0x77a231);return;}const _0xcff90b=_0x197126[_0x917b52(0x1be)];if(!_0xcff90b){_0x2a0389['logger'][_0x917b52(0xf0)](_0xdff44d+_0x917b52(0x184)+JSON['stringify'](_0x197126)),_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+'\x20done'+_0x77a231);return;}if(!_0xcff90b['userName']){_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0xf0)](_0xdff44d+'\x20missing\x20mandatory\x20user.userName\x20in\x20message:\x20'+JSON['stringify'](_0x197126)),_0x2a0389[_0x917b52(0x1c9)]['debug'](_0xdff44d+_0x917b52(0x1ac)+_0x77a231);return;}delete _0xcff90b[_0x917b52(0x1e3)];let _0x6d107f;_0xcff90b['id']&&(_0x6d107f=_0xcff90b['id'],delete _0xcff90b['id']);let _0x26fa62;_0xcff90b['onCreate']&&(_0x26fa62=utils['copyObj'](_0xcff90b[_0x917b52(0x1a4)]),delete _0xcff90b['onCreate']);await _0x162af5(_0x11a74c,_0xcff90b);const _0x216f27=_0xcff90b[_0x917b52(0xf3)];let _0x49f5e6,_0xb395be;try{_0x49f5e6=await _0x5d75a1(_0x11a74c,_0x917b52(0xf3),_0x216f27);}catch(_0x18ab71){_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0xf0)](_0xdff44d+_0x917b52(0x1c3)+_0x18ab71[_0x917b52(0x114)]),_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+'\x20done'+_0x77a231);const _0x181cf1=['UnableConnectingHost',_0x917b52(0x1f1),_0x917b52(0x107),_0x917b52(0x17d),_0x917b52(0x189),_0x917b52(0x144)];for(const _0x508513 in _0x181cf1){if(_0x18ab71[_0x917b52(0x114)][_0x917b52(0x12a)](_0x508513))return!![];}return;}if(!_0x4a3c1c[_0x917b52(0x113)]){let _0x33ee0d=![];if(_0x197126[_0x917b52(0x1d1)]&&Array[_0x917b52(0x11e)](_0x197126['Operations']))for(let _0x4dcff6=0x0;_0x4dcff6<_0x197126['Operations']['length'];_0x4dcff6++){const _0xd5cfba=_0x197126[_0x917b52(0x1d1)][_0x4dcff6];_0xd5cfba[_0x917b52(0x1ae)][_0x917b52(0x104)](_0x917b52(0x1bf))&&(_0xd5cfba[_0x917b52(0x1ae)]='groups',Array[_0x917b52(0x11e)](_0xd5cfba[_0x917b52(0x14a)])?(_0xd5cfba[_0x917b52(0x14a)][0x0]['id']=_0xd5cfba[_0x917b52(0x14a)][0x0][_0x917b52(0x14a)],_0xd5cfba[_0x917b52(0x14a)][0x0][_0x917b52(0x1cb)]=_0xd5cfba[_0x917b52(0x14a)][0x0][_0x917b52(0x1c7)]+'\x20-\x20'+_0xd5cfba['value'][0x0][_0x917b52(0x14a)],delete _0xd5cfba['value'][0x0][_0x917b52(0x14a)],delete _0xd5cfba['value'][0x0]['type']):_0xd5cfba[_0x917b52(0x14a)]=[{'id':_0xd5cfba[_0x917b52(0x14a)],'display':_0xd5cfba[_0x917b52(0x14a)]}],delete _0xd5cfba[_0x917b52(0xf8)],_0x33ee0d=!![]);}if(_0xcff90b[_0x917b52(0x1bf)]&&Array[_0x917b52(0x11e)](_0xcff90b[_0x917b52(0x1bf)])&&_0xcff90b[_0x917b52(0x1bf)][_0x917b52(0x1b1)]>0x0){if(!_0xcff90b['groups'])_0xcff90b[_0x917b52(0x1e2)]=[];if(!Array['isArray'](_0xcff90b[_0x917b52(0x1e2)]))_0xcff90b[_0x917b52(0x1e2)]=[];for(let _0x4a143f=0x0;_0x4a143f<_0xcff90b['roles'][_0x917b52(0x1b1)];_0x4a143f++){const _0x44633e={},_0x5c0afc=_0xcff90b[_0x917b52(0x1bf)][_0x4a143f];_0x44633e[_0x917b52(0x14a)]=_0x5c0afc[_0x917b52(0x14a)],_0x44633e['display']=_0x5c0afc[_0x917b52(0x1c7)]+_0x917b52(0x173)+_0x5c0afc[_0x917b52(0x1cb)],_0xcff90b['groups'][_0x917b52(0x174)](_0x44633e);}delete _0xcff90b['roles'],_0x33ee0d=!![];}if(_0x33ee0d)_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x1dd)+JSON[_0x917b52(0x1df)](_0x197126));}if(!_0x49f5e6){if(_0x197126[_0x917b52(0x183)]===_0x917b52(0x1e4)){_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x150)+_0x216f27+_0x917b52(0x13d)),_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x1ac)+_0x77a231);return;}if(_0x4a3c1c[_0x917b52(0x12d)]&&_0x4a3c1c[_0x917b52(0x12d)]===!![]){_0x2a0389[_0x917b52(0x1c9)]['debug'](_0xdff44d+_0x917b52(0xf4)+_0x216f27+_0x917b52(0x171)),_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+'\x20done'+_0x77a231);return;}if(Object[_0x917b52(0x176)]['hasOwnProperty'][_0x917b52(0xf5)](_0xcff90b,_0x917b52(0x128))){if(typeof _0xcff90b['active']===_0x917b52(0x181)){const _0x2dd703=_0xcff90b['active'][_0x917b52(0xfe)]();if(_0x2dd703===_0x917b52(0xf1))_0xcff90b[_0x917b52(0x128)]=!![];else{if(_0x2dd703===_0x917b52(0x133))_0xcff90b[_0x917b52(0x128)]=![];}}if(_0xcff90b[_0x917b52(0x128)]===![]){_0x2a0389['logger'][_0x917b52(0x157)](_0xdff44d+_0x917b52(0xf4)+_0x216f27+_0x917b52(0x10f)),_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x1ac)+_0x77a231);return;}}_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x1b4)+_0x216f27);const _0x4598f4=utils[_0x917b52(0x1ec)](_0xcff90b);try{delete _0x4598f4[_0x917b52(0x1e2)];!_0x4598f4[_0x917b52(0xf2)]&&_0x4a3c1c['generateUserPassword']&&_0x4a3c1c['generateUserPassword']===!![]&&(_0x4598f4[_0x917b52(0xf2)]=utils[_0x917b52(0x11c)](0xf));if(_0x26fa62||_0x6d107f){if(_0x26fa62)for(const _0x19f9fe in _0x26fa62){_0x4598f4[_0x19f9fe]=_0x26fa62[_0x19f9fe];}if(_0x6d107f)_0x4598f4['id']=_0x6d107f;await _0x162af5(_0x11a74c,_0x4598f4);}await _0x2a0389['createUser'](_0x11a74c,_0x4598f4),_0xcff90b[_0x917b52(0x1e2)]&&Array['isArray'](_0xcff90b[_0x917b52(0x1e2)])&&_0xcff90b['groups'][_0x917b52(0x1b1)]>0x0&&(_0xb395be=await _0x5d75a1(_0x11a74c,_0x917b52(0xf3),_0x216f27));}catch(_0x2b64ab){_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0xf0)](_0xdff44d+_0x917b52(0x168)+JSON[_0x917b52(0x1df)](_0x4598f4)+_0x917b52(0x1ef)+_0x2b64ab[_0x917b52(0x114)]+'}'),_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x1ac)+_0x77a231);return;}}if(_0x49f5e6||_0xb395be){if(_0x197126[_0x917b52(0x183)]===_0x917b52(0x1e4)){if(_0x4a3c1c[_0x917b52(0x12d)]&&_0x4a3c1c[_0x917b52(0x12d)]===!![]){_0x2a0389['logger'][_0x917b52(0x157)](_0xdff44d+'\x20Delete\x20User\x20id='+_0x49f5e6+_0x917b52(0xfc)),_0x2a0389['logger'][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x1ac)+_0x77a231);return;}_0x2a0389['logger'][_0x917b52(0x157)](_0xdff44d+'\x20Delete\x20User\x20id='+_0x49f5e6);try{await _0x2a0389[_0x917b52(0x1e4)](_0x11a74c,_0x49f5e6);}catch(_0x4227fc){_0x2a0389[_0x917b52(0x1c9)]['error'](_0xdff44d+_0x917b52(0x1ab)+_0x49f5e6+_0x917b52(0x1ef)+_0x4227fc[_0x917b52(0x114)]+'}'),_0x2a0389[_0x917b52(0x1c9)]['debug'](_0xdff44d+_0x917b52(0x1ac)+_0x77a231);return;}}else{if(_0xb395be)_0x49f5e6=_0xb395be;_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x163)+_0x49f5e6);const _0x220e97={};_0x220e97[_0x917b52(0x18a)]=()=>{},_0x220e97[_0x917b52(0x1d7)]={},_0x220e97[_0x917b52(0x1d7)][_0x917b52(0x170)]=_0x11a74c,_0x220e97[_0x917b52(0x1d7)]['id']=_0x49f5e6,_0x220e97[_0x917b52(0x12c)]={},_0x220e97[_0x917b52(0x12c)][_0x917b52(0x141)]=_0x11a74c?'/'+_0x11a74c+_0x917b52(0x122)+_0x49f5e6:_0x917b52(0x122)+_0x49f5e6,_0x220e97[_0x917b52(0x12c)]['body']=_0xcff90b;try{await _0x2a0389[_0x917b52(0x135)](_0x220e97,_0x4a3c1c[_0x917b52(0x125)]);}catch(_0x3cc849){_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0xf0)](_0xdff44d+_0x917b52(0x163)+_0x49f5e6+_0x917b52(0x1ef)+_0x3cc849[_0x917b52(0x114)]),_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+'\x20done'+_0x77a231);return;}if(_0x220e97[_0x917b52(0x110)]&&(_0x220e97[_0x917b52(0x110)]<0xc8||_0x220e97['status']>0x12b)){if(_0x220e97[_0x917b52(0x18d)]){if(_0x220e97[_0x917b52(0x18d)][_0x917b52(0x149)]){let _0x4f4f01=_0x220e97[_0x917b52(0x18d)][_0x917b52(0x149)];_0x4f4f01=_0x4f4f01[_0x917b52(0x152)](_0x2a0389['gwName']+'['+_0x2a0389[_0x917b52(0x119)]+']',''+_0xdff44d),_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0xf0)](''+_0x4f4f01);}else{if(_0x220e97[_0x917b52(0x18d)][_0x917b52(0x11d)]&&Array[_0x917b52(0x11e)](_0x220e97[_0x917b52(0x18d)][_0x917b52(0x11d)])&&_0x220e97[_0x917b52(0x18d)]['Errors'][_0x917b52(0x1b1)]>0x0){let _0x58de21=_0x220e97[_0x917b52(0x18d)][_0x917b52(0x11d)][0x0][_0x917b52(0x17b)];_0x58de21=_0x58de21[_0x917b52(0x152)](_0x2a0389[_0x917b52(0x1e0)]+'['+_0x2a0389[_0x917b52(0x119)]+']',''+_0xdff44d),_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0xf0)](''+_0x58de21);}}}}if(_0x4a3c1c[_0x917b52(0x125)]){const [_0x54e9b8,_0x48f36d]=_0x2a0389['convertedScim20']({'Operations':_0x197126[_0x917b52(0x1d1)]});if(_0x48f36d){_0x2a0389[_0x917b52(0x1c9)]['error'](_0xdff44d+_0x917b52(0x163)+_0x49f5e6+_0x917b52(0x15a)+_0x48f36d[_0x917b52(0x114)]),_0x2a0389['logger'][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x1ac)+_0x77a231);return;}const _0x434f3a=[];if(_0x54e9b8[_0x917b52(0x1bf)]&&Array['isArray'](_0x54e9b8['roles']))for(let _0x2fb5dd=0x0;_0x2fb5dd<_0x54e9b8[_0x917b52(0x1bf)][_0x917b52(0x1b1)];_0x2fb5dd++){_0x54e9b8[_0x917b52(0x1bf)][_0x2fb5dd]['operation']&&_0x54e9b8[_0x917b52(0x1bf)][_0x2fb5dd]['operation']===_0x917b52(0x148)&&_0x434f3a['push'](_0x54e9b8[_0x917b52(0x1bf)][_0x2fb5dd]);}if(_0x434f3a[_0x917b52(0x1b1)]>0x0)try{await _0x2a0389[_0x917b52(0x112)](_0x11a74c,_0x49f5e6,{'roles':_0x434f3a});}catch(_0x1a386d){_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0xf0)](_0xdff44d+_0x917b52(0x163)+_0x49f5e6+'\x20role\x20removal\x20error:\x20'+_0x1a386d[_0x917b52(0x114)]);}const _0x40455a=[];if(_0x54e9b8['groups']&&Array[_0x917b52(0x11e)](_0x54e9b8[_0x917b52(0x1e2)]))for(let _0x5a8057=0x0;_0x5a8057<_0x54e9b8[_0x917b52(0x1e2)]['length'];_0x5a8057++){_0x54e9b8[_0x917b52(0x1e2)][_0x5a8057][_0x917b52(0x1d9)]&&_0x54e9b8[_0x917b52(0x1e2)][_0x5a8057][_0x917b52(0x1d9)]===_0x917b52(0x148)&&_0x40455a[_0x917b52(0x174)](_0x54e9b8[_0x917b52(0x1e2)][_0x5a8057]);}if(_0x40455a[_0x917b52(0x1b1)]>0x0)for(let _0x31cfe8=0x0;_0x31cfe8<_0x40455a[_0x917b52(0x1b1)];_0x31cfe8++){try{await _0x2a0389[_0x917b52(0x1ee)](_0x11a74c,_0x40455a[_0x31cfe8]['id'],{'members':[{'operation':_0x917b52(0x148),'value':_0x49f5e6}]});}catch(_0xb09c4c){_0x2a0389['logger']['error'](_0xdff44d+_0x917b52(0x163)+_0x49f5e6+'\x20group\x20removal\x20error:\x20'+_0xb09c4c['message']);}}}if(_0x4a3c1c[_0x917b52(0x1d5)]&&_0x197126[_0x917b52(0x183)]===_0x917b52(0x112)){if(_0xcff90b['groups']&&Array[_0x917b52(0x11e)](_0xcff90b[_0x917b52(0x1e2)])&&_0xcff90b[_0x917b52(0x1e2)][_0x917b52(0x1b1)]===0x0){if(_0xcff90b[_0x917b52(0x1bf)]&&Array[_0x917b52(0x11e)](_0xcff90b[_0x917b52(0x1bf)])&&_0xcff90b[_0x917b52(0x1bf)][_0x917b52(0x1b1)]===0x0){if(_0x197126[_0x917b52(0x1d1)]&&Array[_0x917b52(0x11e)](_0x197126[_0x917b52(0x1d1)])&&_0x197126[_0x917b52(0x1d1)][_0x917b52(0x1b1)]>0x0){let _0x383183=![];for(let _0x1374d0=0x0;_0x1374d0<_0x197126['Operations'][_0x917b52(0x1b1)];_0x1374d0++){const _0x4b7999=_0x197126[_0x917b52(0x1d1)][_0x1374d0];if(_0x4b7999['op']===_0x917b52(0x134)){if(_0x4b7999[_0x917b52(0x1ae)]){if(_0x4b7999['path']['startsWith']('roles')&&_0x4b7999['typeId']){_0x383183=!![];break;}else{if(_0x4b7999[_0x917b52(0x1ae)]==='groups'){_0x383183=!![];break;}}}}}if(_0x383183){_0x2a0389[_0x917b52(0x1c9)]['debug'](_0xdff44d+_0x917b52(0x1ab)+_0x49f5e6);try{await _0x2a0389[_0x917b52(0x1e4)](_0x11a74c,_0x49f5e6);}catch(_0x3950eb){_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0xf0)](_0xdff44d+'\x20Delete\x20User\x20id='+_0x49f5e6+_0x917b52(0x1ef)+_0x3950eb['message']+'}'),_0x2a0389[_0x917b52(0x1c9)]['debug'](_0xdff44d+_0x917b52(0x1ac)+_0x77a231);return;}}}}}}}}_0x2a0389[_0x917b52(0x1c9)][_0x917b52(0x157)](_0xdff44d+_0x917b52(0x1ac)+_0x77a231);}catch(_0x332a0e){_0x2a0389['logger']['error'](_0x2a0389[_0x917b52(0x1e0)]+'['+_0x2a0389['pluginName']+']\x20subscriber['+_0x11a74c+']['+_0x1be0d9+']\x20error:\x20'+_0x332a0e[_0x917b52(0x114)]+_0x917b52(0x159)+_0x77a231);}},_0x5d328b=nats[_0x27c58(0x111)](),_0x18488f=_0x117e8a[_0x27c58(0x108)](),_0x3beace=(_0x27c58(0x1e5)+_0x2a0389[_0x27c58(0x119)]+'_'+_0x11a74c)['replaceAll']('*','#')[_0x27c58(0x1a7)]('>','##')[_0x27c58(0x1a7)]('.','_'),_0x10406a=_0x1be0d9[_0x27c58(0x160)]('.')[0x0][_0x27c58(0x14e)]()==='GW',_0x238d0d=async()=>{const _0x5bb862=_0x27c58;try{let _0x45ba8b;const _0x3abe35=''+_0x4a3c1c?.[_0x5bb862(0x1c5)]?.['tenant'],_0x3d30c0=await _0x117e8a[_0x5bb862(0x185)](),_0x4b2f38=async()=>{const _0x5d3c86=_0x5bb862;let _0x8e72c0;try{_0x8e72c0=await _0x18488f[_0x5d3c86(0x1de)][_0x5d3c86(0x124)](_0x3abe35,_0x3beace);}catch(_0x861829){const _0x371bd2={'durable_name':_0x3beace,'deliver_policy':nats[_0x5d3c86(0x14d)][_0x5d3c86(0x1ce)],'ack_policy':nats['AckPolicy'][_0x5d3c86(0x197)],'filter_subject':_0x1be0d9};await _0x3d30c0['consumers'][_0x5d3c86(0x1b2)](_0x3abe35,_0x371bd2),_0x8e72c0=await _0x18488f[_0x5d3c86(0x1de)][_0x5d3c86(0x124)](_0x3abe35,_0x3beace);}if(_0x8e72c0?.['_info']?.[_0x5d3c86(0x19b)]?.['deliver_policy']!==_0x5d3c86(0x120))throw new Error(_0x5d3c86(0x1b9));_0x8e72c0?.[_0x5d3c86(0x1bd)]?.[_0x5d3c86(0x19b)]?.['filter_subject']!==_0x1be0d9&&(await _0x3d30c0[_0x5d3c86(0x1de)][_0x5d3c86(0x153)](_0x3abe35,_0x3beace,{'filter_subject':_0x1be0d9}),_0x8e72c0=await _0x18488f['consumers'][_0x5d3c86(0x124)](_0x3abe35,_0x3beace)),_0x45ba8b=await _0x8e72c0['consume']({'max_messages':0x64}),_0x3872ba(_0x45ba8b);},_0x3872ba=async _0x5a9912=>{const _0x43d155=_0x5bb862;for await(const _0x1b59b2 of await _0x5a9912['status']()){switch(_0x1b59b2['type']){case nats['ConsumerEvents']['ConsumerNotFound']:_0x2a0389['logger'][_0x43d155(0x17c)](_0x2a0389['gwName']+'['+_0x2a0389[_0x43d155(0x119)]+_0x43d155(0x15d)+_0x11a74c+']['+_0x1be0d9+']\x20client\x20consumer\x20reinitiated\x20because\x20of\x20'+_0x1b59b2[_0x43d155(0x1c7)]),_0x4b2f38();return;}}};await _0x4b2f38();let _0x2c47f3=-0x1;do{for await(const _0x419c38 of _0x45ba8b){if(!_0x419c38['headers']||!_0x419c38['headers'][_0x5bb862(0x124)](_0x5bb862(0x1c1))){_0x419c38['ack']();continue;}_0x2c47f3=_0x45ba8b['getProcessed']();const _0x18df0a=_0x2a0389[_0x5bb862(0x1e0)]+'['+_0x2a0389['pluginName']+_0x5bb862(0x15d)+_0x11a74c+']['+_0x419c38[_0x5bb862(0x16b)]+']['+_0x2c47f3+']['+(_0x419c38[_0x5bb862(0x17f)]?_0x419c38[_0x5bb862(0x17f)][_0x5bb862(0x124)]('Msg-Id'):'')+']',_0x45ca5c=_0x5d328b[_0x5bb862(0x154)](_0x419c38['data']),_0x9bf5b8=await _0x1dc621(_0x18df0a,_0x45ca5c);if(!_0x9bf5b8||_0x9bf5b8!==!![])_0x419c38[_0x5bb862(0x16c)]();else _0x2a0389[_0x5bb862(0x1c9)][_0x5bb862(0xf0)](_0x18df0a+'\x20subscriber\x20error:\x20scimgateway\x20endpoint\x20connect\x20problem\x20-\x20will\x20do\x20auto\x20retry\x20until\x20connected');if(_0x2c47f3<0x1)break;}}while(_0x2c47f3===0x0);}catch(_0x1935b3){_0x2a0389['logger'][_0x5bb862(0xf0)](_0x2a0389['gwName']+'['+_0x2a0389[_0x5bb862(0x119)]+']\x20subscriber['+_0x11a74c+']['+_0x1be0d9+_0x5bb862(0x13c)+_0x1935b3[_0x5bb862(0x114)]);}},_0x1088a5=async()=>{const _0xbeb5b9=_0x27c58,_0x389570=_0x117e8a['subscribe'](_0x1be0d9,{'max':0x64});for await(const _0x2898a4 of _0x389570){if(!_0x2898a4[_0xbeb5b9(0x17f)]||!_0x2898a4['headers'][_0xbeb5b9(0x124)]('Msg-Id'))continue;let _0x54e832,_0x223702;try{try{_0x54e832=JSON[_0xbeb5b9(0x140)](_0x2898a4['string']());}catch(_0xe14b2d){const _0x3f05fc=_0xbeb5b9(0x10d);_0x2a0389[_0xbeb5b9(0x1c9)][_0xbeb5b9(0xf0)](_0x2a0389[_0xbeb5b9(0x1e0)]+'['+_0x2a0389[_0xbeb5b9(0x119)]+_0xbeb5b9(0x15d)+_0x11a74c+']['+_0x1be0d9+']\x20'+_0x3f05fc+':\x20'+_0x2898a4[_0xbeb5b9(0x181)]());throw new Error(_0x3f05fc);}if(!_0x54e832||!_0x54e832['handle']){const _0x33c4b3=_0xbeb5b9(0x1e9);_0x2a0389[_0xbeb5b9(0x1c9)][_0xbeb5b9(0xf0)](_0x2a0389['gwName']+'['+_0x2a0389['pluginName']+_0xbeb5b9(0x15d)+_0x11a74c+']['+_0x1be0d9+']\x20'+_0x33c4b3+':\x20'+_0x54e832);throw new Error(_0x33c4b3);}!Object[_0xbeb5b9(0x176)]['hasOwnProperty']['call'](_0x54e832,_0xbeb5b9(0x170))&&(_0x54e832[_0xbeb5b9(0x170)]=_0xbeb5b9(0xf6));if(_0x54e832[_0xbeb5b9(0x170)]!==_0x11a74c){const _0xe07104=_0xbeb5b9(0x1bb)+_0x54e832[_0xbeb5b9(0x170)]+'\x20not\x20equal\x20subscriber\x20configured\x20baseEntity='+_0x11a74c;_0x2a0389['logger']['error'](_0x2a0389['gwName']+'['+_0x2a0389[_0xbeb5b9(0x119)]+_0xbeb5b9(0x15d)+_0x11a74c+']['+_0x1be0d9+']\x20'+_0xe07104);throw new Error(_0xe07104);}_0x223702=_0x2a0389['gwName']+'['+_0x2a0389[_0xbeb5b9(0x119)]+']\x20subscriber['+_0x11a74c+']['+_0x2898a4[_0xbeb5b9(0x16b)]+']['+(_0x2898a4['headers']?_0x2898a4[_0xbeb5b9(0x17f)][_0xbeb5b9(0x124)]('Msg-Id'):'')+']',_0x2a0389[_0xbeb5b9(0x1c9)][_0xbeb5b9(0x157)](_0x223702+_0xbeb5b9(0x1c2));const _0x39ea01={};let _0x575a5d,_0x3d8fc8;switch(_0x54e832[_0xbeb5b9(0x13e)]){case _0xbeb5b9(0x1e1):_0x575a5d=await _0x2a0389[_0x54e832[_0xbeb5b9(0x13e)]](_0x11a74c,_0x54e832['obj'],_0x54e832['attributes'],_0x54e832[_0xbeb5b9(0x1a2)]);break;case'getGroups':_0x575a5d=await _0x2a0389[_0x54e832['handle']](_0x11a74c,_0x54e832[_0xbeb5b9(0x13f)],_0x54e832['attributes'],_0x54e832[_0xbeb5b9(0x1a2)]);break;case'createUser':_0x575a5d=await _0x2a0389[_0x54e832['handle']](_0x11a74c,_0x54e832['obj'],_0x54e832[_0xbeb5b9(0x1a2)]);break;case'createGroup':_0x575a5d=await _0x2a0389[_0x54e832[_0xbeb5b9(0x13e)]](_0x11a74c,_0x54e832[_0xbeb5b9(0x13f)],_0x54e832[_0xbeb5b9(0x1a2)]);break;case _0xbeb5b9(0x1e4):_0x575a5d=await _0x2a0389[_0x54e832['handle']](_0x11a74c,_0x54e832['id'],_0x54e832['ctxPassThrough']);break;case _0xbeb5b9(0x1c8):_0x575a5d=await _0x2a0389[_0x54e832['handle']](_0x11a74c,_0x54e832['id'],_0x54e832['ctxPassThrough']);break;case'modifyUser':_0x575a5d=await _0x2a0389[_0x54e832[_0xbeb5b9(0x13e)]](_0x11a74c,_0x54e832['id'],_0x54e832[_0xbeb5b9(0x13f)],_0x54e832['ctxPassThrough']);break;case _0xbeb5b9(0x1ee):_0x575a5d=await _0x2a0389[_0x54e832[_0xbeb5b9(0x13e)]](_0x11a74c,_0x54e832['id'],_0x54e832['obj'],_0x54e832['ctxPassThrough']);break;case _0xbeb5b9(0x135):_0x39ea01['set']=()=>{},_0x39ea01['params']={},_0x39ea01[_0xbeb5b9(0x1d7)][_0xbeb5b9(0x170)]=_0x11a74c,_0x39ea01[_0xbeb5b9(0x1d7)]['id']=_0x54e832['id'],_0x39ea01[_0xbeb5b9(0x12c)]={},_0x39ea01[_0xbeb5b9(0x12c)][_0xbeb5b9(0x141)]=_0x54e832[_0xbeb5b9(0x141)],_0x39ea01[_0xbeb5b9(0x12c)]['body']=_0x54e832[_0xbeb5b9(0x13f)],_0x39ea01[_0xbeb5b9(0x182)]=_0x54e832['ctxPassThrough'],_0x575a5d=await _0x2a0389[_0x54e832[_0xbeb5b9(0x13e)]](_0x39ea01);break;case'postApi':_0x575a5d=await _0x2a0389[_0x54e832[_0xbeb5b9(0x13e)]](_0x11a74c,_0x54e832[_0xbeb5b9(0x13f)],_0x54e832[_0xbeb5b9(0x1a2)]);break;case _0xbeb5b9(0x12e):_0x575a5d=await _0x2a0389[_0x54e832[_0xbeb5b9(0x13e)]](_0x11a74c,_0x54e832['id'],_0x54e832[_0xbeb5b9(0x13f)],_0x54e832[_0xbeb5b9(0x1a2)]);break;case _0xbeb5b9(0x15b):_0x575a5d=await _0x2a0389[_0x54e832[_0xbeb5b9(0x13e)]](_0x11a74c,_0x54e832['id'],_0x54e832[_0xbeb5b9(0x13f)],_0x54e832[_0xbeb5b9(0x1a2)]);break;case'getApi':_0x575a5d=await _0x2a0389[_0x54e832['handle']](_0x11a74c,_0x54e832['id'],_0x54e832[_0xbeb5b9(0x1aa)],_0x54e832['obj'],_0x54e832['ctxPassThrough']);break;case _0xbeb5b9(0x1d8):_0x575a5d=await _0x2a0389[_0x54e832['handle']](_0x11a74c,_0x54e832['id'],_0x54e832[_0xbeb5b9(0x1a2)]);break;default:_0x3d8fc8=_0xbeb5b9(0x162)+_0x54e832[_0xbeb5b9(0x13e)]+'\x27\x20not\x20supported',_0x2a0389[_0xbeb5b9(0x1c9)]['error'](_0x2a0389['gwName']+'['+_0x2a0389[_0xbeb5b9(0x119)]+']\x20subscriber['+_0x11a74c+']['+_0x1be0d9+']\x20'+_0x3d8fc8);throw new Error(_0x3d8fc8);}if(!_0x575a5d)_0x575a5d=null;const _0x4501dc=JSON[_0xbeb5b9(0x1df)](_0x575a5d);_0x2898a4[_0xbeb5b9(0x139)](_0x4501dc),_0x2a0389[_0xbeb5b9(0x1c9)][_0xbeb5b9(0x17c)](_0x223702+_0xbeb5b9(0x142)+_0x54e832[_0xbeb5b9(0x13e)]+_0xbeb5b9(0x121)+(_0x54e832[_0xbeb5b9(0x13f)]?JSON[_0xbeb5b9(0x1df)](_0x54e832[_0xbeb5b9(0x13f)]):'')+',\x20id='+(_0x54e832['id']?_0x54e832['id']:'')+_0xbeb5b9(0x15c)+(_0x54e832[_0xbeb5b9(0x18f)]?_0x54e832[_0xbeb5b9(0x18f)]:'')+'\x20message\x20response:\x20'+_0x4501dc+_0x77a231);}catch(_0x2d5654){const _0x238813=_0xbeb5b9(0x1b8)+_0x2d5654[_0xbeb5b9(0x114)]+_0xbeb5b9(0x146)+_0x2d5654[_0xbeb5b9(0x179)]+'\x22}';_0x2898a4[_0xbeb5b9(0x139)](_0x238813),_0x2a0389[_0xbeb5b9(0x1c9)][_0xbeb5b9(0x17c)]((_0x223702||'')+_0xbeb5b9(0x142)+_0x54e832['handle']+_0xbeb5b9(0x121)+(_0x54e832['obj']?JSON[_0xbeb5b9(0x1df)](_0x54e832[_0xbeb5b9(0x13f)]):'')+',\x20id='+(_0x54e832['id']?_0x54e832['id']:'')+',\x20attributes='+(_0x54e832['attributes']?_0x54e832[_0xbeb5b9(0x18f)]:'')+_0xbeb5b9(0x19a)+_0x238813+_0x77a231);}}};if(_0x10406a)_0x1088a5();else _0x238d0d();},_0x3b536e=async(_0x2c8080,_0x2bf2f2)=>{const _0x1ecb69=_0x375032,_0x49ccc0=_0x2f6dd3[_0x2c8080][_0x1ecb69(0x19b)]?.['nats']?.[_0x1ecb69(0x16b)];let _0xb2b9f0=0x0;for await(const _0x3ca72a of _0x2bf2f2[_0x1ecb69(0x110)]()){switch(_0x3ca72a[_0x1ecb69(0x1c7)]){case nats[_0x1ecb69(0x1c6)][_0x1ecb69(0x131)]:_0x2a0389[_0x1ecb69(0x1c9)][_0x1ecb69(0xf0)](_0x2a0389[_0x1ecb69(0x1e0)]+'['+_0x2a0389[_0x1ecb69(0x119)]+_0x1ecb69(0x15d)+_0x2c8080+']['+_0x49ccc0+']\x20client\x20disconnected\x20'+_0x3ca72a[_0x1ecb69(0x199)]+_0x1ecb69(0x12b)),_0xb2b9f0=0x0;break;case nats[_0x1ecb69(0x1c6)][_0x1ecb69(0x18e)]:_0x2a0389['logger']['info'](_0x2a0389[_0x1ecb69(0x1e0)]+'['+_0x2a0389[_0x1ecb69(0x119)]+']\x20subscriber['+_0x2c8080+']['+_0x49ccc0+_0x1ecb69(0x1d3)+_0x3ca72a[_0x1ecb69(0x199)]);break;case nats[_0x1ecb69(0x1c6)][_0x1ecb69(0x18b)]:_0x2a0389[_0x1ecb69(0x1c9)]['error'](_0x2a0389['gwName']+'['+_0x2a0389['pluginName']+']\x20subscriber['+_0x2c8080+']['+_0x49ccc0+_0x1ecb69(0x106)+_0x3ca72a[_0x1ecb69(0x199)]);break;case nats[_0x1ecb69(0x19d)]['Reconnecting']:_0xb2b9f0+=0x1;_0xb2b9f0%0x1e===0x0&&_0x2a0389[_0x1ecb69(0x1c9)][_0x1ecb69(0x157)](_0x2a0389['gwName']+'['+_0x2a0389[_0x1ecb69(0x119)]+_0x1ecb69(0x15d)+_0x2c8080+']['+_0x49ccc0+_0x1ecb69(0x1cf)+_0x3ca72a[_0x1ecb69(0x199)]+_0x1ecb69(0xfb)+_0xb2b9f0+')');break;case nats[_0x1ecb69(0x19d)]['StaleConnection']:_0x2a0389[_0x1ecb69(0x1c9)][_0x1ecb69(0x157)](_0x2a0389[_0x1ecb69(0x1e0)]+'['+_0x2a0389['pluginName']+_0x1ecb69(0x15d)+_0x2c8080+']['+_0x49ccc0+_0x1ecb69(0x180)+_0x3ca72a['data']);break;}}};process['on'](_0x375032(0x166),async()=>{const _0x45c287=_0x375032;for(const _0x510083 in _0x2f6dd3){_0x2f6dd3[_0x510083]['nc']&&!_0x2f6dd3[_0x510083]['nc'][_0x45c287(0x127)]()&&await _0x2f6dd3[_0x510083]['nc'][_0x45c287(0x1cd)]();}}),process['on'](_0x375032(0x1e8),async()=>{const _0x4cb3e5=_0x375032;for(const _0x168095 in _0x2f6dd3){_0x2f6dd3[_0x168095]['nc']&&!_0x2f6dd3[_0x168095]['nc'][_0x4cb3e5(0x127)]()&&await _0x2f6dd3[_0x168095]['nc']['drain']();}});const _0x5d75a1=async(_0x52a935,_0x58d465,_0xdc639)=>{const _0x39cb61=_0x375032,_0x1a764e={'attribute':_0x58d465,'operator':'eq','value':_0xdc639,'rawFilter':undefined,'startIndex':undefined,'count':undefined},_0x23e78d=[_0x58d465];if(_0x58d465!=='id')_0x23e78d[_0x39cb61(0x174)]('id');try{const _0x377504=await _0x2a0389['getUsers'](_0x52a935,_0x1a764e,_0x23e78d);if(!_0x377504||!_0x377504[_0x39cb61(0x16e)]||!Array['isArray'](_0x377504[_0x39cb61(0x16e)]))throw new Error(_0x39cb61(0x1c0)+JSON[_0x39cb61(0x1df)](_0x1a764e)+_0x39cb61(0x10b));if(_0x377504[_0x39cb61(0x16e)][_0x39cb61(0x1b1)]===0x0)return null;else{if(_0x377504['Resources'][_0x39cb61(0x1b1)]>0x2)throw new Error(_0x39cb61(0x1c0)+JSON['stringify'](_0x1a764e)+'\x20error:\x20more\x20than\x20one\x20user\x20were\x20found}');else{const _0x56cea8=_0x377504[_0x39cb61(0x16e)][0x0];if(!_0x56cea8['id'])throw new Error(_0x39cb61(0x1c0)+JSON[_0x39cb61(0x1df)](_0x1a764e)+_0x39cb61(0x1a1)+JSON['stringify'](_0x56cea8)+_0x39cb61(0x12f));return decodeURIComponent(_0x56cea8['id']);}}}catch(_0x151547){throw new Error(_0x39cb61(0x1c0)+JSON['stringify'](_0x1a764e)+'\x20error:\x20'+_0x151547['message']+'}');}},_0x4dabde=_0x32239b=>{const _0x57f209=_0x375032;if(!_0x32239b||typeof _0x32239b!==_0x57f209(0x181))return[null,null];_0x32239b=_0x32239b[_0x57f209(0x196)]();const _0x326c8b=_0x32239b[_0x57f209(0x13b)]('(');if(_0x326c8b<0x1)return[null,null];if(_0x32239b[_0x57f209(0x191)](_0x32239b['length']-0x1)!==')')return[null,null];if(_0x269f6a(_0x32239b,'(')!==_0x269f6a(_0x32239b,')'))return[null,null];const _0x2d0ec9=_0x32239b[_0x57f209(0x191)](0x0,_0x326c8b),_0x528058=_0x32239b[_0x57f209(0x191)](_0x326c8b+0x1,_0x32239b[_0x57f209(0x1b1)]-0x1);let _0x5835d1=[];const _0x161e8f=_0x528058[_0x57f209(0x160)](',');let _0xdf0d13='';for(let _0x1a43ea=0x0;_0x1a43ea<_0x161e8f[_0x57f209(0x1b1)];_0x1a43ea++){const _0x1ae12f=_0xdf0d13?_0xdf0d13+','+_0x161e8f[_0x1a43ea]:_0x161e8f[_0x1a43ea],_0x2684e3=_0x269f6a(_0x1ae12f,'('),_0x295cb3=_0x269f6a(_0x1ae12f,')');if(_0x2684e3===_0x295cb3)_0x5835d1[_0x57f209(0x174)](_0x600a8d(_0x1ae12f,'\x22')),_0xdf0d13='';else{if(_0xdf0d13)_0xdf0d13+=','+_0x161e8f[_0x1a43ea];else _0xdf0d13+=_0x161e8f[_0x1a43ea];}}if(_0x5835d1[_0x57f209(0x1b1)]===0x0)_0x5835d1=null;return[_0x2d0ec9,_0x5835d1];};function _0x269f6a(_0x1d2c1c,_0x3502d8){const _0x5c6628=_0x375032;let _0x5b067a=0x0;for(let _0xb40f3e=0x0;_0xb40f3e<_0x1d2c1c[_0x5c6628(0x1b1)];_0xb40f3e++){_0x1d2c1c[_0x5c6628(0x1a5)](_0xb40f3e)===_0x3502d8&&(_0x5b067a+=0x1);}return _0x5b067a;}const _0x600a8d=(_0x1b5b0d,_0x54172b)=>{const _0x1ff84b=_0x375032;if(typeof _0x1b5b0d!==_0x1ff84b(0x181)||typeof _0x54172b!=='string')return _0x1b5b0d;if(_0x1b5b0d[_0x1ff84b(0x1b1)]===0x1)return _0x1b5b0d;if(_0x54172b[_0x1ff84b(0x1b1)]!==0x1)return _0x1b5b0d;return _0x1b5b0d=_0x1b5b0d[_0x1ff84b(0x196)](),_0x1b5b0d[_0x1ff84b(0x191)](0x0,0x1)===_0x54172b&&(_0x1b5b0d=_0x1b5b0d[_0x1ff84b(0x191)](0x1)),_0x1b5b0d[_0x1ff84b(0x191)](_0x1b5b0d[_0x1ff84b(0x1b1)]-0x1)===_0x54172b&&(_0x1b5b0d=_0x1b5b0d[_0x1ff84b(0x191)](0x0,_0x1b5b0d['length']-0x1)),_0x1b5b0d;},_0x30171c=async(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x5d85a0)=>{const _0x14d576=_0x375032;if(!_0x3bdae3||!_0x1df37d||!_0x5d85a0)return null;const [_0x29d324,_0x428675]=_0x4dabde(_0x5d85a0);if(!_0x29d324||!_0x428675){const _0x4c5a14=_0x5d85a0[_0x14d576(0x160)]('(');if(_0x4c5a14[_0x14d576(0x1b1)]>0x1){const _0x2505fd=[_0x14d576(0x14c),_0x14d576(0x1a0),_0x14d576(0x109),'elementnumber',_0x14d576(0x102),'replace','normalize','increment',_0x14d576(0xfd)],_0x5aed12=_0x4c5a14[0x0]['toLowerCase']();if(_0x2505fd[_0x14d576(0x12a)](_0x5aed12))return null;}return _0x5d85a0;}for(let _0x490e98=0x0;_0x490e98<_0x428675['length'];_0x490e98++){if(_0x428675[_0x490e98][_0x14d576(0x191)](0x0,0x1)==='['){const _0x26f0f7=_0x428675[_0x490e98][_0x14d576(0x13b)](']');if(_0x26f0f7<0x0)return null;const _0x35f4a9=_0x428675[_0x490e98][_0x14d576(0x191)](0x1,_0x26f0f7),_0x40e65b=_0x35f4a9[_0x14d576(0x160)]('.');let _0x483e03;for(let _0x2e33ad=0x0;_0x2e33ad<_0x40e65b[_0x14d576(0x1b1)];_0x2e33ad++){if(_0x2e33ad===0x0)_0x483e03=_0x3bdae3[_0x40e65b[_0x2e33ad]];else{if(!_0x483e03)return null;_0x483e03=_0x483e03[_0x40e65b[_0x2e33ad]];}}if(!_0x483e03)return null;_0x428675[_0x490e98]=_0x483e03;}}for(let _0x37d500=0x0;_0x37d500<_0x428675[_0x14d576(0x1b1)];_0x37d500++){const [_0xd5aaaf]=_0x4dabde(_0x428675[_0x37d500]);_0xd5aaaf&&(_0x428675[_0x37d500]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x428675[_0x37d500]));}if(_0x428675[0x0]===null)return null;switch(_0x29d324[_0x14d576(0xfe)]()){case _0x14d576(0x14c):{if(_0x428675[_0x14d576(0x1b1)]!==0x1)return null;const [_0x5e0898]=_0x4dabde(_0x428675[0x0]);if(_0x5e0898)_0x428675[0x0]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x5e0898);if(_0x428675[0x0]===null)return null;return _0x428675[0x0]['toLowerCase']();}case _0x14d576(0x1a0):{if(_0x428675['length']!==0x1)return null;const [_0x5f5ba8]=_0x4dabde(_0x428675[0x0]);if(_0x5f5ba8)_0x428675[0x0]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x5f5ba8);if(_0x428675[0x0]===null)return null;return _0x428675[0x0][_0x14d576(0x14e)]();}case _0x14d576(0x109):{if(_0x428675[_0x14d576(0x1b1)]!==0x2)return null;const [_0x12fcc4]=_0x4dabde(_0x428675[0x0]);if(_0x12fcc4)_0x428675[0x0]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x12fcc4);if(_0x428675[0x0]===null)return null;if(isNaN(_0x428675[0x1]))return null;return _0x428675[0x0][_0x14d576(0x191)](0x0,_0x428675[0x1]);}case _0x14d576(0x19c):{const [_0x198910]=_0x4dabde(_0x428675[0x0]);if(_0x428675[_0x14d576(0x1b1)]<0x2)return null;if(_0x198910)_0x428675[0x0]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x198910);if(_0x428675[0x0]===null)return null;const _0x2e646a=_0x428675[0x1];if(isNaN(_0x2e646a))return null;let _0x29451a;if(_0x428675[_0x14d576(0x1b1)]===0x3)_0x29451a=_0x428675[0x0][_0x14d576(0x160)](_0x428675[0x2]);else _0x29451a=_0x29451a=_0x428675[0x0][_0x14d576(0x160)]('\x20');if(_0x2e646a<=_0x29451a[_0x14d576(0x1b1)])return _0x29451a[_0x2e646a-0x1];else return'';}case _0x14d576(0x152):{const [_0x1afa7f]=_0x4dabde(_0x428675[0x0]);if(_0x1afa7f)_0x428675[0x0]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x1afa7f);if(_0x428675[0x0]===null)return null;if(_0x428675[_0x14d576(0x1b1)]!==0x3)return null;return _0x428675[0x0]['replaceAll'](_0x428675[0x1],_0x428675[0x2]);}case _0x14d576(0x156):{if(_0x428675[_0x14d576(0x1b1)]!==0x1)return null;const [_0x45dfc6]=_0x4dabde(_0x428675[0x0]);if(_0x45dfc6)_0x428675[0x0]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x45dfc6);if(_0x428675[0x0]===null)return null;return ascii127[_0x14d576(0x115)](_0x428675[0x0]);}case'join':{let _0x1db14e='';for(let _0x3b9f96=0x0;_0x3b9f96<_0x428675[_0x14d576(0x1b1)];_0x3b9f96++){const [_0x3d4da9]=_0x4dabde(_0x428675[_0x3b9f96]);if(_0x3d4da9)_0x428675[_0x3b9f96]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x3d4da9);if(_0x428675[_0x3b9f96]===null)return null;_0x1db14e+=_0x428675[_0x3b9f96];}return _0x1db14e;}case _0x14d576(0x15f):{if(_0x428675[_0x14d576(0x1b1)]>0x2)return null;const [_0x24ffc9]=_0x4dabde(_0x428675[0x0]);if(_0x24ffc9)_0x428675[0x0]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x24ffc9);if(_0x428675[0x0]===null)return null;const _0x55300e=parseInt(_0x428675[0x0]);if(isNaN(_0x55300e))return null;let _0x3217a1=_0x14d576(0x129);_0x3217a1+=','+_0x428675[0x0];if(_0x428675[_0x14d576(0x1b1)]===0x2&&_0x428675[0x1][_0x14d576(0xfe)]()===_0x14d576(0xf1))_0x3217a1+=_0x14d576(0x1c4);else _0x3217a1+=_0x14d576(0x11a);return _0x3217a1+='##',_0x3217a1;}case _0x14d576(0xfd):{if(_0x428675[_0x14d576(0x1b1)]!==0x1)return null;const [_0x3efe71]=_0x4dabde(_0x428675[0x0]);if(_0x3efe71)_0x428675[0x0]=await _0x30171c(_0x1b26cd,_0x3bdae3,_0x1df37d,_0x3efe71);if(_0x428675[0x0]===null)return null;let _0x509aff,_0x262783=![],_0x9758c5='';const _0x5f19e7=_0x428675[0x0][_0x14d576(0x160)]('##');if(_0x5f19e7['length']>0x2)for(let _0x587a45=0x0;_0x587a45<_0x5f19e7[_0x14d576(0x1b1)];_0x587a45++){if(_0x5f19e7[_0x587a45]['startsWith'](_0x14d576(0x126))){const _0x4e3396=_0x5f19e7[_0x587a45][_0x14d576(0x160)](',');if(_0x4e3396['length']<0x2)return null;const _0x48f540=parseInt(_0x4e3396[0x1]);if(isNaN(_0x48f540))return null;_0x9758c5='##'+_0x5f19e7[_0x587a45]+'##',_0x509aff=_0x4e3396[0x1],_0x4e3396[_0x14d576(0x1b1)]>0x2&&(_0x262783=_0x4e3396[0x2][_0x14d576(0xfe)]()===_0x14d576(0xf1));}}let _0x2294ad,_0x2c9f9c=0x0,_0x53c40c=0x0;if(_0x509aff){_0x53c40c=_0x509aff['length'],_0x2c9f9c=0xa;for(let _0x141328=0x1;_0x141328<_0x53c40c;_0x141328++){_0x2c9f9c*=0xa;}_0x2c9f9c-=0x1,_0x2294ad=parseInt(_0x509aff);if(isNaN(_0x2294ad))return null;_0x2294ad-=0x1;}else _0x2294ad=0x0;do{_0x2294ad+=0x1;let _0x4a5680=_0x428675[0x0];if(_0x509aff!==undefined&&_0x9758c5){let _0x432eb6=_0x2294ad[_0x14d576(0x1a3)]();while(_0x432eb6[_0x14d576(0x1b1)]<_0x53c40c){_0x432eb6='0'+_0x432eb6;}_0x262783?_0x4a5680=_0x4a5680['replace'](_0x9758c5,_0x432eb6):(_0x4a5680=_0x4a5680[_0x14d576(0x152)](_0x9758c5,''),_0x262783=!![],_0x2294ad-=0x1);}try{const _0x10eb36=await _0x5d75a1(_0x1b26cd,_0x1df37d,_0x4a5680);if(!_0x10eb36)return _0x4a5680;}catch(_0x5574af){return _0x2a0389[_0x14d576(0x1c9)]['error'](_0x2a0389[_0x14d576(0x1e0)]+'['+_0x2a0389['pluginName']+']\x20'+_0x29d324+'\x20getUserId()\x20error:\x20'+_0x5574af[_0x14d576(0x114)]),null;}}while(_0x2294ad<_0x2c9f9c);return null;}default:}return null;},_0x162af5=async(_0x42dc52,_0xd159aa)=>{const _0x98a951=_0x375032;for(const _0x56ec40 in _0xd159aa){const _0xc23263=_0xd159aa[_0x56ec40],[_0x5776a9,_0xe1bd17]=_0x4dabde(_0xc23263);if(_0x5776a9){const _0x3c2d7f=''+_0x56ec40,_0x4554a5=_0x5776a9+'('+_0xe1bd17[_0x98a951(0x102)](',')+')',_0x301f47=await _0x30171c(_0x42dc52,_0xd159aa,_0x3c2d7f,_0x4554a5);if(_0x301f47===null)delete _0xd159aa[_0x56ec40];else _0xd159aa[_0x56ec40]=_0x301f47;}for(const _0x17ff7b in _0xc23263){const _0x167f21=_0xc23263[_0x17ff7b],[_0x2c4204,_0x7b092b]=_0x4dabde(_0x167f21);if(_0x2c4204){const _0x197fc5=_0x56ec40+'.'+_0x17ff7b,_0x51bdab=_0x2c4204+'('+_0x7b092b[_0x98a951(0x102)](',')+')',_0x29d4fe=await _0x30171c(_0x42dc52,_0xd159aa,_0x197fc5,_0x51bdab);if(_0x29d4fe===null)delete _0xc23263[_0x17ff7b];else _0xc23263[_0x17ff7b]=_0x29d4fe;}}}return _0xd159aa;};},module[a0_0x2ad4e4(0x19f)][a0_0x2ad4e4(0x118)]=function(_0x54f2df){const _0x4afee8=a0_0x2ad4e4,_0x5d21ca=_0x54f2df,_0x1acfcf={},_0x507a6c=async(_0x411170,_0x19d774)=>{const _0x520475=a0_0x7bcd,_0x448588=_0x1acfcf[_0x411170][_0x520475(0x19b)]?.['nats']?.['subject'];let _0x3b10f3=0x0;for await(const _0x707d44 of _0x19d774[_0x520475(0x110)]()){switch(_0x707d44[_0x520475(0x1c7)]){case nats[_0x520475(0x1c6)]['Disconnect']:_0x5d21ca['logger'][_0x520475(0xf0)](_0x5d21ca[_0x520475(0x1e0)]+'['+_0x5d21ca[_0x520475(0x119)]+_0x520475(0x1b3)+_0x411170+']['+_0x448588+_0x520475(0x192)+_0x707d44[_0x520475(0x199)]+_0x520475(0x12b)),_0x3b10f3=0x0;break;case nats[_0x520475(0x1c6)][_0x520475(0x18e)]:_0x5d21ca[_0x520475(0x1c9)][_0x520475(0x17c)](_0x5d21ca[_0x520475(0x1e0)]+'['+_0x5d21ca[_0x520475(0x119)]+_0x520475(0x1b3)+_0x411170+']['+_0x448588+_0x520475(0x1d3)+_0x707d44[_0x520475(0x199)]);break;case nats['Events'][_0x520475(0x18b)]:_0x5d21ca['logger'][_0x520475(0xf0)](_0x5d21ca['gwName']+'['+_0x5d21ca[_0x520475(0x119)]+_0x520475(0x1b3)+_0x411170+']['+_0x448588+_0x520475(0x106)+_0x707d44[_0x520475(0x199)]);break;case nats[_0x520475(0x19d)][_0x520475(0x1dc)]:_0x3b10f3+=0x1;_0x3b10f3%0x1e===0x0&&_0x5d21ca[_0x520475(0x1c9)]['debug'](_0x5d21ca[_0x520475(0x1e0)]+'['+_0x5d21ca[_0x520475(0x119)]+']\x20publisher['+_0x411170+']['+_0x448588+_0x520475(0x1cf)+_0x707d44[_0x520475(0x199)]+'\x20(count='+_0x3b10f3+')');break;case nats[_0x520475(0x19d)][_0x520475(0x1b0)]:_0x5d21ca['logger'][_0x520475(0x157)](_0x5d21ca[_0x520475(0x1e0)]+'['+_0x5d21ca[_0x520475(0x119)]+_0x520475(0x1b3)+_0x411170+']['+_0x448588+_0x520475(0x180)+_0x707d44[_0x520475(0x199)]);break;}}},_0x51ce0b=async(_0x4ceae3,_0x3b61bb)=>{const _0x4e5d58=a0_0x7bcd,_0x1296d6=_0x1acfcf[_0x4ceae3]['config']?.[_0x4e5d58(0x1c5)]?.[_0x4e5d58(0x16b)];let _0x388b41;try{_0x388b41=await nats['connect'](_0x3b61bb);if(_0x388b41[_0x4e5d58(0x17c)][_0x4e5d58(0x1ea)]!==_0x4e5d58(0x158)){_0x388b41[_0x4e5d58(0x1bc)]();return;}_0x1acfcf[_0x4ceae3]['nc']=_0x388b41,_0x507a6c(_0x4ceae3,_0x388b41);}catch(_0x1ffcf2){_0x5d21ca[_0x4e5d58(0x1c9)][_0x4e5d58(0xf0)](_0x5d21ca['gwName']+'['+_0x5d21ca[_0x4e5d58(0x119)]+_0x4e5d58(0x1b3)+_0x4ceae3+']['+_0x1296d6+']\x20connect\x20error:\x20'+_0x1ffcf2[_0x4e5d58(0x114)]+'\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration'),_0x3b61bb[_0x4e5d58(0x1d2)]=!![];try{_0x388b41=await nats[_0x4e5d58(0x175)](_0x3b61bb);if(_0x388b41[_0x4e5d58(0x17c)][_0x4e5d58(0x1ea)]!==_0x4e5d58(0x158)){_0x388b41[_0x4e5d58(0x1bc)]();return;}_0x1acfcf[_0x4ceae3]['nc']=_0x388b41,_0x507a6c(_0x4ceae3,_0x388b41);}catch(_0x35580e){_0x5d21ca[_0x4e5d58(0x1c9)]['error'](_0x5d21ca[_0x4e5d58(0x1e0)]+'['+_0x5d21ca['pluginName']+_0x4e5d58(0x1b3)+_0x4ceae3+']['+_0x1296d6+_0x4e5d58(0x1ca)+_0x35580e[_0x4e5d58(0x114)]);return;}}_0x5d21ca['logger']['debug'](_0x5d21ca[_0x4e5d58(0x1e0)]+'['+_0x5d21ca[_0x4e5d58(0x119)]+_0x4e5d58(0x1b3)+_0x4ceae3+']['+_0x1296d6+_0x4e5d58(0x17a)+(_0x3b61bb[_0x4e5d58(0x16f)]['ca']?_0x4e5d58(0x16f):'')+'\x20'+_0x388b41[_0x4e5d58(0x136)]()),_0x388b41[_0x4e5d58(0xf7)]()[_0x4e5d58(0x10a)](_0x52ec0c=>{const _0x3a6d44=_0x4e5d58;_0x52ec0c&&_0x5d21ca[_0x3a6d44(0x1c9)][_0x3a6d44(0xf0)](_0x5d21ca[_0x3a6d44(0x1e0)]+'['+_0x5d21ca[_0x3a6d44(0x119)]+_0x3a6d44(0x1b3)+_0x4ceae3+']['+_0x1296d6+_0x3a6d44(0x177)+_0x52ec0c[_0x3a6d44(0x114)]);});};this[_0x4afee8(0x1b2)]=async(_0x4b0578,_0x38de1c)=>{const _0x3a3b1b=_0x4afee8;if(!_0x38de1c?.[_0x3a3b1b(0x1c5)]){_0x5d21ca['logger'][_0x3a3b1b(0xf0)](_0x5d21ca['gwName']+'['+_0x5d21ca['pluginName']+_0x3a3b1b(0x1b3)+_0x4b0578+_0x3a3b1b(0x1b7));return;}if(!_0x38de1c?.[_0x3a3b1b(0x1c5)]?.['tenant']){_0x5d21ca[_0x3a3b1b(0x1c9)][_0x3a3b1b(0xf0)](_0x5d21ca[_0x3a3b1b(0x1e0)]+'['+_0x5d21ca['pluginName']+_0x3a3b1b(0x1b3)+_0x4b0578+_0x3a3b1b(0x198));return;}if(!_0x38de1c?.[_0x3a3b1b(0x1c5)]?.[_0x3a3b1b(0x16b)]){_0x5d21ca['logger'][_0x3a3b1b(0xf0)](_0x5d21ca[_0x3a3b1b(0x1e0)]+'['+_0x5d21ca[_0x3a3b1b(0x119)]+_0x3a3b1b(0x1b3)+_0x4b0578+_0x3a3b1b(0x14b));return;}if(!_0x38de1c?.[_0x3a3b1b(0x1c5)]?.[_0x3a3b1b(0x16b)][_0x3a3b1b(0x104)](_0x3a3b1b(0x1ba))){_0x5d21ca['logger'][_0x3a3b1b(0xf0)](_0x5d21ca[_0x3a3b1b(0x1e0)]+'['+_0x5d21ca['pluginName']+']\x20publisher['+_0x4b0578+_0x3a3b1b(0x161));return;}if(!_0x38de1c[_0x3a3b1b(0x145)]||!Array[_0x3a3b1b(0x11e)](_0x38de1c[_0x3a3b1b(0x145)])||_0x38de1c[_0x3a3b1b(0x145)]['length']<0x1){_0x5d21ca['logger'][_0x3a3b1b(0xf0)](_0x5d21ca[_0x3a3b1b(0x1e0)]+'['+_0x5d21ca[_0x3a3b1b(0x119)]+_0x3a3b1b(0x1b3)+_0x4b0578+']\x20initialization\x20error:\x20missing\x20configuration\x20stream.baseUrls');return;}if(!_0x38de1c?.[_0x3a3b1b(0x103)]?.['ca']){_0x5d21ca[_0x3a3b1b(0x1c9)][_0x3a3b1b(0xf0)](_0x5d21ca[_0x3a3b1b(0x1e0)]+'['+_0x5d21ca[_0x3a3b1b(0x119)]+_0x3a3b1b(0x1b3)+_0x4b0578+_0x3a3b1b(0x17e));return;}const _0x23090b={};try{let _0x240103=path[_0x3a3b1b(0x102)](_0x5d21ca[_0x3a3b1b(0x167)],'/certs/',_0x38de1c?.[_0x3a3b1b(0x103)]?.['ca']||_0x3a3b1b(0x186));(_0x38de1c?.[_0x3a3b1b(0x103)]?.['ca']?.[_0x3a3b1b(0x104)]('/')||_0x38de1c?.[_0x3a3b1b(0x103)]?.['ca']?.['includes']('\x5c'))&&(_0x240103=_0x38de1c[_0x3a3b1b(0x103)]['ca']),_0x23090b['ca']=[fs[_0x3a3b1b(0x1cc)](_0x240103)],_0x23090b[_0x3a3b1b(0x132)]=!![];}catch(_0x124e7d){_0x5d21ca[_0x3a3b1b(0x1c9)][_0x3a3b1b(0xf0)](_0x5d21ca[_0x3a3b1b(0x1e0)]+'['+_0x5d21ca[_0x3a3b1b(0x119)]+']\x20publisher['+_0x4b0578+']\x20initialization\x20certificate\x20error:\x20'+_0x124e7d['message']);return;}const _0x102851={},_0x43fe3e=new TextEncoder()[_0x3a3b1b(0x195)](_0x38de1c?.[_0x3a3b1b(0x1c5)]?.[_0x3a3b1b(0x15e)]),_0x5cb17f=_0x38de1c?.[_0x3a3b1b(0x1c5)]?.[_0x3a3b1b(0x187)];_0x102851[_0x3a3b1b(0x1e6)]=nats[_0x3a3b1b(0x164)](_0x5cb17f,_0x43fe3e),_0x102851[_0x3a3b1b(0x165)]=_0x38de1c[_0x3a3b1b(0x145)],_0x102851[_0x3a3b1b(0x16f)]=_0x23090b,_0x102851['waitOnFirstConnect']=![],_0x102851[_0x3a3b1b(0x101)]=!![],_0x102851[_0x3a3b1b(0x16d)]=0x3e8*0xa,_0x102851['maxReconnectAttempts']=-0x1,_0x102851[_0x3a3b1b(0x190)]=0x2*0x3c*0x3e8,_0x102851[_0x3a3b1b(0x1e7)]=0x5,_0x102851[_0x3a3b1b(0x157)]=![],_0x1acfcf[_0x4b0578]={},_0x1acfcf[_0x4b0578]['config']=_0x38de1c,_0x1acfcf[_0x4b0578]['nc']=undefined,_0x51ce0b(_0x4b0578,_0x102851);};const _0x3108af=nats[_0x4afee8(0x111)]();this['publish']=async _0x2cb6d8=>{const _0x5c590f=_0x4afee8;let _0x2b20ee;try{if(_0x2cb6d8[_0x5c590f(0x105)]===Object){_0x2b20ee=_0x2cb6d8[_0x5c590f(0x170)];if(!_0x2b20ee)_0x2cb6d8[_0x5c590f(0x170)]=_0x5c590f(0xf6);_0x2cb6d8=JSON[_0x5c590f(0x1df)](_0x2cb6d8);}else{const _0xb20f33=JSON[_0x5c590f(0x140)](_0x2cb6d8);_0x2b20ee=_0xb20f33[_0x5c590f(0x170)];}}catch(_0x336262){throw new Error(_0x5c590f(0x151)+_0x2b20ee+_0x5c590f(0x193));}if(!_0x1acfcf[_0x2b20ee])throw new Error(_0x5c590f(0x151)+_0x2b20ee+']\x20error:\x20missing\x20entity\x20configuration\x20for\x20baseEntity='+_0x2b20ee);const _0x198eb1=nats['headers']();_0x198eb1['append'](_0x5c590f(0x1c1),crypto['randomUUID']());let _0x59c1a2;try{if(!_0x1acfcf[_0x2b20ee]['nc'])throw new Error('publisher\x20not\x20initialized/connected');_0x59c1a2=await _0x1acfcf[_0x2b20ee]['nc'][_0x5c590f(0x12c)](_0x1acfcf[_0x2b20ee][_0x5c590f(0x19b)]?.[_0x5c590f(0x1c5)]?.[_0x5c590f(0x16b)],_0x3108af[_0x5c590f(0x195)](_0x2cb6d8),{'headers':_0x198eb1});}catch(_0x55ba46){if(_0x55ba46[_0x5c590f(0x114)]===_0x5c590f(0x1a6))throw new Error(_0x5c590f(0x151)+_0x2b20ee+']\x20error:\x20no\x20subscribers/responders\x20to\x20subject\x20'+_0x1acfcf[_0x2b20ee]['config']?.[_0x5c590f(0x1c5)]?.[_0x5c590f(0x16b)]);else throw new Error(_0x5c590f(0x151)+_0x2b20ee+_0x5c590f(0x1f2)+_0x55ba46[_0x5c590f(0x114)]);}let _0x13d9ea;try{_0x13d9ea=JSON[_0x5c590f(0x140)](_0x59c1a2[_0x5c590f(0x181)]());}catch(_0x23b965){throw new Error(_0x5c590f(0x1a9)+_0x59c1a2[_0x5c590f(0x181)]());}if(_0x13d9ea?.[_0x5c590f(0xf0)]){const _0x36bdb4=new Error('publisher\x20response\x20error:\x20'+_0x13d9ea[_0x5c590f(0xf0)]);_0x36bdb4[_0x5c590f(0x179)]=_0x13d9ea['errName'];throw _0x36bdb4;}return _0x13d9ea;},process['on'](_0x4afee8(0x166),async()=>{const _0x1cd413=_0x4afee8;for(const _0x53590c in _0x1acfcf){_0x1acfcf[_0x53590c]['nc']&&!_0x1acfcf[_0x53590c]['nc'][_0x1cd413(0x127)]()&&await _0x1acfcf[_0x53590c]['nc'][_0x1cd413(0x1cd)]();}}),process['on'](_0x4afee8(0x1e8),async()=>{const _0x358c33=_0x4afee8;for(const _0x1d9708 in _0x1acfcf){_0x1acfcf[_0x1d9708]['nc']&&!_0x1acfcf[_0x1d9708]['nc'][_0x358c33(0x127)]()&&await _0x1acfcf[_0x1d9708]['nc'][_0x358c33(0x1cd)]();}});},module[a0_0x2ad4e4(0x19f)][a0_0x2ad4e4(0x14f)]=async(_0x21c16b,_0x26d02e,_0x20d6bd,_0xda380f)=>{const _0x15f24c=a0_0x2ad4e4,_0x369324='getAppRoles',_0x27f5a5=_0x21c16b;_0x27f5a5[_0x15f24c(0x1c9)][_0x15f24c(0x157)](_0x27f5a5[_0x15f24c(0x1e0)]+'['+_0x27f5a5['pluginName']+']\x20handling\x20\x22'+_0x369324+'\x22');try{if(!fs[_0x15f24c(0x1d6)](_0x27f5a5[_0x15f24c(0x167)]+'/approles'))fs['mkdirSync'](_0x27f5a5[_0x15f24c(0x167)]+'/approles');}catch(_0x3948a4){}const _0x15a29f=path[_0x15f24c(0x102)](''+_0x27f5a5['configDir'],_0x15f24c(0x1eb),_0x15f24c(0x130)+_0x27f5a5[_0x15f24c(0x119)]+'_autogenerated.cfg'),_0x302315={};utils['fsExistsSync'](_0x15a29f)&&fs[_0x15f24c(0x1cc)](_0x15a29f,_0x15f24c(0x116))[_0x15f24c(0x160)](/\r?\n/)[_0x15f24c(0x100)](_0x3da6f8=>{const _0x3b5c97=_0x15f24c,_0x514d9a=_0x3da6f8[_0x3b5c97(0x160)]('\x20');_0x514d9a[_0x3b5c97(0x1b1)]===0x2&&(_0x302315[_0x514d9a[0x0]]=_0x514d9a[0x1]);});const _0xbf36a2=fs[_0x15f24c(0xfa)](_0x15a29f,{'flags':'w','encoding':_0x15f24c(0x143),'mode':0x1b6,'autoClose':!![]}),_0x442353=[],_0x17ccf1=await _0x27f5a5[_0x15f24c(0x1d4)](_0x26d02e,{'attribute':undefined,'operator':undefined,'value':undefined},['id','displayName']);return _0x17ccf1[_0x15f24c(0x16e)][_0x15f24c(0x100)](_0x448e5c=>{const _0xb9673b=_0x15f24c;if(_0x448e5c['id']){let _0x3f9d12=crypto[_0xb9673b(0x172)]();if(_0x302315[_0x448e5c['id']])_0x3f9d12=_0x302315[_0x448e5c['id']];const _0x1a13ad={'allowedMemberTypes':[_0xb9673b(0x11b)],'description':_0xb9673b(0x194),'displayName':_0x448e5c[_0xb9673b(0x1b6)]||_0x448e5c['id'],'id':_0x3f9d12,'isEnabled':!![],'lang':null,'origin':'Application','value':decodeURIComponent(_0x448e5c['id'])};_0x442353[_0xb9673b(0x174)](_0x1a13ad),_0xbf36a2[_0xb9673b(0x178)](_0x448e5c['id']+'\x20'+_0x3f9d12+'\x0a');}}),_0xbf36a2[_0x15f24c(0x1bc)](),_0x27f5a5[_0x15f24c(0x1c9)]['debug'](_0x27f5a5[_0x15f24c(0x1e0)]+'['+_0x27f5a5['pluginName']+']\x20approle\x20uuid\x20file\x20created:\x20'+_0x15a29f),{'Resources':[{'appRoles':_0x442353}]};};
@@ -1509,7 +1509,7 @@ const ScimGateway = function () {
1509
1509
  } else {
1510
1510
  if (Array.isArray(scimdata.members) && scimdata.members.length === 0 && handle.modifyMethod === 'modifyGroup') {
1511
1511
  ctx.request.body = scimdata
1512
- await replaceUsrGrp(ctx)
1512
+ await replaceUsrGrp(ctx, config.scim.usePutSoftSync)
1513
1513
  } else {
1514
1514
  logger.debug(`${gwName}[${pluginName}] calling "${handle.modifyMethod}" and awaiting result`)
1515
1515
  await this[handle.modifyMethod](ctx.params.baseEntity, id, scimdata, ctx.passThrough)
@@ -1603,7 +1603,7 @@ const ScimGateway = function () {
1603
1603
  // Replace User
1604
1604
  // Replace Group
1605
1605
  // ==========================================
1606
- const replaceUsrGrp = async (ctx) => {
1606
+ const replaceUsrGrp = async (ctx, usePutSoftSync) => {
1607
1607
  const requestBody = utils.copyObj(ctx.request.body)
1608
1608
  let u = ctx.request.originalUrl.substr(0, ctx.request.originalUrl.lastIndexOf('/'))
1609
1609
  u = u.substr(u.lastIndexOf('/') + 1) // u = Users, Groups
@@ -1644,16 +1644,18 @@ const ScimGateway = function () {
1644
1644
  const activeExists = Object.prototype.hasOwnProperty.call(obj, 'active')
1645
1645
  let objGroups
1646
1646
  if (obj.groups) {
1647
- objGroups = utils.copyObj(obj.groups)
1648
- if (!config.scim.groupMemberOfUser || !config.scim.usePutGroupMemberOfUser) delete obj.groups // usePutGroupMemberOfUser is legacy
1647
+ if (!config.scim.groupMemberOfUser && !config.scim.usePutGroupMemberOfUser) { // usePutGroupMemberOfUser is legacy
1648
+ objGroups = utils.copyObj(obj.groups)
1649
+ delete obj.groups
1650
+ }
1649
1651
  }
1650
1652
 
1651
1653
  // merge obj with currentObj as cleared
1652
- utils.extendObjClear(obj, currentObj, config.scim.usePutSoftSync)
1654
+ utils.extendObjClear(obj, currentObj, usePutSoftSync)
1653
1655
  delete obj.id
1654
1656
  delete obj.schemas
1655
1657
  delete obj.meta
1656
- if (!activeExists && !config.scim.usePutSoftSync) delete obj.active
1658
+ if (!activeExists && !usePutSoftSync) delete obj.active
1657
1659
  // remove from obj what match currentObj
1658
1660
  utils.deltaObj(obj, currentObj)
1659
1661
  // userName/displayName should not be set to blank
@@ -1670,7 +1672,7 @@ const ScimGateway = function () {
1670
1672
  }
1671
1673
 
1672
1674
  // add/remove groups
1673
- if (!config.scim.groupMemberOfUser || !config.scim.usePutGroupMemberOfUser) { // default user member of group, usePutGroupMemberOfUser is legacy
1675
+ if (!config.scim.groupMemberOfUser && !config.scim.usePutGroupMemberOfUser) { // default user member of group, usePutGroupMemberOfUser is legacy
1674
1676
  if (objGroups && Array.isArray(objGroups)) { // only if groups included, { "groups": [] } will remove all existing
1675
1677
  if (typeof this[handler.groups.getMethod] !== 'function' || typeof this[handler.groups.modifyMethod] !== 'function') {
1676
1678
  throw new Error('replaceUser error: put operation can not be fully completed for the user`s groups, methods like getGroups() and modifyGroup() are not implemented')
@@ -1738,7 +1740,7 @@ const ScimGateway = function () {
1738
1740
  }
1739
1741
 
1740
1742
  let errRemove = []
1741
- if (!config.scim.usePutSoftSync) { // default will remove any existing groups not included, usePutSoftSync=true prevents removing existing groups (only add groups)
1743
+ if (!usePutSoftSync) { // default will remove any existing groups not included, usePutSoftSync=true prevents removing existing groups (only add groups)
1742
1744
  const res = await Promise.allSettled(removeGrps.map((grp) => removeGroups(grp)))
1743
1745
  errRemove = res.filter(result => result.status === 'rejected').map(result => result.reason.message)
1744
1746
  }
@@ -1772,7 +1774,7 @@ const ScimGateway = function () {
1772
1774
  logger.debug(`${gwName}[${pluginName}] publishing replaceUsrGrp to SCIM Stream and awaiting result`)
1773
1775
  await this.publish(streamObj)
1774
1776
  } else {
1775
- await replaceUsrGrp(ctx)
1777
+ await replaceUsrGrp(ctx, config.scim.usePutSoftSync)
1776
1778
  }
1777
1779
  ctx.request.originalUrl = originalUrl
1778
1780
  return await getById(ctx)
package/lib/utils.js CHANGED
@@ -277,7 +277,7 @@ module.exports.extendObjClear = (obj, src, isSoftSync) => {
277
277
  if (typeof val !== 'object') {
278
278
  if (!obj[key].includes(val)) obj[key].push(val) // e.g. ["value1", "value2"]
279
279
  } else {
280
- if (Object.prototype.hasOwnProperty.call(val, 'type')) {
280
+ if (Object.prototype.hasOwnProperty.call(val, 'type') && key !== 'members' && key !== 'groups') {
281
281
  if (obj[key].length < 1) {
282
282
  const v = this.copyObj(val)
283
283
  if (!isSoftSync) v.operation = 'delete'
@@ -330,7 +330,7 @@ module.exports.extendObjClear = (obj, src, isSoftSync) => {
330
330
  break
331
331
  }
332
332
  }
333
- if (!found) {
333
+ if (!found) {
334
334
  const v = module.exports.copyObj(val)
335
335
  if (!isSoftSync) v.operation = 'delete'
336
336
  addArr.push(v)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scimgateway",
3
- "version": "4.5.8",
3
+ "version": "4.5.10",
4
4
  "description": "Using SCIM protocol as a gateway for user provisioning to other endpoints",
5
5
  "author": "Jarle Elshaug <jarle.elshaug@gmail.com> (https://elshaug.xyz)",
6
6
  "homepage": "https://elshaug.xyz",
@@ -34,7 +34,7 @@
34
34
  "callsite": "^1.0.0",
35
35
  "dot-object": "^2.1.5",
36
36
  "fold-to-ascii": "^5.0.1",
37
- "https-proxy-agent": "^7.0.4",
37
+ "https-proxy-agent": "^7.0.5",
38
38
  "is-in-subnet": "^4.0.1",
39
39
  "jsonwebtoken": "^9.0.2",
40
40
  "koa": "^2.15.3",
@@ -42,14 +42,14 @@
42
42
  "koa-router": "^12.0.1",
43
43
  "ldapjs": "^3.0.7",
44
44
  "lokijs": "^1.5.12",
45
- "mongodb": "^6.6.2",
45
+ "mongodb": "^6.9.0",
46
46
  "nats": "^2.28.2",
47
47
  "node-machine-id": "1.1.9",
48
- "nodemailer": "^6.9.13",
48
+ "nodemailer": "^6.9.15",
49
49
  "passport": "^0.7.0",
50
50
  "passport-azure-ad": "^4.3.5",
51
- "tedious": "^18.2.0",
52
- "winston": "^3.13.0"
51
+ "tedious": "^18.6.1",
52
+ "winston": "^3.14.2"
53
53
  },
54
54
  "devDependencies": {
55
55
  "chai": "^4.2.0",